summaryrefslogtreecommitdiff
path: root/newgrf.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-11-06 10:11:03 +0000
committerpeter1138 <peter1138@openttd.org>2006-11-06 10:11:03 +0000
commitdb7d474b0f7589c1598b5a947a93a462352f1d7d (patch)
tree91e133d6156081ec32bb3fce17029a81cc44b0fb /newgrf.c
parent56b4a2ad7be4818fc9cf515848e56d3a204b6459 (diff)
downloadopenttd-db7d474b0f7589c1598b5a947a93a462352f1d7d.tar.xz
(svn r7079) -Codechange: Move an array to the only place it is used.
Diffstat (limited to 'newgrf.c')
-rw-r--r--newgrf.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/newgrf.c b/newgrf.c
index dfd05c9c5..59965bb6a 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -3305,6 +3305,31 @@ static void InitNewGRFFile(const GRFConfig *config, int sprite_offset)
}
}
+
+/** Bitmasked values of what type of cargo is refittable for the given vehicle-type.
+ * This coupled with the landscape information (_landscape_global_cargo_mask) gives
+ * us exactly what is refittable and what is not */
+#define MC(cargo) (1 << cargo)
+static const uint32 _default_refitmasks[NUM_VEHICLE_TYPES] = {
+ /* Trains */
+ MC(GC_PASSENGERS) | MC(GC_COAL) | MC(GC_MAIL) | MC(GC_LIVESTOCK) | MC(GC_GOODS) | MC(GC_GRAIN) | MC(GC_WOOD) | MC(GC_IRON_ORE) |
+ MC(GC_STEEL) | MC(GC_VALUABLES) | MC(GC_PAPER) | MC(GC_FOOD) | MC(GC_FRUIT) | MC(GC_COPPER_ORE) | MC(GC_WATER) | MC(GC_SUGAR) |
+ MC(GC_TOYS) | MC(GC_CANDY) | MC(GC_TOFFEE) | MC(GC_COLA) | MC(GC_COTTON_CANDY) | MC(GC_BUBBLES) | MC(GC_PLASTIC) | MC(GC_FIZZY_DRINKS),
+ /* Road vehicles (not refittable by default) */
+ 0,
+ /* Ships */
+ MC(GC_COAL) | MC(GC_MAIL) | MC(GC_LIVESTOCK) | MC(GC_GOODS) | MC(GC_GRAIN) | MC(GC_WOOD) | MC(GC_IRON_ORE) | MC(GC_STEEL) | MC(GC_VALUABLES) |
+ MC(GC_PAPER) | MC(GC_FOOD) | MC(GC_FRUIT) | MC(GC_COPPER_ORE) | MC(GC_WATER) | MC(GC_RUBBER) | MC(GC_SUGAR) | MC(GC_TOYS) | MC(GC_BATTERIES) |
+ MC(GC_CANDY) | MC(GC_TOFFEE) | MC(GC_COLA) | MC(GC_COTTON_CANDY) | MC(GC_BUBBLES) | MC(GC_PLASTIC) | MC(GC_FIZZY_DRINKS),
+ /* Aircraft */
+ MC(GC_PASSENGERS) | MC(GC_MAIL) | MC(GC_GOODS) | MC(GC_VALUABLES) | MC(GC_FOOD) | MC(GC_FRUIT) | MC(GC_SUGAR) | MC(GC_TOYS) |
+ MC(GC_BATTERIES) | MC(GC_CANDY) | MC(GC_TOFFEE) | MC(GC_COLA) | MC(GC_COTTON_CANDY) | MC(GC_BUBBLES) | MC(GC_PLASTIC) | MC(GC_FIZZY_DRINKS),
+ /* Special/Disaster */
+ 0,0
+};
+#undef MC
+
+
/**
* Precalculate refit masks from cargo classes for all vehicles.
*/