From 33ba051a5b2833a069dd3388ada72f14d3c9fccd Mon Sep 17 00:00:00 2001 From: Steven Casper Date: Sat, 22 Mar 2025 17:21:11 -0400 Subject: [PATCH] Fix all compiler warnings --- configure.py | 1 + src/SB/Core/gc/iTRC.cpp | 3 + src/SB/Core/gc/isavegame.cpp | 4 +- src/SB/Core/x/xBehaveMgr.h | 1 + src/SB/Game/zAssetTypes.cpp | 191 +++++++------- src/SB/Game/zCutsceneMgr.cpp | 2 +- src/SB/Game/zEntPlayer.cpp | 2 +- src/SB/Game/zEntSimpleObj.cpp | 2 +- src/SB/Game/zNPCGoalAmbient.cpp | 8 +- src/SB/Game/zNPCGoalAmbient.h | 7 +- src/SB/Game/zNPCGoalRobo.cpp | 416 ++++++++++++++---------------- src/SB/Game/zNPCGoalStd.h | 23 +- src/SB/Game/zNPCMessenger.cpp | 16 +- src/SB/Game/zNPCSupplement.cpp | 6 +- src/SB/Game/zNPCSupplement.h | 4 +- src/SB/Game/zNPCTypeDutchman.cpp | 2 +- src/SB/Game/zNPCTypeKingJelly.cpp | 6 +- src/SB/Game/zNPCTypePrawn.cpp | 13 +- 18 files changed, 350 insertions(+), 357 deletions(-) diff --git a/configure.py b/configure.py index 8d160a4c8..f68943d26 100644 --- a/configure.py +++ b/configure.py @@ -150,6 +150,7 @@ config.wibo_tag = "0.6.11" # Project +config.shift_jis = False config.config_path = Path("config") / config.version / "config.yml" config.check_sha_path = Path("config") / config.version / "build.sha1" config.asflags = [ diff --git a/src/SB/Core/gc/iTRC.cpp b/src/SB/Core/gc/iTRC.cpp index abcb13e85..a43f14bd2 100644 --- a/src/SB/Core/gc/iTRC.cpp +++ b/src/SB/Core/gc/iTRC.cpp @@ -10,6 +10,7 @@ namespace ResetButton bool ROMFont::Init() { + return false; } void ROMFont::InitGX() @@ -130,6 +131,7 @@ void iTRCDisk::SetMovieResumeFunction(void (*Func)()) bool iTRCDisk::IsDiskIDed() { + return false; } void iTRCDisk::DisplayErrorMessage() @@ -142,4 +144,5 @@ void iTRCDisk::SetDVDState() bool iTRCDisk::CheckDVDAndResetState() { + return false; } diff --git a/src/SB/Core/gc/isavegame.cpp b/src/SB/Core/gc/isavegame.cpp index cf966b52e..cfdab72b2 100644 --- a/src/SB/Core/gc/isavegame.cpp +++ b/src/SB/Core/gc/isavegame.cpp @@ -1753,7 +1753,7 @@ static S32 iSG_mc_fopen(st_ISG_MEMCARD_DATA* mcdata, const char* fname, S32 fsiz static S32 iSG_mc_fclose(st_ISG_MEMCARD_DATA* mcdata) { - iSG_mc_fclose(mcdata, NULL); + return iSG_mc_fclose(mcdata, NULL); } static S32 iSG_mc_fclose(st_ISG_MEMCARD_DATA* mcdata, CARDStat* stat) @@ -1879,7 +1879,7 @@ static S32 iSG_mcqa_fread(st_ISG_MEMCARD_DATA* mcdata, char* buf, S32 len, S32 o static S32 iSG_mcqa_fwrite(st_ISG_MEMCARD_DATA* mcdata, char* buf, S32 len); static S32 iSG_mc_fwrite(st_ISG_MEMCARD_DATA* mcdata, char* buf, S32 len) { - iSG_mcqa_fwrite(mcdata, buf, len); + return iSG_mcqa_fwrite(mcdata, buf, len); } static S32 iSG_mcqa_fwrite(st_ISG_MEMCARD_DATA* mcdata, char* buf, S32 len) diff --git a/src/SB/Core/x/xBehaveMgr.h b/src/SB/Core/x/xBehaveMgr.h index 934bbd0ec..e111398cd 100644 --- a/src/SB/Core/x/xBehaveMgr.h +++ b/src/SB/Core/x/xBehaveMgr.h @@ -13,6 +13,7 @@ struct xBehaveMgr : RyzMemData st_XORDEREDARRAY psylist; xBehaveMgr(); + ~xBehaveMgr(); void Startup(S32, S32); void RegBuiltIn(); xPsyche* Subscribe(xBase* owner, S32 i); diff --git a/src/SB/Game/zAssetTypes.cpp b/src/SB/Game/zAssetTypes.cpp index dae6892a7..194b6a5e0 100644 --- a/src/SB/Game/zAssetTypes.cpp +++ b/src/SB/Game/zAssetTypes.cpp @@ -36,83 +36,83 @@ static u32 s_patFootSoundA; static u32 s_patFootSoundB; static st_PACKER_ASSETTYPE assetTypeHandlers[78] = { - {'BSP ', 0, 0, BSP_Read, NULL, NULL, NULL, NULL, BSP_Unload, NULL}, - {'JSP ', 0, 0, JSP_Read, NULL, NULL, NULL, NULL, JSP_Unload, NULL}, - {'TXD '}, - {'MODL', 0, 0, Model_Read, NULL, NULL, NULL, NULL, Model_Unload, NULL}, - {'ANIM', 0, 0, NULL, NULL, NULL, NULL, NULL, Anim_Unload, NULL}, - {'RWTX', 0, 0, RWTX_Read, NULL, NULL, NULL, NULL, TextureRW3_Unload, NULL}, - {'LKIT', 0, 0, NULL, NULL, NULL, NULL, NULL, LightKit_Unload, NULL}, - {'CAM '}, - {'PLYR'}, - {'NPC '}, - {'ITEM'}, - {'PKUP'}, - {'TRIG'}, - {'SDF '}, - {'TEX '}, - {'TXT '}, - {'ENV '}, - {'ATBL', 0, 0, ATBL_Read, NULL, NULL, NULL, NULL, NULL, NULL}, - {'MINF'}, - {'PICK'}, - {'PLAT'}, - {'PEND'}, - {'MRKR'}, - {'MVPT', 0, 0, NULL, NULL, NULL, NULL, NULL, MovePoint_Unload, NULL}, - {'TIMR'}, - {'CNTR'}, - {'PORT'}, - {'SND '}, - {'SNDS'}, - {'GRUP'}, - {'MPHT'}, - {'SFX '}, - {'SNDI', 0, 0, SndInfoRead, NULL, NULL, NULL, NULL, NULL, NULL}, - {'HANG'}, - {'SIMP'}, - {'BUTN'}, - {'SURF'}, - {'DSTR'}, - {'BOUL'}, - {'MAPR'}, - {'GUST'}, - {'VOLU'}, - {'UI '}, - {'UIFT'}, - {'TEXT'}, - {'COND'}, - {'DPAT'}, - {'PRJT'}, - {'LOBM'}, - {'FOG '}, - {'LITE'}, - {'PARE'}, - {'PARS'}, - {'CSN '}, - {'CTOC'}, - {'CSNM'}, - {'EGEN'}, - {'ALST'}, - {'RAW '}, - {'LODT'}, - {'SHDW'}, - {'DYNA'}, - {'VIL '}, - {'VILP'}, - {'COLL'}, - {'PARP'}, - {'PIPT'}, - {'DSCO'}, - {'JAW '}, - {'SHRP'}, - {'FLY '}, - {'TRCK'}, - {'CRV ', 0, 0, Curve_Read, NULL, NULL, NULL, NULL, NULL, NULL}, - {'ZLIN'}, - {'DUPC'}, - {'SLID'}, - {'CRDT'}, + { 'BSP ', 0, 0, BSP_Read, NULL, NULL, NULL, NULL, BSP_Unload, NULL }, + { 'JSP ', 0, 0, JSP_Read, NULL, NULL, NULL, NULL, JSP_Unload, NULL }, + { 'TXD ' }, + { 'MODL', 0, 0, Model_Read, NULL, NULL, NULL, NULL, Model_Unload, NULL }, + { 'ANIM', 0, 0, NULL, NULL, NULL, NULL, NULL, Anim_Unload, NULL }, + { 'RWTX', 0, 0, RWTX_Read, NULL, NULL, NULL, NULL, TextureRW3_Unload, NULL }, + { 'LKIT', 0, 0, NULL, NULL, NULL, NULL, NULL, LightKit_Unload, NULL }, + { 'CAM ' }, + { 'PLYR' }, + { 'NPC ' }, + { 'ITEM' }, + { 'PKUP' }, + { 'TRIG' }, + { 'SDF ' }, + { 'TEX ' }, + { 'TXT ' }, + { 'ENV ' }, + { 'ATBL', 0, 0, ATBL_Read, NULL, NULL, NULL, NULL, NULL, NULL }, + { 'MINF' }, + { 'PICK' }, + { 'PLAT' }, + { 'PEND' }, + { 'MRKR' }, + { 'MVPT', 0, 0, NULL, NULL, NULL, NULL, NULL, MovePoint_Unload, NULL }, + { 'TIMR' }, + { 'CNTR' }, + { 'PORT' }, + { 'SND ' }, + { 'SNDS' }, + { 'GRUP' }, + { 'MPHT' }, + { 'SFX ' }, + { 'SNDI', 0, 0, SndInfoRead, NULL, NULL, NULL, NULL, NULL, NULL }, + { 'HANG' }, + { 'SIMP' }, + { 'BUTN' }, + { 'SURF' }, + { 'DSTR' }, + { 'BOUL' }, + { 'MAPR' }, + { 'GUST' }, + { 'VOLU' }, + { 'UI ' }, + { 'UIFT' }, + { 'TEXT' }, + { 'COND' }, + { 'DPAT' }, + { 'PRJT' }, + { 'LOBM' }, + { 'FOG ' }, + { 'LITE' }, + { 'PARE' }, + { 'PARS' }, + { 'CSN ' }, + { 'CTOC' }, + { 'CSNM' }, + { 'EGEN' }, + { 'ALST' }, + { 'RAW ' }, + { 'LODT' }, + { 'SHDW' }, + { 'DYNA' }, + { 'VIL ' }, + { 'VILP' }, + { 'COLL' }, + { 'PARP' }, + { 'PIPT' }, + { 'DSCO' }, + { 'JAW ' }, + { 'SHRP' }, + { 'FLY ' }, + { 'TRCK' }, + { 'CRV ', 0, 0, Curve_Read, NULL, NULL, NULL, NULL, NULL, NULL }, + { 'ZLIN' }, + { 'DUPC' }, + { 'SLID' }, + { 'CRDT' }, }; void zAssetStartup() @@ -127,8 +127,8 @@ void zAssetShutdown() } static HackModelRadius hackRadiusTable[3] = { { 0xFA77E6FAU, 20.0f }, - { 0x5BD0EDACU, 1000.0f }, - { 0xED21A1C6U, 50.0f } }; + { 0x5BD0EDACU, 1000.0f }, + { 0xED21A1C6U, 50.0f } }; static char* jsp_shadow_hack_textures[5] = { "beach_towel", "wood_board_Nails_singleV2", "wood_board_Nails_singleV3", @@ -168,7 +168,11 @@ struct AnimTableList animTable[33] = { { "ZNPC_AnimTable_Chuck", ZNPC_AnimTable_Chuck, 0 }, { "ZNPC_AnimTable_Jelly", ZNPC_AnimTable_Jelly, 0 }, { "ZNPC_AnimTable_SuperFriend", ZNPC_AnimTable_SuperFriend, 0 }, - { "ZNPC_AnimTable_BossPatrick", ZNPC_AnimTable_BossPatrick, 0, } + { + "ZNPC_AnimTable_BossPatrick", + ZNPC_AnimTable_BossPatrick, + 0, + } }; static xAnimTable* (*tableFuncList[48])() = { @@ -227,7 +231,7 @@ extern xJSPHeader sDummyEmptyJSP; static void* Model_Read(void* param_1, U32 param_2, void* indata, U32 insize, U32* outsize) { - RpAtomic* model = (RpAtomic *)iModelFileNew(indata, insize); + RpAtomic* model = (RpAtomic*)iModelFileNew(indata, insize); *outsize = 0x70; @@ -237,7 +241,8 @@ static void* Model_Read(void* param_1, U32 param_2, void* indata, U32 insize, U3 { continue; } - for (RpAtomic* tmpModel = model; tmpModel != NULL; tmpModel = (RpAtomic *)iModelFile_RWMultiAtomic(tmpModel)) + for (RpAtomic* tmpModel = model; tmpModel != NULL; + tmpModel = (RpAtomic*)iModelFile_RWMultiAtomic(tmpModel)) { tmpModel->boundingSphere.radius = hackRadiusTable[i].radius; @@ -260,7 +265,7 @@ static void* Curve_Read(void* param_1, U32 param_2, void* indata, U32 insize, U3 void* __dest = RWSRCGLOBAL(memoryFuncs.rwmalloc(insize)); memcpy(__dest, indata, insize); - *(int *)((int)__dest + 0x10) = (int)__dest + 0x14; + *(int*)((int)__dest + 0x10) = (int)__dest + 0x14; return __dest; } @@ -305,7 +310,6 @@ static void* BSP_Read(void* param_1, U32 param_2, void* indata, U32 insize, U32* return bsp; } - static void BSP_Unload(void*, U32) { xEnvFree(globals.sceneCur->env); @@ -340,10 +344,12 @@ static RwTexture* TexCB(RwTexture* texture, void* data) { *(RwTexture**)(data) = texture; } + return texture; } -static void* RWTX_Read(void*, unsigned int, void*, unsigned int, unsigned int*) { - +static void* RWTX_Read(void*, unsigned int, void*, unsigned int, unsigned int*) +{ + return NULL; } static void TextureRW3_Unload(void* a, U32 b) @@ -365,10 +371,10 @@ static void ATBL_Init() void FootstepHackSceneEnter() { - s_sbFootSoundA = xStrHash("SB_run1L"); - s_sbFootSoundB = xStrHash("SB_run1R"); - s_scFootSoundA = xStrHash("SC_run_kelpL"); - s_scFootSoundB = xStrHash("SC_run_kelpL"); + s_sbFootSoundA = xStrHash("SB_run1L"); + s_sbFootSoundB = xStrHash("SB_run1R"); + s_scFootSoundA = xStrHash("SC_run_kelpL"); + s_scFootSoundB = xStrHash("SC_run_kelpL"); s_patFootSoundA = xStrHash("Pat_run_rock_dryL"); s_patFootSoundB = xStrHash("Pat_run_rock_dryR"); } @@ -378,8 +384,9 @@ static U8 dummyEffectCB(U32, xAnimActiveEffect*, xAnimSingle*, void*) return 0; } -static void* ATBL_Read(void*, unsigned int, void*, unsigned int, unsigned int*) { - +static void* ATBL_Read(void*, unsigned int, void*, unsigned int, unsigned int*) +{ + return NULL; } static void Anim_Unload(void*, U32) diff --git a/src/SB/Game/zCutsceneMgr.cpp b/src/SB/Game/zCutsceneMgr.cpp index 40a70b7e9..5244557d5 100644 --- a/src/SB/Game/zCutsceneMgr.cpp +++ b/src/SB/Game/zCutsceneMgr.cpp @@ -285,7 +285,7 @@ void zCutsceneMgrFinishLoad(xBase* to) void zCutsceneMgrFinishExit(xBase* to) { - zCutsceneMgr* t; + zCutsceneMgr* t = (zCutsceneMgr*)to; while (1) { diff --git a/src/SB/Game/zEntPlayer.cpp b/src/SB/Game/zEntPlayer.cpp index 664954693..bcc9bb381 100644 --- a/src/SB/Game/zEntPlayer.cpp +++ b/src/SB/Game/zEntPlayer.cpp @@ -4678,7 +4678,7 @@ void zEntPlayer_SNDPlayStreamRandom(_tagePlayerStreamSnd player_snd_start, if (player_snd_start != player_snd_end) { S32 first_valid; - S32 num_valid; + S32 num_valid = 0; for (S32 i = 0; i < diff; i++) { S32 possible = rand_array[i]; diff --git a/src/SB/Game/zEntSimpleObj.cpp b/src/SB/Game/zEntSimpleObj.cpp index 136ad9c31..b9c4d3f0a 100644 --- a/src/SB/Game/zEntSimpleObj.cpp +++ b/src/SB/Game/zEntSimpleObj.cpp @@ -298,7 +298,7 @@ void zEntSimpleObj_MgrUpdateRender(RpWorld* world, F32 dt) s32 sp1C; s32 sp18; s32 sp14; - f32 spC; + f32 spC = 0.0f; xVec3 sp8; f32 temp_f0; f32 temp_f1; diff --git a/src/SB/Game/zNPCGoalAmbient.cpp b/src/SB/Game/zNPCGoalAmbient.cpp index 3cbda0b23..75be8179f 100644 --- a/src/SB/Game/zNPCGoalAmbient.cpp +++ b/src/SB/Game/zNPCGoalAmbient.cpp @@ -39,12 +39,12 @@ S32 zNPCGoalJellyAttack::Process(en_trantype* arg0, F32 arg1, void* arg2, xScene return zNPCGoalPushAnim::Process(arg0, arg1, arg2, arg3); } -S32 zNPCGoalJellyAttack::ZapperStop() +void zNPCGoalJellyAttack::ZapperStop() { - zNPC_SNDStop((_tageNPCSnd) 4); - for (S32 i = 0; i< 3; ++i) + zNPC_SNDStop((_tageNPCSnd)4); + for (S32 i = 0; i < 3; ++i) { - if(zap_lytnin[i] != NULL) + if (zap_lytnin[i] != NULL) { zLightningKill(zap_lytnin[i]); } diff --git a/src/SB/Game/zNPCGoalAmbient.h b/src/SB/Game/zNPCGoalAmbient.h index 89d06d1e8..563e548d5 100644 --- a/src/SB/Game/zNPCGoalAmbient.h +++ b/src/SB/Game/zNPCGoalAmbient.h @@ -9,7 +9,6 @@ #include "zNPCSupport.h" #include "zLightning.h" - xFactoryInst* GOALCreate_Ambient(S32 who, RyzMemGrow* grow, void*); struct zNPCGoalJellyBirth : zNPCGoalCommon @@ -24,13 +23,13 @@ struct zNPCGoalJellyBirth : zNPCGoalCommon struct zNPCGoalJellyAttack : zNPCGoalPushAnim { - class zLightning * zap_lytnin[3]; + class zLightning* zap_lytnin[3]; U32 lastAnimTime; S32 Enter(F32 dt, void* updCtxt); S32 Exit(F32 dt, void* updCtxt); S32 Process(en_trantype* trantyp, F32 dt, void* updCxt, xScene* xscn); - S32 ZapperStart(); - S32 ZapperStop(); + S32 ZapperStart(); + void ZapperStop(); S32 ZapperUpdate(); }; diff --git a/src/SB/Game/zNPCGoalRobo.cpp b/src/SB/Game/zNPCGoalRobo.cpp index 94b744d76..53119b98a 100644 --- a/src/SB/Game/zNPCGoalRobo.cpp +++ b/src/SB/Game/zNPCGoalRobo.cpp @@ -208,24 +208,23 @@ void zNPCGoalTubeLasso::ChkPrelimTran(en_trantype* trantype, int* nextgoal) switch (npc->tub_pete->tubestat) { - case TUBE_STAT_BORN: - *nextgoal = NPC_GOAL_TUBEBIRTH; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_DUCKLING: - *nextgoal = NPC_GOAL_TUBEDUCKLING; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_ATTACK: - *nextgoal = NPC_GOAL_TUBEATTACK; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_DYING: - case TUBE_STAT_DEAD: - *nextgoal = NPC_GOAL_TUBEDYING; - *trantype = GOAL_TRAN_SET; - break; - + case TUBE_STAT_BORN: + *nextgoal = NPC_GOAL_TUBEBIRTH; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_DUCKLING: + *nextgoal = NPC_GOAL_TUBEDUCKLING; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_ATTACK: + *nextgoal = NPC_GOAL_TUBEATTACK; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_DYING: + case TUBE_STAT_DEAD: + *nextgoal = NPC_GOAL_TUBEDYING; + *trantype = GOAL_TRAN_SET; + break; } // ????? @@ -237,24 +236,24 @@ void zNPCGoalTubeLasso::ChkPrelimTran(en_trantype* trantype, int* nextgoal) S32 zNPCGoalPatThrow::Enter(F32 dt, void* updCtxt) { - zNPCRobot* npc = (zNPCRobot *)(psyche->clt_owner); + zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner); NPCGlyph* glyph = npc->glyf_stun; if (glyph != NULL) { glyph->Discard(); } npc->glyf_stun = NULL; - zNPCGoalCommon::Enter(dt, updCtxt); + return zNPCGoalCommon::Enter(dt, updCtxt); } -S32 zNPCGoalTubeAttack::LaserRender() +void zNPCGoalTubeAttack::LaserRender() { zNPCTubeSlave::laser.Render(&paul.pos_laserSource, &paul.pos_laserTarget); } void zNPCGoalTubeAttack::MaryzFury() { - zNPCTubelet* npc = *(zNPCTubelet **)(&psyche->clt_owner); + zNPCTubelet* npc = *(zNPCTubelet**)(&psyche->clt_owner); NPCHazard* haz = HAZ_Acquire(); if (haz != NULL) { @@ -269,7 +268,7 @@ void zNPCGoalTubeAttack::MaryzFury() S32 zNPCGoalStunned::Enter(F32 dt, void* updCtxt) { - zNPCRobot* npc = (zNPCRobot *)(psyche->clt_owner); + zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner); if (!(flg_info & 0x10)) { F32 stun = npc->cfg_npc->tym_stun; @@ -277,7 +276,7 @@ S32 zNPCGoalStunned::Enter(F32 dt, void* updCtxt) } flg_info = 0; npc->VelStop(); - zNPCGoalCommon::Enter(dt, updCtxt); + return zNPCGoalCommon::Enter(dt, updCtxt); } S32 zNPCGoalTubeLasso::Exit(F32 dt, void* updCtxt) @@ -287,7 +286,7 @@ S32 zNPCGoalTubeLasso::Exit(F32 dt, void* updCtxt) zNPCGoalTubeDying* tubedie = (zNPCGoalTubeDying*)psyche->FindGoal(0x4e475255); tubedie->DeathByLasso(npc->Pos()); - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalDeflate::Exit(F32 dt, void* updCtxt) @@ -298,7 +297,7 @@ S32 zNPCGoalDeflate::Exit(F32 dt, void* updCtxt) mdl_wig->Scale.assign(1.0f); npc->RestoreColFlags(); - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalTubeDying::Exit(F32 dt, void* updCtxt) @@ -309,7 +308,7 @@ S32 zNPCGoalTubeDying::Exit(F32 dt, void* updCtxt) mdl_wig->Scale.assign(1.0f); npc->RestoreColFlags(); - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalTeleport::Exit(F32 dt, void* updCtxt) @@ -321,7 +320,7 @@ S32 zNPCGoalTeleport::Exit(F32 dt, void* updCtxt) npc->RestoreColFlags(); - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalTubeBonked::Exit(F32 dt, void* updCtxt) @@ -332,7 +331,7 @@ S32 zNPCGoalTubeBonked::Exit(F32 dt, void* updCtxt) npc->ModelAtomicHide(4, NULL); npc->ShowerConfetti(NULL); npc->SndPlayRandom(NPC_STYP_UNBONKED); - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalAlertGlove::Exit(F32 dt, void* updCtxt) @@ -341,7 +340,7 @@ S32 zNPCGoalAlertGlove::Exit(F32 dt, void* updCtxt) npc->flg_vuln |= 0x00100000; npc->flg_vuln |= 0x82010000; zNPC_SNDStop(eNPCSnd_GloveAttack); - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalAlertSleepy::Exit(F32 dt, void* updCtxt) @@ -349,7 +348,7 @@ S32 zNPCGoalAlertSleepy::Exit(F32 dt, void* updCtxt) zNPCSleepy* npc = ((zNPCSleepy*)(psyche->clt_owner)); npc->ModelAtomicHide(1, NULL); zNPC_SNDStop(eNPCSnd_SleepyAttack); - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } void zNPCGoalTubePal::ChkPrelimTran(en_trantype* trantype, int* nextgoal) @@ -358,30 +357,30 @@ void zNPCGoalTubePal::ChkPrelimTran(en_trantype* trantype, int* nextgoal) switch (npc->tub_pete->tubestat) { - case TUBE_STAT_BORN: - *nextgoal = NPC_GOAL_TUBEBIRTH; - *trantype = GOAL_TRAN_SET; - return; - case TUBE_STAT_DUCKLING: - *nextgoal = NPC_GOAL_TUBEDUCKLING; - *trantype = GOAL_TRAN_SET; - return; - case TUBE_STAT_ATTACK: - *nextgoal = NPC_GOAL_TUBEATTACK; - *trantype = GOAL_TRAN_SET; - return; - case TUBE_STAT_LASSO: - *nextgoal = NPC_GOAL_TUBELASSO; - *trantype = GOAL_TRAN_SET; - return; - case TUBE_STAT_DYING: - *nextgoal = NPC_GOAL_TUBEDYING; - *trantype = GOAL_TRAN_SET; - return; - case TUBE_STAT_DEAD: - *nextgoal = NPC_GOAL_TUBEDEAD; - *trantype = GOAL_TRAN_SET; - return; + case TUBE_STAT_BORN: + *nextgoal = NPC_GOAL_TUBEBIRTH; + *trantype = GOAL_TRAN_SET; + return; + case TUBE_STAT_DUCKLING: + *nextgoal = NPC_GOAL_TUBEDUCKLING; + *trantype = GOAL_TRAN_SET; + return; + case TUBE_STAT_ATTACK: + *nextgoal = NPC_GOAL_TUBEATTACK; + *trantype = GOAL_TRAN_SET; + return; + case TUBE_STAT_LASSO: + *nextgoal = NPC_GOAL_TUBELASSO; + *trantype = GOAL_TRAN_SET; + return; + case TUBE_STAT_DYING: + *nextgoal = NPC_GOAL_TUBEDYING; + *trantype = GOAL_TRAN_SET; + return; + case TUBE_STAT_DEAD: + *nextgoal = NPC_GOAL_TUBEDEAD; + *trantype = GOAL_TRAN_SET; + return; } } @@ -391,29 +390,29 @@ void zNPCGoalTubeDuckling::ChkPrelimTran(en_trantype* trantype, int* nextgoal) switch (npc->tub_pete->tubestat) { - case TUBE_STAT_BORN: - *nextgoal = NPC_GOAL_TUBEBIRTH; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_ATTACK: - if (flg_duckling & 2) - { - break; - } - *nextgoal = NPC_GOAL_TUBEATTACK; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_LASSO: - *nextgoal = NPC_GOAL_TUBELASSO; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_DYING: - case TUBE_STAT_DEAD: - *nextgoal = NPC_GOAL_TUBEDYING; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_DUCKLING: + case TUBE_STAT_BORN: + *nextgoal = NPC_GOAL_TUBEBIRTH; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_ATTACK: + if (flg_duckling & 2) + { break; + } + *nextgoal = NPC_GOAL_TUBEATTACK; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_LASSO: + *nextgoal = NPC_GOAL_TUBELASSO; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_DYING: + case TUBE_STAT_DEAD: + *nextgoal = NPC_GOAL_TUBEDYING; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_DUCKLING: + break; } if (npc->hitpoints == 0) @@ -429,24 +428,23 @@ void zNPCGoalTubeAttack::ChkPrelimTran(en_trantype* trantype, int* nextgoal) switch (npc->tub_pete->tubestat) { - case TUBE_STAT_BORN: - *nextgoal = NPC_GOAL_TUBEBIRTH; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_DUCKLING: - *nextgoal = NPC_GOAL_TUBEDUCKLING; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_LASSO: - *nextgoal = NPC_GOAL_TUBELASSO; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_DYING: - case TUBE_STAT_DEAD: - *nextgoal = NPC_GOAL_TUBEDYING; - *trantype = GOAL_TRAN_SET; - break; - + case TUBE_STAT_BORN: + *nextgoal = NPC_GOAL_TUBEBIRTH; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_DUCKLING: + *nextgoal = NPC_GOAL_TUBEDUCKLING; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_LASSO: + *nextgoal = NPC_GOAL_TUBELASSO; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_DYING: + case TUBE_STAT_DEAD: + *nextgoal = NPC_GOAL_TUBEDYING; + *trantype = GOAL_TRAN_SET; + break; } if (*trantype != 0) @@ -469,25 +467,25 @@ void zNPCGoalTubeBirth::ChkPrelimTran(en_trantype* trantype, int* nextgoal) switch (npc->tub_pete->tubestat) { - case TUBE_STAT_DUCKLING: - *nextgoal = NPC_GOAL_TUBEDUCKLING; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_ATTACK: - *nextgoal = NPC_GOAL_TUBEATTACK; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_LASSO: - *nextgoal = NPC_GOAL_TUBELASSO; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_DYING: - case TUBE_STAT_DEAD: - *nextgoal = NPC_GOAL_TUBEDYING; - *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_BORN: - break; + case TUBE_STAT_DUCKLING: + *nextgoal = NPC_GOAL_TUBEDUCKLING; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_ATTACK: + *nextgoal = NPC_GOAL_TUBEATTACK; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_LASSO: + *nextgoal = NPC_GOAL_TUBELASSO; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_DYING: + case TUBE_STAT_DEAD: + *nextgoal = NPC_GOAL_TUBEDYING; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_BORN: + break; } if (npc->hitpoints != 0) @@ -505,22 +503,22 @@ void zNPCGoalTubeDead::ChkPrelimTran(en_trantype* trantype, int* nextgoal) switch (npc->tub_pete->tubestat) { - case TUBE_STAT_BORN: - *nextgoal = NPC_GOAL_TUBEBIRTH; - *trantype = GOAL_TRAN_SET; - return; - case TUBE_STAT_DUCKLING: - *nextgoal = NPC_GOAL_TUBEDUCKLING; - *trantype = GOAL_TRAN_SET; - return; - case TUBE_STAT_ATTACK: - *nextgoal = NPC_GOAL_TUBEATTACK; - *trantype = GOAL_TRAN_SET; - return; - case TUBE_STAT_LASSO: - *nextgoal = NPC_GOAL_TUBELASSO; - *trantype = GOAL_TRAN_SET; - return; + case TUBE_STAT_BORN: + *nextgoal = NPC_GOAL_TUBEBIRTH; + *trantype = GOAL_TRAN_SET; + return; + case TUBE_STAT_DUCKLING: + *nextgoal = NPC_GOAL_TUBEDUCKLING; + *trantype = GOAL_TRAN_SET; + return; + case TUBE_STAT_ATTACK: + *nextgoal = NPC_GOAL_TUBEATTACK; + *trantype = GOAL_TRAN_SET; + return; + case TUBE_STAT_LASSO: + *nextgoal = NPC_GOAL_TUBELASSO; + *trantype = GOAL_TRAN_SET; + return; } return; } @@ -708,13 +706,13 @@ int zNPCGoalAttackFodder::CattleNotify::Notify(en_haznote hazNote, NPCHazard* ha { switch (hazNote) { - case HAZ_NOTE_DISCARD: - case HAZ_NOTE_ABORT: - goal->haz_cattle = NULL; - break; - case HAZ_NOTE_HITPLAYER: - goal->flg_attack |= 3; - break; + case HAZ_NOTE_DISCARD: + case HAZ_NOTE_ABORT: + goal->haz_cattle = NULL; + break; + case HAZ_NOTE_HITPLAYER: + goal->flg_attack |= 3; + break; } return 0; } @@ -770,18 +768,18 @@ S32 zNPCGoalLassoThrow::Exit(F32 dt, void* updCtxt) return xGoal::Exit(dt, updCtxt); } -S32 zNPCGoalKnock::StreakPrep() +void zNPCGoalKnock::StreakPrep() { streakID = NPCC_StreakCreate(NPC_STRK_TOSSEDROBOT); } -S32 zNPCGoalAttackHammer::FXStreakPrep() +void zNPCGoalAttackHammer::FXStreakPrep() { streakID[0] = NPCC_StreakCreate(NPC_STRK_HAMMERSMASH_HORZ); streakID[1] = NPCC_StreakCreate(NPC_STRK_HAMMERSMASH_VERT); } -S32 zNPCGoalAttackArfMelee::FXStreakPrep() +void zNPCGoalAttackArfMelee::FXStreakPrep() { for (int i = 0; i < 4; i++) { @@ -789,7 +787,7 @@ S32 zNPCGoalAttackArfMelee::FXStreakPrep() } } -S32 zNPCGoalAttackArf::SetAttackMode(S32 a, S32 b) +void zNPCGoalAttackArf::SetAttackMode(S32 a, S32 b) { flg_attack &= 0xfffffff8; if (a != 0) @@ -1144,7 +1142,7 @@ S32 NPCArena::IncludesPlayer(F32 rad_thresh, xVec3* vec) NPCGlyph* GLYF_Acquire(en_npcglyph); -F32 zNPCGoalEvilPat::GlyphStart() +void zNPCGoalEvilPat::GlyphStart() { static xVec3 ang_delta = { DEG2RAD(2.1f), 0.0f, 0.0f }; static xVec3 scale = { 0.75f, 0.75f, 0.75f }; @@ -1210,12 +1208,12 @@ S32 zNPCGoalDogPounce::NPCMessage(NPCMsg* mail) S32 ret = 0; switch (mail->msgid) { - case NPC_MID_DAMAGE: - flg_user = 1; - break; - default: - ret = 0; - break; + case NPC_MID_DAMAGE: + flg_user = 1; + break; + default: + ret = 0; + break; } return ret; } @@ -1305,7 +1303,7 @@ S32 zNPCGoalEvilPat::NPCMessage(NPCMsg* mail) zNPCRobot* npc = ((zNPCRobot*)(psyche->clt_owner)); switch (mail->msgid) { - case NPC_MID_STUN: + case NPC_MID_STUN: F32 stuntime = mail->stundata.tym_stuntime; F32 blah = (xurand() - 0.5f); blah = 0.25f * blah; @@ -1339,7 +1337,7 @@ S32 zNPCGoalTaunt::Enter(F32 dt, void* updCtxt) { zNPCCommon* npc = ((zNPCCommon*)(psyche->clt_owner)); npc->SndPlayRandom(NPC_STYP_LAUGH); - zNPCGoalLoopAnim::Enter(dt, updCtxt); + return zNPCGoalLoopAnim::Enter(dt, updCtxt); } S32 zNPCGoalAttackArfMelee::Enter(F32 dt, void* updCtxt) @@ -1347,7 +1345,7 @@ S32 zNPCGoalAttackArfMelee::Enter(F32 dt, void* updCtxt) zNPCCommon* npc = ((zNPCCommon*)(psyche->clt_owner)); FXStreakPrep(); npc->SndPlayRandom(NPC_STYP_PUNCH); - zNPCGoalPushAnim::Enter(dt, updCtxt); + return zNPCGoalPushAnim::Enter(dt, updCtxt); } S32 zNPCGoalAttackHammer::Enter(F32 dt, void* updCtxt) @@ -1377,23 +1375,11 @@ void zNPCGoalAttackHammer::ModifyAnimSpeed() void zNPCGoalAttackHammer::TellBunnies() { - static en_NPCTYPES toTypes[3] = - { - NPC_TYPE_FODDER, - NPC_TYPE_FODBOMB, - NPC_TYPE_CHOMPER - }; + static en_NPCTYPES toTypes[3] = { NPC_TYPE_FODDER, NPC_TYPE_FODBOMB, NPC_TYPE_CHOMPER }; zNPCCommon* npc = ((zNPCCommon*)(psyche->clt_owner)); - zNPCMsg_AreaNotify - ( - npc, - NPC_MID_BUNNYHOP, - 8.0f, - 18, - (en_NPCTYPES)toTypes - ); + zNPCMsg_AreaNotify(npc, NPC_MID_BUNNYHOP, 8.0f, 18, (en_NPCTYPES)toTypes); } S32 zNPCGoalEvade::Enter(F32 dt, void* updCtxt) @@ -1534,7 +1520,7 @@ S32 zNPCGoalAlertMonsoon::Enter(F32 dt, void* updCtxt) alertmony = MONSOON_ALERT_NOTICE; tmr_reload = 0.0; xVec3Copy(&pos_corner, npc->Pos()); - zNPCGoalCommon::Enter(dt, updCtxt); + return zNPCGoalCommon::Enter(dt, updCtxt); } S32 zNPCGoalTubeLasso::Enter(F32 dt, void* updCtxt) @@ -1544,7 +1530,7 @@ S32 zNPCGoalTubeLasso::Enter(F32 dt, void* updCtxt) return zNPCGoalCommon::Enter(dt, updCtxt); } -S32 zNPCGoalTubeDying::DeathByLasso(const xVec3* vec) +void zNPCGoalTubeDying::DeathByLasso(const xVec3* vec) { flg_tubedying |= 1; pos_lassoDeath = *vec; @@ -1618,40 +1604,40 @@ S32 zNPCGoalKnock::Exit(F32 dt, void* updCtxt) void zNPCGoalTubeBonked::CheckForTran(en_trantype* trantype, int* nextgoal) { - zNPCTubeSlave* npc = (zNPCTubeSlave *)(psyche->clt_owner); + zNPCTubeSlave* npc = (zNPCTubeSlave*)(psyche->clt_owner); switch (npc->tub_pete->tubestat) { - case TUBE_STAT_BORN: - if (npc->hitpoints != 0) - { - *nextgoal = NPC_GOAL_TUBEBIRTH; - *trantype = GOAL_TRAN_SET; - } - break; - case TUBE_STAT_DUCKLING: - if (npc->hitpoints != 0) - { - *nextgoal = NPC_GOAL_TUBEDUCKLING; - *trantype = GOAL_TRAN_SET; - } - break; - case TUBE_STAT_ATTACK: - if (npc->hitpoints != 0) - { - *nextgoal = NPC_GOAL_TUBEATTACK; - *trantype = GOAL_TRAN_SET; - } - break; - case TUBE_STAT_LASSO: - *nextgoal = NPC_GOAL_TUBELASSO; + case TUBE_STAT_BORN: + if (npc->hitpoints != 0) + { + *nextgoal = NPC_GOAL_TUBEBIRTH; *trantype = GOAL_TRAN_SET; - break; - case TUBE_STAT_DYING: - case TUBE_STAT_DEAD: - *nextgoal = NPC_GOAL_TUBEDYING; + } + break; + case TUBE_STAT_DUCKLING: + if (npc->hitpoints != 0) + { + *nextgoal = NPC_GOAL_TUBEDUCKLING; *trantype = GOAL_TRAN_SET; - break; + } + break; + case TUBE_STAT_ATTACK: + if (npc->hitpoints != 0) + { + *nextgoal = NPC_GOAL_TUBEATTACK; + *trantype = GOAL_TRAN_SET; + } + break; + case TUBE_STAT_LASSO: + *nextgoal = NPC_GOAL_TUBELASSO; + *trantype = GOAL_TRAN_SET; + break; + case TUBE_STAT_DYING: + case TUBE_STAT_DEAD: + *nextgoal = NPC_GOAL_TUBEDYING; + *trantype = GOAL_TRAN_SET; + break; } } @@ -1684,7 +1670,8 @@ S32 zNPCGoalLassoBase::Exit(F32 dt, void* updCtxt) S32 zNPCGoalAlertFodBzzt::Exit(F32 dt, void* updCtxt) { zNPCFodBzzt::cnt_alerthokey--; - zNPCFodBzzt::cnt_alerthokey = ~(zNPCFodBzzt::cnt_alerthokey >> 31) & zNPCFodBzzt::cnt_alerthokey; + zNPCFodBzzt::cnt_alerthokey = + ~(zNPCFodBzzt::cnt_alerthokey >> 31) & zNPCFodBzzt::cnt_alerthokey; zNPC_SNDStop(eNPCSnd_FodBzztAttack); zNPCTubelet* npc = ((zNPCTubelet*)(psyche->clt_owner)); @@ -1786,7 +1773,7 @@ void zNPCGoalAttackArfMelee::FXStreakDone() } } -S32 zNPCGoalAttackHammer::FXStreakDone() +void zNPCGoalAttackHammer::FXStreakDone() { for (S32 i = 0; i < (S32)(sizeof(this->streakID) / sizeof(U32)); i++) { @@ -1816,8 +1803,8 @@ S32 zNPCGoalWound::NPCMessage(NPCMsg* msg) { switch (msg->msgid) { - case NPC_MID_DAMAGE: - return 1; + case NPC_MID_DAMAGE: + return 1; } return 0; } @@ -1826,27 +1813,27 @@ S32 zNPCGoalTeleport::NPCMessage(NPCMsg* msg) { switch (msg->msgid) { - case NPC_MID_DAMAGE: - return 1; + case NPC_MID_DAMAGE: + return 1; } return 0; } -S32 zNPCGoalAlertTubelet::PeteAttackBegin() +void zNPCGoalAlertTubelet::PeteAttackBegin() { - zNPCTubelet* npc = (zNPCTubelet *)(psyche->clt_owner); + zNPCTubelet* npc = (zNPCTubelet*)(psyche->clt_owner); npc->pete_attack_last = 1; zNPC_SNDPlay3D(eNPCSnd_TubeAttack, npc); } S32 zNPCGoalAlertGlove::Resume(F32 dt, void* updCtxt) { - zNPCCommon* npc = (zNPCCommon *)(psyche->clt_owner); + zNPCCommon* npc = (zNPCCommon*)(psyche->clt_owner); npc->flg_vuln &= 0xffefffff; npc->flg_vuln &= 0x7dfeffff; tmr_minAttack = 1.0; zNPC_SNDPlay3D(eNPCSnd_GloveAttack, npc); - zNPCGoalCommon::Resume(dt, updCtxt); + return zNPCGoalCommon::Resume(dt, updCtxt); } S32 zNPCGoalRespawn::InputInfo(NPCSpawnInfo* info) @@ -1883,7 +1870,7 @@ S32 zNPCGoalStunned::InputInfo(NPCStunInfo* info) S32 zNPCGoalEvilPat::InputStun(NPCStunInfo* info) { xPsyche* psyche = xGoal::GetPsyche(); - zNPCGoalStunned* stunned = (zNPCGoalStunned *)psyche->FindGoal(NPC_GOAL_STUNNED); + zNPCGoalStunned* stunned = (zNPCGoalStunned*)psyche->FindGoal(NPC_GOAL_STUNNED); return stunned == NULL ? 0 : stunned->InputInfo(info); } @@ -1901,7 +1888,7 @@ S32 zNPCGoalAlertFodBzzt::Suspend(F32 dt, void* updCtxt) { zNPCGlove* npc = ((zNPCGlove*)(psyche->clt_owner)); zNPC_SNDStop(eNPCSnd_FodBzztAttack); - xGoal::Suspend(dt, updCtxt); + return xGoal::Suspend(dt, updCtxt); } S32 zNPCGoalAlertGlove::Suspend(F32 dt, void* updCtxt) @@ -1910,7 +1897,7 @@ S32 zNPCGoalAlertGlove::Suspend(F32 dt, void* updCtxt) npc->flg_vuln |= 0x00100000; npc->flg_vuln |= 0x82010000; zNPC_SNDStop(eNPCSnd_GloveAttack); - xGoal::Suspend(dt, updCtxt); + return xGoal::Suspend(dt, updCtxt); } void NPCArena::IncludesNPC(zNPCCommon* npc, float dt, xVec3* vec) @@ -1922,16 +1909,13 @@ void NPCArena::IncludesNPC(zNPCCommon* npc, float dt, xVec3* vec) S32 zNPCGoalDamage::NPCMessage(NPCMsg* msg) { U32 ret = 1; - xPsyche* psyche = (xPsyche *)xGoal::GetPsyche(); + xPsyche* psyche = (xPsyche*)xGoal::GetPsyche(); switch (msg->msgid) { case NPC_MID_DAMAGE: - if - ( - (msg->infotype == NPC_MDAT_DAMAGE) && + if ((msg->infotype == NPC_MDAT_DAMAGE) && ((msg->dmgdata.dmg_type == DMGTYP_SURFACE) || - (msg->dmgdata.dmg_type == DMGTYP_DAMAGE_SURFACE)) - ) + (msg->dmgdata.dmg_type == DMGTYP_DAMAGE_SURFACE))) { psyche->GoalSet(NPC_GOAL_AFTERLIFE, 0); } @@ -1962,4 +1946,4 @@ F32 LERP(F32 x, F32 y, F32 z) U8 LERP(float x, U8 y, U8 z) { return (U8)(x * (z - y)) + y; -} \ No newline at end of file +} diff --git a/src/SB/Game/zNPCGoalStd.h b/src/SB/Game/zNPCGoalStd.h index fe875f053..c962efb22 100644 --- a/src/SB/Game/zNPCGoalStd.h +++ b/src/SB/Game/zNPCGoalStd.h @@ -343,7 +343,7 @@ class zNPCGoalAttackArfMelee : public zNPCGoalPushAnim S32 Enter(F32 dt, void* updCtxt); S32 Exit(F32 dt, void* updCtxt); - S32 FXStreakPrep(); + void FXStreakPrep(); void FXStreakDone(); U32 streakID[4]; // offset 0x54, size 0x10 @@ -360,7 +360,7 @@ class zNPCGoalAttackArf : public zNPCGoalPushAnim S32 LaunchBone(F32 dt, S32 param_2); S32 Exit(F32 dt, void* updCtxt); - S32 SetAttackMode(S32 a, S32 b); + void SetAttackMode(S32 a, S32 b); S32 flg_attack; // offset 0x54, size 0x4 }; @@ -432,7 +432,7 @@ class zNPCGoalEvilPat : public zNPCGoalCommon S32 Enter(F32 dt, void* updCtxt); S32 Exit(F32 dt, void* updCtxt); - F32 GlyphStart(); + void GlyphStart(); void GlyphStop(); S32 NPCMessage(NPCMsg* mail); S32 Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene); @@ -650,11 +650,11 @@ class zNPCGoalAlertTubelet : public zNPCGoalCommon xGoal::SetFlags(6); } - S32 PeteAttackBegin(); + void PeteAttackBegin(); S32 Exit(F32 dt, void* updCtxt); S32 Enter(F32 dt, void* updCtxt); S32 Resume(F32 dt, void* updCtxt); - S32 PeteAttackBegin(F32 dt, void* updCtxt); + void PeteAttackBegin(F32 dt, void* updCtxt); S32 flg_attack; // offset 0x4C, size 0x4 S32 cnt_nextlos; // offset 0x50, size 0x4 F32 len_laser; // offset 0x54, size 0x4 @@ -850,8 +850,8 @@ class zNPCGoalAttackHammer : public zNPCGoalPushAnim void ModifyAnimSpeed(); S32 Exit(F32 dt, void* updCtxt); - S32 FXStreakPrep(); - S32 FXStreakDone(); + void FXStreakPrep(); + void FXStreakDone(); void TellBunnies(); S32 Enter(F32 dt, void* updCtxt); S32 flg_attack; // offset 0x54, size 0x4 @@ -880,7 +880,6 @@ struct zNPCGoalAttackFodder : zNPCGoalPushAnim CattleNotify() { - } S32 Notify(en_haznote note, NPCHazard*); @@ -1059,7 +1058,6 @@ class zNPCGoalTubeDead : public zNPCGoalDead public: zNPCGoalTubeDead(S32 id) : zNPCGoalDead(id) { - } void ChkPrelimTran(en_trantype*, int*); @@ -1071,10 +1069,9 @@ class zNPCGoalTubeDying : public zNPCGoalCommon public: zNPCGoalTubeDying(S32 id) : zNPCGoalCommon(id) { - } - S32 DeathByLasso(const xVec3*); + void DeathByLasso(const xVec3*); S32 Exit(F32 dt, void* updCtxt); S32 flg_tubedying; // offset 0x4C, size 0x4 F32 spd_gothatway; // offset 0x50, size 0x4 @@ -1127,7 +1124,7 @@ class zNPCGoalTubeAttack : public zNPCGoalCommon S32 Enter(F32 dt, void* updCtxt); S32 Resume(F32 dt, void* updCtxt); bool MarySpinUp(float); - S32 LaserRender(); + void LaserRender(); void MaryzBlessing(); void MaryzFury(); S32 MarySpinDown(F32 dt); @@ -1233,7 +1230,7 @@ class zNPCGoalKnock : public zNPCGoalCommon } void StreakDone(); - S32 StreakPrep(); + void StreakPrep(); S32 Exit(F32 dt, void* updCtxt); S32 flg_knock; // offset 0x4C, size 0x4 xVec3 pos_bumper; // offset 0x50, size 0xC diff --git a/src/SB/Game/zNPCMessenger.cpp b/src/SB/Game/zNPCMessenger.cpp index 40155d01e..cd0785848 100644 --- a/src/SB/Game/zNPCMessenger.cpp +++ b/src/SB/Game/zNPCMessenger.cpp @@ -18,7 +18,7 @@ void zNPCMsg_ScenePrepare() void zNPCMsg_SceneFinish() { - return zNPCMsg_SceneReset(); + return zNPCMsg_SceneReset(); } void zNPCMsg_SendMsg(en_NPC_MSG_ID, U8) @@ -47,11 +47,12 @@ void NPCPS_queMessage(NPCMsg*) S32 NPCPS_flagForMID(en_NPC_MSG_ID) { - return 7; + return 7; } F32 NPCPS_MsgPoolInit(NPCPSData*, int) { + return 0; } void NPCPS_MsgPoolReset(NPCPSData*) @@ -60,6 +61,7 @@ void NPCPS_MsgPoolReset(NPCPSData*) F32 NPCPS_CltPoolInit(NPCPSData*, int) { + return 0; } void NPCPS_CltPoolReset(NPCPSData*) @@ -68,7 +70,7 @@ void NPCPS_CltPoolReset(NPCPSData*) NPCPSData* NPCPS_postOffice() { - return &g_postoffice; + return &g_postoffice; } void NPCPS_grabMsg() @@ -81,10 +83,10 @@ void NPCPS_freeMsg(NPCMsg*) void zNPCMsg_SceneReset() { - // 57% there but not quite - NPCPS_CltPoolReset(NPCPS_postOffice()); - NPCPS_MsgPoolReset(NPCPS_postOffice()); - return; + // 57% there but not quite + NPCPS_CltPoolReset(NPCPS_postOffice()); + NPCPS_MsgPoolReset(NPCPS_postOffice()); + return; } void zNPCMsg_Timestep(xScene*, float) diff --git a/src/SB/Game/zNPCSupplement.cpp b/src/SB/Game/zNPCSupplement.cpp index 30ad59ca1..9a0171d88 100644 --- a/src/SB/Game/zNPCSupplement.cpp +++ b/src/SB/Game/zNPCSupplement.cpp @@ -68,11 +68,11 @@ void NPCSupplement_Timestep(float dt) NPAR_Timestep(dt); } -S32 NPCC_StreakCreate(en_npcstreak styp) +U32 NPCC_StreakCreate(en_npcstreak styp) { - StreakInfo info = info_950; + static StreakInfo info; NPCC_MakeStreakInfo(styp, &info); - xFXStreakStart(&styp); + return xFXStreakStart(&info); } void NPAR_ScenePrepare() diff --git a/src/SB/Game/zNPCSupplement.h b/src/SB/Game/zNPCSupplement.h index d791bafc9..0530486a8 100644 --- a/src/SB/Game/zNPCSupplement.h +++ b/src/SB/Game/zNPCSupplement.h @@ -122,8 +122,8 @@ void NPAR_SceneReset(); void NPCC_ShadowCacheReset(); void NPAR_Timestep(F32 dt); void NPCC_MakeStreakInfo(en_npcstreak styp, StreakInfo* info); -void xFXStreakStart(en_npcstreak* styp); -S32 NPCC_StreakCreate(en_npcstreak styp); +U32 xFXStreakStart(StreakInfo* styp); +U32 NPCC_StreakCreate(en_npcstreak styp); void UpdateAndRender(NPARMgmt param_1, F32 dt); F32 BOWL3(F32 param_1); F32 QUB(F32 param_1); diff --git a/src/SB/Game/zNPCTypeDutchman.cpp b/src/SB/Game/zNPCTypeDutchman.cpp index 76fdb0e17..b45733c67 100644 --- a/src/SB/Game/zNPCTypeDutchman.cpp +++ b/src/SB/Game/zNPCTypeDutchman.cpp @@ -148,7 +148,7 @@ void zNPCDutchman::Damage(en_NPC_DAMAGE_TYPE, xBase*, const xVec3*) S32 zNPCDutchman::LassoSetup() { zNPCCommon::LassoUseGuides(1, 1); - zNPCCommon::LassoSetup(); + return zNPCCommon::LassoSetup(); } void zNPCDutchman::render_debug() diff --git a/src/SB/Game/zNPCTypeKingJelly.cpp b/src/SB/Game/zNPCTypeKingJelly.cpp index 695619064..1b4c07699 100644 --- a/src/SB/Game/zNPCTypeKingJelly.cpp +++ b/src/SB/Game/zNPCTypeKingJelly.cpp @@ -357,15 +357,15 @@ S32 zNPCGoalKJDeath::Enter(float dt, void* updCtxt) zNPCKingJelly& kj = *(zNPCKingJelly*)this->psyche->clt_owner; kj.decompose(); kj.post_decompose(); - zNPCGoalCommon::Enter(dt, updCtxt); + return zNPCGoalCommon::Enter(dt, updCtxt); } S32 zNPCGoalKJDeath::Exit(float dt, void* updCtxt) { - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalKJDeath::Process(en_trantype* trantype, float dt, void* updCtxt, xScene* xscn) { - xGoal::Process(trantype, dt, updCtxt, xscn); + return xGoal::Process(trantype, dt, updCtxt, xscn); } diff --git a/src/SB/Game/zNPCTypePrawn.cpp b/src/SB/Game/zNPCTypePrawn.cpp index ae4f3deb9..7c38bf85e 100644 --- a/src/SB/Game/zNPCTypePrawn.cpp +++ b/src/SB/Game/zNPCTypePrawn.cpp @@ -204,7 +204,6 @@ void tweak_group::register_tweaks(bool init, xModelAssetParam* ap, U32 apsize) */ } - void aqua_beam::reset() // I don't know whats wrong here. Probably a simple error { firing = 0; @@ -337,7 +336,7 @@ S32 zNPCGoalPrawnDamage::Enter(float dt, void* updCtxt) { zNPCPrawn& prawn = *(zNPCPrawn*)psyche->clt_owner; prawn.set_floor_state(prawn.FS_DANGER, false, false); - zNPCGoalCommon::Enter(dt, updCtxt); + return zNPCGoalCommon::Enter(dt, updCtxt); } // S32 zNPCGoalPrawnBowl::Enter(float dt, void* updCtxt) @@ -351,31 +350,31 @@ S32 zNPCGoalPrawnBowl::Exit(float dt, void* updCtxt) { zNPCPrawn& prawn = *(zNPCPrawn*)psyche->clt_owner; prawn.set_floor_state(prawn.FS_BEGIN, true, false); - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalPrawnDamage::Exit(float dt, void* updCtxt) { zNPCPrawn& prawn = *(zNPCPrawn*)this->psyche->clt_owner; prawn.update_round(); - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalPrawnDeath::Enter(float dt, void* updCtxt) { zNPCPrawn& prawn = *(zNPCPrawn*)this->psyche->clt_owner; prawn.decompose(); - zNPCGoalCommon::Enter(dt, updCtxt); + return zNPCGoalCommon::Enter(dt, updCtxt); } S32 zNPCGoalPrawnDeath::Exit(float dt, void* updCtxt) { - xGoal::Exit(dt, updCtxt); + return xGoal::Exit(dt, updCtxt); } S32 zNPCGoalPrawnDeath::Process(en_trantype* trantype, float dt, void* updCtxt, xScene* xscn) { - xGoal::Process(trantype, dt, updCtxt, xscn); + return xGoal::Process(trantype, dt, updCtxt, xscn); } void xDebugAddTweak(const char*, xVec3*, const tweak_callback*, void*, U32)