src/newgrf_engine.cpp
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 6502 7ca154aca2b7
child 9906 6f41b8713b65
--- a/src/newgrf_engine.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_engine.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -24,17 +24,17 @@
 int _traininfo_vehicle_pitch = 0;
 int _traininfo_vehicle_width = 29;
 
-typedef struct WagonOverride {
+struct WagonOverride {
 	byte *train_id;
 	int trains;
 	CargoID cargo;
 	const SpriteGroup *group;
-} WagonOverride;
+};
 
-typedef struct WagonOverrides {
+struct WagonOverrides {
 	int overrides_count;
 	WagonOverride *overrides;
-} WagonOverrides;
+};
 
 static WagonOverrides _engine_wagon_overrides[TOTAL_NUM_ENGINES];
 
@@ -85,7 +85,7 @@
 /**
  * Unload all wagon override sprite groups.
  */
-void UnloadWagonOverrides(void)
+void UnloadWagonOverrides()
 {
 	WagonOverrides *wos;
 	WagonOverride *wo;
@@ -123,7 +123,7 @@
 /**
  * Unload all engine sprite groups.
  */
-void UnloadCustomEngineSprites(void)
+void UnloadCustomEngineSprites()
 {
 	memset(_engine_custom_sprites, 0, sizeof(_engine_custom_sprites));
 	memset(_engine_grf, 0, sizeof(_engine_grf));
@@ -144,7 +144,7 @@
 }
 
 /** Unload all rotor override sprite groups */
-void UnloadRotorOverrideSprites(void)
+void UnloadRotorOverrideSprites()
 {
 	EngineID engine;
 
@@ -195,7 +195,7 @@
 
 static int MapOldSubType(const Vehicle *v)
 {
-	if (v->type != VEH_Train) return v->subtype;
+	if (v->type != VEH_TRAIN) return v->subtype;
 	if (IsTrainEngine(v)) return 0;
 	if (IsFreeWagon(v)) return 4;
 	return 2;
@@ -489,7 +489,7 @@
 	switch (variable) {
 		case 0x40: /* Get length of consist */
 		case 0x41: /* Get length of same consecutive wagons */
-			if (v->type != VEH_Train) return 1;
+			if (v->type != VEH_TRAIN) return 1;
 
 			{
 				const Vehicle* u;
@@ -545,7 +545,7 @@
 			return v->owner;
 
 		case 0x44: /* Aircraft information */
-			if (v->type != VEH_Aircraft) return UINT_MAX;
+			if (v->type != VEH_AIRCRAFT) return UINT_MAX;
 
 			{
 				const Vehicle *w = v->next;
@@ -590,7 +590,7 @@
 
 		/* Variables which use the parameter */
 		case 0x60: /* Count consist's engine ID occurance */
-			if (v->type != VEH_Train) return v->engine_type == parameter;
+			if (v->type != VEH_TRAIN) return v->engine_type == parameter;
 
 			{
 				uint count = 0;
@@ -699,7 +699,7 @@
 
 	/* Vehicle specific properties */
 	switch (v->type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			switch (variable - 0x80) {
 				case 0x62: return v->u.rail.track;
 				case 0x66: return v->u.rail.railtype;
@@ -714,7 +714,7 @@
 			}
 			break;
 
-		case VEH_Road:
+		case VEH_ROAD:
 			switch (variable - 0x80) {
 				case 0x62: return v->u.road.state;
 				case 0x64: return v->u.road.blocked_ctr;
@@ -726,7 +726,7 @@
 			}
 			break;
 
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			switch (variable - 0x80) {
 				case 0x62: return MapAircraftMovementState(v);  // Current movement state
 				case 0x63: return v->u.air.targetairport;       // Airport to which the action refers
@@ -751,7 +751,7 @@
 
 	if (v == NULL) return group->g.real.loading[0];
 
-	if (v->type == VEH_Train) {
+	if (v->type == VEH_TRAIN) {
 		in_motion = GetFirstVehicleInChain(v)->current_order.type != OT_LOADING;
 	} else {
 		in_motion = v->current_order.type != OT_LOADING;
@@ -780,7 +780,7 @@
 	res->ResolveReal   = &VehicleResolveReal;
 
 	res->u.vehicle.self   = v;
-	res->u.vehicle.parent = (v != NULL && v->type == VEH_Train) ? GetFirstVehicleInChain(v) : v;
+	res->u.vehicle.parent = (v != NULL && v->type == VEH_TRAIN) ? GetFirstVehicleInChain(v) : v;
 
 	res->u.vehicle.self_type = engine_type;
 
@@ -812,7 +812,7 @@
 	} else {
 		cargo = v->cargo_type;
 
-		if (v->type == VEH_Train) {
+		if (v->type == VEH_TRAIN) {
 			group = GetWagonOverrideSpriteSet(engine, cargo, v->u.rail.first_engine);
 
 			if (group != NULL) return group;
@@ -874,7 +874,7 @@
  */
 bool UsesWagonOverride(const Vehicle* v)
 {
-	assert(v->type == VEH_Train);
+	assert(v->type == VEH_TRAIN);
 	return GetWagonOverrideSpriteSet(v->engine_type, v->cargo_type, v->u.rail.first_engine) != NULL;
 }
 
@@ -962,7 +962,7 @@
 			 * i.e.), so we give them all the NEW_CARGO triggered
 			 * vehicle's portion of random bits. */
 			assert(first);
-			DoTriggerVehicle((v->type == VEH_Train) ? GetFirstVehicleInChain(v) : v, VEHICLE_TRIGGER_ANY_NEW_CARGO, new_random_bits, false);
+			DoTriggerVehicle((v->type == VEH_TRAIN) ? GetFirstVehicleInChain(v) : v, VEHICLE_TRIGGER_ANY_NEW_CARGO, new_random_bits, false);
 			break;
 
 		case VEHICLE_TRIGGER_DEPOT:
@@ -1007,7 +1007,7 @@
 	_engine_custom_names[engine] = name;
 }
 
-void UnloadCustomEngineNames(void)
+void UnloadCustomEngineNames()
 {
 	EngineID i;
 	for (i = 0; i < TOTAL_NUM_ENGINES; i++) {
@@ -1025,7 +1025,7 @@
 static EngineID _engine_list_order[NUM_TRAIN_ENGINES];
 static byte _engine_list_position[NUM_TRAIN_ENGINES];
 
-void ResetEngineListOrder(void)
+void ResetEngineListOrder()
 {
 	EngineID i;