newgrf_canal.h File Reference

Handling of NewGRF canals. More...

#include "gfx_type.h"
#include "tile_type.h"
#include "newgrf_generic.h"
#include "newgrf_callbacks.h"

Go to the source code of this file.

Data Structures

struct  WaterFeature
 Information about a water feature. More...

Enumerations

enum  CanalFeature {
  CF_WATERSLOPE, CF_LOCKS, CF_DIKES, CF_ICON,
  CF_DOCKS, CF_RIVER_SLOPE, CF_RIVER_EDGE, CF_END
}
 

List of different canal 'features'.

More...
enum  CanalFeatureFlag { CFF_HAS_FLAT_SPRITE = 0 }
 

Flags controlling the display of canals.

More...

Functions

SpriteID GetCanalSprite (CanalFeature feature, TileIndex tile)
 Lookup the base sprite to use for a canal.
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.

Detailed Description

Handling of NewGRF canals.

Definition in file newgrf_canal.h.


Enumeration Type Documentation

List of different canal 'features'.

Each feature gets an entry in the canal spritegroup table

Definition at line 24 of file newgrf_canal.h.

Flags controlling the display of canals.

Enumerator:
CFF_HAS_FLAT_SPRITE 

Additional flat ground sprite in the beginning.

Definition at line 36 of file newgrf_canal.h.


Function Documentation

SpriteID GetCanalSprite ( CanalFeature  feature,
TileIndex  tile 
)

Lookup the base sprite to use for a canal.

Parameters:
feature Which canal feature we want.
tile Tile index of canal, if appropriate.
Returns:
Base sprite returned by GRF, or 0 if none.

Definition at line 95 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.

Parameters:
tile Tile index of the canal/water tile.
feature For which feature to get the new sprite offset.
cur_offset Current sprite offset.
Returns:
New sprite offset.

Definition at line 141 of file newgrf_canal.cpp.

References CALLBACK_FAILED, CBID_CANALS_SPRITE_OFFSET, CBM_CANAL_SPRITE_OFFSET, GetCanalCallback(), and HasBit().

Referenced by DrawWaterSprite(), and DrawWaterTileStruct().


Generated on Fri Dec 31 17:15:47 2010 for OpenTTD by  doxygen 1.6.1