summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-11-05 19:46:17 +0000
committerfrosch <frosch@openttd.org>2009-11-05 19:46:17 +0000
commit79627b4f8952da6a6d6132d9428ce037aeaae9df (patch)
tree6b9df6eb573db144ea20096edad74759d7a742d6 /src
parentb92c6b3741500439521019ca28690b456712df2a (diff)
downloadopenttd-79627b4f8952da6a6d6132d9428ce037aeaae9df.tar.xz
(svn r17976) -Codechange: Move CargoClass to cargotype.h and clean up including of newgrf_cargo.h
Diffstat (limited to 'src')
-rw-r--r--src/ai/api/ai_cargo.cpp1
-rw-r--r--src/aircraft_cmd.cpp1
-rw-r--r--src/build_vehicle_gui.cpp1
-rw-r--r--src/cargotype.cpp1
-rw-r--r--src/cargotype.h16
-rw-r--r--src/economy.cpp1
-rw-r--r--src/industry_cmd.cpp1
-rw-r--r--src/misc_gui.cpp1
-rw-r--r--src/newgrf.cpp1
-rw-r--r--src/newgrf_cargo.h15
-rw-r--r--src/newgrf_engine.cpp1
-rw-r--r--src/newgrf_spritegroup.h1
-rw-r--r--src/newgrf_station.cpp1
-rw-r--r--src/newgrf_station.h1
-rw-r--r--src/order_cmd.cpp1
-rw-r--r--src/order_gui.cpp1
-rw-r--r--src/roadveh_cmd.cpp1
-rw-r--r--src/station_cmd.cpp1
-rw-r--r--src/water_cmd.cpp1
-rw-r--r--src/yapf/yapf_road.cpp1
20 files changed, 21 insertions, 28 deletions
diff --git a/src/ai/api/ai_cargo.cpp b/src/ai/api/ai_cargo.cpp
index 9748e02e5..0a737a08a 100644
--- a/src/ai/api/ai_cargo.cpp
+++ b/src/ai/api/ai_cargo.cpp
@@ -14,7 +14,6 @@
#include "../../economy_func.h"
#include "../../core/alloc_func.hpp"
#include "../../core/bitmath_func.hpp"
-#include "../../newgrf_cargo.h"
/* static */ bool AICargo::IsValidCargo(CargoID cargo_type)
{
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index d90320f07..52ec58de2 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -35,7 +35,6 @@
#include "effectvehicle_func.h"
#include "station_base.h"
#include "cargotype.h"
-#include "newgrf_cargo.h"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 8a1c204a3..87bad3050 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -31,7 +31,6 @@
#include "window_gui.h"
#include "engine_gui.h"
#include "cargotype.h"
-#include "newgrf_cargo.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/cargotype.cpp b/src/cargotype.cpp
index 4ee0922c2..901326c18 100644
--- a/src/cargotype.cpp
+++ b/src/cargotype.cpp
@@ -10,7 +10,6 @@
/** @file cargotype.cpp Implementation of cargos. */
#include "stdafx.h"
-#include "newgrf_cargo.h"
#include "cargotype.h"
#include "core/bitmath_func.hpp"
diff --git a/src/cargotype.h b/src/cargotype.h
index 61814dd6f..ef7e76ee8 100644
--- a/src/cargotype.h
+++ b/src/cargotype.h
@@ -29,6 +29,20 @@ enum TownEffect {
TE_FOOD,
};
+enum CargoClass {
+ CC_NOAVAILABLE = 0, ///< No cargo class has been specified
+ CC_PASSENGERS = 1 << 0, ///< Passengers
+ CC_MAIL = 1 << 1, ///< Mail
+ CC_EXPRESS = 1 << 2, ///< Express cargo (Goods, Food, Candy, but also possible for passengers)
+ CC_ARMOURED = 1 << 3, ///< Armoured cargo (Valuables, Gold, Diamonds)
+ CC_BULK = 1 << 4, ///< Bulk cargo (Coal, Grain etc., Ores, Fruit)
+ CC_PIECE_GOODS = 1 << 5, ///< Piece goods (Livestock, Wood, Steel, Paper)
+ CC_LIQUID = 1 << 6, ///< Liquids (Oil, Water, Rubber)
+ CC_REFRIGERATED = 1 << 7, ///< Refrigerated cargo (Food, Fruit)
+ CC_HAZARDOUS = 1 << 8, ///< Hazardous cargo (Nuclear Fuel, Explosives, etc.)
+ CC_COVERED = 1 << 9, ///< Covered/Sheltered Freight (Transporation in Box Vans, Silo Wagons, etc.)
+ CC_SPECIAL = 1 << 15 ///< Special bit used for livery refit tricks instead of normal cargoes.
+};
static const byte INVALID_CARGO = 0xFF;
@@ -115,7 +129,7 @@ SpriteID GetCargoSprite(CargoID i);
CargoID GetCargoIDByLabel(CargoLabel cl);
CargoID GetCargoIDByBitnum(uint8 bitnum);
-static inline bool IsCargoInClass(CargoID c, uint16 cc)
+static inline bool IsCargoInClass(CargoID c, CargoClass cc)
{
return (CargoSpec::Get(c)->classes & cc) != 0;
}
diff --git a/src/economy.cpp b/src/economy.cpp
index 20bc23abe..78521011b 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -23,6 +23,7 @@
#include "ai/ai.hpp"
#include "aircraft.h"
#include "train.h"
+#include "newgrf_cargo.h"
#include "newgrf_engine.h"
#include "newgrf_sound.h"
#include "newgrf_industries.h"
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 4161951ee..57d112f47 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -25,6 +25,7 @@
#include "genworld.h"
#include "tree_map.h"
#include "newgrf.h"
+#include "newgrf_cargo.h"
#include "newgrf_commons.h"
#include "newgrf_industries.h"
#include "newgrf_industrytiles.h"
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 04da4cce8..aad9ecbf8 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -33,7 +33,6 @@
#include "fios.h"
#include "zoom_func.h"
#include "window_func.h"
-#include "newgrf_cargo.h"
#include "tilehighlight_func.h"
#include "querystring_gui.h"
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index aa07f1774..f53639211 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -27,6 +27,7 @@
#include "fontcache.h"
#include "currency.h"
#include "landscape.h"
+#include "newgrf_cargo.h"
#include "newgrf_house.h"
#include "newgrf_sound.h"
#include "newgrf_station.h"
diff --git a/src/newgrf_cargo.h b/src/newgrf_cargo.h
index 85b3cd15f..ddebeeb30 100644
--- a/src/newgrf_cargo.h
+++ b/src/newgrf_cargo.h
@@ -16,21 +16,6 @@
#include "cargo_type.h"
#include "gfx_type.h"
-enum CargoClass {
- CC_NOAVAILABLE = 0, ///< No cargo class has been specified
- CC_PASSENGERS = 1 << 0, ///< Passengers
- CC_MAIL = 1 << 1, ///< Mail
- CC_EXPRESS = 1 << 2, ///< Express cargo (Goods, Food, Candy, but also possible for passengers)
- CC_ARMOURED = 1 << 3, ///< Armoured cargo (Valuables, Gold, Diamonds)
- CC_BULK = 1 << 4, ///< Bulk cargo (Coal, Grain etc., Ores, Fruit)
- CC_PIECE_GOODS = 1 << 5, ///< Piece goods (Livestock, Wood, Steel, Paper)
- CC_LIQUID = 1 << 6, ///< Liquids (Oil, Water, Rubber)
- CC_REFRIGERATED = 1 << 7, ///< Refrigerated cargo (Food, Fruit)
- CC_HAZARDOUS = 1 << 8, ///< Hazardous cargo (Nuclear Fuel, Explosives, etc.)
- CC_COVERED = 1 << 9, ///< Covered/Sheltered Freight (Transporation in Box Vans, Silo Wagons, etc.)
- CC_SPECIAL = 1 << 15 ///< Special bit used for livery refit tricks instead of normal cargoes.
-};
-
static const CargoID CT_DEFAULT = NUM_CARGO + 0;
static const CargoID CT_PURCHASE = NUM_CARGO + 1;
static const CargoID CT_DEFAULT_NA = NUM_CARGO + 2;
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index 1103bf3b3..b49f9dbfb 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -15,6 +15,7 @@
#include "roadveh.h"
#include "company_func.h"
#include "newgrf.h"
+#include "newgrf_cargo.h"
#include "newgrf_engine.h"
#include "newgrf_spritegroup.h"
#include "date_func.h"
diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h
index 69086fce2..056f95e35 100644
--- a/src/newgrf_spritegroup.h
+++ b/src/newgrf_spritegroup.h
@@ -21,7 +21,6 @@
#include "core/pool_type.hpp"
#include "house_type.h"
-#include "newgrf_cargo.h"
#include "newgrf_callbacks.h"
#include "newgrf_generic.h"
#include "newgrf_storage.h"
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index e3d1ff3d9..b701ec3b6 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -16,6 +16,7 @@
#include "station_base.h"
#include "waypoint_base.h"
#include "roadstop_base.h"
+#include "newgrf_cargo.h"
#include "newgrf_commons.h"
#include "newgrf_station.h"
#include "newgrf_spritegroup.h"
diff --git a/src/newgrf_station.h b/src/newgrf_station.h
index b13b05d86..25d5831c7 100644
--- a/src/newgrf_station.h
+++ b/src/newgrf_station.h
@@ -14,7 +14,6 @@
#include "engine_type.h"
#include "newgrf_callbacks.h"
-#include "newgrf_cargo.h"
#include "tile_type.h"
#include "station_type.h"
#include "strings_type.h"
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 6660c07b3..dc99b258b 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -19,7 +19,6 @@
#include "strings_func.h"
#include "functions.h"
#include "window_func.h"
-#include "newgrf_cargo.h"
#include "timetable.h"
#include "vehicle_func.h"
#include "depot_base.h"
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 071b1cbfb..847a38ecb 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -23,7 +23,6 @@
#include "window_func.h"
#include "vehicle_func.h"
#include "company_func.h"
-#include "newgrf_cargo.h"
#include "widgets/dropdown_func.h"
#include "textbuf_gui.h"
#include "string_func.h"
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index f482c0ebb..8aebc4e4d 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -36,7 +36,6 @@
#include "effectvehicle_func.h"
#include "roadstop_base.h"
#include "cargotype.h"
-#include "newgrf_cargo.h"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 746202868..769c8d2d0 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -22,6 +22,7 @@
#include "train.h"
#include "roadveh.h"
#include "industry.h"
+#include "newgrf_cargo.h"
#include "newgrf_station.h"
#include "newgrf_commons.h"
#include "yapf/yapf.h"
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 2c9a3a9af..914961461 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -36,7 +36,6 @@
#include "clear_map.h"
#include "tree_map.h"
#include "aircraft.h"
-#include "newgrf_cargo.h"
#include "effectvehicle_func.h"
#include "tunnelbridge_map.h"
#include "station_base.h"
diff --git a/src/yapf/yapf_road.cpp b/src/yapf/yapf_road.cpp
index f4bfae46d..30b65705e 100644
--- a/src/yapf/yapf_road.cpp
+++ b/src/yapf/yapf_road.cpp
@@ -12,7 +12,6 @@
#include "../stdafx.h"
#include "../roadstop_base.h"
#include "../cargotype.h"
-#include "../newgrf_cargo.h"
#include "yapf.hpp"
#include "yapf_node_road.hpp"