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

Function sprite_setData

TheForceEngine/TFE_Jedi/Level/robject.cpp:95–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 }
94
95 void sprite_setData(SecObject* obj, JediWax* data)
96 {
97 obj->wax = data;
98 obj->type = OBJ_TYPE_SPRITE;
99 obj->flags |= OBJ_FLAG_NEEDS_TRANSFORM;
100
101 if (data)
102 {
103 WaxAnim* anim = WAX_AnimPtr(data, 0);
104 WaxView* view = WAX_ViewPtr(data, anim, 0);
105 WaxFrame* frame = WAX_FramePtr(data, view, 0);
106 WaxCell* cell = WAX_CellPtr(data, frame);
107
108 if (obj->worldWidth == -1)
109 {
110 const fixed16_16 width = intToFixed16(TFE_Jedi::abs(cell->sizeX)/2);
111 obj->worldWidth = div16(mul16(data->xScale, width), SPRITE_SCALE_FIXED);
112 }
113 if (obj->worldHeight == -1)
114 {
115 const fixed16_16 height = intToFixed16(TFE_Jedi::abs(cell->sizeY));
116 obj->worldHeight = div16(mul16(data->yScale, height), SPRITE_SCALE_FIXED);
117 }
118 }
119 }
120
121 void frame_setData(SecObject* obj, WaxFrame* data)
122 {

Callers 15

level_loadObjectsFunction · 0.85
hitEffectTaskFuncFunction · 0.85
hitEffectExplodeFuncFunction · 0.85
generatorTaskFuncFunction · 0.85
setProjectileObjectFunction · 0.85
item_createFunction · 0.85
logic_spawnEnemyFunction · 0.85
sewerCreatureDamageFuncFunction · 0.85
sceneryLogicFuncFunction · 0.85
phaseTwo_handleDyingFunction · 0.85

Calls 4

intToFixed16Function · 0.85
absFunction · 0.85
div16Function · 0.85
mul16Function · 0.85

Tested by

no test coverage detected