MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getSprite

Method getSprite

game/state/shared/doodad.cpp:63–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63sp<Image> Doodad::getSprite()
64{
65 if (this->sprite)
66 return sprite;
67 int animTime = 0;
68 sp<Image> frame;
69 for (auto &f : type->frames)
70 {
71 frame = f.image;
72 animTime += f.time * TICKS_MULTIPLIER;
73 if (animTime > age)
74 return frame;
75 }
76 LogWarning("Doodad reached age %d with no frame", age);
77 return frame;
78}
79
80} // namespace OpenApoc

Callers 1

drawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected