MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / InitShape

Method InitShape

engine/Poseidon/World/Simulation/Simul.cpp:230–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void EntityType::InitShape()
231{
232 if (!_shape)
233 return;
234
235 const ParamEntry* array = _par->FindEntry("animateTextures");
236 if (array)
237 {
238 int n = array->GetSize() / 2, index = 0;
239 _animateTextures.Realloc(n);
240 _animateTextures.Resize(n);
241 for (int i = 0; i < n; i++)
242 {
243 RString name = (*array)[index++];
244 _animateTextures[i].animation.Init(_shape, name, nullptr);
245 float animTime = (*array)[index++];
246 _animateTextures[i].animSpeed = animTime > 0 ? 1.0f / animTime : 0;
247 }
248 }
249
250 array = _par->FindEntry("Animations");
251 if (array)
252 {
253 int n = array->GetEntryCount();
254 _animations.Realloc(n);
255 _animations.Resize(n);
256 for (int i = 0; i < n; i++)
257 {
258 _animations[i] = AnimationType::CreateObject(array->GetEntry(i), _shape);
259 }
260 }
261}
262
263void EntityType::DeinitShape() {}
264

Callers 1

VehicleAddRefMethod · 0.45

Calls 6

FindEntryMethod · 0.45
GetSizeMethod · 0.45
ReallocMethod · 0.45
ResizeMethod · 0.45
InitMethod · 0.45
GetEntryCountMethod · 0.45

Tested by

no test coverage detected