Merge branch 'rando-next' of https://github.com/HarbourMasters/Shipwright into shopsanity

This commit is contained in:
Garrett Cox 2022-09-14 12:23:47 -05:00
commit 8fa9baaaf6
14 changed files with 81 additions and 78 deletions

View File

@ -293,7 +293,9 @@ static void printStack(CONTEXT* ctx) {
process = GetCurrentProcess();
thread = GetCurrentThread();
SymInitialize(process, nullptr, true);
SymSetOptions(SYMOPT_NO_IMAGE_SEARCH | SYMOPT_IGNORE_IMAGEDIR);
SymInitialize(process, "debug", true);
constexpr DWORD machineType =

View File

@ -2003,6 +2003,10 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
INSTALL(TARGETS soh DESTINATION . COMPONENT ship)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
INSTALL(FILES $<TARGET_PDB_FILE:soh> DESTINATION ./debug COMPONENT ship)
endif()
find_program(CURL NAMES curl DOC "Path to the curl program. Used to download files.")
execute_process(COMMAND ${CURL} -sSfL https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt -o ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt OUTPUT_VARIABLE RESULT)
@ -2026,7 +2030,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch")
nx_generate_nacp(Ship.nacp
NAME "Ship of Harkinian"
AUTHOR "Harbour Masters"
VERSION "3.1.0"
VERSION "4.0.0"
)
nx_create_nro(soh

View File

@ -3489,7 +3489,6 @@ RandomizerCheck Randomizer::GetCheckFromActor(s16 actorId, s16 sceneNum, s16 act
break;
case 93:
switch (actorParams) {
case 262:
case 1984:
return RC_GF_CHEST;
case 21506:

View File

@ -276,10 +276,6 @@ ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) {
result.currentAmmo = AMMO(ITEM_SLINGSHOT);
break;
case ITEM_WALLET_ADULT:
result.currentCapacity = CUR_CAPACITY(UPG_WALLET);
result.maxCapacity = 200;
result.currentAmmo = gSaveContext.rupees;
break;
case ITEM_WALLET_GIANT:
result.currentCapacity = CUR_CAPACITY(UPG_WALLET);
result.maxCapacity = 500;

View File

@ -546,7 +546,11 @@ namespace GameMenuBar {
}
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f);
#if defined(__SWITCH__) || defined(__WIIU__)
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 110.0f);
#else
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f);
#endif
if (ImGui::SliderInt("##ExtraLatencyThreshold", &val, 0, 360, "", ImGuiSliderFlags_AlwaysClamp))
{
CVar_SetS32(cvar, val);
@ -1095,8 +1099,8 @@ namespace GameMenuBar {
}
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f);
#ifdef __WIIU__
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f * 2);
#if defined(__SWITCH__) || defined(__WIIU__)
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 110.0f);
#else
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f);
#endif

View File

@ -322,11 +322,11 @@ namespace UIWidgets {
ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f);
}
if (PlusMinusButton) {
#ifdef __WIIU__
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f * 2);
#else
#if defined(__SWITCH__) || defined(__WIIU__)
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 110.0f);
#else
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f);
#endif
#endif
}
if (ImGui::SliderFloat(id, &val, min, max, format))
{

View File

@ -81,7 +81,7 @@ Color_RGB8 sOcarinaNoteA4Prim;
Color_RGB8 sOcarinaNoteF4Prim;
Color_RGB8 sOcarinaNoteD4Prim;
// If the "separate" bool is set, use the "gCCC<cDirection>BtnPrim<R/G/B> CVars
// If the "separate" bool is set, use the "gCCC<cDirection>BtnPrim CVars
// to set the button color. Otherwise, use sOcarinaNoteCBtnPrim.
void Message_SetCustomOrGeneralCColor(Color_RGB8* color, bool separate, char cDirection) {
if (!separate) {
@ -90,15 +90,9 @@ void Message_SetCustomOrGeneralCColor(Color_RGB8* color, bool separate, char cDi
}
// C direction is '*' @ idx 4
// Color component is '*' @ idx 12
char cVar[] = "gCCC*BtnPrim*";
char cVar[] = "gCCC*BtnPrim";
cVar[4] = cDirection;
cVar[12] = 'R';
color->r = CVar_GetS32(cVar, 255);
cVar[12] = 'G';
color->g = CVar_GetS32(cVar, 255);
cVar[12] = 'B';
color->b = CVar_GetS32(cVar, 50);
*color = CVar_GetRGB(cVar, (Color_RGB8){ .r = 255, .g = 255, .b = 50});
}
typedef struct {
@ -115,9 +109,7 @@ typedef struct {
void Message_SetCustomOcarinaNoteColor(Color_RGB8* color, s32 btnMap, CustomNoteOptions* flags) {
switch (btnMap) {
case BTN_A:
color->r = CVar_GetS32("gCCABtnPrimR", 80);
color->g = CVar_GetS32("gCCABtnPrimG", 255);
color->b = CVar_GetS32("gCCABtnPrimB", 150);
*color = CVar_GetRGB("gCCABtnPrim", (Color_RGB8){ .r = 80, .g = 255, .b = 150 });
break;
case BTN_CUP:
Message_SetCustomOrGeneralCColor(color, flags->separateC, 'U');
@ -132,24 +124,24 @@ void Message_SetCustomOcarinaNoteColor(Color_RGB8* color, s32 btnMap, CustomNote
Message_SetCustomOrGeneralCColor(color, flags->separateC, 'R');
break;
case BTN_START:
color->r = CVar_GetS32("gCCStartBtnPrimR", 200);
color->g = CVar_GetS32("gCCStartBtnPrimG", 0);
color->b = CVar_GetS32("gCCStartBtnPrimB", 0);
*color = CVar_GetRGB("gCCStartBtnPrim", (Color_RGB8){ .r = 200, .g = 0, .b = 0 });
break;
case BTN_DUP:
case BTN_DDOWN:
case BTN_DLEFT:
case BTN_DRIGHT:
color->r = CVar_GetS32("gCCDpadPrimR", 255) * 103 / 255;
color->g = CVar_GetS32("gCCDpadPrimG", 255) * 103 / 255;
color->b = CVar_GetS32("gCCDpadPrimB", 255) * 103 / 255;
*color = CVar_GetRGB("gCCDpadPrim", (Color_RGB8){ .r = 255, .g = 255, .b = 255 });
color->r *= 103 / 255;
color->g *= 103 / 255;
color->b *= 103 / 255;
break;
case 0:
if (flags->dpad && !flags->rightStick) {
// D pad is dark gray even when set to white, so emulate that.
color->r = CVar_GetS32("gCCDpadPrimR", 255) * 103 / 255;
color->g = CVar_GetS32("gCCDpadPrimG", 255) * 103 / 255;
color->b = CVar_GetS32("gCCDpadPrimB", 255) * 103 / 255;
*color = CVar_GetRGB("gCCDpadPrim", (Color_RGB8){ .r = 255, .g = 255, .b = 255 });
color->r *= 103 / 255;
color->g *= 103 / 255;
color->b *= 103 / 255;
break;
} // else fall through
default:
@ -184,9 +176,7 @@ void Message_ResetOcarinaNoteState(void) {
sOcarinaNoteA4Prim = sOcarinaNoteCBtnPrim;
sOcarinaNoteF4Prim = sOcarinaNoteCBtnPrim;
} else { // Custom
sOcarinaNoteCBtnPrim.r = CVar_GetS32("gCCCBtnPrimR", 255);
sOcarinaNoteCBtnPrim.g = CVar_GetS32("gCCCBtnPrimG", 255);
sOcarinaNoteCBtnPrim.b = CVar_GetS32("gCCCBtnPrimB", 50);
sOcarinaNoteCBtnPrim = CVar_GetRGB("gCCCBtnPrim", (Color_RGB8){ .r = 255, .g = 255, .b = 50 });
CustomNoteOptions options = (CustomNoteOptions){
.separateC = CVar_GetS32("gCCparated", 0),
@ -205,9 +195,7 @@ void Message_ResetOcarinaNoteState(void) {
Message_SetCustomOrGeneralCColor(&sOcarinaNoteB4Prim, options.separateC, 'L');
Message_SetCustomOrGeneralCColor(&sOcarinaNoteA4Prim, options.separateC, 'R');
Message_SetCustomOrGeneralCColor(&sOcarinaNoteF4Prim, options.separateC, 'D');
sOcarinaNoteD4Prim.r = CVar_GetS32("gCCABtnPrimR", 80);
sOcarinaNoteD4Prim.g = CVar_GetS32("gCCABtnPrimG", 255);
sOcarinaNoteD4Prim.b = CVar_GetS32("gCCABtnPrimB", 150);
sOcarinaNoteD4Prim = CVar_GetRGB("gCCABtnPrim", (Color_RGB8){ .r = 80, .g = 255, .b = 150 });
}
}
}
@ -583,12 +571,13 @@ void Message_DrawTextboxIcon(GlobalContext* globalCtx, Gfx** p, s16 x, s16 y) {
sIconEnvColors[1][1] = 255;
sIconEnvColors[1][2] = 130;
} else if (CVar_GetS32("gHudColors", 1) == 2) {
sIconPrimColors[0][0] = (CVar_GetS32("gCCABtnPrimR", 0)/255)*95;
sIconPrimColors[0][1] = (CVar_GetS32("gCCABtnPrimG", 200)/255)*95;
sIconPrimColors[0][2] = (CVar_GetS32("gCCABtnPrimB", 80)/255)*95;
sIconPrimColors[1][0] = CVar_GetS32("gCCABtnPrimR", 0);
sIconPrimColors[1][1] = CVar_GetS32("gCCABtnPrimG", 200);
sIconPrimColors[1][2] = CVar_GetS32("gCCABtnPrimB", 80);
Color_RGB8 aBtnColor = CVar_GetRGB("gCCABtnPrim", (Color_RGB8){ .r = 0, .g = 200, .b = 80 });
sIconPrimColors[0][0] = (aBtnColor.r/255)*95;
sIconPrimColors[0][1] = (aBtnColor.g/255)*95;
sIconPrimColors[0][2] = (aBtnColor.b/255)*95;
sIconPrimColors[1][0] = aBtnColor.r;
sIconPrimColors[1][1] = aBtnColor.g;
sIconPrimColors[1][2] = aBtnColor.b;
sIconEnvColors[0][0] = 0;
sIconEnvColors[0][1] = 0;
sIconEnvColors[0][2] = 0;
@ -2075,12 +2064,13 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
{ 80, 255, 150 },
{ 100, 255, 200 },
};
s16 ABtnR = CVar_GetS32("gCCABtnPrimR", 80);
s16 ABtnG = CVar_GetS32("gCCABtnPrimG", 255);
s16 ABtnB = CVar_GetS32("gCCABtnPrimB", 150);
s16 ABtnR_2 = CVar_GetS32("gCCABtnPrimR", 80)+20;
s16 ABtnG_2 = CVar_GetS32("gCCABtnPrimG", 235)+20;
s16 ABtnB_2 = CVar_GetS32("gCCABtnPrimB", 180)+20;
Color_RGB8 ABtnColor = CVar_GetRGB("gCCABtnPrim", (Color_RGB8){ .r = 80, .g = 255, .b = 150});
s16 ABtnR = ABtnColor.r;
s16 ABtnG = ABtnColor.g;
s16 ABtnB = ABtnColor.b;
s16 ABtnR_2 = ABtnColor.r+20;
s16 ABtnG_2 = ABtnColor.g+20;
s16 ABtnB_2 = ABtnColor.b+20;
if(ABtnR_2 > 255){ABtnR_2=255;};
if(ABtnG_2 > 255){ABtnG_2=255;};
if(ABtnB_2 > 255){ABtnB_2=255;};
@ -2097,24 +2087,31 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
{ 255, 255, 50 },
{ 255, 255, 180 },
};
s16 CBtnR = CVar_GetS32("gCCCBtnPrimR", 255);
s16 CBtnG = CVar_GetS32("gCCCBtnPrimG", 255);
s16 CBtnB = CVar_GetS32("gCCCBtnPrimB", 50);
s16 CBtnR_2 = CVar_GetS32("gCCCBtnPrimR", 255)+20;
s16 CBtnG_2 = CVar_GetS32("gCCCBtnPrimG", 255)+20;
s16 CBtnB_2 = CVar_GetS32("gCCCBtnPrimB", 50)+20;
s16 CBtnRU = CVar_GetS32("gCCCUBtnPrimR", 255);
s16 CBtnGU = CVar_GetS32("gCCCUBtnPrimG", 255);
s16 CBtnBU = CVar_GetS32("gCCCUBtnPrimB", 50);
s16 CBtnRL = CVar_GetS32("gCCCLBtnPrimR", 255);
s16 CBtnGL = CVar_GetS32("gCCCLBtnPrimG", 255);
s16 CBtnBL = CVar_GetS32("gCCCLBtnPrimB", 50);
s16 CBtnRD = CVar_GetS32("gCCCDBtnPrimR", 255);
s16 CBtnGD = CVar_GetS32("gCCCDBtnPrimG", 255);
s16 CBtnBD = CVar_GetS32("gCCCDBtnPrimB", 50);
s16 CBtnRR = CVar_GetS32("gCCCRBtnPrimR", 255);
s16 CBtnGR = CVar_GetS32("gCCCRBtnPrimG", 255);
s16 CBtnBR = CVar_GetS32("gCCCRBtnPrimB", 50);
Color_RGB8 CBtnDefaultColor = {255, 255, 50};
Color_RGB8 CBtnColor = CVar_GetRGB("gCCCBtnPrim", CBtnDefaultColor);
s16 CBtnR = CBtnColor.r;
s16 CBtnG = CBtnColor.g;
s16 CBtnB = CBtnColor.b;
s16 CBtnR_2 = CBtnColor.r+20;
s16 CBtnG_2 = CBtnColor.g+20;
s16 CBtnB_2 = CBtnColor.b+20;
Color_RGB8 CUpColor = CVar_GetRGB("gCCCUBtnPrim", CBtnDefaultColor);
s16 CBtnRU = CUpColor.r;
s16 CBtnGU = CUpColor.g;
s16 CBtnBU = CUpColor.b;
Color_RGB8 CLeftColor = CVar_GetRGB("gCCCLBtnPrim", CBtnDefaultColor);
s16 CBtnRL = CLeftColor.r;
s16 CBtnGL = CLeftColor.g;
s16 CBtnBL = CLeftColor.b;
Color_RGB8 CDownColor = CVar_GetRGB("gCCCDBtnPrim", CBtnDefaultColor);
s16 CBtnRD = CDownColor.r;
s16 CBtnGD = CDownColor.g;
s16 CBtnBD = CDownColor.b;
Color_RGB8 CRightColor = CVar_GetRGB("gCCCRBtnPrim", CBtnDefaultColor);
s16 CBtnRR = CRightColor.r;
s16 CBtnGR = CRightColor.g;
s16 CBtnBR = CRightColor.b;
if(CBtnR_2 > 255){CBtnR_2=255;};
if(CBtnG_2 > 255){CBtnG_2=255;};
if(CBtnB_2 > 255){CBtnB_2=255;};

View File

@ -439,7 +439,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
gSaveContext.inventory.dungeonKeys[SCENE_MIZUSIN] = 6; // Water
gSaveContext.inventory.dungeonKeys[SCENE_JYASINZOU] = 5; // Spirit
gSaveContext.inventory.dungeonKeys[SCENE_HAKADAN] = 5; // Shadow
gSaveContext.inventory.dungeonKeys[SCENE_HAKADANCH] = 2; // BotW
gSaveContext.inventory.dungeonKeys[SCENE_HAKADANCH] = 3; // BotW
gSaveContext.inventory.dungeonKeys[SCENE_MEN] = 9; // GTG
gSaveContext.inventory.dungeonKeys[SCENE_GANONTIKA] = 2; // Ganon
}

View File

@ -138,7 +138,7 @@ void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) {
}
this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 3.0f);
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f);
if (D_8088BFC0 > 0.0f) {
temp_v1 = Math_StepToF(&D_8088BFC0, 20.0f, this->dyna.actor.speedXZ);

View File

@ -388,7 +388,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 3.0f);
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f);
blockStop = Math_StepToF(&sBgPoEventblockPushDist, 20.0f, this->dyna.actor.speedXZ);
displacement = this->direction * sBgPoEventblockPushDist;
this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x;

View File

@ -260,9 +260,9 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) {
s32 approxFResult;
Actor* actor = &this->dyna.actor;
this->unk_174 = this->unk_174 + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f;
this->unk_174 = this->unk_174 + ((CVar_GetS32("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f;
this->unk_174 = CLAMP_MAX(this->unk_174, 3.0f);
this->unk_174 = CLAMP_MAX(this->unk_174, 2.0f);
approxFResult = Math_StepToF(&this->unk_178, 20.0f, this->unk_174);

View File

@ -558,9 +558,9 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) {
f32 pushDistSigned;
s32 stopFlag;
this->pushSpeed = this->pushSpeed + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f;
this->pushSpeed = this->pushSpeed + ((CVar_GetS32("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f;
this->stateFlags |= PUSHBLOCK_PUSH;
this->pushSpeed = CLAMP_MAX(this->pushSpeed, 3.0f);
this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f);
stopFlag = Math_StepToF(&this->pushDist, 20.0f, this->pushSpeed);
pushDistSigned = ((this->direction >= 0.0f) ? 1.0f : -1.0f) * this->pushDist;
thisx->world.pos.x = thisx->home.pos.x + (pushDistSigned * this->yawSin);

View File

@ -9434,6 +9434,7 @@ static EffectBlureInit2 D_8085470C = {
static Vec3s D_80854730 = { -57, 3377, 0 };
void Player_InitCommon(Player* this, GlobalContext* globalCtx, FlexSkeletonHeader* skelHeader) {
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
this->ageProperties = &sAgeProperties[gSaveContext.linkAge];
Actor_ProcessInitChain(&this->actor, sInitChain);
this->swordEffectIndex = TOTAL_EFFECT_COUNT;

View File

@ -365,7 +365,7 @@ void DrawSeedHashSprites(FileChooseContext* this) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, this->fileButtonAlpha[this->buttonIndex]);
if (CVar_GetS32("gRandomizer", 0) != 0 && CVar_GetString("gSpoilerLog", "") != "") {
if (CVar_GetS32("gRandomizer", 0) && strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0) {
u16 xStart = 64;
for (u8 i = 0; i < 5; i++) {
SpriteLoad(this, GetSeedTexture(gSaveContext.seedIcons[i]));