Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ce4e1ae
Fix zNPCFXCinematic implementation
Redberd36 Apr 13, 2025
ed0c49d
All NPCCone functions 100%
Redberd36 Apr 13, 2025
6a79296
forgot one change.
Redberd36 Apr 13, 2025
d382c2e
Moved Static S32 init to the top of file in zNPCFXCinematic.cpp
Redberd36 Apr 13, 2025
684981b
Removed commented code in zNPCFXCinematic.cpp
Redberd36 Apr 13, 2025
cbe27cc
Removed commented code at the bottom of zNPCFXCinematic.cpp
Redberd36 Apr 13, 2025
4ff0424
Removed commented code at the top of zNPCFXCinematic.h
Redberd36 Apr 13, 2025
cef38d3
Merge branch 'main' of https://github.com/bfbbdecomp/bfbb
Redberd36 Apr 13, 2025
462a133
Merge branch 'main' of https://github.com/Redberd36/bfbb
Redberd36 Apr 13, 2025
c6a9785
Added parameter names for UVSliceSet, UVBaseSet, ColorSet
Redberd36 Apr 13, 2025
04bf2d3
Removed the blank git file
Redberd36 Apr 13, 2025
eb5bd75
Merge branch 'main' of https://github.com/bfbbdecomp/bfbb
Redberd36 Apr 13, 2025
c4fc36e
40% - 92% for some NCIN_Par functions in zNPCFXCinematic
Redberd36 Apr 14, 2025
115da66
Merge branch 'main' of https://github.com/bfbbdecomp/bfbb
Redberd36 Apr 14, 2025
9e56c4c
Merge branch 'bfbbdecomp:main' into main
Redberd36 Apr 14, 2025
5ab6dfa
Pointer name fixes for NCIN_Par functions in zNPCFXCinematic + one 10…
Redberd36 Apr 15, 2025
056b991
Merge branch 'main' of https://github.com/Redberd36/bfbb
Redberd36 Apr 15, 2025
3830707
Deleted static variables top of script
Redberd36 Apr 15, 2025
1f4a4da
Working more on zNPCFXCinematic with one 100% and started some others.
Redberd36 Apr 17, 2025
76cb5e3
Working more on zNPCFXCinematic with one 100% and started some others.
Redberd36 Apr 17, 2025
a94bdd3
Working more on zNPCFXCinematic with one 100% and started some others.
Redberd36 Apr 17, 2025
9e4998d
Fixed a minor error in zNPCFXCinematic
Redberd36 Apr 17, 2025
53c1979
Fixed a minor error in zTalkBox
Redberd36 Apr 17, 2025
2c005bd
Fixed another minor error in zTalkBox
Redberd36 Apr 17, 2025
d7fd37b
Fixed formatting and removed a zTalkBox function
Redberd36 Apr 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 145 additions & 14 deletions src/SB/Game/zNPCFXCinematic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void NCIN_Par_BPLANK_JET_1_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 param)

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -87,7 +87,7 @@ void NCIN_Par_BPLANK_JET_2_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 param)

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -125,7 +125,7 @@ void NCIN_Par_BPLANK_SBB_FLAMES_1_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -163,7 +163,7 @@ void NCIN_Par_BPLANK_SBB_FLAMES_2_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -201,7 +201,7 @@ void NCIN_Par_BPLANK_SBB_JET_1_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 pa

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -239,7 +239,7 @@ void NCIN_Par_BPLANK_SBB_JET_2_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 pa

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -277,7 +277,7 @@ void NCIN_Par_BPLANK_SBB_SMOKE_1_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -315,7 +315,7 @@ void NCIN_Par_BPLANK_SBB_SMOKE_2_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -353,7 +353,7 @@ void NCIN_Par_CIN_BIGDUP_SMOKE_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 pa

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -391,7 +391,7 @@ void NCIN_Par_CIN_BIGDUP_SPAWN_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 pa

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -429,7 +429,7 @@ void NCIN_Par_CIN_PLATFORM_JETS_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 p

F32& float_accum = fxrec->pos_A[1].y;

if (float_accum < 0.0f)
if (float_accum < 0.0f)
{
U8 val = fxrec->fxdata.pardata.emitter->emit_pad[0];
float_accum = 20.0f + val;
Expand Down Expand Up @@ -457,7 +457,7 @@ void NCIN_BubSlam(const zCutsceneMgr*, NCINEntry* fxrec, S32 param)

if (!(fxrec->flg_stat & 2))
{
return;
return;
}

switch (fxrec->typ_ncinfx)
Expand Down Expand Up @@ -557,6 +557,138 @@ void NCIN_HammerShock(const zCutsceneMgr*, NCINEntry* fxrec, S32 param)
}
}

void NCIN_HammerStreak_Upd(const zCutsceneMgr*, NCINEntry* fxrec, S32 param)
{
if (param != 0)
{
fxrec->flg_stat |= 4;

xFXStreakStop(fxrec->fxdata.strkdata.sid_horz);
xFXStreakStop(fxrec->fxdata.strkdata.sid_vert);

fxrec->fxdata.strkdata.sid_horz = 57005;
fxrec->fxdata.strkdata.sid_vert = 57005;

return;
}

if (fxrec->flg_stat & 2)
{
en_npcstreak styp_h = NPC_STRK_HAMMERSMASH_HORZ;
en_npcstreak styp_v = NPC_STRK_HAMMERSMASH_VERT;

fxrec->fxdata.strkdata.sid_horz = NPCC_StreakCreate(styp_h);
fxrec->fxdata.strkdata.sid_vert = NPCC_StreakCreate(styp_v);
}
}

void NCIN_HammerStreak_AR(const zCutsceneMgr*, NCINEntry* fxrec, RpAtomic*, RwMatrixTag*, U32 num_1,
U32 num_2)
{
if (num_2 != 2)
{
return;
}

U32 sid_vert = fxrec->fxdata.strkdata.sid_vert;
U32 sid_horz = fxrec->fxdata.strkdata.sid_horz;
}

void NCIN_WaterSplash(const zCutsceneMgr*, NCINEntry* fxrec, S32 param)
{
if (param != 0)
{
fxrec->flg_stat |= 4;
return;
}

if (fxrec->flg_stat & 2)
{
const F32 splash_radius = -1.0f;

NPCC_MakeASplash(&fxrec->pos_A[0], splash_radius);
fxrec->flg_stat |= 4;
}
}

void NCIN_HazProjShoot(const zCutsceneMgr* mgr, NCINEntry* fxrec, S32 param)
{
if (param != 0)
{
fxrec->flg_stat |= 4;

if (fxrec->fxdata.hazdata.npchaz->flg_hazard)
{
fxrec->fxdata.hazdata.npchaz->MarkForRecycle();
}
return;
}

if (fxrec->flg_stat & 2)
{
S32 type = fxrec->fxdata.hazdata.npchaz->typ_hazard;
S32 haztype = 10;

if (type == 11)
{
haztype = 18;
}
else if (type >= 10 && type < 13)
{
haztype = (type == 12) ? 16 : 10;
}

NPCHazard* haz = HAZ_Acquire();

if (!haz)
{
return;
}

if (!haz->ConfigHelper((en_npchaz)haztype))
{
return;
}

haz->SetNPCOwner(NULL);
fxrec->fxdata.hazdata.npchaz = haz;
haz->flg_hazard &= ~128;

xVec3 delta = fxrec->pos_B[0] - fxrec->pos_A[0];
F32 len = delta.length();

F32 height = fxrec->tym_beg - fxrec->tym_end;

if (height < 0.01f)
{
height = 1.0f;
}

haz->pos_hazard = delta;
haz->Start(&fxrec->pos_A[0], height);
}

if (fxrec->fxdata.hazdata.npchaz)
{
if (fxrec->fxdata.hazdata.npchaz->typ_hazard != 11)
{
fxrec->fxdata.hazdata.npchaz->flg_hazard &= ~0xF000;
}
else
{
fxrec->flg_stat |= 4;
}
}
}

void NCIN_HazTTSteam_Upd(const zCutsceneMgr* manager, NCINEntry* fxrec, S32 param)
{
}

void NCIN_HazTTSteam_AR(const zCutsceneMgr* cutsceneMgr, NCINEntry* fxrec, RpAtomic* atomic,
RwMatrixTag* matrix, U32 num_1, U32 num_2)
{
}

void clamp_bone_index(NCINEntry*, RpAtomic*)
{
Expand All @@ -570,7 +702,7 @@ void NPCCone::TextureSet(RwRaster* raster)
void NPCCone::UVSliceSet(F32 u, F32 v)
{
this->uv_tip[2] = u;
this->uv_slice[1] = v;
this->uv_slice[1] = v;
}

void NPCCone::UVBaseSet(F32 u, F32 v)
Expand All @@ -594,4 +726,3 @@ void NPARMgmt::KillAll()
{
this->cnt_active = 0;
}

50 changes: 1 addition & 49 deletions src/SB/Game/zNPCFXCinematic.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <types.h>
#include "zCutsceneMgr.h"
#include "zNPCSupplement.h"
#include "xVec3.h"
#include "zLightning.h"
#include "zNPCHazard.h"
Expand All @@ -17,55 +18,6 @@ S32 zNPCFXCutscenePrep(const xScene*, F32, const zCutsceneMgr* csnmgr);
void zNPCFXCutscene(const xScene*, F32, const zCutsceneMgr* csnmgr);
void zNPCFXCutsceneDone(const xScene*, F32, const zCutsceneMgr* csnmgr);

enum en_nparptyp
{
NPAR_TYP_UNKNOWN,
NPAR_TYP_OILBUB,
NPAR_TYP_TUBESPIRAL,
NPAR_TYP_TUBECONFETTI,
NPAR_TYP_GLOVEDUST ,
NPAR_TYP_MONSOONRAIN,
NPAR_TYP_SLEEPYZEEZ,
NPAR_TYP_CHUCKSPLASH,
NPAR_TYP_TARTARGUNK,
NPAR_TYP_DOGBREATH,
NPAR_TYP_VISSPLASH,
NPAR_TYP_FIREWORKS,
NPAR_TYP_NOMORE,
NPAR_TYP_FORCE = 2147483647
};

struct NPARData
{
xVec3 pos;
F32 xy_size[2];
F32 uv_tl[2];
F32 uv_br[2];
RwRGBA color;
F32 tmr_remain;
F32 tym_exist;
F32 fac_abuse;
xVec3 vel;
S32 flg_popts : 24;
S32 nparmode : 8;
F32 unused[3];
};

struct NPARXtraData
{
};

struct NPARMgmt
{
en_nparptyp typ_npar;
S32 flg_npar;
NPARData * par_buf;
S32 cnt_active;
S32 num_max;
RwTexture * txtr;
NPARXtraData * xtra_data;
void KillAll();
};

struct NCINLyt
{
Expand Down
1 change: 1 addition & 0 deletions src/SB/Game/zNPCSupplement.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct NPARMgmt
RwTexture* txtr;
NPARXtraData* xtra_data;
void** user_data;
void KillAll();

void Init(en_nparptyp parType, void** userData, NPARXtraData* xtraData);
void Clear();
Expand Down
3 changes: 2 additions & 1 deletion src/SB/Game/zTalkBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ struct ztalkbox : xBase
static void update_all(xScene& s, F32 dt);
static void render_all();
static void reset_all();
static void clear_layout();
static void permit(U32 add_flags, U32 remove_flags);
static ztalkbox* get_active();


static ztalkbox* get_active();
void start_talk(U32 textID, callback*, zNPCCommon*); // FIXME: params not verified
void stop_talk();

Expand Down