Skip to content

Commit 4223784

Browse files
committed
Address feedback + couple more improvements
1 parent da87807 commit 4223784

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/SB/Core/x/xEntBoulder.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ void xEntBoulder_Render(xEnt* ent)
4545
xVec3 shadVec;
4646
F32 radius;
4747

48-
if ((model != NULL) && (xEntIsVisible(ent) != 0))
48+
if ((model != NULL) && xEntIsVisible(ent))
4949
{
5050
switch (model->Flags & 0x400)
5151
{
5252
case 0:
5353
if (ent->flags & 0x40)
5454
{
55-
if (iModelCull(model->Data, model->Mat) == 0)
55+
if (!iModelCull(model->Data, model->Mat))
5656
{
5757
xModelRender(model);
5858
}
@@ -63,12 +63,12 @@ void xEntBoulder_Render(xEnt* ent)
6363
shadVec.y = model->Mat->pos.y - 10.0f;
6464
shadVec.z = model->Mat->pos.z;
6565

66-
if (iModelCullPlusShadow(model->Data, model->Mat, &shadVec, &shadowResult) == 0)
66+
if (!iModelCullPlusShadow(model->Data, model->Mat, &shadVec, &shadowResult))
6767
{
6868
xModelRender(model);
6969
}
7070

71-
if (shadowResult == 0)
71+
if (!shadowResult)
7272
{
7373
if (ent->flags & 0x10)
7474
{
@@ -104,9 +104,9 @@ void xEntBoulder_Init(xEntBoulder* ent, xEntAsset* asset)
104104
xEntBoulderAsset* basset;
105105

106106
xEntInit(ent, asset);
107-
ent->collType = 4;
107+
ent->collType = XENT_COLLTYPE_DYN;
108108
ent->collLev = 4;
109-
ent->bound.type = 1;
109+
ent->bound.type = XBOUND_TYPE_SPHERE;
110110
ent->moreFlags |= 0x10;
111111
zEntParseModelInfo(ent, asset->modelInfoID);
112112
xEntInitShadow(*ent, ent->entShadow_embedded);
@@ -118,13 +118,13 @@ void xEntBoulder_Init(xEntBoulder* ent, xEntAsset* asset)
118118
ent->collis = NULL;
119119
ent->basset = basset;
120120
ent->eventFunc = xEntBoulderEventCB;
121-
ent->update = (void(*)(xEnt*, xScene*, F32))xEntBoulder_Update;
122-
ent->bupdate = (void(*)(xEnt*, xVec3*))xEntBoulder_BUpdate;
121+
ent->update = (xEntUpdateCallback)xEntBoulder_Update;
122+
ent->bupdate = (xEntBoundUpdateCallback)xEntBoulder_BUpdate;
123123
ent->render = xEntBoulder_Render;
124124

125125
if (ent->linkCount != 0)
126126
{
127-
ent->link = (xLinkAsset *)((int)ent->asset + 0x9C); // TODO: Figure out the actual type.
127+
ent->link = (xLinkAsset *)(&ent->asset[1]);
128128
}
129129
else
130130
{
@@ -144,8 +144,8 @@ void xEntBoulder_Init(xEntBoulder* ent, xEntAsset* asset)
144144
{
145145
ent->update = NULL;
146146
xEntHide(ent);
147-
ent->chkby = 0;
148-
ent->penby = 0;
147+
ent->chkby = XENT_COLLTYPE_NONE;
148+
ent->penby = XENT_COLLTYPE_NONE;
149149
ent->collis_chk = 0;
150150
ent->collis_pen = 0;
151151
globals.player.bubblebowl = ent;
@@ -333,9 +333,9 @@ void xEntBoulder_Update(xEntBoulder* ent, xScene* sc, F32 dt)
333333
zGridUpdateEnt(ent);
334334
zGooCollsBegin();
335335
xEntBeginUpdate(ent, sc, dt);
336-
ent->collType = 0x10;
336+
ent->collType = XENT_COLLTYPE_PLYR;
337337
xEntCollide(ent, sc, dt);
338-
ent->collType = 0x04;
338+
ent->collType = XENT_COLLTYPE_DYN;
339339
xEntEndUpdate(ent, sc, dt);
340340
zGooCollsEnd();
341341

@@ -764,8 +764,8 @@ S32 xEntBoulder_KilledBySurface(xEntBoulder* ent, xScene* sc, F32 dt)
764764

765765
void xEntBoulder_Kill(xEntBoulder* ent)
766766
{
767-
ent->chkby = 0;
768-
ent->penby = 0;
767+
ent->chkby = XENT_COLLTYPE_NONE;
768+
ent->penby = XENT_COLLTYPE_NONE;
769769
ent->collis_chk = 0;
770770
ent->collis_pen = 0;
771771
ent->update = NULL;
@@ -789,13 +789,13 @@ void xEntBoulder_BubbleBowl(F32 multiplier)
789789
return;
790790
}
791791

792-
if (ent->update == (void (*)(xEnt *, xScene *, F32))xEntBoulder_Update)
792+
if (ent->update == (xEntUpdateCallback)xEntBoulder_Update)
793793
{
794-
zEntEvent(ent, 0x25);
794+
zEntEvent(ent, eEventKill);
795795
}
796796

797797
xEntBoulder_Reset(ent, globals.sceneCur);
798-
ent->update = (void (*)(xEnt *, xScene *, F32))xEntBoulder_Update;
798+
ent->update = (xEntUpdateCallback)xEntBoulder_Update;
799799

800800
if (sBubbleStreakID != 0xdead)
801801
{
@@ -873,8 +873,8 @@ void xEntBoulder_Setup(xEntBoulder* ent)
873873

874874
void xEntBoulder_Reset(xEntBoulder* boul, xScene* sc)
875875
{
876-
boul->chkby = 0x1c;
877-
boul->penby = 0x10;
876+
boul->chkby = XENT_COLLTYPE_PLYR | XENT_COLLTYPE_NPC | XENT_COLLTYPE_DYN;
877+
boul->penby = XENT_COLLTYPE_PLYR;
878878
boul->collis_chk = 0x2e;
879879
boul->collis_pen = 0;
880880

@@ -955,7 +955,7 @@ void xBoulderGenerator_Init(xBoulderGenerator* bg, xBoulderGeneratorAsset* asset
955955
xVec3Normalize(&bg->bgasset->initaxis, &bg->bgasset->initaxis);
956956

957957
bg->lengthOfInitVel = xVec3Length(&bg->bgasset->initvel);
958-
if (bg->lengthOfInitVel > 1e-05f)
958+
if (bg->lengthOfInitVel > 1e-5f)
959959
{
960960
bg->perp1.x = bg->bgasset->initvel.z - bg->bgasset->initvel.y;
961961
bg->perp1.y = bg->bgasset->initvel.x - bg->bgasset->initvel.z;
@@ -1064,7 +1064,7 @@ void xBoulderGenerator_Launch(xBoulderGenerator* bg, xVec3* pnt, F32 t)
10641064
{
10651065
xEntBoulder_Reset(b, globals.sceneCur);
10661066
zEntEvent(b, eEventBorn);
1067-
b->update = (void(*)(xEnt*, xScene*, F32))xEntBoulder_Update;
1067+
b->update = (xEntUpdateCallback)xEntBoulder_Update;
10681068
if (bg->isMarker)
10691069
{
10701070
xVec3Copy((xVec3 *)(&b->model->Mat->pos), &((xMarkerAsset *)(bg->objectPtr))->pos);

0 commit comments

Comments
 (0)