(svn r2136) - Fix: [ 1174313 ] terrain hotkeys nonfunctional in scenario editor (D,Q,W,E,R,T,Y,U fltr)
- Fix: 'L' no longer opens ingame terraform bar in scenario editor bar, but the land generator one
- Feature: [ 1095110 ] Create Lake and draggable Create Desert tools (initial implementation GoneWacko), also added sticky buttons to land generator and town generator
- CodeChange: moved around some of the draggable tools, demystifying them
- CodeChange: change CmdBuildCanal to allow for XANDY dragging not only X or Y (only scenario editor)
- CodeChange: add some more enums to sprites.
- TODO: merge most of the ingame and scenario editor land terraform code. This can only be done after OnClickButton function is changed so it also includes the backreference to the widget being clicked, postponed to after 0.4.0
#ifndef WAYPOINT_H
#define WAYPOINT_H
#include "pool.h"
struct Waypoint {
TileIndex xy;
uint16 index;
uint16 town_index;
byte town_cn; // The Nth waypoint for this town (consecutive number)
StringID string; // If this is zero, town + town_cn is used for naming
ViewportSign sign;
uint16 build_date;
byte stat_id;
byte deleted; // this is a delete counter. when it reaches 0, the waypoint struct is deleted.
};
enum {
RAIL_TYPE_WAYPOINT = 0xC4,
RAIL_WAYPOINT_TRACK_MASK = 1,
};
extern MemoryPool _waypoint_pool;
/**
* Get the pointer to the waypoint with index 'index'
*/
static inline Waypoint *GetWaypoint(uint index)
{
return (Waypoint*)GetItemFromPool(&_waypoint_pool, index);
}
/**
* Get the current size of the WaypointPool
*/
static inline uint16 GetWaypointPoolSize(void)
{
return _waypoint_pool.total_items;
}
#define FOR_ALL_WAYPOINTS_FROM(wp, start) for (wp = GetWaypoint(start); wp != NULL; wp = (wp->index + 1 < GetWaypointPoolSize()) ? GetWaypoint(wp->index + 1) : NULL)
#define FOR_ALL_WAYPOINTS(wp) FOR_ALL_WAYPOINTS_FROM(wp, 0)
static inline bool IsRailWaypoint(byte m5)
{
return (m5 & 0xFC) == 0xC4;
}
int32 RemoveTrainWaypoint(uint tile, uint32 flags, bool justremove);
Station *ComposeWaypointStation(uint tile);
Waypoint *GetWaypointByTile(TileIndex tile);
void ShowRenameWaypointWindow(Waypoint *cp);
void DrawWaypointSprite(int x, int y, int image, int railtype);
void UpdateWaypointSign(Waypoint *cp);
void FixOldWaypoints(void);
void UpdateAllWaypointSigns(void);
#endif /* WAYPOINT_H */