112 }
else if ((v->
progress & 7) == 1) {
278 static const struct {
296 v->
x_pos += _inc_by_dir[b->direction].x;
297 v->
y_pos += _inc_by_dir[b->direction].y;
328 #define MK(x, y, z, i) { x, y, z, i } 329 #define ME(i) { i, 4, 0, 0 } 476 if ((v->
progress & 3) != 0)
return true;
496 if (b->y == 4 && b->x == 0) {
501 if (b->y == 4 && b->x == 1) {
509 if (b->y == 4 && b->x == 2) {
520 b = &_bubble_movement[v->
spritenum - 1][anim_state];
Flag for an invalid direction.
static bool Chance16I(const uint a, const uint b, const uint32 r)
Checks if a given randomize-number is below a given probability.
void AddAnimatedTile(TileIndex tile)
Add the given tile to the animated tile table (if it does not exist on that table yet)...
static IndustryGfx GetIndustryGfx(TileIndex t)
Get the industry graphics ID for the given industry tile.
byte spritenum
currently displayed sprite index 0xfd == custom sprite, 0xfe == custom second head sprite 0xff == res...
Functions related to vehicles.
byte animation_substate
Sub state to time the change of the graphics/behaviour.
void Set(SpriteID sprite)
Assign a single sprite to the sequence.
bool ambient
Play ambient, industry and town sounds.
A special vehicle is one of the following:
static EffectInitProc *const _effect_init_procs[]
Functions to initialise an effect vehicle after construction.
Accessors for industries.
EffectVehicle * CreateEffectVehicleAbove(int x, int y, int z, EffectVehicleType type)
Create an effect vehicle above a particular location.
static const uint TILE_SIZE
Tile size in world coordinates.
VehicleSpriteSeq sprite_seq
Vehicle appearance.
Direction
Defines the 8 directions on the map.
static bool IncrementSprite(EffectVehicle *v, SpriteID last)
Increment the sprite unless it has reached the end of the animation.
Pseudo random number generator.
byte subtype
subtype (Filled with values from #EffectVehicles/#TrainSubTypes/#AircraftSubTypes) ...
TransparencyOption GetTransparencyOption() const
Determines the transparency option affecting the effect.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a give tiletype.
SoundSettings sound
sound effect settings
ClientSettings _settings_client
The current settings for this game.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
void UpdateDeltaXY(Direction direction)
Updates the x and y offsets and the size of the sprite used for this vehicle.
TileIndex tile
Current tile index.
Base class for all effect vehicles.
#define lengthof(x)
Return the length of an fixed size array.
Functions related to sound.
EffectVehicle * CreateEffectVehicleRel(const Vehicle *v, int x, int y, int z, EffectVehicleType type)
Create an effect vehicle above a particular vehicle.
static T Clamp(const T a, const T min, const T max)
Clamp a value between an interval.
EffectVehicle * CreateEffectVehicle(int x, int y, int z, EffectVehicleType type)
Create an effect vehicle at a particular location.
bool Tick()
Calls the tick handler of the vehicle.
static TileIndex TileVirtXY(uint x, uint y)
Get a tile from the virtual XY-coordinate.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32 TileIndex
The index/ID of a Tile.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
Invalid transparency option.
static uint MapMaxY()
Gets the maximum Y coordinate within the map, including MP_VOID.
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function() ...
Functions related to OTTD's landscape.
EffectVehicleType
Effect vehicle types.
byte progress
The percentage (if divided by 256) this vehicle already crossed the tile unit.
static uint MapMaxX()
Gets the maximum X coordinate within the map, including MP_VOID.
SpriteID sprite
The 'real' sprite.
uint16 animation_state
State primarily used to change the graphics/behaviour.
Functions related to effect vehicles.
void UpdatePositionAndViewport()
Update the position of the vehicle, and update the viewport.
static EffectTickProc *const _effect_tick_procs[]
Functions for controlling effect vehicles at each tick.
TransparencyOption
Transparency option bits: which position in _transparency_opt stands for which transparency.
Vehicle is not clickable by the user (shadow vehicles).
static const TransparencyOption _effect_transparency_options[]
Transparency options affecting the effects.