MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / Process

Method Process

src/SB/Core/x/xNPCBasic.cpp:163–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163void xNPCBasic::Process(xScene* xscn, F32 dt)
164{
165 xEnt* thisEnt = this;
166 void (*bak_bupdate)(xEnt*, xVec3*);
167 S32 hasgrav = 0;
168
169 if (flags2.flg_colCheck || flags2.flg_penCheck)
170 {
171 colFreq -= 1;
172 }
173 else
174 {
175 colFreq = 1;
176 }
177
178 if (pflags & 0x4)
179 {
180 hasgrav = 1;
181 }
182
183 if (colFreq >= 0)
184 {
185 pflags &= 0xfb;
186 }
187
188 if (pflags & 0x2)
189 {
190 xEntApplyPhysics(thisEnt, xscn, dt);
191 }
192
193 if (pflags & 0x1)
194 {
195 xEntMove(thisEnt, xscn, dt);
196 }
197
198 if (ffx != NULL)
199 {
200 xFFXApply(this, xscn, dt);
201 }
202
203 if (frame != NULL && (flags1.flg_upward & 0x2))
204 {
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);
209 model->Mat->pos.y = MAX(model->Mat->pos.y, frame->oldmat.pos.y);
210 }
211
212 if (colFreq < 0)
213 {
214 colFreq = colFreqReset;
215
216 DBG_PStatCont(eNPCPerfEnable);
217 DBG_PStatOn(eNPCPerfDisable);
218
219 if (collis == NULL)
220 {

Callers 2

NPC_entwrap_updateFunction · 0.45
TimestepMethod · 0.45

Calls 10

xFFXApplyFunction · 0.85
memsetFunction · 0.85
xVec3Length2Function · 0.85
xDrawSetColorFunction · 0.85
xBoundDrawFunction · 0.85
xEntApplyPhysicsFunction · 0.70
xEntMoveFunction · 0.70
xEntCollideFunction · 0.70
NPC_spdBasedColFreqFunction · 0.70
CollideReviewFunction · 0.50

Tested by

no test coverage detected