MCPcopy Create free account
hub / github.com/crossuo/crossuo / AddRender

Method AddRender

src/GameObjects/MapBlock.cpp:265–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265void CMapBlock::AddRender(CRenderWorldObject *item, int x, int y)
266{
267 item->RemoveRender();
268 int priorityZ = item->GetZ();
269 if (item->IsLandObject())
270 {
271 if (((CLandObject *)item)->IsStretched)
272 {
273 priorityZ = ((CLandObject *)item)->AverageZ - 1;
274 }
275 else
276 {
277 priorityZ--;
278 }
279 }
280 else if (item->IsStaticGroupObject())
281 {
282 if (item->IsGameObject())
283 {
284 //priorityZ++;
285 if (((CGameObject *)item)->NPC || ((CGameObject *)item)->IsCorpse())
286 {
287 priorityZ++;
288 }
289 else
290 {
291 goto process_static;
292 }
293 }
294 else if (
295 item->IsMultiObject() &&
296 ((((CMultiObject *)item)->State & CHMOF_GENERIC_INTERNAL) != 0))
297 {
298 priorityZ--;
299 }
300 else
301 {
302 process_static:
303 if (item->IsBackground())
304 {
305 priorityZ--;
306 }
307
308 if (((CRenderStaticObject *)item)->GetStaticHeight() != 0u)
309 {
310 priorityZ++;
311 }
312 }
313 }
314 else if (item->IsEffectObject())
315 {
316 priorityZ += 2;
317 }
318
319 item->PriorityZ = priorityZ;
320 CRenderWorldObject *obj = Block[x][y];
321 if (obj == item)
322 {

Callers 6

MoveToTopMethod · 0.45
UpdateMethod · 0.45
AddMultiMethod · 0.45
LoadMultiMethod · 0.45

Calls 10

RemoveRenderMethod · 0.80
GetZMethod · 0.80
IsCorpseMethod · 0.80
GetStaticHeightMethod · 0.80
IsLandObjectMethod · 0.45
IsStaticGroupObjectMethod · 0.45
IsGameObjectMethod · 0.45
IsMultiObjectMethod · 0.45
IsBackgroundMethod · 0.45
IsEffectObjectMethod · 0.45

Tested by

no test coverage detected