MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / frame_setData

Function frame_setData

TheForceEngine/TFE_Jedi/Level/robject.cpp:121–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119 }
120
121 void frame_setData(SecObject* obj, WaxFrame* data)
122 {
123 obj->fme = data;
124 obj->type = OBJ_TYPE_FRAME;
125 obj->flags |= OBJ_FLAG_NEEDS_TRANSFORM;
126 WaxCell* cell = data ? WAX_CellPtr(data, data) : nullptr;
127
128 if (obj->worldWidth == -1 && cell)
129 {
130 const fixed16_16 width = intToFixed16(TFE_Jedi::abs(cell->sizeX)/2);
131 obj->worldWidth = div16(width, SPRITE_SCALE_FIXED);
132 }
133 if (obj->worldHeight == -1 && cell)
134 {
135 const fixed16_16 height = intToFixed16(TFE_Jedi::abs(cell->sizeY));
136 obj->worldHeight = div16(height, SPRITE_SCALE_FIXED);
137 }
138 }
139
140 /////////////////////////////////
141 // Internal

Callers 4

level_loadObjectsFunction · 0.85
setProjectileObjectFunction · 0.85
item_createFunction · 0.85
mousebot_dieFunction · 0.85

Calls 3

intToFixed16Function · 0.85
absFunction · 0.85
div16Function · 0.85

Tested by

no test coverage detected