summaryrefslogtreecommitdiff
path: root/ttd.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-11-21 10:49:40 +0000
committertron <tron@openttd.org>2004-11-21 10:49:40 +0000
commit57adc97733fc0cc226f7d8f71c7e6b62dab690e0 (patch)
tree3fa8e5167fbe6804668a83cddbd662bdb0e8de2c /ttd.h
parent75d002690ac43c3a1c9bdbd16ca0eb48c9a2c50e (diff)
downloadopenttd-57adc97733fc0cc226f7d8f71c7e6b62dab690e0.tar.xz
(svn r724) Remove restriction that a tile can only accept 3 cargo types.
This especially enables houses to accept passengers, mail, goods AND food. Add string templates for up to 5 cargo types for the tile info window. If more are needed just add them. Simplify (de-uglify) the logic for cargo acceptence for houses and split the goods/food table into two. The acceptance is unmodified, but accepting goods AND food is now trivially possible. The exact amounts have to be decided. This is based on Celestar's changes in the map branch plus some further bits that will be merged there soon.
Diffstat (limited to 'ttd.h')
-rw-r--r--ttd.h88
1 files changed, 42 insertions, 46 deletions
diff --git a/ttd.h b/ttd.h
index a05693f07..656c71640 100644
--- a/ttd.h
+++ b/ttd.h
@@ -222,11 +222,47 @@ typedef struct GameDifficulty {
int town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff
} GameDifficulty;
-typedef struct AcceptedCargo {
- int type_1, amount_1;
- int type_2, amount_2;
- int type_3, amount_3;
-} AcceptedCargo;
+enum {
+ // Temperate
+ CT_PASSENGERS = 0,
+ CT_COAL = 1,
+ CT_MAIL = 2,
+ CT_OIL = 3,
+ CT_LIVESTOCK = 4,
+ CT_GOODS = 5,
+ CT_GRAIN = 6,
+ CT_WOOD = 7,
+ CT_IRON_ORE = 8,
+ CT_STEEL = 9,
+ CT_VALUABLES = 10,
+ CT_FOOD = 11,
+
+ // Arctic
+ CT_HILLY_UNUSED = 8,
+ CT_PAPER = 9,
+
+ // Tropic
+ CT_RUBBER = 1,
+ CT_FRUIT = 4,
+ CT_COPPER_ORE = 8,
+ CT_WATER = 9,
+
+ // Toyland
+ CT_SUGAR = 1,
+ CT_TOYS = 3,
+ CT_BATTERIES = 4,
+ CT_CANDY = 5,
+ CT_TOFFEE = 6,
+ CT_COLA = 7,
+ CT_COTTON_CANDY = 8,
+ CT_BUBBLES = 9,
+ CT_PLASTIC = 10,
+ CT_FIZZY_DRINKS = 11,
+
+ NUM_CARGO = 12,
+};
+
+typedef uint AcceptedCargo[NUM_CARGO];
typedef struct TileDesc {
StringID str;
@@ -253,7 +289,7 @@ typedef int32 CommandProc(int x, int y, uint32 flags, uint32 p1, uint32 p2);
typedef void DrawTileProc(TileInfo *ti);
typedef uint GetSlopeZProc(TileInfo *ti);
typedef int32 ClearTileProc(uint tile, byte flags);
-typedef void GetAcceptedCargoProc(uint tile, AcceptedCargo *res);
+typedef void GetAcceptedCargoProc(uint tile, AcceptedCargo res);
typedef void GetTileDescProc(uint tile, TileDesc *td);
/* GetTileTrackStatusProcs return a value that contains the possible tracks
* that can be taken on a given tile by a given transport. The return value is
@@ -327,46 +363,6 @@ enum {
};
enum {
- // Temperate
- CT_PASSENGERS = 0,
- CT_COAL = 1,
- CT_MAIL = 2,
- CT_OIL = 3,
- CT_LIVESTOCK = 4,
- CT_GOODS = 5,
- CT_GRAIN = 6,
- CT_WOOD = 7,
- CT_IRON_ORE = 8,
- CT_STEEL = 9,
- CT_VALUABLES = 10,
- CT_FOOD = 11,
-
- // Arctic
- CT_HILLY_UNUSED = 8,
- CT_PAPER = 9,
-
- // Tropic
- CT_RUBBER = 1,
- CT_FRUIT = 4,
- CT_COPPER_ORE = 8,
- CT_WATER = 9,
-
- // Toyland
- CT_SUGAR = 1,
- CT_TOYS = 3,
- CT_BATTERIES = 4,
- CT_CANDY = 5,
- CT_TOFFEE = 6,
- CT_COLA = 7,
- CT_COTTON_CANDY = 8,
- CT_BUBBLES = 9,
- CT_PLASTIC = 10,
- CT_FIZZY_DRINKS = 11,
-
- NUM_CARGO = 12,
-};
-
-enum {
WC_MAIN_WINDOW = 0x0,
WC_MAIN_TOOLBAR = 0x1,
WC_STATUS_BAR = 0x2,