# newgrf_canal.cpp File Reference

Implementation of NewGRF canals. More...

`#include "stdafx.h"`
`#include "debug.h"`
`#include "newgrf_commons.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, byte 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.
## Variables
WaterFeature | _water_feature [CF_END]
| Table of canal 'feature' sprite groups.

## Detailed Description

Implementation of NewGRF canals.

Definition in file newgrf_canal.cpp.

## 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 96 of file newgrf_canal.cpp.

References SpriteGroup::Resolve().

Referenced by DrawCanalWater().