(svn r2812) Move variables, which only vehicle_gui.c needs to know about, there
authortron
Fri, 05 Aug 2005 20:22:06 +0000
changeset 2288 57af8e0506f2
parent 2287 2e556bae5fbb
child 2289 b0eb1b7f3eeb
(svn r2812) Move variables, which only vehicle_gui.c needs to know about, there
misc.c
variables.h
vehicle_gui.c
--- a/misc.c	Fri Aug 05 20:18:08 2005 +0000
+++ b/misc.c	Fri Aug 05 20:22:06 2005 +0000
@@ -130,8 +130,6 @@
 	for (i = 0; i < lengthof(_autoreplace_array); i++)
 		_autoreplace_array[i] = i;
 
-	_railtype_selected_in_replace_gui = 0;
-
 	AddTypeToEngines(); // make sure all engines have a type
 
 	SetObjectToPlace(SPR_CURSOR_ZZZ, 0, 0, 0);
--- a/variables.h	Fri Aug 05 20:18:08 2005 +0000
+++ b/variables.h	Fri Aug 05 20:22:06 2005 +0000
@@ -451,8 +451,6 @@
 
 /* Autoreplace vehicle stuff*/
 VARDEF byte _autoreplace_array[256];
-VARDEF uint16 _player_num_engines[256];
-VARDEF byte _railtype_selected_in_replace_gui;
 
 /* Forking stuff */
 VARDEF bool _dedicated_forks;
--- a/vehicle_gui.c	Fri Aug 05 20:18:08 2005 +0000
+++ b/vehicle_gui.c	Fri Aug 05 20:22:06 2005 +0000
@@ -23,6 +23,9 @@
 static uint32 _last_vehicle_idx;        // cached index to hopefully speed up name-sorting
 static bool   _internal_sort_order;     // descending/ascending
 
+static uint16 _player_num_engines[256];
+static byte _railtype_selected_in_replace_gui;
+
 VehicleSortListingTypeFunctions * const _vehicle_sorter[] = {
 	&VehicleUnsortedSorter,
 	&VehicleNumberSorter,
@@ -158,6 +161,7 @@
 /* General Vehicle GUI based procedures that are independent of vehicle types */
 void InitializeVehiclesGuiList(void)
 {
+	_railtype_selected_in_replace_gui = 0;
 }
 
 // draw the vehicle profit button in the vehicle list window.