Go to the documentation of this file.
110 }
else if ((v->
progress & 7) == 1) {
276 static const struct {
294 v->
x_pos += _inc_by_dir[b->direction].x;
295 v->
y_pos += _inc_by_dir[b->direction].y;
326 #define MK(x, y, z, i) { x, y, z, i }
327 #define ME(i) { i, 4, 0, 0 }
474 if ((v->
progress & 3) != 0)
return true;
494 if (b->y == 4 && b->x == 0) {
499 if (b->y == 4 && b->x == 1) {
507 if (b->y == 4 && b->x == 2) {
518 b = &_bubble_movement[v->
spritenum - 1][anim_state];
uint32 TileIndex
The index/ID of a Tile.
VehicleSpriteSeq sprite_seq
Vehicle appearance.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
static IndustryGfx GetIndustryGfx(TileIndex t)
Get the industry graphics ID for the given industry tile.
uint16 animation_state
State primarily used to change the graphics/behaviour.
static EffectInitProc *const _effect_init_procs[]
Functions to initialise an effect vehicle after construction.
byte y_extent
y-extent of vehicle bounding box
void Set(SpriteID sprite)
Assign a single sprite to the sequence.
bool Tick()
Calls the tick handler of the vehicle.
SpriteID sprite
The 'real' sprite.
static const uint TILE_SIZE
Tile size in world coordinates.
ClientSettings _settings_client
The current settings for this game.
@ MP_INDUSTRY
Part of an industry.
static bool Chance16I(const uint a, const uint b, const uint32 r)
Checks if a given randomize-number is below a given probability.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
bool ambient
Play ambient, industry and town sounds.
static bool IncrementSprite(EffectVehicle *v, SpriteID last)
Increment the sprite unless it has reached the end of the animation.
@ TO_INVALID
Invalid transparency option.
SoundSettings sound
sound effect settings
TileIndex tile
Current tile index.
EffectVehicle * CreateEffectVehicleRel(const Vehicle *v, int x, int y, int z, EffectVehicleType type)
Create an effect vehicle above a particular vehicle.
MutableSpriteCache sprite_cache
Cache of sprites and values related to recalculating them, see MutableSpriteCache.
int8 y_offs
y offset for vehicle sprite
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a given tiletype.
@ TO_INDUSTRIES
industries
EffectVehicle * CreateEffectVehicle(int x, int y, int z, EffectVehicleType type)
Create an effect vehicle at a particular location.
void UpdateDeltaXY()
Updates the x and y offsets and the size of the sprite used for this vehicle.
byte x_extent
x-extent of vehicle bounding box
@ SND_2F_BUBBLE_GENERATOR_FAIL
47 == 0x2F Industry animation: bubble generator (2a): bubble pop
TransparencyOption
Transparency option bits: which position in _transparency_opt stands for which transparency.
static T Clamp(const T a, const T min, const T max)
Clamp a value between an interval.
static uint MapMaxY()
Gets the maximum Y coordinate within the map, including MP_VOID.
int8 x_offs
x offset for vehicle sprite
byte z_extent
z-extent of vehicle bounding box
EffectVehicleType
Effect vehicle types.
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function()
A special vehicle is one of the following:
EffectVehicle * CreateEffectVehicleAbove(int x, int y, int z, EffectVehicleType type)
Create an effect vehicle above a particular location.
static uint MapMaxX()
Gets the maximum X coordinate within the map, including MP_VOID.
byte subtype
subtype (Filled with values from AircraftSubType/DisasterSubType/EffectVehicleType/GroundVehicleSubty...
@ VS_UNCLICKABLE
Vehicle is not clickable by the user (shadow vehicles).
@ SND_31_BUBBLE_GENERATOR_SUCCESS
49 == 0x31 Industry animation: bubble generator (2b): bubble slurped
#define lengthof(x)
Return the length of an fixed size array.
byte progress
The percentage (if divided by 256) this vehicle already crossed the tile unit.
byte spritenum
currently displayed sprite index 0xfd == custom sprite, 0xfe == custom second head sprite 0xff == res...
void UpdatePositionAndViewport()
Update the position of the vehicle, and update the viewport.
TransparencyOption GetTransparencyOption() const
Determines the transparency option affecting the effect.
byte animation_substate
Sub state to time the change of the graphics/behaviour.
static EffectTickProc *const _effect_tick_procs[]
Functions for controlling effect vehicles at each tick.
static const TransparencyOption _effect_transparency_options[]
Transparency options affecting the effects.
static TileIndex TileVirtXY(uint x, uint y)
Get a tile from the virtual XY-coordinate.
void AddAnimatedTile(TileIndex tile)
Add the given tile to the animated tile table (if it does not exist on that table yet).