MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / animate

Method animate

src/Savegame/Tile.cpp:582–605  ·  view source on GitHub ↗

* Animate the tile. This means to advance the current frame for every object. * Ufo doors are a bit special, they animated only when triggered. * When ufo doors are on frame 0(closed) or frame 7(open) they are not animated further. */

Source from the content-addressed store, hash-verified

580 * When ufo doors are on frame 0(closed) or frame 7(open) they are not animated further.
581 */
582void Tile::animate()
583{
584 int newframe;
585 for (int i=0; i < 4; ++i)
586 {
587 if (_objects[i])
588 {
589 if (_objects[i]->isUFODoor() && (_currentFrame[i] == 0 || _currentFrame[i] == 7)) // ufo door is static
590 {
591 continue;
592 }
593 newframe = _currentFrame[i] + 1;
594 if (_objects[i]->isUFODoor() && _objects[i]->getSpecialType() == START_POINT && newframe == 3)
595 {
596 newframe = 7;
597 }
598 if (newframe == 8)
599 {
600 newframe = 0;
601 }
602 _currentFrame[i] = newframe;
603 }
604 }
605}
606
607/**
608 * Get the sprite of a certain part of the tile.

Callers

nothing calls this directly

Calls 2

isUFODoorMethod · 0.80
getSpecialTypeMethod · 0.80

Tested by

no test coverage detected