(svn r10920) [NewGRF_ports] -Cleanup: remove the tables/files that were used to define airports as they will all be defined in a NewGRF and we do not need them anymore. NewGRF_ports
authorrubidium
Thu, 16 Aug 2007 08:23:58 +0000
branchNewGRF_ports
changeset 6837 c39d50afbaf0
parent 6836 271667de8349
child 6838 33fd9078e316
(svn r10920) [NewGRF_ports] -Cleanup: remove the tables/files that were used to define airports as they will all be defined in a NewGRF and we do not need them anymore.
src/aircraft_cmd.cpp
src/airport.cpp
src/airport.h
src/airport_movement.h
src/airport_states.h
src/disaster_cmd.cpp
src/newgrf_engine.cpp
src/openttd.cpp
src/station_cmd.cpp
src/table/station_air.h
src/viewport.cpp
--- a/src/aircraft_cmd.cpp	Thu Aug 16 08:22:36 2007 +0000
+++ b/src/aircraft_cmd.cpp	Thu Aug 16 08:23:58 2007 +0000
@@ -34,7 +34,6 @@
 #include "date.h"
 #include "spritecache.h"
 #include "cargotype.h"
-#include "airport_states.h"
 
 void Aircraft::UpdateDeltaXY(Direction direction)
 {
--- a/src/airport.cpp	Thu Aug 16 08:22:36 2007 +0000
+++ b/src/airport.cpp	Thu Aug 16 08:23:58 2007 +0000
@@ -12,7 +12,6 @@
 #include "date.h"
 #include "helpers.hpp"
 #include "newgrf_fsmports.h"
-#include "airport_movement.h"
 
 /* Uncomment this to print out a full report of the airport-structure
  * You should either use
@@ -21,31 +20,6 @@
  * - false: give a summarized report which only shows current and next position */
 //#define DEBUG_AIRPORT false
 
-AirportFTAClass *DummyAirport;
-
-void InitializeAirports()
-{
-	DummyAirport = new AirportFTAClass(
-		_airport_moving_data_dummy,
-		NULL,
-		NULL,
-		_airport_entries_dummy,
-		AirportFTAClass::ALL,
-		_airport_fta_dummy,
-		NULL,
-		0,
-		0, 0,
-		0,
-		0
-	);
-}
-
-void UnInitializeAirports()
-{
-	delete DummyAirport;
-}
-
-
 static uint16 AirportGetNofElements(const AirportFTAbuildup *apFA);
 static AirportFTA* AirportBuildAutomata(uint nofelements, const AirportFTAbuildup *apFA);
 static byte AirportGetTerminalCount(const byte *terminals, byte *groups);
--- a/src/airport.h	Thu Aug 16 08:22:36 2007 +0000
+++ b/src/airport.h	Thu Aug 16 08:23:58 2007 +0000
@@ -29,6 +29,43 @@
 	AT_DUMMY         = 255
 };
 
+/* Airport movements & speeds */
+enum {
+	AMED_EXACTPOS   = 1 << 0,
+	AMED_NOSPDCLAMP = 1 << 4,
+	AMED_SLOWTURN   = 1 << 5,
+	AMED_BRAKE      = 1 << 6,
+	AMED_HOLD       = 1 << 7,
+	AMED_LAND       = 1 << 8,
+	AMED_HELI_RAISE = 1 << 8,
+	AMED_TAKEOFF    = 1 << 8,
+	AMED_HELI_LOWER = 1 << 8,
+};
+
+/* Movement States on Airports (headings target) */
+enum {
+	TO_ALL         = 0x00,
+	FIRST_TERMINAL = 0x01,
+	LAST_TERMINAL  = 0x24,
+	FIRST_HELIPAD  = 0x25,
+	LAST_HELIPAD   = 0x3C,
+	HANGAR         = 0x40,
+	TAKEOFF        = 0x41,
+	STARTTAKEOFF   = 0x42,
+	ENDTAKEOFF     = 0x43,
+	LANDING        = 0x44,
+	ENDLANDING     = 0x45,
+	SHORTTAKEOFF   = 0x49,  /* Only used in movement command choices. If used as the heading in the first command element, treated as TAKEOFF.
+						   * This is best placed on the TAKEOFF line at the start of the runway. The aircraft will make the acceleration noise,
+						   * and then you give the instruction of where to go to for the SHORTTAKEOFF instruction sequence. eg.:
+						   * { 40, TAKEOFF, RUNWAY_OUT_block, 0 }, { 40, SHORTTAKEOFF, RUNWAY_OUT_block2, 42 }, { 40, 0, RUNWAY_OUT_block2, 41 },
+						   */
+	HELITAKEOFF    = 0x51,
+	HELIENDTAKEOFF = 0x53,
+	HELILANDING    = 0x54,
+	HELIENDLANDING = 0x55,
+	FLYING         = 0x7F,
+};
 
 struct AirportMovingData {
 	int16 x;
--- a/src/airport_movement.h	Thu Aug 16 08:22:36 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/* $Id$ */
-
-/** @file airport_movement.h Heart of the airports and their finite state machines */
-
-#ifndef AIRPORT_MOVEMENT_H
-#define AIRPORT_MOVEMENT_H
-
-#include "airport_states.h"
-
-///////////////////////////////////////////////////////////////////////
-/////*********Movement Positions on Airports********************///////
-
-static AirportMovingData _airport_moving_data_dummy[] = {
-	{    0,    0, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N}, 0, 0 },
-	{    0,   96, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N}, 0, 0 },
-	{   96,   96, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N}, 0, 0 },
-	{   96,    0, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N}, 0, 0 },
-};
-
-///////////////////////////////////////////////////////////////////////
-/////**********Movement Machine on Airports*********************///////
-static byte _airport_entries_dummy[] = {0, 1, 2, 3};
-static AirportFTAbuildup _airport_fta_dummy[] = {
-	{ 0, 0, 0, 3},
-	{ 1, 0, 0, 0},
-	{ 2, 0, 0, 1},
-	{ 3, 0, 0, 2},
-	{ MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE
-};
-
-#endif /* AIRPORT_MOVEMENT_H */
--- a/src/airport_states.h	Thu Aug 16 08:22:36 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/* $Id$ */
-
-/** @file airport_states.h Defines values used in airport state machines */
-
-/***************************
- * This include defines the Movement States, Movement Speeds,
- * and Blocks for the airport Finite State Machines.
- ***************************/
-
-/* Airport movements & speeds */
-enum {
-	AMED_EXACTPOS   = 1 << 0,
-	AMED_NOSPDCLAMP = 1 << 4,
-	AMED_SLOWTURN   = 1 << 5,
-	AMED_BRAKE      = 1 << 6,
-	AMED_HOLD       = 1 << 7,
-	AMED_LAND       = 1 << 8,
-	AMED_HELI_RAISE = 1 << 8,
-	AMED_TAKEOFF    = 1 << 8,
-	AMED_HELI_LOWER = 1 << 8,
-};
-
-/* Movement States on Airports (headings target) */
-enum {
-	TO_ALL         = 0x00,
-	FIRST_TERMINAL = 0x01,
-	LAST_TERMINAL  = 0x24,
-	FIRST_HELIPAD  = 0x25,
-	LAST_HELIPAD   = 0x3C,
-	HANGAR         = 0x40,
-	TAKEOFF        = 0x41,
-	STARTTAKEOFF   = 0x42,
-	ENDTAKEOFF     = 0x43,
-	LANDING        = 0x44,
-	ENDLANDING     = 0x45,
-	SHORTTAKEOFF   = 0x49,  /* Only used in movement command choices. If used as the heading in the first command element, treated as TAKEOFF.
-						   * This is best placed on the TAKEOFF line at the start of the runway. The aircraft will make the acceleration noise,
-						   * and then you give the instruction of where to go to for the SHORTTAKEOFF instruction sequence. eg.:
-						   * { 40, TAKEOFF, RUNWAY_OUT_block, 0 }, { 40, SHORTTAKEOFF, RUNWAY_OUT_block2, 42 }, { 40, 0, RUNWAY_OUT_block2, 41 },
-						   */
-	HELITAKEOFF    = 0x51,
-	HELIENDTAKEOFF = 0x53,
-	HELILANDING    = 0x54,
-	HELIENDLANDING = 0x55,
-	FLYING         = 0x7F,
-};
--- a/src/disaster_cmd.cpp	Thu Aug 16 08:22:36 2007 +0000
+++ b/src/disaster_cmd.cpp	Thu Aug 16 08:23:58 2007 +0000
@@ -39,7 +39,6 @@
 #include "variables.h"
 #include "table/sprites.h"
 #include "date.h"
-#include "airport_states.h"
 
 enum DisasterSubType {
 	ST_Zeppeliner,
--- a/src/newgrf_engine.cpp	Thu Aug 16 08:22:36 2007 +0000
+++ b/src/newgrf_engine.cpp	Thu Aug 16 08:23:58 2007 +0000
@@ -21,7 +21,6 @@
 #include "date.h"
 #include "helpers.hpp"
 #include "cargotype.h"
-#include "airport_states.h"
 
 
 int _traininfo_vehicle_pitch = 0;
--- a/src/openttd.cpp	Thu Aug 16 08:22:36 2007 +0000
+++ b/src/openttd.cpp	Thu Aug 16 08:23:58 2007 +0000
@@ -299,9 +299,6 @@
 {
 	UnInitWindowSystem();
 
-	/* Uninitialize airport state machines */
-	UnInitializeAirports();
-
 	/* Uninitialize variables that are allocated dynamically */
 	_Town_pool.CleanPool();
 	_Industry_pool.CleanPool();
@@ -497,9 +494,6 @@
 	/* initialize screenshot formats */
 	InitializeScreenshotFormats();
 
-	/* initialize airport state machines */
-	InitializeAirports();
-
 	/* initialize all variables that are allocated dynamically */
 	InitializeDynamicVariables();
 
@@ -1495,43 +1489,14 @@
 							 * d) when aircraft are loaded, they will need updating
 							 */
 							switch (st->airport_type) {
-								case AT_SMALL:
-									{
-										ResetAirportToNewGRFSpec(t, st, 0x4450414F, 0);
-									}
-									break;
-								case AT_LARGE:
-									{
-										ResetAirportToNewGRFSpec(t, st, 0x4450414F, 1);
-									}
-									break;
-								case AT_HELIPORT:
-									{
-										ResetAirportToNewGRFSpec(t, st, 0x4450414F, 2);
-									}
-									break;
-								case AT_COMMUTER:
-									{
-										ResetAirportToNewGRFSpec(t, st, 0x5850414F, 0);
-									}
-									break;
-								case AT_METROPOLITAN:
-									{
-										ResetAirportToNewGRFSpec(t, st, 0x5850414F, 1);
-									}
-									break;
-								case AT_INTERNATIONAL:
-									{
-										ResetAirportToNewGRFSpec(t, st, 0x5850414F, 2);
-									}
-									break;
-								case AT_HELIDEPOT:
-									{
-										ResetAirportToNewGRFSpec(t, st, 0x5850414F, 3);
-									}
-									break;
-								default:
-									break;
+								default: break;
+								case AT_SMALL:         ResetAirportToNewGRFSpec(t, st, 0x4450414F, 0); break;
+								case AT_LARGE:         ResetAirportToNewGRFSpec(t, st, 0x4450414F, 1); break;
+								case AT_HELIPORT:      ResetAirportToNewGRFSpec(t, st, 0x4450414F, 2); break;
+								case AT_COMMUTER:      ResetAirportToNewGRFSpec(t, st, 0x5850414F, 0); break;
+								case AT_METROPOLITAN:  ResetAirportToNewGRFSpec(t, st, 0x5850414F, 1); break;
+								case AT_INTERNATIONAL: ResetAirportToNewGRFSpec(t, st, 0x5850414F, 2); break;
+								case AT_HELIDEPOT:     ResetAirportToNewGRFSpec(t, st, 0x5850414F, 3); break;
 							}
 						}
 						break;
--- a/src/station_cmd.cpp	Thu Aug 16 08:22:36 2007 +0000
+++ b/src/station_cmd.cpp	Thu Aug 16 08:23:58 2007 +0000
@@ -42,8 +42,6 @@
 #include "road.h"
 #include "cargotype.h"
 #include "strings.h"
-#include "table/station_air.h"
-#include "airport_states.h"
 #include "newgrf_fsmports.h"
 
 DEFINE_OLD_POOL_GENERIC(Station, Station)
--- a/src/table/station_air.h	Thu Aug 16 08:22:36 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/* $Id$ */
-
-/** @file table/station_air.h   Layouts of airports */
-
-/*
- * The sprites are defined in station_land.h.
- * 255 means "skip this location", but cannot be first tile
- */
-
-// Country Airfield (small)
-static const byte _airport_sections_country[] = {
-	54, 53, 52, 65,
-	58, 57, 56, 55,
-	64, 63, 63, 62
-};
-
-// City Airport (large)
-static const byte _airport_sections_town[] = {
-	31,  9, 33,  9,  9, 32,
-	27, 36, 29, 34,  8, 10,
-	30, 11, 35, 13, 20, 21,
-	51, 12, 14, 17, 19, 28,
-	38, 13, 15, 16, 18, 39,
-	26, 22, 23, 24, 25, 26
-};
-
-// Metropolitain Airport (large) - 2 runways
-static const byte _airport_sections_metropolitan[] = {
-	 31,  9, 33,  9,  9, 32,
-	 27, 36, 29, 34,  8, 10,
-	 30, 11, 35, 13, 20, 21,
-	102,  8,  8,  8,  8, 28,
-	 83, 84, 84, 84, 84, 83,
-	 26, 23, 23, 23, 23, 26
-};
-
-// International Airport (large) - 2 runways
-static const byte _airport_sections_international[] = {
-	88, 89, 89, 89, 89, 89,  88,
-	51,  8,  8,  8,  8,  8,  32,
-	30,  8, 11, 27, 11,  8,  10,
-	32,  8, 11, 27, 11,  8, 114,
-	87,  8, 11, 85, 11,  8, 114,
-	87,  8,  8,  8,  8,  8,  90,
-	26, 23, 23, 23, 23, 23,  26
-};
-
-// Intercontinental Airport (vlarge) - 4 runways
-static const byte _airport_sections_intercontinental[] = {
-	102, 120,  89,  89,  89,  89,  89,  89, 118,
-	120,  22,  22,  22,  22,  22,  22, 119, 117,
-	 87,  54,  87,   8,   8,   8,   8,  51, 117,
-	 87, 162,  87,  85, 116, 116,   8,   9,  10,
-	 87,   8,   8,  11,  31,  11,   8, 160,  32,
-	 32, 160,   8,  11,  27,  11,   8,   8,  10,
-	 87,   8,   8,  11,  30,  11,   8,   8,  10,
-	 87, 142,   8,  11,  29,  11,  10, 163,  10,
-	 87, 164,  87,   8,   8,   8,  10,  37, 117,
-	 87, 120,  89,  89,  89,  89,  89,  89, 119,
-	121,  22,  22,  22,  22,  22,  22, 119,  37
-};
-
-// Commuter Airfield (small)
-static const byte _airport_sections_commuter[] = {
-	85, 30, 115, 115, 32,
-	87, 8,    8,   8, 10,
-	87, 11,  11,  11, 10,
-	26, 23,  23,  23, 26
-};
-
-// Heliport
-static const byte _airport_sections_heliport[] = {
-	66,
-};
-
-// Helidepot
-static const byte _airport_sections_helidepot[] = {
-	124, 32,
-	122, 123
-};
-
-// Helistation
-static const byte _airport_sections_helistation[] = {
-	 32, 134, 159, 158,
-	161, 142, 142, 157
-};
-
-static const byte * const _airport_sections[] = {
-	_airport_sections_country,           // Country Airfield (small)
-	_airport_sections_town,              // City Airport (large)
-	_airport_sections_heliport,          // Heliport
-	_airport_sections_metropolitan,      // Metropolitain Airport (large)
-	_airport_sections_international,     // International Airport (xlarge)
-	_airport_sections_commuter,          // Commuter Airport (small)
-	_airport_sections_helidepot,         // Helidepot
-	_airport_sections_intercontinental,  // Intercontinental Airport (xxlarge)
-	_airport_sections_helistation        // Helistation
-};
--- a/src/viewport.cpp	Thu Aug 16 08:22:36 2007 +0000
+++ b/src/viewport.cpp	Thu Aug 16 08:23:58 2007 +0000
@@ -25,7 +25,6 @@
 #include "train.h"
 #include "roadveh.h"
 #include "blitter/factory.hpp"
-#include "table/station_air.h"
 #include "newgrf_fsmports.h"
 
 #define VIEWPORT_DRAW_MEM (65536 * 2)