1717#include " xColor.h"
1818#include " iCollide.h"
1919
20- extern float xNPCBasic_float_0;
21- extern float xNPCBasic_float_1;
22- extern float xNPCBasic_float_onehalf;
23- extern float xNPCBasic_float_onequarter;
24- extern float xNPCBasic_float_15;
25- extern float xNCPBasic_float_0p10000000;
26- extern float xNPCBasic_float_0p75;
27- extern float xNPCBasic_float_1eminus5;
28- extern float xNPCBasic_float_0p2;
29- extern float xNPCBasic_float_thirty;
30- extern float xNPCBasic_float_0p04;
31- extern float xNPCBasic_float_0p025;
32-
33- extern xEntCollis g_colrec;
34- extern xVec3 lbl_8026A3F8;
20+ static xEntCollis g_colrec = { 0 };
3521
3622void NPC_alwaysUseSphere (xEnt*, xVec3*);
3723void NPC_entwrap_setup (xEnt*);
@@ -45,17 +31,17 @@ void NPC_entwrap_render(xEnt*);
4531// The order of the function pointer assignment instructions at the end of the
4632void xNPCBasic::Init (xEntAsset* asset)
4733{
48- if (xNPCBasic_float_0 == asset->scale .x )
34+ if (0 . 0f == asset->scale .x )
4935 {
50- asset->scale .x = xNPCBasic_float_1 ;
36+ asset->scale .x = 1 . 0f ;
5137 }
52- if (xNPCBasic_float_0 == asset->scale .y )
38+ if (0 . 0f == asset->scale .y )
5339 {
54- asset->scale .y = xNPCBasic_float_1 ;
40+ asset->scale .y = 1 . 0f ;
5541 }
56- if (xNPCBasic_float_0 == asset->scale .z )
42+ if (0 . 0f == asset->scale .z )
5743 {
58- asset->scale .z = xNPCBasic_float_1 ;
44+ asset->scale .z = 1 . 0f ;
5945 }
6046
6147 xEnt* thisEnt = this ;
@@ -125,14 +111,15 @@ void xNPCBasic::Reset()
125111void NPC_alwaysUseSphere (xEnt* ent, xVec3* value)
126112{
127113 xNPCBasic* npc = (xNPCBasic*)ent;
128- xVec3 bndcent = lbl_8026A3F8;
114+ const xVec3 vec = { 0 , 0 , 0 };
115+ xVec3 bndcent = vec;
129116
130117 xVec3Copy (&bndcent, xEntGetPos (npc));
131- bndcent.y += xNPCBasic_float_0p75 ;
118+ bndcent.y += 0 . 75f ;
132119
133120 npc->bound .type = XBOUND_TYPE_SPHERE;
134121 xVec3Copy (&npc->bound .sph .center , &bndcent);
135- npc->bound .sph .r = xNPCBasic_float_0p75 ;
122+ npc->bound .sph .r = 0 . 75f ;
136123 if (npc->bound .type != XBOUND_TYPE_NA)
137124 {
138125 xQuickCullForBound (&npc->bound .qcd , &npc->bound );
@@ -148,12 +135,12 @@ void NPC_alwaysUseSphere(xEnt* ent, xVec3* value)
148135
149136void NPC_spdBasedColFreq (xNPCBasic* npc, F32 dt)
150137{
151- if (dt < xNPCBasic_float_1eminus5 )
138+ if (dt < 1e- 5f )
152139 {
153140 return ;
154141 }
155142 F32 d = xVec3Length (&npc->frame ->vel );
156- if (d < xNPCBasic_float_0p2 )
143+ if (d < 0 . 2f )
157144 {
158145 return ;
159146 }
@@ -169,7 +156,7 @@ void NPC_spdBasedColFreq(xNPCBasic* npc, F32 dt)
169156 npc->bound .box .box .upper .z - npc->bound .box .box .lower .z );
170157 }
171158
172- S32 nf = xNPCBasic_float_thirty * (radius / d);
159+ S32 nf = 30 . 0f * (radius / d);
173160 npc->colFreq = MIN (npc->colFreq , nf);
174161}
175162
@@ -215,10 +202,10 @@ void xNPCBasic::Process(xScene* xscn, F32 dt)
215202
216203 if (frame != NULL && (flags1.flg_upward & 0x2 ))
217204 {
218- frame->dpos .y = MAX (xNPCBasic_float_0 , frame->dpos .y );
219- frame->dvel .y = MAX (xNPCBasic_float_0 , frame->dvel .y );
220- frame->vel .y = MAX (xNPCBasic_float_0 , frame->vel .y );
221- frame->oldvel .y = MAX (xNPCBasic_float_0 , frame->oldvel .y );
205+ frame->dpos .y = MAX (0 . 0f , frame->dpos .y );
206+ frame->dvel .y = MAX (0 . 0f , frame->dvel .y );
207+ frame->vel .y = MAX (0 . 0f , frame->vel .y );
208+ frame->oldvel .y = MAX (0 . 0f , frame->oldvel .y );
222209 model->Mat ->pos .y = MAX (model->Mat ->pos .y , frame->oldmat .pos .y );
223210 }
224211
@@ -254,7 +241,7 @@ void xNPCBasic::Process(xScene* xscn, F32 dt)
254241 DBG_PStatOn (eNPCPerfEnable);
255242 }
256243
257- if ((pflags & (0x2 | 0x1 )) != 0 && xVec3Length2 (&frame->vel ) > xNCPBasic_float_0p10000000 )
244+ if ((pflags & (0x2 | 0x1 )) != 0 && xVec3Length2 (&frame->vel ) > 0 . 1f )
258245 {
259246 NPC_spdBasedColFreq (this , dt);
260247 }
@@ -302,9 +289,9 @@ void NPC_entwrap_reset(xEnt* ent)
302289void NPC_entwrap_update (xEnt* ent, xScene* scn, F32 dt_caller)
303290{
304291 F32 dt = dt_caller;
305- if (dt > xNPCBasic_float_0p04 )
292+ if (dt > 0 . 04f )
306293 {
307- dt = xNPCBasic_float_0p025 ;
294+ dt = 0 . 025000002f ;
308295 }
309296
310297 xNPCBasic* npc = (xNPCBasic*)ent;
0 commit comments