Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 38 additions & 2 deletions src/SB/Game/zNPCSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@

#include "xMathInlines.h"

void NPCSupport_Startup()
NPCWidget g_npc_widgets[1] = {};
static U32 g_hash_uiwidgets[1];
static char* g_strz_uiwidgets[1] = {};

void NPCSupport_Startup()
{
zNPCHazard_Startup();
zNPCGlyph_Startup();
Expand Down Expand Up @@ -76,7 +79,9 @@ void NPCSupport_Timestep(F32 dt)

void NPCWidget_Startup()
{
g_hash_uiwidgets[0] = xStrHash((const char*)g_strz_uiwidgets);
}

void NPCWidget_Shutdown()
{
}
Expand All @@ -87,9 +92,15 @@ void NPCWidget_ScenePrepare()

void NPCWidget_SceneFinish()
{
NPCWidget_SceneReset();
}

void NPCWidget_SceneReset() // Come back after more data is in
{
g_npc_widgets->Reset();
}

void NPCWidget_SceneReset()
void NPCWidget::Reset()
{
}

Expand All @@ -105,6 +116,7 @@ void Firework_ScenePrepare()

void Firework_SceneFinish()
{
Firework_SceneReset(1);
}

void Firework_SceneReset(int)
Expand All @@ -120,6 +132,30 @@ bool NPCC_ForceTalkOk()
return false;
}

RwRaster* NPCC_FindRWRaster(const char* txtrname)
{
RwTexture* txtr = NPCC_FindRWTexture(txtrname);
if (txtr != NULL)
{
return txtr->raster;
}
return NULL;
}

RwTexture* NPCC_FindRWTexture(const char*)
{
return NULL;
}

RwRaster* NPCC_FindRWRaster(RwTexture* txtr)
{
if (txtr != NULL)
{
return txtr->raster;
}
return NULL;
}

void zNPC_SNDInit()
{
}
Expand Down
22 changes: 22 additions & 0 deletions src/SB/Game/zNPCSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ enum _tageNPCSnd
eNPCSnd_Total
};

enum en_NPC_UI_WIDGETS
{
NPC_UI_WIDGETS_unk // Come back after more data is put in
};

struct NPCTarget
{
en_npctgt typ_target;
Expand All @@ -46,6 +51,19 @@ struct NPCBlinker
void Reset();
};

struct NPCWidget
{
en_NPC_UI_WIDGETS idxID;
xBase* base_widge;
zNPCCommon* npc_ownerlock;

U32 NPCIsTheLocker(zNPCCommon* npc_lock);
U32 IsVisible();
U32 Off(zNPCCommon* npc, U32 theman);
U32 On(zNPCCommon* npc, U32 theman);
void Reset();
};

bool NPCC_ForceTalkOk();
void NPCWidget_Startup();
void NPCWidget_Shutdown();
Expand All @@ -64,6 +82,10 @@ void Firework_SceneReset(S32);
void Firework_ScenePrepare();
void Firework_SceneFinish();
void Firework_Timestep(F32 dt);
RwTexture* NPCC_FindRWTexture(U32 hashid);
RwTexture* NPCC_FindRWTexture(const char* txtrname);
RwRaster* NPCC_FindRWRaster(const char* txtrname);
RwRaster* NPCC_FindRWRaster(RwTexture* txtr);
void zNPC_SNDInit();
S32 NPCC_LampStatus();
F32 NPCC_TmrCycle(F32* tmr, F32 dt, F32 interval);
Expand Down
60 changes: 60 additions & 0 deletions src/SB/Game/zNPCTypeDutchman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

#include <types.h>

namespace
{
}

void xMat3x3RMulVec(xVec3* o, const xMat3x3* m, const xVec3* v)
{
F32 x = m->right.x * v->x + m->up.x * v->y + m->at.x * v->z;
Expand All @@ -15,6 +19,22 @@ void xMat3x3RMulVec(xVec3* o, const xMat3x3* m, const xVec3* v)
o->z = z;
}

void zNPCDutchman::Setup()
{
zNPCSubBoss::Setup();
}

void zNPCDutchman::Destroy()
{
zNPCCommon::Destroy();
dutchman_count--;
}

void zNPCDutchman::Render()
{
zNPCDutchman::render_debug();
}

void zNPCDutchman::render_debug()
{
}
Expand All @@ -27,6 +47,46 @@ void zNPCDutchman::add_splash(const xVec3&, float)
{
}

void zNPCDutchman::vanish()
{
}

void zNPCDutchman::reset_speed()
{
}

//S32 zNPCGoalDutchmanInitiate::Exit(F32 dt, void* updCtxt)
//{
// owner;
// return xGoal::Exit(dt, updCtxt);
//}

S32 zNPCGoalDutchmanIdle::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
}

S32 zNPCGoalDutchmanDisappear::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
}

S32 zNPCGoalDutchmanTeleport::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
}

S32 zNPCGoalDutchmanReappear::Exit(F32 dt, void* updCtxt)
{
owner.reset_speed();
return xGoal::Exit(dt, updCtxt);
}

S32 zNPCGoalDutchmanBeam::Exit(F32 dt, void* updCtxt)
{
return xGoal::Exit(dt, updCtxt);
}

U8 zNPCDutchman::PhysicsFlags() const
{
return 3;
Expand Down
15 changes: 14 additions & 1 deletion src/SB/Game/zNPCTypeDutchman.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,14 @@ struct zNPCDutchman : zNPCSubBoss
RwRaster* laser_raster;

zNPCDutchman(S32 myType);
void Setup();
void Destroy();
void Render();
void render_debug();
void update_animation(float);
void add_splash(const xVec3&, float);
void vanish();
void reset_speed();
U8 PhysicsFlags() const;
U8 ColPenByFlags() const;
U8 ColChkByFlags() const;
Expand All @@ -155,34 +160,40 @@ struct zNPCGoalDutchmanNil : zNPCGoalCommon
struct zNPCGoalDutchmanInitiate : zNPCGoalCommon
{
zNPCDutchman& owner;
S32 Exit(float, void*);

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
};

struct zNPCGoalDutchmanIdle : zNPCGoalCommon
{
zNPCDutchman& owner;
S32 Exit(float, void*);

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
};

struct zNPCGoalDutchmanDisappear : zNPCGoalCommon
{
zNPCDutchman& owner;
S32 Exit(float, void*);

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
};

struct zNPCGoalDutchmanTeleport : zNPCGoalCommon
{
zNPCDutchman& owner;
S32 Exit(float, void*);

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
};

struct zNPCGoalDutchmanReappear : zNPCGoalCommon
{
zNPCDutchman& owner;
S32 Exit(float, void*);
void reset_speed();

static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
};
Expand Down Expand Up @@ -215,7 +226,7 @@ struct zNPCGoalDutchmanBeam : zNPCGoalCommon
S32 shots;
beam_data beam[2];
zNPCDutchman& owner;

S32 Exit(float, void*);
static xFactoryInst* create(S32 who, RyzMemGrow* grow, void* info);
};

Expand Down Expand Up @@ -280,5 +291,7 @@ struct zNPCGoalDutchmanDeath : zNPCGoalCommon
};

xAnimTable* ZNPC_AnimTable_Dutchman();
U32 dutchman_count;
void Exit();

#endif