summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-22 15:13:50 +0000
committersmatz <smatz@openttd.org>2009-05-22 15:13:50 +0000
commit62a7948af0ca9eb3b190a54918201e1075edcbbc (patch)
tree27a79b7850682cd43cac2462c3410ed8b567c4b2 /src/station.cpp
parent04723b240ebc7384954f73590be517ad2a47ce04 (diff)
downloadopenttd-62a7948af0ca9eb3b190a54918201e1075edcbbc.tar.xz
(svn r16378) -Codechange: replace OldPool with simpler Pool. Compilation time, binary size and run time (with asserts disabled) should be improved
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/station.cpp b/src/station.cpp
index aff65dda6..03d7a9db8 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -20,9 +20,15 @@
#include "aircraft.h"
#include "vehicle_gui.h"
#include "settings_type.h"
+#include "core/pool_func.hpp"
#include "table/strings.h"
+StationPool _station_pool("Station");
+INSTANTIATE_POOL_METHODS(Station)
+RoadStopPool _roadstop_pool("RoadStop");
+INSTANTIATE_POOL_METHODS(RoadStop)
+
Station::Station(TileIndex tile)
{
DEBUG(station, cDebugCtorLevel, "I+%3d", index);
@@ -88,8 +94,6 @@ Station::~Station()
/* Remove all news items */
DeleteStationNews(this->index);
- xy = INVALID_TILE;
-
InvalidateWindowData(WC_SELECT_STATION, 0, 0);
for (CargoID c = 0; c < NUM_CARGO; c++) {
@@ -460,8 +464,6 @@ RoadStop::~RoadStop()
assert(num_vehicles == 0);
DEBUG(ms, cDebugCtorLevel , "I- at %d[0x%x]", xy, xy);
-
- xy = INVALID_TILE;
}
/** Checks whether there is a free bay in this road stop */
@@ -546,3 +548,9 @@ RoadStop *RoadStop::GetNextRoadStop(const Vehicle *v) const
return NULL;
}
+
+void InitializeStations()
+{
+ _station_pool.CleanPool();
+ _roadstop_pool.CleanPool();
+}