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
48 changes: 48 additions & 0 deletions src/SB/Game/zPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,54 @@ U32 zMechIsStartingBack(zPlatform* ent, U16 param_2)
}
}

static F32 SolvePaddleMotion(zPlatform* plat, F32* time, F32 tmr)
{
}

void zPlatform_PaddleStartRotate(xEnt* entplat, S32 direction, S32 stutter)
{
zPlatform* plat = (zPlatform*)entplat;
F32 time[3];

if (stutter != 0)
{
if (direction > 0)
{
plat->state = ZPLATFORM_STATE_UNK4;
}
else if (direction < 0)
{
plat->state = ZPLATFORM_STATE_UNK1;
}
}
else
{
if (direction > 0)
{
plat->state = ZPLATFORM_STATE_UNK3;
plat->ctr += 1;

if (plat->ctr >= plat->passet->paddle.countOrient)
{
plat->ctr = 0;
}
}
else if (direction < 0)
{
plat->state = ZPLATFORM_STATE_UNK2;
plat->ctr -= 1;

if (plat->ctr < 0)
{
plat->ctr = plat->passet->paddle.countOrient - 1;
}
}
}

SolvePaddleMotion(plat, time, -1.0f);
plat->tmr = time[0] + time[1] + time[2];
}

S32 zPlatformEventCB(xBase* from, xBase* to, U32 toEvent, const F32* toParam, xBase* base3)
{
return 1;
Expand Down
5 changes: 4 additions & 1 deletion src/SB/Game/zPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,19 @@ struct zPlatform : zEnt
#define ZPLATFORM_SUBTYPE_PADDLE 12
#define ZPLATFORM_SUBTYPE_FM 13

#define ZPLATFORM_STATE_UNK1 0x3
#define ZPLATFORM_STATE_INIT 0x0
#define ZPLATFORM_STATE_UNK1 0x3
#define ZPLATFORM_STATE_UNK2 0x1
#define ZPLATFORM_STATE_UNK3 0x2
#define ZPLATFORM_STATE_UNK4 0x4

void zPlatform_Init(void* plat, void* asset);
void zPlatform_Init(zPlatform* plat, xEntAsset* asset);
void zPlatform_Setup(zPlatform* plat, xScene* sc);
void zPlatform_Save(zPlatform* ent, xSerial* s);
void zPlatform_Load(zPlatform* ent, xSerial* s);
void zPlatform_Reset(zPlatform* plat, xScene* sc);
void zPlatform_PaddleStartRotate(class xEnt* entplat, S32 direction, S32 stutter);
void zPlatform_Update(xEnt* ent, xScene* sc, float dt);
U32 zPlatform_PaddleCollide(xCollis* coll, const xVec3* hitsource, const xVec3* hitvel,
U32 worldSpaceNorm);
Expand Down