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

Function zGridUpdateEnt

src/SB/Game/zGrid.cpp:205–281  ·  view source on GitHub ↗

WIP

Source from the content-addressed store, hash-verified

203
204// WIP
205void zGridUpdateEnt(xEnt* ent)
206{
207 if (!zGridInitted)
208 return;
209
210 S32 oversize = 0;
211 xGrid* grid = NULL;
212
213 // case 2 and 3 need to use `cntlzw` but are `mr` currently
214 switch (ent->gridb.ingrid)
215 {
216 case 1:
217 grid = &colls_grid;
218 break;
219 case 2:
220 oversize = (2 - ent->gridb.oversize) >> 5 & 0xFF;
221 grid = &colls_oso_grid;
222 break;
223 case 3:
224 oversize = (1 - ent->gridb.oversize) >> 5 & 0xFF;
225 grid = &npcs_grid;
226 break;
227 default:
228 break;
229 }
230
231 if ((ent->chkby & 0x98) == 0)
232 {
233 if ((ent->baseType == eBaseTypePickup) && (grid != NULL))
234 {
235 if (oversize == 0)
236 {
237 xGridUpdate(grid, ent);
238 }
239 else if (ent->collType == XENT_COLLTYPE_NPC)
240 {
241 oversize = xGridEntIsTooBig(&npcs_grid, ent);
242 if (oversize)
243 {
244 ent->gridb.oversize = 1;
245 }
246 else
247 {
248 ent->gridb.oversize = 0;
249 }
250 xGridAdd(&npcs_grid, ent);
251 }
252 else
253 {
254 oversize = xGridEntIsTooBig(&colls_grid, ent);
255 if (oversize)
256 {
257 oversize = xGridEntIsTooBig(&colls_oso_grid, ent);
258 if (oversize)
259 {
260 ent->gridb.oversize = 2;
261 }
262 else

Callers 12

zGridResetFunction · 0.70
BUpdateMethod · 0.70
SB1Dummy_BoundFuncFunction · 0.70
ProcessMethod · 0.70
NewTimeMethod · 0.70
bossPatBoxUpdateMethod · 0.70
BUpdateMethod · 0.70
NPC_alwaysUseSphereFunction · 0.50
xEntBoulder_RealBUpdateFunction · 0.50
xEntBoulder_UpdateFunction · 0.50
xEntDefaultBoundUpdateFunction · 0.50
xEntRepositionFunction · 0.50

Calls 4

xGridUpdateFunction · 0.50
xGridEntIsTooBigFunction · 0.50
xGridAddFunction · 0.50
xGridRemoveFunction · 0.50

Tested by

no test coverage detected