OpenTTD Source
20241124-master-g9399a92a4f
|
Implementation of NewGRF canals. More...
#include "stdafx.h"
#include "debug.h"
#include "newgrf_spritegroup.h"
#include "newgrf_canal.h"
#include "water.h"
#include "water_map.h"
#include "spritecache.h"
#include "safeguards.h"
Go to the source code of this file.
Data Structures | |
struct | CanalScopeResolver |
Scope resolver of a canal tile. More... | |
struct | CanalResolverObject |
Resolver object for canals. More... | |
Functions | |
SpriteID | GetCanalSprite (CanalFeature feature, TileIndex tile) |
Lookup the base sprite to use for a canal. More... | |
static uint16_t | GetCanalCallback (CallbackID callback, uint32_t param1, uint32_t param2, CanalFeature feature, TileIndex tile) |
Run a specific callback for canals. More... | |
uint | GetCanalSpriteOffset (CanalFeature feature, TileIndex tile, uint cur_offset) |
Get the new sprite offset for a water tile. More... | |
Variables | |
WaterFeature | _water_feature [CF_END] |
Table of canal 'feature' sprite groups. | |
Implementation of NewGRF canals.
Definition in file newgrf_canal.cpp.
|
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 158 of file newgrf_canal.cpp.
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. |
0
if none. Definition at line 140 of file newgrf_canal.cpp.
References SpriteGroup::Resolve().
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 171 of file newgrf_canal.cpp.
References _water_feature, CBM_CANAL_SPRITE_OFFSET, and HasBit().