src/newgrf_canal.h
author rubidium
Thu, 18 Dec 2008 12:23:08 +0000
changeset 10436 8d3a9fbe8f19
parent 9750 7114408dd1fa
permissions -rw-r--r--
(svn r14689) -Change: make configure die on commonly made user mistakes, like not having SDL development files or zlib headers installed; you can still compile a dedicated server or a binary without zlib, but you have to explicitly force it.
6583
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
     1
/* $Id$ */
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
     2
9111
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8372
diff changeset
     3
/** @file newgrf_canal.h Handling of NewGRF canals. */
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8372
diff changeset
     4
6583
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
     5
#ifndef NEWGRF_CANAL_H
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
     6
#define NEWGRF_CANAL_H
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
     7
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
     8
/** List of different canal 'features'.
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
     9
 * Each feature gets an entry in the canal spritegroup table */
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    10
enum CanalFeature {
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    11
	CF_WATERSLOPE,
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    12
	CF_LOCKS,
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    13
	CF_DIKES,
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    14
	CF_ICON,
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    15
	CF_DOCKS,
8360
3021c928de6c (svn r11926) -Feature: Rivers. Graphics must be provided by NewGRF else rivers are drawn as canals. Rivers can currently only be placed with-in the scenario editor.
peter1138
parents: 6583
diff changeset
    16
	CF_RIVER_SLOPE,
3021c928de6c (svn r11926) -Feature: Rivers. Graphics must be provided by NewGRF else rivers are drawn as canals. Rivers can currently only be placed with-in the scenario editor.
peter1138
parents: 6583
diff changeset
    17
	CF_RIVER_EDGE,
6583
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    18
	CF_END,
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    19
};
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    20
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    21
8372
49f8ca06527d (svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138
parents: 8360
diff changeset
    22
struct WaterFeature {
49f8ca06527d (svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138
parents: 8360
diff changeset
    23
	const SpriteGroup *group;
9750
7114408dd1fa (svn r13885) -Fix [FS#2168]: Var 0x7F is not feature-specific.
frosch
parents: 9111
diff changeset
    24
	const GRFFile *grffile;   ///< newgrf where 'group' belongs to
8372
49f8ca06527d (svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138
parents: 8360
diff changeset
    25
	uint8 callbackmask;
49f8ca06527d (svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138
parents: 8360
diff changeset
    26
	uint8 flags;
49f8ca06527d (svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138
parents: 8360
diff changeset
    27
};
49f8ca06527d (svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138
parents: 8360
diff changeset
    28
49f8ca06527d (svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138
parents: 8360
diff changeset
    29
6583
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    30
/** Table of canal 'feature' sprite groups */
8372
49f8ca06527d (svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138
parents: 8360
diff changeset
    31
extern WaterFeature _water_feature[CF_END];
6583
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    32
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    33
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    34
/** Lookup the base sprite to use for a canal.
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    35
 * @param feature Which canal feature we want.
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    36
 * @param tile Tile index of canal, if appropriate.
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    37
 * @return Base sprite returned by GRF, or 0 if none.
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    38
 */
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    39
SpriteID GetCanalSprite(CanalFeature feature, TileIndex tile);
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    40
71d62b85d3ad (svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138
parents:
diff changeset
    41
#endif /* NEWGRF_CANAL_H */