Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into new_item_menu
Browse files Browse the repository at this point in the history
  • Loading branch information
lilDavid committed Jan 22, 2023
1 parent 93f0ab1 commit bde376e
Show file tree
Hide file tree
Showing 128 changed files with 2,806 additions and 2,008 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/generate-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,17 @@ jobs:
readme.txt
build-linux:
needs: extract-assets
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-20.04
gcc: 10
archive-suffix: compatibility
- os: ubuntu-22.04
gcc: 12
archive-suffix: performance
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -105,7 +115,7 @@ jobs:
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache
key: ${{ matrix.os }}-ccache
- name: Install latest SDL
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
Expand Down Expand Up @@ -143,12 +153,12 @@ jobs:
mv README.md readme.txt
mv build-cmake/*.appimage soh.appimage
env:
CC: gcc-10
CXX: g++-10
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: soh-linux
name: soh-linux-${{ matrix.archive-suffix }}
path: |
soh.appimage
readme.txt
Expand Down
3 changes: 3 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ You can also find the v142 toolset by searching through the individual component
While you're there, you can also install Python 3 and Git if needed.

1. Clone the Ship of Harkinian repository

_Note: Be sure to either clone with the ``--recursive`` flag or do ``git submodule init`` after cloning to pull in the libultraship submodule!_

2. Place one or more [compatible](#compatible-roms) roms in the `OTRExporter` directory with namings of your choice

_Note: Instructions assume using powershell_
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)

project(Ship LANGUAGES C CXX
VERSION 5.1.3)
set(PROJECT_BUILD_NAME "BRADLEY DELTA" CACHE STRING "")
VERSION 5.1.4)
set(PROJECT_BUILD_NAME "BRADLEY ECHO" CACHE STRING "")
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")

set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
Expand Down
2 changes: 1 addition & 1 deletion OTRGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
.
)

INSTALL(TARGETS OTRGui DESTINATION . COMPONENT ship)
INSTALL(TARGETS OTRGui DESTINATION . COMPONENT ship OPTIONAL)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/assets
DESTINATION .
COMPONENT ship
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ Assuming you have done everything correctly, boot up SoH and open up the SFX Edi
Refer to the [building instructions](BUILDING.md) to compile SoH.

## Nightly Builds
Nightly builds of Ship of Harkinian are available here: [Windows](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-windows.zip), [macOS](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-mac.zip), [Linux](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-linux.zip), [Switch](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-switch.zip), [Wii U](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-wiiu.zip)
Nightly builds of Ship of Harkinian are available here: [Windows](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-windows.zip), [macOS](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-mac.zip), [Linux (compatibility*)](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-linux-compatiblity.zip), [Linux (performance*)](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-linux-performance.zip), [Switch](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-switch.zip), [Wii U](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-wiiu.zip)

_*compatibility: compatible with most Linux distributions, but may not be as performant as the perf build._\
_*performance: requires glibc 2.35 or newer, but will be more performant than the compat build._

## Take The Survey
Want to use cartridge readers in tandem with the OTRGui?
Expand Down
2 changes: 1 addition & 1 deletion libultraship
8 changes: 4 additions & 4 deletions soh/include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,10 @@ void func_8003424C(PlayState* play, Vec3f* arg1);
void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 xluFlag, s16 duration);
Hilite* func_800342EC(Vec3f* object, PlayState* play);
Hilite* func_8003435C(Vec3f* object, PlayState* play);
s32 func_800343CC(PlayState* play, Actor* actor, s16* arg2, f32 interactRange,
u16 (*unkFunc1)(PlayState*, Actor*), s16 (*unkFunc2)(PlayState*, Actor*));
s16 func_800347E8(s16 arg0);
void func_80034A14(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3);
s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interactRange,
NpcGetTextIdFunc getTextId, NpcUpdateTalkStateFunc updateTalkState);
s16 Npc_GetTrackingPresetMaxPlayerYaw(s16 presetIndex);
void Npc_TrackPoint(Actor* actor, NpcInteractInfo* interactInfo, s16 presetIndex, s16 trackingMode);
void func_80034BA0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw,
PostLimbDraw postLimbDraw, Actor* actor, s16 alpha);
void func_80034CC4(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw,
Expand Down
12 changes: 0 additions & 12 deletions soh/include/z64.h
Original file line number Diff line number Diff line change
Expand Up @@ -1508,18 +1508,6 @@ typedef struct {
/* 0x08 */ f32 morphFrames;
} AnimationMinimalInfo; // size = 0xC

typedef struct {
/* 0x00 */ s16 unk_00;
/* 0x02 */ s16 unk_02;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 unk_06;
/* 0x08 */ Vec3s unk_08;
/* 0x0E */ Vec3s unk_0E;
/* 0x14 */ f32 unk_14;
/* 0x18 */ Vec3f unk_18;
/* 0x24 */ s16 unk_24;
} struct_80034A14_arg1; // size = 0x28

typedef struct {
/* 0x00 */ s8 scene;
/* 0x01 */ s8 spawn;
Expand Down
31 changes: 29 additions & 2 deletions soh/include/z64actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ struct Lights;
typedef void (*ActorFunc)(struct Actor*, struct PlayState*);
typedef void (*ActorResetFunc)(void);
typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState*);
typedef u16 (*callback1_800343CC)(struct PlayState*, struct Actor*);
typedef s16 (*callback2_800343CC)(struct PlayState*, struct Actor*);
typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*);
typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*);

typedef struct {
Vec3f pos;
Expand Down Expand Up @@ -369,4 +369,31 @@ typedef enum {
DOORLOCK_NORMAL_SPIRIT
} DoorLockType;

typedef enum {
/* 0x0 */ NPC_TALK_STATE_IDLE, // NPC not currently talking to player
/* 0x1 */ NPC_TALK_STATE_TALKING, // NPC is currently talking to player
/* 0x2 */ NPC_TALK_STATE_ACTION, // An NPC-defined action triggered in the conversation
/* 0x3 */ NPC_TALK_STATE_ITEM_GIVEN // NPC finished giving an item and text box is done
} NpcTalkState;

typedef enum {
/* 0x0 */ NPC_TRACKING_PLAYER_AUTO_TURN, // Determine tracking mode based on player position, see Npc_UpdateAutoTurn
/* 0x1 */ NPC_TRACKING_NONE, // Don't track the target (usually the player)
/* 0x2 */ NPC_TRACKING_HEAD_AND_TORSO, // Track target by turning the head and the torso
/* 0x3 */ NPC_TRACKING_HEAD, // Track target by turning the head
/* 0x4 */ NPC_TRACKING_FULL_BODY // Track target by turning the body, torso and head
} NpcTrackingMode;

typedef struct {
/* 0x00 */ s16 talkState;
/* 0x02 */ s16 trackingMode;
/* 0x04 */ s16 autoTurnTimer;
/* 0x06 */ s16 autoTurnState;
/* 0x08 */ Vec3s headRot;
/* 0x0E */ Vec3s torsoRot;
/* 0x14 */ f32 yOffset; // Y position offset to add to actor position when calculating angle to target
/* 0x18 */ Vec3f trackPos;
/* 0x24 */ char unk_24[0x4];
} NpcInteractInfo; // size = 0x28

#endif
1 change: 1 addition & 0 deletions soh/include/z64save.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ typedef struct {
/* */ char adultAltarText[750];
/* */ char ganonHintText[150];
/* */ char ganonText[250];
/* */ char dampeText[150];
/* */ char warpMinuetText[100];
/* */ char warpBoleroText[100];
/* */ char warpSerenadeText[100];
Expand Down
37 changes: 37 additions & 0 deletions soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,25 @@ void DrawCosmeticsEditor(bool& open) {
ImGui::SameLine();
UIWidgets::EnhancementCombobox("gCosmetics.DefaultColorScheme", colorSchemes, 2, 0);
UIWidgets::EnhancementCheckbox("Advanced Mode", "gCosmetics.AdvancedMode");
if (CVarGetInteger("gCosmetics.AdvancedMode", 0)) {
if (ImGui::Button("Lock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (cosmeticOption.advancedOption) {
CVarSetInteger(cosmeticOption.lockedCvar, 1);
}
}
SohImGui::RequestCvarSaveOnNextTick();
}
ImGui::SameLine();
if (ImGui::Button("Unlock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (cosmeticOption.advancedOption) {
CVarSetInteger(cosmeticOption.lockedCvar, 0);
}
}
SohImGui::RequestCvarSaveOnNextTick();
}
}
UIWidgets::EnhancementCheckbox("Sync Rainbow colors", "gCosmetics.RainbowSync");
UIWidgets::EnhancementSliderFloat("Rainbow Speed: %f", "##rainbowSpeed", "gCosmetics.RainbowSpeed", 0.03f, 1.0f, "", 0.6f, false);
if (ImGui::Button("Randomize All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
Expand All @@ -1691,6 +1710,24 @@ void DrawCosmeticsEditor(bool& open) {
SohImGui::RequestCvarSaveOnNextTick();
}

if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0)) {
CVarSetInteger(cosmeticOption.lockedCvar, 1);
}
}
SohImGui::RequestCvarSaveOnNextTick();
}
ImGui::SameLine();
if (ImGui::Button("Unlock All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0)) {
CVarSetInteger(cosmeticOption.lockedCvar, 0);
}
}
SohImGui::RequestCvarSaveOnNextTick();
}

if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
if (ImGui::BeginTabItem("Link & Items")) {
DrawCosmeticGroup(GROUP_LINK);
Expand Down
8 changes: 5 additions & 3 deletions soh/soh/Enhancements/crowd-control/CrowdControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void CrowdControl::Disable() {

void CrowdControl::ListenToServer() {
while (isEnabled) {
while (!connected) {
while (!connected && isEnabled) {
SPDLOG_TRACE("[CrowdControl] Attempting to make connection to server...");
tcpsock = SDLNet_TCP_Open(&ip);

Expand All @@ -112,8 +112,10 @@ void CrowdControl::ListenToServer() {
}
}

auto socketSet = SDLNet_AllocSocketSet(1);
SDLNet_TCP_AddSocket(socketSet, tcpsock);
SDLNet_SocketSet socketSet = SDLNet_AllocSocketSet(1);
if (tcpsock) {
SDLNet_TCP_AddSocket(socketSet, tcpsock);
}

// Listen to socket messages
while (connected && tcpsock && isEnabled) {
Expand Down
2 changes: 2 additions & 0 deletions soh/soh/Enhancements/custom-message/CustomMessageTypes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once

typedef enum {
TEXT_CURSED_SKULLTULA_PEOPLE = 0x22,
TEXT_DAMPES_DIARY = 0x5003,
TEXT_BUY_BOMBCHU_10_PROMPT = 0x8C,
TEXT_BUY_BOMBCHU_10_DESC = 0xBC,
TEXT_GS_NO_FREEZE = 0xB4,
Expand Down
32 changes: 32 additions & 0 deletions soh/soh/Enhancements/presets.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const std::vector<const char*> enhancementsCvars = {
"gNoHeartDrops",
"gBombchuDrops",
"gGoronPot",
"gFullHealthSpawn",
"gDampeWin",
"gRedPotionEffect",
"gRedPotionHealth",
Expand Down Expand Up @@ -172,16 +173,25 @@ const std::vector<const char*> enhancementsCvars = {
"gBombchuBowlingNoBigCucco",
"gBombchuBowlingAmmunition",
"gCreditsFix",
"gSilverRupeeJingleExtend",
"gStaticExplosionRadius"
};

const std::vector<const char*> randomizerCvars = {
"gRandomize10GSHint",
"gRandomize20GSHint",
"gRandomize30GSHint",
"gRandomize40GSHint",
"gRandomize50GSHint",
"gRandomizeAllLocationsReachable",
"gRandomizeAltarHint",
"gRandomizeBigPoeTargetCount",
"gRandomizeBlueFireArrows",
"gRandomizeBombchusInLogic",
"gRandomizeBossKeysanity",
"gRandomizeCompleteMaskQuest",
"gRandomizeCuccosToReturn",
"gRandomizeDampeHint",
"gRandomizeDecoupleEntrances",
"gRandomizeDoorOfTime",
"gRandomizeDungeonCount",
Expand All @@ -207,6 +217,7 @@ const std::vector<const char*> randomizerCvars = {
"gRandomizeLacsRewardCount",
"gRandomizeLacsStoneCount",
"gRandomizeLacsTokenCount",
"gRandomizeLAHint",
"gRandomizeLinksPocket",
"gRandomizeLogicRules",
"gRandomizeMedallionCount",
Expand All @@ -219,9 +230,11 @@ const std::vector<const char*> randomizerCvars = {
"gRandomizeMqDungeons",
"gRandomizeRainbowBridge",
"gRandomizeRewardCount",
"gRandomizeScrubText",
"gRandomizeShopsanity",
"gRandomizeShuffleAdultTrade",
"gRandomizeShuffleBeans",
"gRandomizeShuffleBossEntrances",
"gRandomizeShuffleCows",
"gRandomizeShuffleDungeonReward",
"gRandomizeShuffleDungeonsEntrances",
Expand Down Expand Up @@ -258,14 +271,27 @@ const std::vector<const char*> randomizerCvars = {
"gRandomizeSkipTowerEscape",
"gRandomizeStartingAge",
"gRandomizeStartingConsumables",
"gRandomizeStartingBoleroOfFire",
"gRandomizeStartingDekuShield",
"gRandomizeStartingEponasSong",
"gRandomizeStartingKokiriSword",
"gRandomizeStartingMapsCompasses",
"gRandomizeStartingMinuetOfForest",
"gRandomizeStartingNocturneOfShadow",
"gRandomizeStartingOcarina",
"gRandomizeStartingPreludeOfLight",
"gRandomizeStartingRequiemOfSpirit",
"gRandomizeStartingSariasSong",
"gRandomizeStartingSerenadeOfWater",
"gRandomizeStartingSkulltulaToken",
"gRandomizeStartingSongOfStorms",
"gRandomizeStartingSongOfTime",
"gRandomizeStartingSunsSong",
"gRandomizeStartingZeldasLullaby",
"gRandomizeStoneCount",
"gRandomizeSunlightArrows",
"gRandomizeTokenCount",
"gRandomizeWarpSongText",
"gRandomizeZorasFountain",
};

Expand Down Expand Up @@ -319,6 +345,8 @@ const std::vector<PresetEntry> vanillaPlusPresetEntries = {
PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1),
// Fix Navi text HUD position
PRESET_ENTRY_S32("gNaviTextFix", 1),
// Extend Silver Rupee Jingle
PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1),

// Red Ganon blood
PRESET_ENTRY_S32("gRedGanonBlood", 1),
Expand Down Expand Up @@ -382,6 +410,8 @@ const std::vector<PresetEntry> enhancedPresetEntries = {
PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1),
// Fix Navi text HUD position
PRESET_ENTRY_S32("gNaviTextFix", 1),
// Extend Silver Rupee Jingle
PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1),

// Red Ganon blood
PRESET_ENTRY_S32("gRedGanonBlood", 1),
Expand Down Expand Up @@ -491,6 +521,8 @@ const std::vector<PresetEntry> randomizerPresetEntries = {
PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1),
// Fix Navi text HUD position
PRESET_ENTRY_S32("gNaviTextFix", 1),
// Extend Silver Rupee Jingle
PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1),

// Red Ganon blood
PRESET_ENTRY_S32("gRedGanonBlood", 1),
Expand Down
Loading

0 comments on commit bde376e

Please sign in to comment.