Implementation of NewGRF canals. More...
#include "stdafx.h"#include "debug.h"#include "newgrf_spritegroup.h"#include "newgrf_canal.h"#include "water_map.h"Go to the source code of this file.
Functions | |
| static uint32 | CanalGetRandomBits (const ResolverObject *object) |
| static uint32 | CanalGetTriggers (const ResolverObject *object) |
| static void | CanalSetTriggers (const ResolverObject *object, int triggers) |
| static uint32 | CanalGetVariable (const ResolverObject *object, byte variable, uint32 parameter, bool *available) |
| static const SpriteGroup * | CanalResolveReal (const ResolverObject *object, const RealSpriteGroup *group) |
| static void | NewCanalResolver (ResolverObject *res, TileIndex tile, const GRFFile *grffile) |
| SpriteID | GetCanalSprite (CanalFeature feature, TileIndex tile) |
| Lookup the base sprite to use for a canal. | |
| static uint16 | GetCanalCallback (CallbackID callback, uint32 param1, uint32 param2, CanalFeature feature, TileIndex tile) |
| Run a specific callback for canals. | |
| uint | GetCanalSpriteOffset (CanalFeature feature, TileIndex tile, uint cur_offset) |
| Get the new sprite offset for a water tile. | |
Variables | |
| WaterFeature | _water_feature [CF_END] |
| Table of canal 'feature' sprite groups. | |
Implementation of NewGRF canals.
Definition in file newgrf_canal.cpp.
| static uint16 GetCanalCallback | ( | CallbackID | callback, | |
| uint32 | param1, | |||
| uint32 | param2, | |||
| CanalFeature | feature, | |||
| TileIndex | tile | |||
| ) | [static] |
Run a specific callback for canals.
| callback | Callback ID. | |
| param1 | Callback parameter 1. | |
| param2 | Callback parameter 2. | |
| feature | For which feature to run the callback. | |
| tile | Tile index of canal. |
Definition at line 126 of file newgrf_canal.cpp.
References CALLBACK_FAILED, and SpriteGroup::Resolve().
Referenced by GetCanalSpriteOffset().
| SpriteID GetCanalSprite | ( | CanalFeature | feature, | |
| TileIndex | tile | |||
| ) |
Lookup the base sprite to use for a canal.
| feature | Which canal feature we want. | |
| tile | Tile index of canal, if appropriate. |
Definition at line 104 of file newgrf_canal.cpp.
References SpriteGroup::Resolve().
Referenced by DrawCanalWater(), DrawWaterEdges(), and DrawWaterLock().
| uint GetCanalSpriteOffset | ( | CanalFeature | feature, | |
| TileIndex | tile, | |||
| uint | cur_offset | |||
| ) |
Get the new sprite offset for a water tile.
| tile | Tile index of the canal/water tile. | |
| feature | For which feature to get the new sprite offset. | |
| cur_offset | Current sprite offset. |
Definition at line 150 of file newgrf_canal.cpp.
References CALLBACK_FAILED, CBID_CANALS_SPRITE_OFFSET, CBM_CANAL_SPRITE_OFFSET, GetCanalCallback(), and HasBit().
Referenced by DrawWaterSprite(), and DrawWaterTileStruct().
1.7.1