From 62a7948af0ca9eb3b190a54918201e1075edcbbc Mon Sep 17 00:00:00 2001 From: smatz Date: Fri, 22 May 2009 15:13:50 +0000 Subject: (svn r16378) -Codechange: replace OldPool with simpler Pool. Compilation time, binary size and run time (with asserts disabled) should be improved --- src/waypoint.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/waypoint.h') diff --git a/src/waypoint.h b/src/waypoint.h index 7e6f9f12a..eb388e86d 100644 --- a/src/waypoint.h +++ b/src/waypoint.h @@ -6,17 +6,18 @@ #define WAYPOINT_H #include "waypoint_type.h" -#include "oldpool.h" #include "rail_map.h" #include "command_type.h" #include "station_type.h" #include "town_type.h" #include "viewport_type.h" #include "date_type.h" +#include "core/pool.hpp" -DECLARE_OLD_POOL(Waypoint, Waypoint, 3, 8000) +typedef Pool WaypointPool; +extern WaypointPool _waypoint_pool; -struct Waypoint : PoolItem { +struct Waypoint : WaypointPool::PoolItem<&_waypoint_pool> { TileIndex xy; ///< Tile of waypoint TownID town_index; ///< Town associated with the waypoint @@ -34,10 +35,8 @@ struct Waypoint : PoolItem { byte deleted; ///< Delete counter. If greater than 0 then it is decremented until it reaches 0; the waypoint is then is deleted. - Waypoint(TileIndex tile = INVALID_TILE); + Waypoint(TileIndex tile = INVALID_TILE) : xy(tile) { } ~Waypoint(); - - inline bool IsValid() const { return this->xy != INVALID_TILE; } }; #define FOR_ALL_WAYPOINTS_FROM(var, start) FOR_ALL_ITEMS_FROM(Waypoint, waypoint_index, var, start) -- cgit v1.2.3-54-g00ecf