mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-08 07:21:53 +00:00
(svn r25890) -Codechange: define a smallstack for station IDs
This commit is contained in:
parent
1ed478d433
commit
dffc4d411e
@ -33,6 +33,10 @@
|
|||||||
StationPool _station_pool("Station");
|
StationPool _station_pool("Station");
|
||||||
INSTANTIATE_POOL_METHODS(Station)
|
INSTANTIATE_POOL_METHODS(Station)
|
||||||
|
|
||||||
|
typedef StationIDStack::SmallStackPool StationIDStackPool;
|
||||||
|
template<> StationIDStackPool StationIDStack::_pool("StationIDStack");
|
||||||
|
INSTANTIATE_POOL_METHODS(StationIDStack)
|
||||||
|
|
||||||
BaseStation::~BaseStation()
|
BaseStation::~BaseStation()
|
||||||
{
|
{
|
||||||
free(this->name);
|
free(this->name);
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#define STATION_TYPE_H
|
#define STATION_TYPE_H
|
||||||
|
|
||||||
#include "core/smallvec_type.hpp"
|
#include "core/smallvec_type.hpp"
|
||||||
|
#include "core/smallstack_type.hpp"
|
||||||
#include "tilearea_type.h"
|
#include "tilearea_type.h"
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
@ -28,6 +29,8 @@ struct Waypoint;
|
|||||||
static const StationID NEW_STATION = 0xFFFE;
|
static const StationID NEW_STATION = 0xFFFE;
|
||||||
static const StationID INVALID_STATION = 0xFFFF;
|
static const StationID INVALID_STATION = 0xFFFF;
|
||||||
|
|
||||||
|
typedef SmallStack<StationID, StationID, INVALID_STATION, 8, 0xFFFD> StationIDStack;
|
||||||
|
|
||||||
/** Station types */
|
/** Station types */
|
||||||
enum StationType {
|
enum StationType {
|
||||||
STATION_RAIL,
|
STATION_RAIL,
|
||||||
|
Loading…
Reference in New Issue
Block a user