OpenTTD Source 20241224-master-gf74b0cf984
|
Helper class for a unified approach to NewGRF animation. More...
#include <newgrf_animation_base.h>
Static Public Member Functions | |
static void | AnimateTile (const Tspec *spec, Tobj *obj, TileIndex tile, bool random_animation, Textra extra_data=0) |
Animate a single tile. | |
static void | ChangeAnimationFrame (CallbackID cb, const Tspec *spec, Tobj *obj, TileIndex tile, uint32_t random_bits, uint32_t trigger, Textra extra_data=0) |
Check a callback to determine what the next animation step is and execute that step. | |
Helper class for a unified approach to NewGRF animation.
Tbase | Instantiation of this class. |
Tspec | NewGRF specification related to the animated tile. |
Tobj | Object related to the animated tile. |
Textra | Custom extra callback data. |
GetCallback | The callback function pointer. |
Tframehelper | The animation frame get/set helper. |
Definition at line 43 of file newgrf_animation_base.h.
|
inlinestatic |
Animate a single tile.
spec | Specification related to the tile. |
obj | Object related to the tile. |
tile | Tile to animate changes for. |
random_animation | Whether to pass random bits to the "next frame" callback. |
extra_data | Custom extra callback data. |
Definition at line 52 of file newgrf_animation_base.h.
References _settings_client, SoundSettings::ambient, ANIM_STATUS_LOOPING, CALLBACK_FAILED, Clamp(), TimerGameTick::counter, DeleteAnimatedTile(), ErrorUnknownCallbackResult(), GB(), HasBit(), MarkTileDirtyByTile(), PlayTileSound(), and ClientSettings::sound.
|
inlinestatic |
Check a callback to determine what the next animation step is and execute that step.
This includes stopping and starting animations as well as updating animation frames and playing sounds.
cb | The callback to actually call. |
spec | Specification related to the tile. |
obj | Object related to the tile. |
tile | Tile to consider animation changes for. |
random_bits | Random bits for this update. To be passed as parameter to the NewGRF. |
trigger | What triggered this update? To be passed as parameter to the NewGRF. |
extra_data | Custom extra data for callback processing. |
Definition at line 131 of file newgrf_animation_base.h.
References _settings_client, AddAnimatedTile(), SoundSettings::ambient, CALLBACK_FAILED, DeleteAnimatedTile(), GB(), PlayTileSound(), and ClientSettings::sound.