mirror of https://github.com/OpenTTD/OpenTTD
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
parent
36bb92ae24
commit
24c4d5b06d
14
src/ai/ai.h
14
src/ai/ai.h
|
@ -7,7 +7,7 @@
|
||||||
#include "../command.h"
|
#include "../command.h"
|
||||||
|
|
||||||
/* How DoCommands look like for an AI */
|
/* How DoCommands look like for an AI */
|
||||||
typedef struct AICommand {
|
struct AICommand {
|
||||||
uint32 tile;
|
uint32 tile;
|
||||||
uint32 p1;
|
uint32 p1;
|
||||||
uint32 p2;
|
uint32 p2;
|
||||||
|
@ -17,22 +17,22 @@ typedef struct AICommand {
|
||||||
char *text;
|
char *text;
|
||||||
uint uid;
|
uint uid;
|
||||||
|
|
||||||
struct AICommand *next;
|
AICommand *next;
|
||||||
} AICommand;
|
};
|
||||||
|
|
||||||
/* The struct for an AIScript Player */
|
/* The struct for an AIScript Player */
|
||||||
typedef struct AIPlayer {
|
struct AIPlayer {
|
||||||
bool active; ///< Is this AI active?
|
bool active; ///< Is this AI active?
|
||||||
AICommand *queue; ///< The commands that he has in his queue
|
AICommand *queue; ///< The commands that he has in his queue
|
||||||
AICommand *queue_tail; ///< The tail of this queue
|
AICommand *queue_tail; ///< The tail of this queue
|
||||||
} AIPlayer;
|
};
|
||||||
|
|
||||||
/* The struct to keep some data about the AI in general */
|
/* The struct to keep some data about the AI in general */
|
||||||
typedef struct AIStruct {
|
struct AIStruct {
|
||||||
/* General */
|
/* General */
|
||||||
bool enabled; ///< Is AI enabled?
|
bool enabled; ///< Is AI enabled?
|
||||||
uint tick; ///< The current tick (something like _frame_counter, only for AIs)
|
uint tick; ///< The current tick (something like _frame_counter, only for AIs)
|
||||||
} AIStruct;
|
};
|
||||||
|
|
||||||
VARDEF AIStruct _ai;
|
VARDEF AIStruct _ai;
|
||||||
VARDEF AIPlayer _ai_player[MAX_PLAYERS];
|
VARDEF AIPlayer _ai_player[MAX_PLAYERS];
|
||||||
|
|
|
@ -446,12 +446,12 @@ static void AiStateDoReplaceVehicle(Player *p)
|
||||||
_veh_do_replace_proc[v->type - VEH_Train](p);
|
_veh_do_replace_proc[v->type - VEH_Train](p);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct FoundRoute {
|
struct FoundRoute {
|
||||||
int distance;
|
int distance;
|
||||||
CargoID cargo;
|
CargoID cargo;
|
||||||
void *from;
|
void *from;
|
||||||
void *to;
|
void *to;
|
||||||
} FoundRoute;
|
};
|
||||||
|
|
||||||
static Town *AiFindRandomTown()
|
static Town *AiFindRandomTown()
|
||||||
{
|
{
|
||||||
|
@ -1824,12 +1824,12 @@ static TileIndex AiGetEdgeOfDefaultRailBlock(byte rule, TileIndex tile, byte cmd
|
||||||
return tile + ToTileIndexDiff(p->tileoffs) - TileOffsByDiagDir(*dir = p->attr);
|
return tile + ToTileIndexDiff(p->tileoffs) - TileOffsByDiagDir(*dir = p->attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct AiRailPathFindData {
|
struct AiRailPathFindData {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
TileIndex tile2;
|
TileIndex tile2;
|
||||||
int count;
|
int count;
|
||||||
bool flag;
|
bool flag;
|
||||||
} AiRailPathFindData;
|
};
|
||||||
|
|
||||||
static bool AiEnumFollowTrack(TileIndex tile, AiRailPathFindData *a, int track, uint length, byte *state)
|
static bool AiEnumFollowTrack(TileIndex tile, AiRailPathFindData *a, int track, uint length, byte *state)
|
||||||
{
|
{
|
||||||
|
@ -1858,7 +1858,7 @@ static bool AiDoFollowTrack(const Player* p)
|
||||||
return arpfd.count > 8;
|
return arpfd.count > 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct AiRailFinder {
|
struct AiRailFinder {
|
||||||
TileIndex final_tile;
|
TileIndex final_tile;
|
||||||
byte final_dir;
|
byte final_dir;
|
||||||
byte depth;
|
byte depth;
|
||||||
|
@ -1873,7 +1873,7 @@ typedef struct AiRailFinder {
|
||||||
TileIndex cur_best_tile, best_tile;
|
TileIndex cur_best_tile, best_tile;
|
||||||
TileIndex bridge_end_tile;
|
TileIndex bridge_end_tile;
|
||||||
Player *player;
|
Player *player;
|
||||||
} AiRailFinder;
|
};
|
||||||
|
|
||||||
static const byte _ai_table_15[4][8] = {
|
static const byte _ai_table_15[4][8] = {
|
||||||
{0, 0, 4, 3, 3, 1, 128 + 0, 64},
|
{0, 0, 4, 3, 3, 1, 128 + 0, 64},
|
||||||
|
@ -2713,7 +2713,7 @@ static void AiStateBuildDefaultRoadBlocks(Player *p)
|
||||||
p->ai.state_mode = 255;
|
p->ai.state_mode = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
struct AiRoadFinder {
|
||||||
TileIndex final_tile;
|
TileIndex final_tile;
|
||||||
byte final_dir;
|
byte final_dir;
|
||||||
byte depth;
|
byte depth;
|
||||||
|
@ -2728,14 +2728,14 @@ typedef struct {
|
||||||
TileIndex cur_best_tile, best_tile;
|
TileIndex cur_best_tile, best_tile;
|
||||||
TileIndex bridge_end_tile;
|
TileIndex bridge_end_tile;
|
||||||
Player *player;
|
Player *player;
|
||||||
} AiRoadFinder;
|
};
|
||||||
|
|
||||||
typedef struct AiRoadEnum {
|
struct AiRoadEnum {
|
||||||
TileIndex dest;
|
TileIndex dest;
|
||||||
TileIndex best_tile;
|
TileIndex best_tile;
|
||||||
int best_track;
|
int best_track;
|
||||||
uint best_dist;
|
uint best_dist;
|
||||||
} AiRoadEnum;
|
};
|
||||||
|
|
||||||
static const byte _dir_by_track[] = {
|
static const byte _dir_by_track[] = {
|
||||||
0, 1, 0, 1, 2, 1,
|
0, 1, 0, 1, 2, 1,
|
||||||
|
|
|
@ -372,9 +372,9 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
|
||||||
extern uint GetRailFoundation(Slope tileh, TrackBits bits); // XXX function declaration in .c
|
extern uint GetRailFoundation(Slope tileh, TrackBits bits); // XXX function declaration in .c
|
||||||
extern uint GetRoadFoundation(Slope tileh, RoadBits bits); // XXX function declaration in .c
|
extern uint GetRoadFoundation(Slope tileh, RoadBits bits); // XXX function declaration in .c
|
||||||
extern uint GetBridgeFoundation(Slope tileh, Axis); // XXX function declaration in .c
|
extern uint GetBridgeFoundation(Slope tileh, Axis); // XXX function declaration in .c
|
||||||
typedef enum BridgeFoundations{
|
enum BridgeFoundation {
|
||||||
BRIDGE_NO_FOUNDATION = 1 << 0 | 1 << 3 | 1 << 6 | 1 << 9 | 1 << 12,
|
BRIDGE_NO_FOUNDATION = 1 << 0 | 1 << 3 | 1 << 6 | 1 << 9 | 1 << 12,
|
||||||
} BridgeFoundation;
|
};
|
||||||
|
|
||||||
// The most important function: it calculates the g-value
|
// The most important function: it calculates the g-value
|
||||||
static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
|
static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
|
||||||
|
|
|
@ -8,12 +8,12 @@
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
|
|
||||||
typedef enum AircraftSubTypes {
|
enum AircraftSubType {
|
||||||
AIR_HELICOPTER = 0,
|
AIR_HELICOPTER = 0,
|
||||||
AIR_AIRCRAFT = 2,
|
AIR_AIRCRAFT = 2,
|
||||||
AIR_SHADOW = 4,
|
AIR_SHADOW = 4,
|
||||||
AIR_ROTOR = 6
|
AIR_ROTOR = 6
|
||||||
} AircraftSubType;
|
};
|
||||||
|
|
||||||
|
|
||||||
/** Check if the aircraft type is a normal flying device; eg
|
/** Check if the aircraft type is a normal flying device; eg
|
||||||
|
|
|
@ -112,17 +112,17 @@ static const uint64
|
||||||
|
|
||||||
NOTHING_block = 1 << 30;
|
NOTHING_block = 1 << 30;
|
||||||
|
|
||||||
typedef struct AirportMovingData {
|
struct AirportMovingData {
|
||||||
int16 x;
|
int16 x;
|
||||||
int16 y;
|
int16 y;
|
||||||
uint16 flag;
|
uint16 flag;
|
||||||
DirectionByte direction;
|
DirectionByte direction;
|
||||||
} AirportMovingData;
|
};
|
||||||
|
|
||||||
struct AirportFTAbuildup;
|
struct AirportFTAbuildup;
|
||||||
|
|
||||||
// Finite sTate mAchine --> FTA
|
// Finite sTate mAchine --> FTA
|
||||||
typedef struct AirportFTAClass {
|
struct AirportFTAClass {
|
||||||
public:
|
public:
|
||||||
enum Flags {
|
enum Flags {
|
||||||
AIRPLANES = 0x1,
|
AIRPLANES = 0x1,
|
||||||
|
@ -167,19 +167,19 @@ typedef struct AirportFTAClass {
|
||||||
byte size_y;
|
byte size_y;
|
||||||
byte delta_z; // Z adjustment for helicopter pads
|
byte delta_z; // Z adjustment for helicopter pads
|
||||||
byte catchment;
|
byte catchment;
|
||||||
} AirportFTAClass;
|
};
|
||||||
|
|
||||||
DECLARE_ENUM_AS_BIT_SET(AirportFTAClass::Flags)
|
DECLARE_ENUM_AS_BIT_SET(AirportFTAClass::Flags)
|
||||||
|
|
||||||
|
|
||||||
// internal structure used in openttd - Finite sTate mAchine --> FTA
|
// internal structure used in openttd - Finite sTate mAchine --> FTA
|
||||||
typedef struct AirportFTA {
|
struct AirportFTA {
|
||||||
struct AirportFTA *next; // possible extra movement choices from this position
|
AirportFTA *next; // possible extra movement choices from this position
|
||||||
uint64 block; // 64 bit blocks (st->airport_flags), should be enough for the most complex airports
|
uint64 block; // 64 bit blocks (st->airport_flags), should be enough for the most complex airports
|
||||||
byte position; // the position that an airplane is at
|
byte position; // the position that an airplane is at
|
||||||
byte next_position; // next position from this position
|
byte next_position; // next position from this position
|
||||||
byte heading; // heading (current orders), guiding an airplane to its target on an airport
|
byte heading; // heading (current orders), guiding an airplane to its target on an airport
|
||||||
} AirportFTA;
|
};
|
||||||
|
|
||||||
void InitializeAirports();
|
void InitializeAirports();
|
||||||
void UnInitializeAirports();
|
void UnInitializeAirports();
|
||||||
|
|
|
@ -8,12 +8,12 @@
|
||||||
|
|
||||||
// state machine input struct (from external file, etc.)
|
// state machine input struct (from external file, etc.)
|
||||||
// Finite sTate mAchine --> FTA
|
// Finite sTate mAchine --> FTA
|
||||||
typedef struct AirportFTAbuildup {
|
struct AirportFTAbuildup {
|
||||||
byte position; // the position that an airplane is at
|
byte position; // the position that an airplane is at
|
||||||
byte heading; // the current orders (eg. TAKEOFF, HANGAR, ENDLANDING, etc.)
|
byte heading; // the current orders (eg. TAKEOFF, HANGAR, ENDLANDING, etc.)
|
||||||
uint64 block; // the block this position is on on the airport (st->airport_flags)
|
uint64 block; // the block this position is on on the airport (st->airport_flags)
|
||||||
byte next; // next position from this position
|
byte next; // next position from this position
|
||||||
} AirportFTAbuildup;
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
/////*********Movement Positions on Airports********************///////
|
/////*********Movement Positions on Airports********************///////
|
||||||
|
|
|
@ -27,7 +27,6 @@ enum{
|
||||||
AYSTAR_INVALID_NODE = -1,
|
AYSTAR_INVALID_NODE = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct AyStarNode AyStarNode;
|
|
||||||
struct AyStarNode {
|
struct AyStarNode {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
int direction;
|
int direction;
|
||||||
|
@ -35,7 +34,6 @@ struct AyStarNode {
|
||||||
};
|
};
|
||||||
|
|
||||||
// The resulting path has nodes looking like this.
|
// The resulting path has nodes looking like this.
|
||||||
typedef struct PathNode PathNode;
|
|
||||||
struct PathNode {
|
struct PathNode {
|
||||||
AyStarNode node;
|
AyStarNode node;
|
||||||
// The parent of this item
|
// The parent of this item
|
||||||
|
@ -45,13 +43,12 @@ struct PathNode {
|
||||||
// For internal use only
|
// For internal use only
|
||||||
// We do not save the h-value, because it is only needed to calculate the f-value.
|
// We do not save the h-value, because it is only needed to calculate the f-value.
|
||||||
// h-value should _always_ be the distance left to the end-tile.
|
// h-value should _always_ be the distance left to the end-tile.
|
||||||
typedef struct OpenListNode OpenListNode;
|
|
||||||
struct OpenListNode {
|
struct OpenListNode {
|
||||||
int g;
|
int g;
|
||||||
PathNode path;
|
PathNode path;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct AyStar AyStar;
|
struct AyStar;
|
||||||
/*
|
/*
|
||||||
* This function is called to check if the end-tile is found
|
* This function is called to check if the end-tile is found
|
||||||
* return values can be:
|
* return values can be:
|
||||||
|
|
12
src/bmp.h
12
src/bmp.h
|
@ -5,7 +5,7 @@
|
||||||
#ifndef BMP_H
|
#ifndef BMP_H
|
||||||
#define BMP_H
|
#define BMP_H
|
||||||
|
|
||||||
typedef struct {
|
struct BmpInfo {
|
||||||
uint32 offset; ///< offset of bitmap data from .bmp file begining
|
uint32 offset; ///< offset of bitmap data from .bmp file begining
|
||||||
uint32 width; ///< bitmap width
|
uint32 width; ///< bitmap width
|
||||||
uint32 height; ///< bitmap height
|
uint32 height; ///< bitmap height
|
||||||
|
@ -13,22 +13,22 @@ typedef struct {
|
||||||
uint16 bpp; ///< bits per pixel
|
uint16 bpp; ///< bits per pixel
|
||||||
uint32 compression; ///< compression method (0 = none, 1 = 8-bit RLE, 2 = 4-bit RLE)
|
uint32 compression; ///< compression method (0 = none, 1 = 8-bit RLE, 2 = 4-bit RLE)
|
||||||
uint32 palette_size; ///< number of colors in palette
|
uint32 palette_size; ///< number of colors in palette
|
||||||
} BmpInfo;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct BmpData {
|
||||||
Colour *palette;
|
Colour *palette;
|
||||||
byte *bitmap;
|
byte *bitmap;
|
||||||
} BmpData;
|
};
|
||||||
|
|
||||||
#define BMP_BUFFER_SIZE 1024
|
#define BMP_BUFFER_SIZE 1024
|
||||||
|
|
||||||
typedef struct {
|
struct BmpBuffer {
|
||||||
byte data[BMP_BUFFER_SIZE];
|
byte data[BMP_BUFFER_SIZE];
|
||||||
int pos;
|
int pos;
|
||||||
int read;
|
int read;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
uint real_pos;
|
uint real_pos;
|
||||||
} BmpBuffer;
|
};
|
||||||
|
|
||||||
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file);
|
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file);
|
||||||
bool BmpReadHeader(BmpBuffer *buffer, BmpInfo *info, BmpData *data);
|
bool BmpReadHeader(BmpBuffer *buffer, BmpInfo *info, BmpData *data);
|
||||||
|
|
|
@ -11,7 +11,7 @@ enum {
|
||||||
|
|
||||||
/** Struct containing information about a single bridge type
|
/** Struct containing information about a single bridge type
|
||||||
*/
|
*/
|
||||||
typedef struct Bridge {
|
struct Bridge {
|
||||||
Year avail_year; ///< the year in which the bridge becomes available
|
Year avail_year; ///< the year in which the bridge becomes available
|
||||||
byte min_length; ///< the minimum length of the bridge (not counting start and end tile)
|
byte min_length; ///< the minimum length of the bridge (not counting start and end tile)
|
||||||
byte max_length; ///< the maximum length of the bridge (not counting start and end tile)
|
byte max_length; ///< the maximum length of the bridge (not counting start and end tile)
|
||||||
|
@ -22,7 +22,7 @@ typedef struct Bridge {
|
||||||
StringID material; ///< the string that contains the bridge description
|
StringID material; ///< the string that contains the bridge description
|
||||||
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
|
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
|
||||||
byte flags; ///< bit 0 set: disable drawing of far pillars.
|
byte flags; ///< bit 0 set: disable drawing of far pillars.
|
||||||
} Bridge;
|
};
|
||||||
|
|
||||||
extern const Bridge orig_bridge[MAX_BRIDGES];
|
extern const Bridge orig_bridge[MAX_BRIDGES];
|
||||||
extern Bridge _bridge[MAX_BRIDGES];
|
extern Bridge _bridge[MAX_BRIDGES];
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
typedef uint32 CargoLabel;
|
typedef uint32 CargoLabel;
|
||||||
|
|
||||||
|
|
||||||
typedef struct CargoSpec {
|
struct CargoSpec {
|
||||||
uint8 bitnum;
|
uint8 bitnum;
|
||||||
CargoLabel label;
|
CargoLabel label;
|
||||||
uint32 grfid;
|
uint32 grfid;
|
||||||
|
@ -35,7 +35,7 @@ typedef struct CargoSpec {
|
||||||
uint16 classes;
|
uint16 classes;
|
||||||
|
|
||||||
bool IsValid() const;
|
bool IsValid() const;
|
||||||
} CargoSpec;
|
};
|
||||||
|
|
||||||
|
|
||||||
extern uint32 _cargo_mask;
|
extern uint32 _cargo_mask;
|
||||||
|
|
|
@ -22,12 +22,12 @@
|
||||||
#include "genworld.h"
|
#include "genworld.h"
|
||||||
#include "industry.h"
|
#include "industry.h"
|
||||||
|
|
||||||
typedef struct TerraformerHeightMod {
|
struct TerraformerHeightMod {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
byte height;
|
byte height;
|
||||||
} TerraformerHeightMod;
|
};
|
||||||
|
|
||||||
typedef struct TerraformerState {
|
struct TerraformerState {
|
||||||
int height[4];
|
int height[4];
|
||||||
uint32 flags;
|
uint32 flags;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ typedef struct TerraformerState {
|
||||||
TileIndex *tile_table;
|
TileIndex *tile_table;
|
||||||
TerraformerHeightMod *modheight;
|
TerraformerHeightMod *modheight;
|
||||||
|
|
||||||
} TerraformerState;
|
};
|
||||||
|
|
||||||
static int TerraformAllowTileProcess(TerraformerState *ts, TileIndex tile)
|
static int TerraformAllowTileProcess(TerraformerState *ts, TileIndex tile)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,14 +12,14 @@
|
||||||
/* ground type, m5 bits 2...4
|
/* ground type, m5 bits 2...4
|
||||||
* valid densities (bits 0...1) in comments after the enum
|
* valid densities (bits 0...1) in comments after the enum
|
||||||
*/
|
*/
|
||||||
typedef enum ClearGround {
|
enum ClearGround {
|
||||||
CLEAR_GRASS = 0, ///< 0-3
|
CLEAR_GRASS = 0, ///< 0-3
|
||||||
CLEAR_ROUGH = 1, ///< 3
|
CLEAR_ROUGH = 1, ///< 3
|
||||||
CLEAR_ROCKS = 2, ///< 3
|
CLEAR_ROCKS = 2, ///< 3
|
||||||
CLEAR_FIELDS = 3, ///< 3
|
CLEAR_FIELDS = 3, ///< 3
|
||||||
CLEAR_SNOW = 4, ///< 0-3
|
CLEAR_SNOW = 4, ///< 0-3
|
||||||
CLEAR_DESERT = 5 ///< 1,3
|
CLEAR_DESERT = 5 ///< 1,3
|
||||||
} ClearGround;
|
};
|
||||||
|
|
||||||
|
|
||||||
static inline ClearGround GetClearGround(TileIndex t)
|
static inline ClearGround GetClearGround(TileIndex t)
|
||||||
|
|
|
@ -176,10 +176,10 @@ enum {
|
||||||
|
|
||||||
typedef int32 CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
|
typedef int32 CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
|
||||||
|
|
||||||
typedef struct Command {
|
struct Command {
|
||||||
CommandProc *proc;
|
CommandProc *proc;
|
||||||
byte flags;
|
byte flags;
|
||||||
} Command;
|
};
|
||||||
|
|
||||||
//#define return_cmd_error(errcode) do { _error_message=(errcode); return CMD_ERROR; } while(0)
|
//#define return_cmd_error(errcode) do { _error_message=(errcode); return CMD_ERROR; } while(0)
|
||||||
#define return_cmd_error(errcode) do { return CMD_ERROR | (errcode); } while (0)
|
#define return_cmd_error(errcode) do { return CMD_ERROR | (errcode); } while (0)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
/* maximum length of a totally expanded command */
|
/* maximum length of a totally expanded command */
|
||||||
#define ICON_MAX_STREAMSIZE 1024
|
#define ICON_MAX_STREAMSIZE 1024
|
||||||
|
|
||||||
typedef enum IConsoleVarTypes {
|
enum IConsoleVarTypes {
|
||||||
ICONSOLE_VAR_BOOLEAN,
|
ICONSOLE_VAR_BOOLEAN,
|
||||||
ICONSOLE_VAR_BYTE,
|
ICONSOLE_VAR_BYTE,
|
||||||
ICONSOLE_VAR_UINT16,
|
ICONSOLE_VAR_UINT16,
|
||||||
|
@ -18,19 +18,19 @@ typedef enum IConsoleVarTypes {
|
||||||
ICONSOLE_VAR_INT16,
|
ICONSOLE_VAR_INT16,
|
||||||
ICONSOLE_VAR_INT32,
|
ICONSOLE_VAR_INT32,
|
||||||
ICONSOLE_VAR_STRING
|
ICONSOLE_VAR_STRING
|
||||||
} IConsoleVarTypes;
|
};
|
||||||
|
|
||||||
typedef enum IConsoleModes {
|
enum IConsoleModes {
|
||||||
ICONSOLE_FULL,
|
ICONSOLE_FULL,
|
||||||
ICONSOLE_OPENED,
|
ICONSOLE_OPENED,
|
||||||
ICONSOLE_CLOSED
|
ICONSOLE_CLOSED
|
||||||
} IConsoleModes;
|
};
|
||||||
|
|
||||||
typedef enum IConsoleHookTypes {
|
enum IConsoleHookTypes {
|
||||||
ICONSOLE_HOOK_ACCESS,
|
ICONSOLE_HOOK_ACCESS,
|
||||||
ICONSOLE_HOOK_PRE_ACTION,
|
ICONSOLE_HOOK_PRE_ACTION,
|
||||||
ICONSOLE_HOOK_POST_ACTION
|
ICONSOLE_HOOK_POST_ACTION
|
||||||
} IConsoleHookTypes;
|
};
|
||||||
|
|
||||||
/** --Hooks--
|
/** --Hooks--
|
||||||
* Hooks are certain triggers get get accessed/executed on either
|
* Hooks are certain triggers get get accessed/executed on either
|
||||||
|
@ -38,11 +38,11 @@ typedef enum IConsoleHookTypes {
|
||||||
* for general flow of permissions or special action needed in some cases
|
* for general flow of permissions or special action needed in some cases
|
||||||
*/
|
*/
|
||||||
typedef bool IConsoleHook();
|
typedef bool IConsoleHook();
|
||||||
typedef struct IConsoleHooks{
|
struct IConsoleHooks{
|
||||||
IConsoleHook *access; ///< trigger when accessing the variable/command
|
IConsoleHook *access; ///< trigger when accessing the variable/command
|
||||||
IConsoleHook *pre; ///< trigger before the variable/command is changed/executed
|
IConsoleHook *pre; ///< trigger before the variable/command is changed/executed
|
||||||
IConsoleHook *post; ///< trigger after the variable/command is changed/executed
|
IConsoleHook *post; ///< trigger after the variable/command is changed/executed
|
||||||
} IConsoleHooks;
|
};
|
||||||
|
|
||||||
/** --Commands--
|
/** --Commands--
|
||||||
* Commands are commands, or functions. They get executed once and any
|
* Commands are commands, or functions. They get executed once and any
|
||||||
|
@ -53,14 +53,13 @@ typedef struct IConsoleHooks{
|
||||||
*/
|
*/
|
||||||
typedef bool (IConsoleCmdProc)(byte argc, char *argv[]);
|
typedef bool (IConsoleCmdProc)(byte argc, char *argv[]);
|
||||||
|
|
||||||
struct IConsoleCmd;
|
struct IConsoleCmd {
|
||||||
typedef struct IConsoleCmd {
|
|
||||||
char *name; ///< name of command
|
char *name; ///< name of command
|
||||||
struct IConsoleCmd *next; ///< next command in list
|
IConsoleCmd *next; ///< next command in list
|
||||||
|
|
||||||
IConsoleCmdProc *proc; ///< process executed when command is typed
|
IConsoleCmdProc *proc; ///< process executed when command is typed
|
||||||
IConsoleHooks hook; ///< any special trigger action that needs executing
|
IConsoleHooks hook; ///< any special trigger action that needs executing
|
||||||
} IConsoleCmd;
|
};
|
||||||
|
|
||||||
/** --Variables--
|
/** --Variables--
|
||||||
* Variables are pointers to real ingame variables which allow for
|
* Variables are pointers to real ingame variables which allow for
|
||||||
|
@ -71,10 +70,9 @@ typedef struct IConsoleCmd {
|
||||||
* - '++' to increase value by one
|
* - '++' to increase value by one
|
||||||
* - '--' to decrease value by one
|
* - '--' to decrease value by one
|
||||||
*/
|
*/
|
||||||
struct IConsoleVar;
|
struct IConsoleVar {
|
||||||
typedef struct IConsoleVar {
|
|
||||||
char *name; ///< name of the variable
|
char *name; ///< name of the variable
|
||||||
struct IConsoleVar *next; ///< next variable in list
|
IConsoleVar *next; ///< next variable in list
|
||||||
|
|
||||||
void *addr; ///< the address where the variable is pointing at
|
void *addr; ///< the address where the variable is pointing at
|
||||||
uint32 size; ///< size of the variable, used for strings
|
uint32 size; ///< size of the variable, used for strings
|
||||||
|
@ -82,7 +80,7 @@ typedef struct IConsoleVar {
|
||||||
IConsoleVarTypes type; ///< type of variable (for correct assignment/output)
|
IConsoleVarTypes type; ///< type of variable (for correct assignment/output)
|
||||||
IConsoleCmdProc *proc; ///< some variables need really special handling, use a callback function for that
|
IConsoleCmdProc *proc; ///< some variables need really special handling, use a callback function for that
|
||||||
IConsoleHooks hook; ///< any special trigger action that needs executing
|
IConsoleHooks hook; ///< any special trigger action that needs executing
|
||||||
} IConsoleVar;
|
};
|
||||||
|
|
||||||
/** --Aliases--
|
/** --Aliases--
|
||||||
* Aliases are like shortcuts for complex functions, variable assignments,
|
* Aliases are like shortcuts for complex functions, variable assignments,
|
||||||
|
@ -95,13 +93,12 @@ typedef struct IConsoleVar {
|
||||||
* - "%!" also lists all parameters but presenting them to the aliased command as one argument
|
* - "%!" also lists all parameters but presenting them to the aliased command as one argument
|
||||||
* - ";" allows for combining commands (see example 'ng')
|
* - ";" allows for combining commands (see example 'ng')
|
||||||
*/
|
*/
|
||||||
struct IConsoleAlias;
|
struct IConsoleAlias {
|
||||||
typedef struct IConsoleAlias {
|
|
||||||
char *name; ///< name of the alias
|
char *name; ///< name of the alias
|
||||||
struct IConsoleAlias *next; ///< next alias in list
|
IConsoleAlias *next; ///< next alias in list
|
||||||
|
|
||||||
char *cmdline; ///< command(s) that is/are being aliased
|
char *cmdline; ///< command(s) that is/are being aliased
|
||||||
} IConsoleAlias;
|
};
|
||||||
|
|
||||||
/* console parser */
|
/* console parser */
|
||||||
VARDEF IConsoleCmd *_iconsole_cmds; ///< list of registred commands
|
VARDEF IConsoleCmd *_iconsole_cmds; ///< list of registred commands
|
||||||
|
|
|
@ -12,7 +12,7 @@ enum {
|
||||||
CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1
|
CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct CurrencySpec {
|
||||||
uint16 rate;
|
uint16 rate;
|
||||||
char separator;
|
char separator;
|
||||||
Year to_euro;
|
Year to_euro;
|
||||||
|
@ -29,7 +29,7 @@ typedef struct {
|
||||||
*/
|
*/
|
||||||
byte symbol_pos;
|
byte symbol_pos;
|
||||||
StringID name;
|
StringID name;
|
||||||
} CurrencySpec;
|
};
|
||||||
|
|
||||||
|
|
||||||
extern CurrencySpec _currency_specs[NUM_CURRENCY];
|
extern CurrencySpec _currency_specs[NUM_CURRENCY];
|
||||||
|
|
|
@ -44,11 +44,11 @@ typedef uint8 Month;
|
||||||
typedef uint8 Day;
|
typedef uint8 Day;
|
||||||
typedef uint16 DateFract;
|
typedef uint16 DateFract;
|
||||||
|
|
||||||
typedef struct YearMonthDay {
|
struct YearMonthDay {
|
||||||
Year year;
|
Year year;
|
||||||
Month month;
|
Month month;
|
||||||
Day day;
|
Day day;
|
||||||
} YearMonthDay;
|
};
|
||||||
|
|
||||||
extern Year _cur_year;
|
extern Year _cur_year;
|
||||||
extern Month _cur_month;
|
extern Month _cur_month;
|
||||||
|
|
|
@ -33,10 +33,10 @@ int _debug_sl_level;
|
||||||
int _debug_station_level;
|
int _debug_station_level;
|
||||||
|
|
||||||
|
|
||||||
typedef struct DebugLevel {
|
struct DebugLevel {
|
||||||
const char *name;
|
const char *name;
|
||||||
int *level;
|
int *level;
|
||||||
} DebugLevel;
|
};
|
||||||
|
|
||||||
#define DEBUG_LEVEL(x) { #x, &_debug_##x##_level }
|
#define DEBUG_LEVEL(x) { #x, &_debug_##x##_level }
|
||||||
static const DebugLevel debug_level[] = {
|
static const DebugLevel debug_level[] = {
|
||||||
|
|
|
@ -290,10 +290,10 @@ static void DrawDepotWindow(Window *w)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct GetDepotVehiclePtData {
|
struct GetDepotVehiclePtData {
|
||||||
Vehicle *head;
|
Vehicle *head;
|
||||||
Vehicle *wagon;
|
Vehicle *wagon;
|
||||||
} GetDepotVehiclePtData;
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MODE_ERROR = 1,
|
MODE_ERROR = 1,
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
|
||||||
/* Direction as commonly used in v->direction, 8 way. */
|
/* Direction as commonly used in v->direction, 8 way. */
|
||||||
typedef enum Direction {
|
enum Direction {
|
||||||
DIR_BEGIN = 0,
|
DIR_BEGIN = 0,
|
||||||
DIR_N = 0,
|
DIR_N = 0,
|
||||||
DIR_NE = 1, ///< Northeast, upper right on your monitor
|
DIR_NE = 1, ///< Northeast, upper right on your monitor
|
||||||
|
@ -20,7 +20,7 @@ typedef enum Direction {
|
||||||
DIR_NW = 7,
|
DIR_NW = 7,
|
||||||
DIR_END,
|
DIR_END,
|
||||||
INVALID_DIR = 0xFF,
|
INVALID_DIR = 0xFF,
|
||||||
} Direction;
|
};
|
||||||
|
|
||||||
/** Define basic enum properties */
|
/** Define basic enum properties */
|
||||||
template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {};
|
template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {};
|
||||||
|
@ -32,14 +32,14 @@ static inline Direction ReverseDir(Direction d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef enum DirDiff {
|
enum DirDiff {
|
||||||
DIRDIFF_SAME = 0,
|
DIRDIFF_SAME = 0,
|
||||||
DIRDIFF_45RIGHT = 1,
|
DIRDIFF_45RIGHT = 1,
|
||||||
DIRDIFF_90RIGHT = 2,
|
DIRDIFF_90RIGHT = 2,
|
||||||
DIRDIFF_REVERSE = 4,
|
DIRDIFF_REVERSE = 4,
|
||||||
DIRDIFF_90LEFT = 6,
|
DIRDIFF_90LEFT = 6,
|
||||||
DIRDIFF_45LEFT = 7
|
DIRDIFF_45LEFT = 7
|
||||||
} DirDiff;
|
};
|
||||||
|
|
||||||
static inline DirDiff DirDifference(Direction d0, Direction d1)
|
static inline DirDiff DirDifference(Direction d0, Direction d1)
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,7 @@ static inline Direction ChangeDir(Direction d, DirDiff delta)
|
||||||
|
|
||||||
|
|
||||||
/* Direction commonly used as the direction of entering and leaving tiles, 4-way */
|
/* Direction commonly used as the direction of entering and leaving tiles, 4-way */
|
||||||
typedef enum DiagDirection {
|
enum DiagDirection {
|
||||||
DIAGDIR_BEGIN = 0,
|
DIAGDIR_BEGIN = 0,
|
||||||
DIAGDIR_NE = 0, ///< Northeast, upper right on your monitor
|
DIAGDIR_NE = 0, ///< Northeast, upper right on your monitor
|
||||||
DIAGDIR_SE = 1,
|
DIAGDIR_SE = 1,
|
||||||
|
@ -67,7 +67,7 @@ typedef enum DiagDirection {
|
||||||
DIAGDIR_NW = 3,
|
DIAGDIR_NW = 3,
|
||||||
DIAGDIR_END,
|
DIAGDIR_END,
|
||||||
INVALID_DIAGDIR = 0xFF,
|
INVALID_DIAGDIR = 0xFF,
|
||||||
} DiagDirection;
|
};
|
||||||
|
|
||||||
DECLARE_POSTFIX_INCREMENT(DiagDirection);
|
DECLARE_POSTFIX_INCREMENT(DiagDirection);
|
||||||
|
|
||||||
|
@ -81,12 +81,12 @@ static inline DiagDirection ReverseDiagDir(DiagDirection d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef enum DiagDirDiff {
|
enum DiagDirDiff {
|
||||||
DIAGDIRDIFF_SAME = 0,
|
DIAGDIRDIFF_SAME = 0,
|
||||||
DIAGDIRDIFF_90RIGHT = 1,
|
DIAGDIRDIFF_90RIGHT = 1,
|
||||||
DIAGDIRDIFF_REVERSE = 2,
|
DIAGDIRDIFF_REVERSE = 2,
|
||||||
DIAGDIRDIFF_90LEFT = 3
|
DIAGDIRDIFF_90LEFT = 3
|
||||||
} DiagDirDiff;
|
};
|
||||||
|
|
||||||
static inline DiagDirection ChangeDiagDir(DiagDirection d, DiagDirDiff delta)
|
static inline DiagDirection ChangeDiagDir(DiagDirection d, DiagDirDiff delta)
|
||||||
{
|
{
|
||||||
|
@ -107,11 +107,11 @@ static inline Direction DiagDirToDir(DiagDirection dir)
|
||||||
|
|
||||||
|
|
||||||
/* the 2 axis */
|
/* the 2 axis */
|
||||||
typedef enum Axis {
|
enum Axis {
|
||||||
AXIS_X = 0,
|
AXIS_X = 0,
|
||||||
AXIS_Y = 1,
|
AXIS_Y = 1,
|
||||||
AXIS_END
|
AXIS_END
|
||||||
} Axis;
|
};
|
||||||
|
|
||||||
|
|
||||||
static inline Axis OtherAxis(Axis a)
|
static inline Axis OtherAxis(Axis a)
|
||||||
|
|
|
@ -30,17 +30,17 @@
|
||||||
#include "video/cocoa_v.h"
|
#include "video/cocoa_v.h"
|
||||||
#include "video/win32_v.h"
|
#include "video/win32_v.h"
|
||||||
|
|
||||||
typedef struct DriverDesc {
|
struct DriverDesc {
|
||||||
const char* name;
|
const char* name;
|
||||||
const char* longname;
|
const char* longname;
|
||||||
const HalCommonDriver* drv;
|
const HalCommonDriver* drv;
|
||||||
} DriverDesc;
|
};
|
||||||
|
|
||||||
typedef struct DriverClass {
|
struct DriverClass {
|
||||||
const DriverDesc *descs;
|
const DriverDesc *descs;
|
||||||
const char *name;
|
const char *name;
|
||||||
const HalCommonDriver** drv;
|
const HalCommonDriver** drv;
|
||||||
} DriverClass;
|
};
|
||||||
|
|
||||||
|
|
||||||
#define M(x, y, z) { x, y, (const HalCommonDriver *)(void *)z }
|
#define M(x, y, z) { x, y, (const HalCommonDriver *)(void *)z }
|
||||||
|
|
|
@ -901,12 +901,12 @@ void DeleteSubsidyWithStation(StationID index)
|
||||||
InvalidateWindow(WC_SUBSIDIES_LIST, 0);
|
InvalidateWindow(WC_SUBSIDIES_LIST, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct FoundRoute {
|
struct FoundRoute {
|
||||||
uint distance;
|
uint distance;
|
||||||
CargoID cargo;
|
CargoID cargo;
|
||||||
void *from;
|
void *from;
|
||||||
void *to;
|
void *to;
|
||||||
} FoundRoute;
|
};
|
||||||
|
|
||||||
static void FindSubsidyPassengerRoute(FoundRoute *fr)
|
static void FindSubsidyPassengerRoute(FoundRoute *fr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,24 +8,24 @@
|
||||||
void ResetPriceBaseMultipliers();
|
void ResetPriceBaseMultipliers();
|
||||||
void SetPriceBaseMultiplier(uint price, byte factor);
|
void SetPriceBaseMultiplier(uint price, byte factor);
|
||||||
|
|
||||||
typedef struct {
|
struct Economy {
|
||||||
int32 max_loan; ///< Maximum possible loan
|
int32 max_loan; ///< Maximum possible loan
|
||||||
int32 max_loan_unround; ///< Economy fluctuation status
|
int32 max_loan_unround; ///< Economy fluctuation status
|
||||||
int fluct;
|
int fluct;
|
||||||
byte interest_rate; ///< Interest
|
byte interest_rate; ///< Interest
|
||||||
byte infl_amount; ///< inflation amount
|
byte infl_amount; ///< inflation amount
|
||||||
byte infl_amount_pr; ///< "floating" portion of inflation
|
byte infl_amount_pr; ///< "floating" portion of inflation
|
||||||
} Economy;
|
};
|
||||||
|
|
||||||
VARDEF Economy _economy;
|
VARDEF Economy _economy;
|
||||||
|
|
||||||
typedef struct Subsidy {
|
struct Subsidy {
|
||||||
CargoID cargo_type;
|
CargoID cargo_type;
|
||||||
byte age;
|
byte age;
|
||||||
/* from and to can either be TownID, StationID or IndustryID */
|
/* from and to can either be TownID, StationID or IndustryID */
|
||||||
uint16 from;
|
uint16 from;
|
||||||
uint16 to;
|
uint16 to;
|
||||||
} Subsidy;
|
};
|
||||||
|
|
||||||
|
|
||||||
enum ScoreID {
|
enum ScoreID {
|
||||||
|
@ -48,11 +48,11 @@ enum ScoreID {
|
||||||
|
|
||||||
DECLARE_POSTFIX_INCREMENT(ScoreID);
|
DECLARE_POSTFIX_INCREMENT(ScoreID);
|
||||||
|
|
||||||
typedef struct ScoreInfo {
|
struct ScoreInfo {
|
||||||
byte id; ///< Unique ID of the score
|
byte id; ///< Unique ID of the score
|
||||||
int needed; ///< How much you need to get the perfect score
|
int needed; ///< How much you need to get the perfect score
|
||||||
int score; ///< How much score it will give
|
int score; ///< How much score it will give
|
||||||
} ScoreInfo;
|
};
|
||||||
|
|
||||||
extern const ScoreInfo _score_info[];
|
extern const ScoreInfo _score_info[];
|
||||||
extern int _score_part[MAX_PLAYERS][SCORE_END];
|
extern int _score_part[MAX_PLAYERS][SCORE_END];
|
||||||
|
|
28
src/engine.h
28
src/engine.h
|
@ -16,7 +16,7 @@ enum RailVehicleTypes {
|
||||||
RAILVEH_WAGON, ///< simple wagon, not motorized
|
RAILVEH_WAGON, ///< simple wagon, not motorized
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct RailVehicleInfo {
|
struct RailVehicleInfo {
|
||||||
byte image_index;
|
byte image_index;
|
||||||
RailVehicleTypes railveh_type;
|
RailVehicleTypes railveh_type;
|
||||||
byte base_cost;
|
byte base_cost;
|
||||||
|
@ -39,9 +39,9 @@ typedef struct RailVehicleInfo {
|
||||||
byte shorten_factor; ///< length on main map for this type is 8 - shorten_factor
|
byte shorten_factor; ///< length on main map for this type is 8 - shorten_factor
|
||||||
byte tractive_effort; ///< Tractive effort coefficient
|
byte tractive_effort; ///< Tractive effort coefficient
|
||||||
byte user_def_data; ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles
|
byte user_def_data; ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles
|
||||||
} RailVehicleInfo;
|
};
|
||||||
|
|
||||||
typedef struct ShipVehicleInfo {
|
struct ShipVehicleInfo {
|
||||||
byte image_index;
|
byte image_index;
|
||||||
byte base_cost;
|
byte base_cost;
|
||||||
uint16 max_speed;
|
uint16 max_speed;
|
||||||
|
@ -50,7 +50,7 @@ typedef struct ShipVehicleInfo {
|
||||||
byte running_cost;
|
byte running_cost;
|
||||||
SoundFxByte sfx;
|
SoundFxByte sfx;
|
||||||
bool refittable;
|
bool refittable;
|
||||||
} ShipVehicleInfo;
|
};
|
||||||
|
|
||||||
/* AircraftVehicleInfo subtypes, bitmask type.
|
/* AircraftVehicleInfo subtypes, bitmask type.
|
||||||
* If bit 0 is 0 then it is a helicopter, otherwise it is a plane
|
* If bit 0 is 0 then it is a helicopter, otherwise it is a plane
|
||||||
|
@ -61,7 +61,7 @@ enum {
|
||||||
AIR_FAST = 2
|
AIR_FAST = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct AircraftVehicleInfo {
|
struct AircraftVehicleInfo {
|
||||||
byte image_index;
|
byte image_index;
|
||||||
byte base_cost;
|
byte base_cost;
|
||||||
byte running_cost;
|
byte running_cost;
|
||||||
|
@ -71,9 +71,9 @@ typedef struct AircraftVehicleInfo {
|
||||||
uint16 max_speed;
|
uint16 max_speed;
|
||||||
byte mail_capacity;
|
byte mail_capacity;
|
||||||
uint16 passenger_capacity;
|
uint16 passenger_capacity;
|
||||||
} AircraftVehicleInfo;
|
};
|
||||||
|
|
||||||
typedef struct RoadVehicleInfo {
|
struct RoadVehicleInfo {
|
||||||
byte image_index;
|
byte image_index;
|
||||||
byte base_cost;
|
byte base_cost;
|
||||||
byte running_cost;
|
byte running_cost;
|
||||||
|
@ -81,12 +81,12 @@ typedef struct RoadVehicleInfo {
|
||||||
byte max_speed;
|
byte max_speed;
|
||||||
byte capacity;
|
byte capacity;
|
||||||
CargoID cargo_type;
|
CargoID cargo_type;
|
||||||
} RoadVehicleInfo;
|
};
|
||||||
|
|
||||||
/** Information about a vehicle
|
/** Information about a vehicle
|
||||||
* @see table/engines.h
|
* @see table/engines.h
|
||||||
*/
|
*/
|
||||||
typedef struct EngineInfo {
|
struct EngineInfo {
|
||||||
Date base_intro;
|
Date base_intro;
|
||||||
Year lifelength;
|
Year lifelength;
|
||||||
Year base_life;
|
Year base_life;
|
||||||
|
@ -97,9 +97,9 @@ typedef struct EngineInfo {
|
||||||
byte refit_cost;
|
byte refit_cost;
|
||||||
byte misc_flags;
|
byte misc_flags;
|
||||||
byte callbackmask;
|
byte callbackmask;
|
||||||
} EngineInfo;
|
};
|
||||||
|
|
||||||
typedef struct Engine {
|
struct Engine {
|
||||||
Date intro_date;
|
Date intro_date;
|
||||||
Date age;
|
Date age;
|
||||||
uint16 reliability;
|
uint16 reliability;
|
||||||
|
@ -112,7 +112,7 @@ typedef struct Engine {
|
||||||
byte preview_wait;
|
byte preview_wait;
|
||||||
byte player_avail;
|
byte player_avail;
|
||||||
byte type; ///< type, ie VEH_Road, VEH_Train, etc. Same as in vehicle.h
|
byte type; ///< type, ie VEH_Road, VEH_Train, etc. Same as in vehicle.h
|
||||||
} Engine;
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EngineInfo.misc_flags is a bitmask, with the following values
|
* EngineInfo.misc_flags is a bitmask, with the following values
|
||||||
|
@ -261,11 +261,9 @@ struct EngineRenew {
|
||||||
EngineRenewID index;
|
EngineRenewID index;
|
||||||
EngineID from;
|
EngineID from;
|
||||||
EngineID to;
|
EngineID to;
|
||||||
struct EngineRenew *next;
|
EngineRenew *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct EngineRenew EngineRenew;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Memory pool for engine renew elements. DO NOT USE outside of engine.c. Is
|
* Memory pool for engine renew elements. DO NOT USE outside of engine.c. Is
|
||||||
* placed here so the only exception to this rule, the saveload code, can use
|
* placed here so the only exception to this rule, the saveload code, can use
|
||||||
|
|
|
@ -48,10 +48,10 @@ static const Widget _engine_preview_widgets[] = {
|
||||||
typedef void DrawEngineProc(int x, int y, EngineID engine, SpriteID pal);
|
typedef void DrawEngineProc(int x, int y, EngineID engine, SpriteID pal);
|
||||||
typedef void DrawEngineInfoProc(EngineID, int x, int y, int maxw);
|
typedef void DrawEngineInfoProc(EngineID, int x, int y, int maxw);
|
||||||
|
|
||||||
typedef struct DrawEngineInfo {
|
struct DrawEngineInfo {
|
||||||
DrawEngineProc *engine_proc;
|
DrawEngineProc *engine_proc;
|
||||||
DrawEngineInfoProc *info_proc;
|
DrawEngineInfoProc *info_proc;
|
||||||
} DrawEngineInfo;
|
};
|
||||||
|
|
||||||
static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw);
|
static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw);
|
||||||
static void DrawRoadVehEngineInfo(EngineID engine, int x, int y, int maxw);
|
static void DrawRoadVehEngineInfo(EngineID engine, int x, int y, int maxw);
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#define FIO_BUFFER_SIZE 512
|
#define FIO_BUFFER_SIZE 512
|
||||||
#define MAX_HANDLES 64
|
#define MAX_HANDLES 64
|
||||||
|
|
||||||
typedef struct {
|
struct Fio {
|
||||||
byte *buffer, *buffer_end; ///< position pointer in local buffer and last valid byte of buffer
|
byte *buffer, *buffer_end; ///< position pointer in local buffer and last valid byte of buffer
|
||||||
uint32 pos; ///< current (system) position in file
|
uint32 pos; ///< current (system) position in file
|
||||||
FILE *cur_fh; ///< current file handle
|
FILE *cur_fh; ///< current file handle
|
||||||
|
@ -29,7 +29,7 @@ typedef struct {
|
||||||
const char *filename[MAX_HANDLES]; ///< array of filenames we (should) have open
|
const char *filename[MAX_HANDLES]; ///< array of filenames we (should) have open
|
||||||
uint usage_count[MAX_HANDLES]; ///< count how many times this file has been opened
|
uint usage_count[MAX_HANDLES]; ///< count how many times this file has been opened
|
||||||
#endif /* LIMITED_FDS */
|
#endif /* LIMITED_FDS */
|
||||||
} Fio;
|
};
|
||||||
|
|
||||||
static Fio _fio;
|
static Fio _fio;
|
||||||
|
|
||||||
|
|
10
src/fios.h
10
src/fios.h
|
@ -6,12 +6,12 @@
|
||||||
#define FIOS_H
|
#define FIOS_H
|
||||||
|
|
||||||
/* Deals with finding savegames */
|
/* Deals with finding savegames */
|
||||||
typedef struct {
|
struct FiosItem {
|
||||||
byte type;
|
byte type;
|
||||||
uint64 mtime;
|
uint64 mtime;
|
||||||
char title[64];
|
char title[64];
|
||||||
char name[256 - 12 - 64];
|
char name[256 - 12 - 64];
|
||||||
} FiosItem;
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
FIOS_TYPE_DRIVE = 0,
|
FIOS_TYPE_DRIVE = 0,
|
||||||
|
@ -56,15 +56,15 @@ int CDECL compare_FiosItems(const void *a, const void *b);
|
||||||
/* Implementation of opendir/readdir/closedir for Windows */
|
/* Implementation of opendir/readdir/closedir for Windows */
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
typedef struct DIR DIR;
|
struct DIR;
|
||||||
|
|
||||||
typedef struct dirent { // XXX - only d_name implemented
|
struct dirent { // XXX - only d_name implemented
|
||||||
wchar_t *d_name; // name of found file
|
wchar_t *d_name; // name of found file
|
||||||
/* little hack which will point to parent DIR struct which will
|
/* little hack which will point to parent DIR struct which will
|
||||||
* save us a call to GetFileAttributes if we want information
|
* save us a call to GetFileAttributes if we want information
|
||||||
* about the file (for example in function fio_bla) */
|
* about the file (for example in function fio_bla) */
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
} dirent;
|
};
|
||||||
|
|
||||||
struct DIR {
|
struct DIR {
|
||||||
HANDLE hFind;
|
HANDLE hFind;
|
||||||
|
|
|
@ -315,10 +315,10 @@ static FT_Face GetFontFace(FontSize size)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct GlyphEntry {
|
struct GlyphEntry {
|
||||||
Sprite *sprite;
|
Sprite *sprite;
|
||||||
byte width;
|
byte width;
|
||||||
} GlyphEntry;
|
};
|
||||||
|
|
||||||
|
|
||||||
/* The glyph cache. This is structured to reduce memory consumption.
|
/* The glyph cache. This is structured to reduce memory consumption.
|
||||||
|
|
|
@ -14,14 +14,14 @@ void InitializeUnicodeGlyphMap();
|
||||||
|
|
||||||
#ifdef WITH_FREETYPE
|
#ifdef WITH_FREETYPE
|
||||||
|
|
||||||
typedef struct FreeTypeSettings {
|
struct FreeTypeSettings {
|
||||||
char small_font[260];
|
char small_font[260];
|
||||||
char medium_font[260];
|
char medium_font[260];
|
||||||
char large_font[260];
|
char large_font[260];
|
||||||
uint small_size;
|
uint small_size;
|
||||||
uint medium_size;
|
uint medium_size;
|
||||||
uint large_size;
|
uint large_size;
|
||||||
} FreeTypeSettings;
|
};
|
||||||
|
|
||||||
extern FreeTypeSettings _freetype;
|
extern FreeTypeSettings _freetype;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ enum {
|
||||||
typedef void gw_done_proc();
|
typedef void gw_done_proc();
|
||||||
typedef void gw_abort_proc();
|
typedef void gw_abort_proc();
|
||||||
|
|
||||||
typedef struct gw_info {
|
struct gw_info {
|
||||||
bool active; ///< Is generating world active
|
bool active; ///< Is generating world active
|
||||||
bool abort; ///< Whether to abort the thread ASAP
|
bool abort; ///< Whether to abort the thread ASAP
|
||||||
bool wait_for_draw; ///< Are we waiting on a draw event
|
bool wait_for_draw; ///< Are we waiting on a draw event
|
||||||
|
@ -42,14 +42,14 @@ typedef struct gw_info {
|
||||||
gw_done_proc *proc; ///< Proc that is called when done (can be NULL)
|
gw_done_proc *proc; ///< Proc that is called when done (can be NULL)
|
||||||
gw_abort_proc *abortp; ///< Proc that is called when aborting (can be NULL)
|
gw_abort_proc *abortp; ///< Proc that is called when aborting (can be NULL)
|
||||||
OTTDThread *thread; ///< The thread we are in (can be NULL)
|
OTTDThread *thread; ///< The thread we are in (can be NULL)
|
||||||
} gw_info;
|
};
|
||||||
|
|
||||||
#ifdef TEMPORARY_OTTDTHREAD_DEFINITION
|
#ifdef TEMPORARY_OTTDTHREAD_DEFINITION
|
||||||
#undef OTTDThread
|
#undef OTTDThread
|
||||||
#undef TEMPORARY_OTTDTHREAD_DEFINITION
|
#undef TEMPORARY_OTTDTHREAD_DEFINITION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum gwp_classes {
|
enum gwp_class {
|
||||||
GWP_MAP_INIT, ///< Initialize/allocate the map, start economy
|
GWP_MAP_INIT, ///< Initialize/allocate the map, start economy
|
||||||
GWP_LANDSCAPE, ///< Create the landscape
|
GWP_LANDSCAPE, ///< Create the landscape
|
||||||
GWP_ROUGH_ROCKY, ///< Make rough and rocky areas
|
GWP_ROUGH_ROCKY, ///< Make rough and rocky areas
|
||||||
|
@ -61,7 +61,7 @@ typedef enum gwp_classes {
|
||||||
GWP_RUNTILELOOP, ///< Runs the tile loop 1280 times to make snow etc
|
GWP_RUNTILELOOP, ///< Runs the tile loop 1280 times to make snow etc
|
||||||
GWP_GAME_START, ///< Really prepare to start the game
|
GWP_GAME_START, ///< Really prepare to start the game
|
||||||
GWP_CLASS_COUNT
|
GWP_CLASS_COUNT
|
||||||
} gwp_class;
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we are currently in the process of generating a world.
|
* Check if we are currently in the process of generating a world.
|
||||||
|
|
|
@ -29,12 +29,12 @@
|
||||||
/**
|
/**
|
||||||
* In what 'mode' the GenerateLandscapeWindowProc is.
|
* In what 'mode' the GenerateLandscapeWindowProc is.
|
||||||
*/
|
*/
|
||||||
typedef enum glwp_modes {
|
enum glwp_modes {
|
||||||
GLWP_GENERATE,
|
GLWP_GENERATE,
|
||||||
GLWP_HEIGHTMAP,
|
GLWP_HEIGHTMAP,
|
||||||
GLWP_SCENARIO,
|
GLWP_SCENARIO,
|
||||||
GLWP_END
|
GLWP_END
|
||||||
} glwp_modes;
|
};
|
||||||
|
|
||||||
static uint _heightmap_x = 0;
|
static uint _heightmap_x = 0;
|
||||||
static uint _heightmap_y = 0;
|
static uint _heightmap_y = 0;
|
||||||
|
@ -740,13 +740,13 @@ static const Widget _show_terrain_progress_widgets[] = {
|
||||||
{ WIDGETS_END},
|
{ WIDGETS_END},
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct tp_info {
|
struct tp_info {
|
||||||
uint percent;
|
uint percent;
|
||||||
StringID cls;
|
StringID cls;
|
||||||
uint current;
|
uint current;
|
||||||
uint total;
|
uint total;
|
||||||
int timer;
|
int timer;
|
||||||
} tp_info;
|
};
|
||||||
|
|
||||||
static tp_info _tp;
|
static tp_info _tp;
|
||||||
|
|
||||||
|
|
|
@ -44,11 +44,11 @@ int _pal_last_dirty;
|
||||||
Colour _cur_palette[256];
|
Colour _cur_palette[256];
|
||||||
byte _stringwidth_table[FS_END][224];
|
byte _stringwidth_table[FS_END][224];
|
||||||
|
|
||||||
typedef enum BlitterModes {
|
enum BlitterMode {
|
||||||
BM_NORMAL,
|
BM_NORMAL,
|
||||||
BM_COLOUR_REMAP,
|
BM_COLOUR_REMAP,
|
||||||
BM_TRANSPARENT,
|
BM_TRANSPARENT,
|
||||||
} BlitterMode;
|
};
|
||||||
|
|
||||||
static void GfxMainBlitter(const Sprite *sprite, int x, int y, BlitterMode mode);
|
static void GfxMainBlitter(const Sprite *sprite, int x, int y, BlitterMode mode);
|
||||||
|
|
||||||
|
@ -718,7 +718,7 @@ void DrawSprite(SpriteID img, SpriteID pal, int x, int y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct BlitterParams {
|
struct BlitterParams {
|
||||||
int start_x, start_y;
|
int start_x, start_y;
|
||||||
const byte *sprite;
|
const byte *sprite;
|
||||||
Pixel *dst;
|
Pixel *dst;
|
||||||
|
@ -726,7 +726,7 @@ typedef struct BlitterParams {
|
||||||
int width, height;
|
int width, height;
|
||||||
int width_org;
|
int width_org;
|
||||||
int pitch;
|
int pitch;
|
||||||
} BlitterParams;
|
};
|
||||||
|
|
||||||
static void GfxBlitTileZoomIn(BlitterParams *bp)
|
static void GfxBlitTileZoomIn(BlitterParams *bp)
|
||||||
{
|
{
|
||||||
|
|
28
src/gfx.h
28
src/gfx.h
|
@ -93,13 +93,13 @@ void CreateConsole();
|
||||||
typedef int32 CursorID;
|
typedef int32 CursorID;
|
||||||
typedef byte Pixel;
|
typedef byte Pixel;
|
||||||
|
|
||||||
typedef struct Point {
|
struct Point {
|
||||||
int x,y;
|
int x,y;
|
||||||
} Point;
|
};
|
||||||
|
|
||||||
typedef struct Rect {
|
struct Rect {
|
||||||
int left,top,right,bottom;
|
int left,top,right,bottom;
|
||||||
} Rect;
|
};
|
||||||
|
|
||||||
/** A single sprite of a list of animated cursors */
|
/** A single sprite of a list of animated cursors */
|
||||||
struct AnimCursor {
|
struct AnimCursor {
|
||||||
|
@ -108,7 +108,7 @@ struct AnimCursor {
|
||||||
byte display_time; ///< Amount of ticks this sprite will be shown
|
byte display_time; ///< Amount of ticks this sprite will be shown
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct CursorVars {
|
struct CursorVars {
|
||||||
Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement
|
Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement
|
||||||
Point draw_pos, draw_size; ///< position and size bounding-box for drawing
|
Point draw_pos, draw_size; ///< position and size bounding-box for drawing
|
||||||
SpriteID sprite; ///< current image of cursor
|
SpriteID sprite; ///< current image of cursor
|
||||||
|
@ -123,20 +123,20 @@ typedef struct CursorVars {
|
||||||
bool dirty; ///< the rect occupied by the mouse is dirty (redraw)
|
bool dirty; ///< the rect occupied by the mouse is dirty (redraw)
|
||||||
bool fix_at; ///< mouse is moving, but cursor is not (used for scrolling)
|
bool fix_at; ///< mouse is moving, but cursor is not (used for scrolling)
|
||||||
bool in_window; ///< mouse inside this window, determines drawing logic
|
bool in_window; ///< mouse inside this window, determines drawing logic
|
||||||
} CursorVars;
|
};
|
||||||
|
|
||||||
typedef struct DrawPixelInfo {
|
struct DrawPixelInfo {
|
||||||
Pixel *dst_ptr;
|
Pixel *dst_ptr;
|
||||||
int left, top, width, height;
|
int left, top, width, height;
|
||||||
int pitch;
|
int pitch;
|
||||||
uint16 zoom;
|
uint16 zoom;
|
||||||
} DrawPixelInfo;
|
};
|
||||||
|
|
||||||
typedef struct Colour {
|
struct Colour {
|
||||||
byte r;
|
byte r;
|
||||||
byte g;
|
byte g;
|
||||||
byte b;
|
byte b;
|
||||||
} Colour;
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -181,12 +181,12 @@ void UndrawMouseCursor();
|
||||||
|
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
|
||||||
typedef enum FontSizes {
|
enum FontSize {
|
||||||
FS_NORMAL,
|
FS_NORMAL,
|
||||||
FS_SMALL,
|
FS_SMALL,
|
||||||
FS_LARGE,
|
FS_LARGE,
|
||||||
FS_END,
|
FS_END,
|
||||||
} FontSize;
|
};
|
||||||
|
|
||||||
DECLARE_POSTFIX_INCREMENT(FontSize);
|
DECLARE_POSTFIX_INCREMENT(FontSize);
|
||||||
|
|
||||||
|
@ -292,9 +292,9 @@ VARDEF byte _colour_gradient[16][8];
|
||||||
|
|
||||||
VARDEF bool _use_dos_palette;
|
VARDEF bool _use_dos_palette;
|
||||||
|
|
||||||
typedef enum StringColorFlags {
|
enum StringColorFlags {
|
||||||
IS_PALETTE_COLOR = 0x100, ///< color value is already a real palette color index, not an index of a StringColor
|
IS_PALETTE_COLOR = 0x100, ///< color value is already a real palette color index, not an index of a StringColor
|
||||||
} StringColorFlags;
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
|
|
@ -18,15 +18,15 @@
|
||||||
#include "fontcache.h"
|
#include "fontcache.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
typedef struct MD5File {
|
struct MD5File {
|
||||||
const char * filename; ///< filename
|
const char * filename; ///< filename
|
||||||
md5_byte_t hash[16]; ///< md5 sum of the file
|
md5_byte_t hash[16]; ///< md5 sum of the file
|
||||||
} MD5File;
|
};
|
||||||
|
|
||||||
typedef struct FileList {
|
struct FileList {
|
||||||
MD5File basic[4]; ///< grf files that always have to be loaded
|
MD5File basic[4]; ///< grf files that always have to be loaded
|
||||||
MD5File landscape[3]; ///< landscape specific grf files
|
MD5File landscape[3]; ///< landscape specific grf files
|
||||||
} FileList;
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SKIP = 0xFFFE,
|
SKIP = 0xFFFE,
|
||||||
|
|
|
@ -43,7 +43,7 @@ enum {
|
||||||
static const int64 INVALID_DATAPOINT = INT64_MAX; // Value used for a datapoint that shouldn't be drawn.
|
static const int64 INVALID_DATAPOINT = INT64_MAX; // Value used for a datapoint that shouldn't be drawn.
|
||||||
static const uint INVALID_DATAPOINT_POS = UINT_MAX; // Used to determine if the previous point was drawn.
|
static const uint INVALID_DATAPOINT_POS = UINT_MAX; // Used to determine if the previous point was drawn.
|
||||||
|
|
||||||
typedef struct GraphDrawer {
|
struct GraphDrawer {
|
||||||
uint excluded_data; ///< bitmask of the datasets that shouldn't be displayed.
|
uint excluded_data; ///< bitmask of the datasets that shouldn't be displayed.
|
||||||
byte num_dataset;
|
byte num_dataset;
|
||||||
byte num_on_x_axis;
|
byte num_on_x_axis;
|
||||||
|
@ -65,7 +65,7 @@ typedef struct GraphDrawer {
|
||||||
StringID format_str_y_axis;
|
StringID format_str_y_axis;
|
||||||
byte colors[GRAPH_MAX_DATASETS];
|
byte colors[GRAPH_MAX_DATASETS];
|
||||||
int64 cost[GRAPH_MAX_DATASETS][24]; ///< last 2 years
|
int64 cost[GRAPH_MAX_DATASETS][24]; ///< last 2 years
|
||||||
} GraphDrawer;
|
};
|
||||||
|
|
||||||
static void DrawGraph(const GraphDrawer *gw)
|
static void DrawGraph(const GraphDrawer *gw)
|
||||||
{
|
{
|
||||||
|
|
16
src/hal.h
16
src/hal.h
|
@ -5,26 +5,26 @@
|
||||||
#ifndef HAL_H
|
#ifndef HAL_H
|
||||||
#define HAL_H
|
#define HAL_H
|
||||||
|
|
||||||
typedef struct {
|
struct HalCommonDriver {
|
||||||
const char *(*start)(const char * const *parm);
|
const char *(*start)(const char * const *parm);
|
||||||
void (*stop)();
|
void (*stop)();
|
||||||
} HalCommonDriver;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct HalVideoDriver {
|
||||||
const char *(*start)(const char * const *parm);
|
const char *(*start)(const char * const *parm);
|
||||||
void (*stop)();
|
void (*stop)();
|
||||||
void (*make_dirty)(int left, int top, int width, int height);
|
void (*make_dirty)(int left, int top, int width, int height);
|
||||||
void (*main_loop)();
|
void (*main_loop)();
|
||||||
bool (*change_resolution)(int w, int h);
|
bool (*change_resolution)(int w, int h);
|
||||||
void (*toggle_fullscreen)(bool fullscreen);
|
void (*toggle_fullscreen)(bool fullscreen);
|
||||||
} HalVideoDriver;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct HalSoundDriver {
|
||||||
const char *(*start)(const char * const *parm);
|
const char *(*start)(const char * const *parm);
|
||||||
void (*stop)();
|
void (*stop)();
|
||||||
} HalSoundDriver;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct HalMusicDriver {
|
||||||
const char *(*start)(const char * const *parm);
|
const char *(*start)(const char * const *parm);
|
||||||
void (*stop)();
|
void (*stop)();
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ typedef struct {
|
||||||
void (*stop_song)();
|
void (*stop_song)();
|
||||||
bool (*is_song_playing)();
|
bool (*is_song_playing)();
|
||||||
void (*set_volume)(byte vol);
|
void (*set_volume)(byte vol);
|
||||||
} HalMusicDriver;
|
};
|
||||||
|
|
||||||
extern HalMusicDriver *_music_driver;
|
extern HalMusicDriver *_music_driver;
|
||||||
extern HalSoundDriver *_sound_driver;
|
extern HalSoundDriver *_sound_driver;
|
||||||
|
|
|
@ -14,11 +14,11 @@ enum {
|
||||||
INVALID_INDUSTRY = 0xFFFF,
|
INVALID_INDUSTRY = 0xFFFF,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum IndustryLifeTypes {
|
enum IndustryLifeType {
|
||||||
INDUSTRYLIFE_NOT_CLOSABLE, ///< Industry can never close
|
INDUSTRYLIFE_NOT_CLOSABLE, ///< Industry can never close
|
||||||
INDUSTRYLIFE_PRODUCTION, ///< Industry can close and change of production
|
INDUSTRYLIFE_PRODUCTION, ///< Industry can close and change of production
|
||||||
INDUSTRYLIFE_CLOSABLE, ///< Industry can only close (no production change)
|
INDUSTRYLIFE_CLOSABLE, ///< Industry can only close (no production change)
|
||||||
} IndustryLifeType;
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the internal data of a functionnal industry
|
* Defines the internal data of a functionnal industry
|
||||||
|
@ -49,15 +49,15 @@ struct Industry {
|
||||||
IndustryID index; ///< index of the industry in the pool of industries
|
IndustryID index; ///< index of the industry in the pool of industries
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct IndustryTileTable {
|
struct IndustryTileTable {
|
||||||
TileIndexDiffC ti;
|
TileIndexDiffC ti;
|
||||||
IndustryGfx gfx;
|
IndustryGfx gfx;
|
||||||
} IndustryTileTable;
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the data structure for constructing industry.
|
* Defines the data structure for constructing industry.
|
||||||
*/
|
*/
|
||||||
typedef struct IndustrySpec {
|
struct IndustrySpec {
|
||||||
const IndustryTileTable *const *table;///< List of the tiles composing the industry
|
const IndustryTileTable *const *table;///< List of the tiles composing the industry
|
||||||
byte num_table; ///< Number of elements in the table
|
byte num_table; ///< Number of elements in the table
|
||||||
byte cost_multiplier; ///< Base cost multiplier*/
|
byte cost_multiplier; ///< Base cost multiplier*/
|
||||||
|
@ -74,15 +74,15 @@ typedef struct IndustrySpec {
|
||||||
StringID closure_text; ///< Message appearing when the industry closes
|
StringID closure_text; ///< Message appearing when the industry closes
|
||||||
StringID production_up_text; ///< Message appearing when the industry's production is increasing
|
StringID production_up_text; ///< Message appearing when the industry's production is increasing
|
||||||
StringID production_down_text; ///< Message appearing when the industry's production is decreasing
|
StringID production_down_text; ///< Message appearing when the industry's production is decreasing
|
||||||
} IndustrySpec;
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the data structure of each indivudual tile of an industry.
|
* Defines the data structure of each indivudual tile of an industry.
|
||||||
*/
|
*/
|
||||||
typedef struct IndustryTileSpec {
|
struct IndustryTileSpec {
|
||||||
CargoID accepts_cargo[3]; ///< Cargo accepted by this tile
|
CargoID accepts_cargo[3]; ///< Cargo accepted by this tile
|
||||||
Slope slopes_refused; ///< slope pattern on which this tile cannot be built
|
Slope slopes_refused; ///< slope pattern on which this tile cannot be built
|
||||||
} IndustryTileSpec;
|
};
|
||||||
|
|
||||||
const IndustrySpec *GetIndustrySpec(IndustryType thistype); ///< Array of industries default data
|
const IndustrySpec *GetIndustrySpec(IndustryType thistype); ///< Array of industries default data
|
||||||
const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx); ///< Array of industry tiles default data
|
const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx); ///< Array of industry tiles default data
|
||||||
|
|
|
@ -166,10 +166,10 @@ static inline void ResetIndustryConstructionStage(TileIndex tile)
|
||||||
_m[tile].m1 = 0;
|
_m[tile].m1 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct IndustryTypeSolver {
|
struct IndustryTypeSolver {
|
||||||
IndustryGfx MinGfx;
|
IndustryGfx MinGfx;
|
||||||
IndustryGfx MaxGfx;
|
IndustryGfx MaxGfx;
|
||||||
} IndustryTypeSolver;
|
};
|
||||||
|
|
||||||
static const IndustryTypeSolver industry_gfx_Solver [IT_END] = {
|
static const IndustryTypeSolver industry_gfx_Solver [IT_END] = {
|
||||||
{ 0, 6}, ///< IT_COAL_MINE
|
{ 0, 6}, ///< IT_COAL_MINE
|
||||||
|
|
12
src/livery.h
12
src/livery.h
|
@ -8,7 +8,7 @@
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
|
||||||
/* List of different livery schemes. */
|
/* List of different livery schemes. */
|
||||||
typedef enum LiverySchemes {
|
enum LiveryScheme {
|
||||||
LS_BEGIN = 0,
|
LS_BEGIN = 0,
|
||||||
LS_DEFAULT = 0,
|
LS_DEFAULT = 0,
|
||||||
|
|
||||||
|
@ -39,25 +39,25 @@ typedef enum LiverySchemes {
|
||||||
LS_LARGE_PLANE,
|
LS_LARGE_PLANE,
|
||||||
|
|
||||||
LS_END
|
LS_END
|
||||||
} LiveryScheme;
|
};
|
||||||
|
|
||||||
DECLARE_POSTFIX_INCREMENT(LiveryScheme);
|
DECLARE_POSTFIX_INCREMENT(LiveryScheme);
|
||||||
|
|
||||||
/* List of different livery classes, used only by the livery GUI. */
|
/* List of different livery classes, used only by the livery GUI. */
|
||||||
typedef enum LiveryClasses {
|
enum LiveryClass {
|
||||||
LC_OTHER,
|
LC_OTHER,
|
||||||
LC_RAIL,
|
LC_RAIL,
|
||||||
LC_ROAD,
|
LC_ROAD,
|
||||||
LC_SHIP,
|
LC_SHIP,
|
||||||
LC_AIRCRAFT,
|
LC_AIRCRAFT,
|
||||||
LC_END
|
LC_END
|
||||||
} LiveryClass;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct Livery {
|
struct Livery {
|
||||||
bool in_use; ///< Set if this livery should be used instead of the default livery.
|
bool in_use; ///< Set if this livery should be used instead of the default livery.
|
||||||
byte colour1; ///< First colour, for all vehicles.
|
byte colour1; ///< First colour, for all vehicles.
|
||||||
byte colour2; ///< Second colour, for vehicles with 2CC support.
|
byte colour2; ///< Second colour, for vehicles with 2CC support.
|
||||||
} Livery;
|
};
|
||||||
|
|
||||||
#endif /* LIVERY_H */
|
#endif /* LIVERY_H */
|
||||||
|
|
|
@ -18,7 +18,7 @@ extern uint _map_size;
|
||||||
#define TILE_MASK(x) ((x) & _map_tile_mask)
|
#define TILE_MASK(x) ((x) & _map_tile_mask)
|
||||||
#define TILE_ASSERT(x) assert(TILE_MASK(x) == (x));
|
#define TILE_ASSERT(x) assert(TILE_MASK(x) == (x));
|
||||||
|
|
||||||
typedef struct Tile {
|
struct Tile {
|
||||||
byte type_height;
|
byte type_height;
|
||||||
byte m1;
|
byte m1;
|
||||||
uint16 m2;
|
uint16 m2;
|
||||||
|
@ -26,7 +26,7 @@ typedef struct Tile {
|
||||||
byte m4;
|
byte m4;
|
||||||
byte m5;
|
byte m5;
|
||||||
byte m6;
|
byte m6;
|
||||||
} Tile;
|
};
|
||||||
|
|
||||||
extern Tile* _m;
|
extern Tile* _m;
|
||||||
|
|
||||||
|
@ -92,10 +92,10 @@ static inline uint TileY(TileIndex tile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct TileIndexDiffC {
|
struct TileIndexDiffC {
|
||||||
int16 x;
|
int16 x;
|
||||||
int16 y;
|
int16 y;
|
||||||
} TileIndexDiffC;
|
};
|
||||||
|
|
||||||
static inline TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc)
|
static inline TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc)
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,11 +68,11 @@ typedef unsigned char md5_byte_t; /* 8-bit byte */
|
||||||
typedef unsigned int md5_word_t; /* 32-bit word */
|
typedef unsigned int md5_word_t; /* 32-bit word */
|
||||||
|
|
||||||
/* Define the state of the MD5 Algorithm. */
|
/* Define the state of the MD5 Algorithm. */
|
||||||
typedef struct md5_state_s {
|
struct md5_state_t {
|
||||||
md5_word_t count[2]; /* message length in bits, lsw first */
|
md5_word_t count[2]; /* message length in bits, lsw first */
|
||||||
md5_word_t abcd[4]; /* digest buffer */
|
md5_word_t abcd[4]; /* digest buffer */
|
||||||
md5_byte_t buf[64]; /* accumulate block */
|
md5_byte_t buf[64]; /* accumulate block */
|
||||||
} md5_state_t;
|
};
|
||||||
|
|
||||||
/* Initialize the algorithm. */
|
/* Initialize the algorithm. */
|
||||||
void md5_init(md5_state_t *pms);
|
void md5_init(md5_state_t *pms);
|
||||||
|
|
|
@ -1191,12 +1191,12 @@ enum QueryWidgets {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct query_d {
|
struct query_d {
|
||||||
void (*proc)(Window*, bool); ///< callback function executed on closing of popup. Window* points to parent, bool is true if 'yes' clicked, false otherwise
|
void (*proc)(Window*, bool); ///< callback function executed on closing of popup. Window* points to parent, bool is true if 'yes' clicked, false otherwise
|
||||||
StringID message; ///< message shown for query window
|
StringID message; ///< message shown for query window
|
||||||
uint32 params[20]; ///< local copy of _decode_parameters
|
uint32 params[20]; ///< local copy of _decode_parameters
|
||||||
bool calledback; ///< has callback been executed already (internal usage for WE_DESTROY event)
|
bool calledback; ///< has callback been executed already (internal usage for WE_DESTROY event)
|
||||||
} query_d;
|
};
|
||||||
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(query_d));
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(query_d));
|
||||||
|
|
||||||
|
|
||||||
|
@ -1766,7 +1766,7 @@ template <> struct EnumPropsT<ce_flags_long> : MakeEnumPropsT<ce_flags_long, byt
|
||||||
typedef TinyEnumT<ce_flags_long> ce_flags;
|
typedef TinyEnumT<ce_flags_long> ce_flags;
|
||||||
|
|
||||||
|
|
||||||
typedef struct CheatEntry {
|
struct CheatEntry {
|
||||||
VarType type; ///< type of selector
|
VarType type; ///< type of selector
|
||||||
ce_flags flags; ///< selector flags
|
ce_flags flags; ///< selector flags
|
||||||
StringID str; ///< string with descriptive text
|
StringID str; ///< string with descriptive text
|
||||||
|
@ -1774,7 +1774,7 @@ typedef struct CheatEntry {
|
||||||
bool *been_used; ///< has this cheat been used before?
|
bool *been_used; ///< has this cheat been used before?
|
||||||
CheckButtonClick *proc;///< procedure
|
CheckButtonClick *proc;///< procedure
|
||||||
int16 min, max; ///< range for spinbox setting
|
int16 min, max; ///< range for spinbox setting
|
||||||
} CheatEntry;
|
};
|
||||||
|
|
||||||
static const CheatEntry _cheats_ui[] = {
|
static const CheatEntry _cheats_ui[] = {
|
||||||
{SLE_BOOL, {CE_CLICK}, STR_CHEAT_MONEY, &_cheats.money.value, &_cheats.money.been_used, &ClickMoneyCheat, 0, 0},
|
{SLE_BOOL, {CE_CLICK}, STR_CHEAT_MONEY, &_cheats.money.value, &_cheats.money.been_used, &ClickMoneyCheat, 0, 0},
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#ifndef MIXER_H
|
#ifndef MIXER_H
|
||||||
#define MIXER_H
|
#define MIXER_H
|
||||||
|
|
||||||
typedef struct MixerChannel MixerChannel;
|
struct MixerChannel;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MX_AUTOFREE = 1,
|
MX_AUTOFREE = 1,
|
||||||
|
|
|
@ -8,10 +8,10 @@
|
||||||
#define NUM_SONGS_PLAYLIST 33
|
#define NUM_SONGS_PLAYLIST 33
|
||||||
#define NUM_SONGS_AVAILABLE 22
|
#define NUM_SONGS_AVAILABLE 22
|
||||||
|
|
||||||
typedef struct SongSpecs {
|
struct SongSpecs {
|
||||||
char filename[256];
|
char filename[256];
|
||||||
char song_name[64];
|
char song_name[64];
|
||||||
} SongSpecs;
|
};
|
||||||
|
|
||||||
extern const SongSpecs origin_songs_specs[NUM_SONGS_AVAILABLE];
|
extern const SongSpecs origin_songs_specs[NUM_SONGS_AVAILABLE];
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ bool NetworkCoreInitialize();
|
||||||
void NetworkCoreShutdown();
|
void NetworkCoreShutdown();
|
||||||
|
|
||||||
/** Status of a network client; reasons why a client has quit */
|
/** Status of a network client; reasons why a client has quit */
|
||||||
typedef enum {
|
enum NetworkRecvStatus {
|
||||||
NETWORK_RECV_STATUS_OKAY, ///< Everything is okay
|
NETWORK_RECV_STATUS_OKAY, ///< Everything is okay
|
||||||
NETWORK_RECV_STATUS_DESYNC, ///< A desync did occur
|
NETWORK_RECV_STATUS_DESYNC, ///< A desync did occur
|
||||||
NETWORK_RECV_STATUS_NEWGRF_MISMATCH, ///< We did not have the required NewGRFs
|
NETWORK_RECV_STATUS_NEWGRF_MISMATCH, ///< We did not have the required NewGRFs
|
||||||
|
@ -27,7 +27,7 @@ typedef enum {
|
||||||
NETWORK_RECV_STATUS_SERVER_FULL, ///< The server is full
|
NETWORK_RECV_STATUS_SERVER_FULL, ///< The server is full
|
||||||
NETWORK_RECV_STATUS_SERVER_BANNED, ///< The server has banned us
|
NETWORK_RECV_STATUS_SERVER_BANNED, ///< The server has banned us
|
||||||
NETWORK_RECV_STATUS_CLOSE_QUERY, ///< Done quering the server
|
NETWORK_RECV_STATUS_CLOSE_QUERY, ///< Done quering the server
|
||||||
} NetworkRecvStatus;
|
};
|
||||||
|
|
||||||
/** Forward declaration due to circular dependencies */
|
/** Forward declaration due to circular dependencies */
|
||||||
struct Packet;
|
struct Packet;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
* some fields will be empty on the client (like game_password) by default
|
* some fields will be empty on the client (like game_password) by default
|
||||||
* and only filled with data a player enters.
|
* and only filled with data a player enters.
|
||||||
*/
|
*/
|
||||||
typedef struct NetworkGameInfo {
|
struct NetworkGameInfo {
|
||||||
byte game_info_version; ///< Version of the game info
|
byte game_info_version; ///< Version of the game info
|
||||||
char server_name[NETWORK_NAME_LENGTH]; ///< Server name
|
char server_name[NETWORK_NAME_LENGTH]; ///< Server name
|
||||||
char hostname[NETWORK_HOSTNAME_LENGTH]; ///< Hostname of the server (if any)
|
char hostname[NETWORK_HOSTNAME_LENGTH]; ///< Hostname of the server (if any)
|
||||||
|
@ -43,8 +43,8 @@ typedef struct NetworkGameInfo {
|
||||||
byte map_set; ///< Graphical set
|
byte map_set; ///< Graphical set
|
||||||
bool dedicated; ///< Is this a dedicated server?
|
bool dedicated; ///< Is this a dedicated server?
|
||||||
char rcon_password[NETWORK_PASSWORD_LENGTH]; ///< RCon password for the server. "" if rcon is disabled
|
char rcon_password[NETWORK_PASSWORD_LENGTH]; ///< RCon password for the server. "" if rcon is disabled
|
||||||
struct GRFConfig *grfconfig; ///< List of NewGRF files used
|
GRFConfig *grfconfig; ///< List of NewGRF files used
|
||||||
} NetworkGameInfo;
|
};
|
||||||
|
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,8 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Packet that wraps a command */
|
/** Packet that wraps a command */
|
||||||
typedef struct CommandPacket {
|
struct CommandPacket {
|
||||||
struct CommandPacket *next; ///< the next command packet (if in queue)
|
CommandPacket *next; ///< the next command packet (if in queue)
|
||||||
PlayerByte player; ///< player that is executing the command
|
PlayerByte player; ///< player that is executing the command
|
||||||
uint32 cmd; ///< command being executed
|
uint32 cmd; ///< command being executed
|
||||||
uint32 p1; ///< parameter p1
|
uint32 p1; ///< parameter p1
|
||||||
|
@ -68,10 +68,10 @@ typedef struct CommandPacket {
|
||||||
char text[80]; ///< possible text sent for name changes etc
|
char text[80]; ///< possible text sent for name changes etc
|
||||||
uint32 frame; ///< the frame in which this packet is executed
|
uint32 frame; ///< the frame in which this packet is executed
|
||||||
byte callback; ///< any callback function executed upon successful completion of the command
|
byte callback; ///< any callback function executed upon successful completion of the command
|
||||||
} CommandPacket;
|
};
|
||||||
|
|
||||||
/** Status of a client */
|
/** Status of a client */
|
||||||
typedef enum {
|
enum ClientStatus {
|
||||||
STATUS_INACTIVE, ///< The client is not connected nor active
|
STATUS_INACTIVE, ///< The client is not connected nor active
|
||||||
STATUS_AUTHORIZING,///< The client is authorizing
|
STATUS_AUTHORIZING,///< The client is authorizing
|
||||||
STATUS_AUTH, ///< The client is authorized
|
STATUS_AUTH, ///< The client is authorized
|
||||||
|
@ -80,7 +80,7 @@ typedef enum {
|
||||||
STATUS_DONE_MAP, ///< The client has downloaded the map
|
STATUS_DONE_MAP, ///< The client has downloaded the map
|
||||||
STATUS_PRE_ACTIVE, ///< The client is catching up the delayed frames
|
STATUS_PRE_ACTIVE, ///< The client is catching up the delayed frames
|
||||||
STATUS_ACTIVE, ///< The client is an active player in the game
|
STATUS_ACTIVE, ///< The client is an active player in the game
|
||||||
} ClientStatus;
|
};
|
||||||
|
|
||||||
/** Base socket handler for all TCP sockets */
|
/** Base socket handler for all TCP sockets */
|
||||||
class NetworkTCPSocketHandler : public NetworkSocketHandler {
|
class NetworkTCPSocketHandler : public NetworkSocketHandler {
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#define NETWORK_VEHICLE_TYPES 5
|
#define NETWORK_VEHICLE_TYPES 5
|
||||||
#define NETWORK_STATION_TYPES 5
|
#define NETWORK_STATION_TYPES 5
|
||||||
|
|
||||||
typedef struct NetworkPlayerInfo {
|
struct NetworkPlayerInfo {
|
||||||
char company_name[NETWORK_NAME_LENGTH]; // Company name
|
char company_name[NETWORK_NAME_LENGTH]; // Company name
|
||||||
char password[NETWORK_PASSWORD_LENGTH]; // The password for the player
|
char password[NETWORK_PASSWORD_LENGTH]; // The password for the player
|
||||||
Year inaugurated_year; // What year the company started in
|
Year inaugurated_year; // What year the company started in
|
||||||
|
@ -53,9 +53,9 @@ typedef struct NetworkPlayerInfo {
|
||||||
uint16 num_station[NETWORK_STATION_TYPES]; // How many stations are there of this type?
|
uint16 num_station[NETWORK_STATION_TYPES]; // How many stations are there of this type?
|
||||||
char players[NETWORK_PLAYERS_LENGTH]; // The players that control this company (Name1, name2, ..)
|
char players[NETWORK_PLAYERS_LENGTH]; // The players that control this company (Name1, name2, ..)
|
||||||
uint16 months_empty; // How many months the company is empty
|
uint16 months_empty; // How many months the company is empty
|
||||||
} NetworkPlayerInfo;
|
};
|
||||||
|
|
||||||
typedef struct NetworkClientInfo {
|
struct NetworkClientInfo {
|
||||||
uint16 client_index; // Index of the client (same as ClientState->index)
|
uint16 client_index; // Index of the client (same as ClientState->index)
|
||||||
char client_name[NETWORK_CLIENT_NAME_LENGTH]; // Name of the client
|
char client_name[NETWORK_CLIENT_NAME_LENGTH]; // Name of the client
|
||||||
byte client_lang; // The language of the client
|
byte client_lang; // The language of the client
|
||||||
|
@ -63,9 +63,9 @@ typedef struct NetworkClientInfo {
|
||||||
uint32 client_ip; // IP-address of the client (so he can be banned)
|
uint32 client_ip; // IP-address of the client (so he can be banned)
|
||||||
Date join_date; // Gamedate the player has joined
|
Date join_date; // Gamedate the player has joined
|
||||||
char unique_id[NETWORK_NAME_LENGTH]; // Every play sends an unique id so we can indentify him
|
char unique_id[NETWORK_NAME_LENGTH]; // Every play sends an unique id so we can indentify him
|
||||||
} NetworkClientInfo;
|
};
|
||||||
|
|
||||||
typedef enum {
|
enum NetworkJoinStatus {
|
||||||
NETWORK_JOIN_STATUS_CONNECTING,
|
NETWORK_JOIN_STATUS_CONNECTING,
|
||||||
NETWORK_JOIN_STATUS_AUTHORIZING,
|
NETWORK_JOIN_STATUS_AUTHORIZING,
|
||||||
NETWORK_JOIN_STATUS_WAITING,
|
NETWORK_JOIN_STATUS_WAITING,
|
||||||
|
@ -74,15 +74,15 @@ typedef enum {
|
||||||
NETWORK_JOIN_STATUS_REGISTERING,
|
NETWORK_JOIN_STATUS_REGISTERING,
|
||||||
|
|
||||||
NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO,
|
NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO,
|
||||||
} NetworkJoinStatus;
|
};
|
||||||
|
|
||||||
// language ids for server_lang and client_lang
|
// language ids for server_lang and client_lang
|
||||||
typedef enum {
|
enum NetworkLanguage {
|
||||||
NETLANG_ANY = 0,
|
NETLANG_ANY = 0,
|
||||||
NETLANG_ENGLISH = 1,
|
NETLANG_ENGLISH = 1,
|
||||||
NETLANG_GERMAN = 2,
|
NETLANG_GERMAN = 2,
|
||||||
NETLANG_FRENCH = 3,
|
NETLANG_FRENCH = 3,
|
||||||
} NetworkLanguage;
|
};
|
||||||
|
|
||||||
VARDEF NetworkGameInfo _network_game_info;
|
VARDEF NetworkGameInfo _network_game_info;
|
||||||
VARDEF NetworkPlayerInfo _network_player_info[MAX_PLAYERS];
|
VARDEF NetworkPlayerInfo _network_player_info[MAX_PLAYERS];
|
||||||
|
|
|
@ -20,13 +20,13 @@
|
||||||
#define NETWORK_SERVER_INDEX 1
|
#define NETWORK_SERVER_INDEX 1
|
||||||
#define NETWORK_EMPTY_INDEX 0
|
#define NETWORK_EMPTY_INDEX 0
|
||||||
|
|
||||||
typedef enum {
|
enum MapPacket {
|
||||||
MAP_PACKET_START,
|
MAP_PACKET_START,
|
||||||
MAP_PACKET_NORMAL,
|
MAP_PACKET_NORMAL,
|
||||||
MAP_PACKET_END,
|
MAP_PACKET_END,
|
||||||
} MapPacket;
|
};
|
||||||
|
|
||||||
typedef enum {
|
enum NetworkErrorCode {
|
||||||
NETWORK_ERROR_GENERAL, // Try to use thisone like never
|
NETWORK_ERROR_GENERAL, // Try to use thisone like never
|
||||||
|
|
||||||
// Signals from clients
|
// Signals from clients
|
||||||
|
@ -46,10 +46,10 @@ typedef enum {
|
||||||
NETWORK_ERROR_KICKED,
|
NETWORK_ERROR_KICKED,
|
||||||
NETWORK_ERROR_CHEATER,
|
NETWORK_ERROR_CHEATER,
|
||||||
NETWORK_ERROR_FULL,
|
NETWORK_ERROR_FULL,
|
||||||
} NetworkErrorCode;
|
};
|
||||||
|
|
||||||
// Actions that can be used for NetworkTextMessage
|
// Actions that can be used for NetworkTextMessage
|
||||||
typedef enum {
|
enum NetworkAction {
|
||||||
NETWORK_ACTION_JOIN,
|
NETWORK_ACTION_JOIN,
|
||||||
NETWORK_ACTION_LEAVE,
|
NETWORK_ACTION_LEAVE,
|
||||||
NETWORK_ACTION_SERVER_MESSAGE,
|
NETWORK_ACTION_SERVER_MESSAGE,
|
||||||
|
@ -58,18 +58,18 @@ typedef enum {
|
||||||
NETWORK_ACTION_CHAT_CLIENT,
|
NETWORK_ACTION_CHAT_CLIENT,
|
||||||
NETWORK_ACTION_GIVE_MONEY,
|
NETWORK_ACTION_GIVE_MONEY,
|
||||||
NETWORK_ACTION_NAME_CHANGE,
|
NETWORK_ACTION_NAME_CHANGE,
|
||||||
} NetworkAction;
|
};
|
||||||
|
|
||||||
typedef enum {
|
enum NetworkPasswordType {
|
||||||
NETWORK_GAME_PASSWORD,
|
NETWORK_GAME_PASSWORD,
|
||||||
NETWORK_COMPANY_PASSWORD,
|
NETWORK_COMPANY_PASSWORD,
|
||||||
} NetworkPasswordType;
|
};
|
||||||
|
|
||||||
typedef enum {
|
enum DestType {
|
||||||
DESTTYPE_BROADCAST, ///< Send message/notice to all players (All)
|
DESTTYPE_BROADCAST, ///< Send message/notice to all players (All)
|
||||||
DESTTYPE_TEAM, ///< Send message/notice to everyone playing the same company (Team)
|
DESTTYPE_TEAM, ///< Send message/notice to everyone playing the same company (Team)
|
||||||
DESTTYPE_CLIENT, ///< Send message/notice to only a certain player (Private)
|
DESTTYPE_CLIENT, ///< Send message/notice to only a certain player (Private)
|
||||||
} DestType;
|
};
|
||||||
|
|
||||||
// following externs are instantiated at network.cpp
|
// following externs are instantiated at network.cpp
|
||||||
extern CommandPacket *_local_command_queue;
|
extern CommandPacket *_local_command_queue;
|
||||||
|
|
|
@ -32,20 +32,20 @@
|
||||||
#define BGC 5
|
#define BGC 5
|
||||||
#define BTC 15
|
#define BTC 15
|
||||||
|
|
||||||
typedef struct network_d {
|
struct network_d {
|
||||||
PlayerID company; // select company in network lobby
|
PlayerID company; // select company in network lobby
|
||||||
byte field; // select text-field in start-server and game-listing
|
byte field; // select text-field in start-server and game-listing
|
||||||
NetworkGameList *server; // selected server in lobby and game-listing
|
NetworkGameList *server; // selected server in lobby and game-listing
|
||||||
FiosItem *map; // selected map in start-server
|
FiosItem *map; // selected map in start-server
|
||||||
} network_d;
|
};
|
||||||
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(network_d));
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(network_d));
|
||||||
|
|
||||||
typedef struct network_ql_d {
|
struct network_ql_d {
|
||||||
network_d n; // see above; general stuff
|
network_d n; // see above; general stuff
|
||||||
querystr_d q; // text-input in start-server and game-listing
|
querystr_d q; // text-input in start-server and game-listing
|
||||||
NetworkGameList **sort_list; // list of games (sorted)
|
NetworkGameList **sort_list; // list of games (sorted)
|
||||||
list_d l; // accompanying list-administration
|
list_d l; // accompanying list-administration
|
||||||
} network_ql_d;
|
};
|
||||||
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(network_ql_d));
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(network_ql_d));
|
||||||
|
|
||||||
/* Global to remember sorting after window has been closed */
|
/* Global to remember sorting after window has been closed */
|
||||||
|
|
|
@ -73,15 +73,15 @@ static const uint _default_cargo_max = 27;
|
||||||
static CargoLabel _default_cargo_list[_default_cargo_max];
|
static CargoLabel _default_cargo_list[_default_cargo_max];
|
||||||
|
|
||||||
|
|
||||||
typedef enum GrfDataType {
|
enum GrfDataType {
|
||||||
GDT_SOUND,
|
GDT_SOUND,
|
||||||
} GrfDataType;
|
};
|
||||||
|
|
||||||
static byte _grf_data_blocks;
|
static byte _grf_data_blocks;
|
||||||
static GrfDataType _grf_data_type;
|
static GrfDataType _grf_data_type;
|
||||||
|
|
||||||
|
|
||||||
typedef enum grfspec_feature {
|
enum grfspec_feature {
|
||||||
GSF_TRAIN,
|
GSF_TRAIN,
|
||||||
GSF_ROAD,
|
GSF_ROAD,
|
||||||
GSF_SHIP,
|
GSF_SHIP,
|
||||||
|
@ -95,7 +95,7 @@ typedef enum grfspec_feature {
|
||||||
GSF_INDUSTRIES,
|
GSF_INDUSTRIES,
|
||||||
GSF_CARGOS,
|
GSF_CARGOS,
|
||||||
GSF_SOUNDFX,
|
GSF_SOUNDFX,
|
||||||
} grfspec_feature;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef void (*SpecialSpriteHandler)(byte *buf, int len);
|
typedef void (*SpecialSpriteHandler)(byte *buf, int len);
|
||||||
|
|
14
src/newgrf.h
14
src/newgrf.h
|
@ -8,31 +8,31 @@
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "cargotype.h"
|
#include "cargotype.h"
|
||||||
|
|
||||||
typedef enum GrfLoadingStage {
|
enum GrfLoadingStage {
|
||||||
GLS_FILESCAN,
|
GLS_FILESCAN,
|
||||||
GLS_SAFETYSCAN,
|
GLS_SAFETYSCAN,
|
||||||
GLS_LABELSCAN,
|
GLS_LABELSCAN,
|
||||||
GLS_INIT,
|
GLS_INIT,
|
||||||
GLS_ACTIVATION,
|
GLS_ACTIVATION,
|
||||||
GLS_END,
|
GLS_END,
|
||||||
} GrfLoadingStage;
|
};
|
||||||
|
|
||||||
DECLARE_POSTFIX_INCREMENT(GrfLoadingStage);
|
DECLARE_POSTFIX_INCREMENT(GrfLoadingStage);
|
||||||
|
|
||||||
|
|
||||||
typedef struct GRFLabel {
|
struct GRFLabel {
|
||||||
byte label;
|
byte label;
|
||||||
uint32 nfo_line;
|
uint32 nfo_line;
|
||||||
uint32 pos;
|
uint32 pos;
|
||||||
struct GRFLabel *next;
|
struct GRFLabel *next;
|
||||||
} GRFLabel;
|
};
|
||||||
|
|
||||||
typedef struct GRFFile {
|
struct GRFFile {
|
||||||
char *filename;
|
char *filename;
|
||||||
uint32 grfid;
|
uint32 grfid;
|
||||||
uint16 sprite_offset;
|
uint16 sprite_offset;
|
||||||
byte grf_version;
|
byte grf_version;
|
||||||
struct GRFFile *next;
|
GRFFile *next;
|
||||||
|
|
||||||
/* A sprite group contains all sprites of a given vehicle (or multiple
|
/* A sprite group contains all sprites of a given vehicle (or multiple
|
||||||
* vehicles) when carrying given cargo. It consists of several sprite
|
* vehicles) when carrying given cargo. It consists of several sprite
|
||||||
|
@ -65,7 +65,7 @@ typedef struct GRFFile {
|
||||||
uint8 cargo_max;
|
uint8 cargo_max;
|
||||||
CargoLabel *cargo_list;
|
CargoLabel *cargo_list;
|
||||||
uint8 cargo_map[NUM_CARGO];
|
uint8 cargo_map[NUM_CARGO];
|
||||||
} GRFFile;
|
};
|
||||||
|
|
||||||
extern GRFFile *_first_grffile;
|
extern GRFFile *_first_grffile;
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,6 @@ const GRFConfig *FindGRFConfig(uint32 grfid, const uint8 *md5sum)
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
|
|
||||||
/** Structure for UnknownGRFs; this is a lightweight variant of GRFConfig */
|
/** Structure for UnknownGRFs; this is a lightweight variant of GRFConfig */
|
||||||
typedef struct UnknownGRF UnknownGRF;
|
|
||||||
struct UnknownGRF : public GRFIdentifier {
|
struct UnknownGRF : public GRFIdentifier {
|
||||||
UnknownGRF *next;
|
UnknownGRF *next;
|
||||||
char name[NETWORK_GRF_NAME_LENGTH];
|
char name[NETWORK_GRF_NAME_LENGTH];
|
||||||
|
|
|
@ -6,42 +6,42 @@
|
||||||
#include "openttd.h"
|
#include "openttd.h"
|
||||||
|
|
||||||
/* GRF config bit flags */
|
/* GRF config bit flags */
|
||||||
typedef enum {
|
enum GCF_Flags {
|
||||||
GCF_SYSTEM, ///< GRF file is an openttd-internal system grf
|
GCF_SYSTEM, ///< GRF file is an openttd-internal system grf
|
||||||
GCF_UNSAFE, ///< GRF file is unsafe for static usage
|
GCF_UNSAFE, ///< GRF file is unsafe for static usage
|
||||||
GCF_STATIC, ///< GRF file is used statically (can be used in any MP game)
|
GCF_STATIC, ///< GRF file is used statically (can be used in any MP game)
|
||||||
GCF_COMPATIBLE,///< GRF file does not exactly match the requested GRF (different MD5SUM), but grfid matches)
|
GCF_COMPATIBLE,///< GRF file does not exactly match the requested GRF (different MD5SUM), but grfid matches)
|
||||||
GCF_COPY, ///< The data is copied from a grf in _all_grfs
|
GCF_COPY, ///< The data is copied from a grf in _all_grfs
|
||||||
} GCF_Flags;
|
};
|
||||||
|
|
||||||
typedef enum {
|
enum GRFStatus {
|
||||||
GCS_UNKNOWN, ///< The status of this grf file is unknown
|
GCS_UNKNOWN, ///< The status of this grf file is unknown
|
||||||
GCS_DISABLED, ///< GRF file is disabled
|
GCS_DISABLED, ///< GRF file is disabled
|
||||||
GCS_NOT_FOUND, ///< GRF file was not found in the local cache
|
GCS_NOT_FOUND, ///< GRF file was not found in the local cache
|
||||||
GCS_INITIALISED, ///< GRF file has been initialised
|
GCS_INITIALISED, ///< GRF file has been initialised
|
||||||
GCS_ACTIVATED ///< GRF file has been activated
|
GCS_ACTIVATED ///< GRF file has been activated
|
||||||
} GRFStatus;
|
};
|
||||||
|
|
||||||
typedef enum {
|
enum GRFListCompatibility{
|
||||||
GLC_ALL_GOOD,
|
GLC_ALL_GOOD,
|
||||||
GLC_COMPATIBLE,
|
GLC_COMPATIBLE,
|
||||||
GLC_NOT_FOUND
|
GLC_NOT_FOUND
|
||||||
} GRFListCompatibility;
|
};
|
||||||
|
|
||||||
typedef struct GRFIdentifier {
|
struct GRFIdentifier {
|
||||||
uint32 grfid;
|
uint32 grfid;
|
||||||
uint8 md5sum[16];
|
uint8 md5sum[16];
|
||||||
} GRF;
|
};
|
||||||
|
|
||||||
typedef struct GRFError {
|
struct GRFError {
|
||||||
StringID message;
|
StringID message;
|
||||||
StringID data;
|
StringID data;
|
||||||
StringID severity;
|
StringID severity;
|
||||||
uint8 num_params;
|
uint8 num_params;
|
||||||
uint8 param_number[2];
|
uint8 param_number[2];
|
||||||
} GRFError;
|
};
|
||||||
|
|
||||||
typedef struct GRFConfig : public GRFIdentifier {
|
struct GRFConfig : public GRFIdentifier {
|
||||||
char *filename;
|
char *filename;
|
||||||
char *name;
|
char *name;
|
||||||
char *info;
|
char *info;
|
||||||
|
@ -53,7 +53,7 @@ typedef struct GRFConfig : public GRFIdentifier {
|
||||||
uint8 num_params;
|
uint8 num_params;
|
||||||
|
|
||||||
struct GRFConfig *next;
|
struct GRFConfig *next;
|
||||||
} GRFConfig;
|
};
|
||||||
|
|
||||||
/* First item in list of all scanned NewGRFs */
|
/* First item in list of all scanned NewGRFs */
|
||||||
extern GRFConfig *_all_grfs;
|
extern GRFConfig *_all_grfs;
|
||||||
|
|
|
@ -24,17 +24,17 @@
|
||||||
int _traininfo_vehicle_pitch = 0;
|
int _traininfo_vehicle_pitch = 0;
|
||||||
int _traininfo_vehicle_width = 29;
|
int _traininfo_vehicle_width = 29;
|
||||||
|
|
||||||
typedef struct WagonOverride {
|
struct WagonOverride {
|
||||||
byte *train_id;
|
byte *train_id;
|
||||||
int trains;
|
int trains;
|
||||||
CargoID cargo;
|
CargoID cargo;
|
||||||
const SpriteGroup *group;
|
const SpriteGroup *group;
|
||||||
} WagonOverride;
|
};
|
||||||
|
|
||||||
typedef struct WagonOverrides {
|
struct WagonOverrides {
|
||||||
int overrides_count;
|
int overrides_count;
|
||||||
WagonOverride *overrides;
|
WagonOverride *overrides;
|
||||||
} WagonOverrides;
|
};
|
||||||
|
|
||||||
static WagonOverrides _engine_wagon_overrides[TOTAL_NUM_ENGINES];
|
static WagonOverrides _engine_wagon_overrides[TOTAL_NUM_ENGINES];
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ bool UsesWagonOverride(const Vehicle *v);
|
||||||
#define GetCustomVehicleSprite(v, direction) GetCustomEngineSprite(v->engine_type, v, direction)
|
#define GetCustomVehicleSprite(v, direction) GetCustomEngineSprite(v->engine_type, v, direction)
|
||||||
#define GetCustomVehicleIcon(et, direction) GetCustomEngineSprite(et, NULL, direction)
|
#define GetCustomVehicleIcon(et, direction) GetCustomEngineSprite(et, NULL, direction)
|
||||||
|
|
||||||
typedef enum VehicleTrigger {
|
enum VehicleTrigger {
|
||||||
VEHICLE_TRIGGER_NEW_CARGO = 1,
|
VEHICLE_TRIGGER_NEW_CARGO = 1,
|
||||||
// Externally triggered only for the first vehicle in chain
|
// Externally triggered only for the first vehicle in chain
|
||||||
VEHICLE_TRIGGER_DEPOT = 2,
|
VEHICLE_TRIGGER_DEPOT = 2,
|
||||||
|
@ -44,7 +44,7 @@ typedef enum VehicleTrigger {
|
||||||
VEHICLE_TRIGGER_EMPTY = 4,
|
VEHICLE_TRIGGER_EMPTY = 4,
|
||||||
// Not triggered externally (called for the whole chain if we got NEW_CARGO)
|
// Not triggered externally (called for the whole chain if we got NEW_CARGO)
|
||||||
VEHICLE_TRIGGER_ANY_NEW_CARGO = 8,
|
VEHICLE_TRIGGER_ANY_NEW_CARGO = 8,
|
||||||
} VehicleTrigger;
|
};
|
||||||
void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger);
|
void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger);
|
||||||
|
|
||||||
void SetCustomEngineName(EngineID engine, StringID name);
|
void SetCustomEngineName(EngineID engine, StringID name);
|
||||||
|
|
|
@ -106,10 +106,10 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, bool show
|
||||||
|
|
||||||
|
|
||||||
/* Dialogue for adding NewGRF files to the selection */
|
/* Dialogue for adding NewGRF files to the selection */
|
||||||
typedef struct newgrf_add_d {
|
struct newgrf_add_d {
|
||||||
GRFConfig **list;
|
GRFConfig **list;
|
||||||
const GRFConfig *sel;
|
const GRFConfig *sel;
|
||||||
} newgrf_add_d;
|
};
|
||||||
|
|
||||||
|
|
||||||
static void NewGRFAddDlgWndProc(Window *w, WindowEvent *e)
|
static void NewGRFAddDlgWndProc(Window *w, WindowEvent *e)
|
||||||
|
@ -236,14 +236,14 @@ static const WindowDesc _newgrf_add_dlg_desc = {
|
||||||
|
|
||||||
|
|
||||||
/* 'NewGRF Settings' dialogue */
|
/* 'NewGRF Settings' dialogue */
|
||||||
typedef struct newgrf_d {
|
struct newgrf_d {
|
||||||
GRFConfig **orig_list; ///< grf list the window is shown with
|
GRFConfig **orig_list; ///< grf list the window is shown with
|
||||||
GRFConfig **list; ///< temporary grf list to which changes are made
|
GRFConfig **list; ///< temporary grf list to which changes are made
|
||||||
GRFConfig *sel; ///< selected grf item
|
GRFConfig *sel; ///< selected grf item
|
||||||
bool editable; ///< is the window editable
|
bool editable; ///< is the window editable
|
||||||
bool show_params; ///< are the grf-parameters shown in the info-panel
|
bool show_params; ///< are the grf-parameters shown in the info-panel
|
||||||
bool execute; ///< on pressing 'apply changes' are grf changes applied immediately, or only list is updated
|
bool execute; ///< on pressing 'apply changes' are grf changes applied immediately, or only list is updated
|
||||||
} newgrf_d;
|
};
|
||||||
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(newgrf_d));
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(newgrf_d));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#ifndef NEWGRF_SOUND_H
|
#ifndef NEWGRF_SOUND_H
|
||||||
#define NEWGRF_SOUND_H
|
#define NEWGRF_SOUND_H
|
||||||
|
|
||||||
typedef enum VehicleSoundEvents {
|
enum VehicleSoundEvent {
|
||||||
VSE_START = 1,
|
VSE_START = 1,
|
||||||
VSE_TUNNEL = 2,
|
VSE_TUNNEL = 2,
|
||||||
VSE_BREAKDOWN = 3,
|
VSE_BREAKDOWN = 3,
|
||||||
|
@ -13,7 +13,7 @@ typedef enum VehicleSoundEvents {
|
||||||
VSE_RUNNING_16 = 7,
|
VSE_RUNNING_16 = 7,
|
||||||
VSE_STOPPED_16 = 8,
|
VSE_STOPPED_16 = 8,
|
||||||
VSE_LOAD_UNLOAD = 9,
|
VSE_LOAD_UNLOAD = 9,
|
||||||
} VehicleSoundEvent;
|
};
|
||||||
|
|
||||||
|
|
||||||
FileEntry *AllocateFileEntry();
|
FileEntry *AllocateFileEntry();
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
#define NEWGRF_SPRITEGROUP_H
|
#define NEWGRF_SPRITEGROUP_H
|
||||||
|
|
||||||
|
|
||||||
typedef struct SpriteGroup SpriteGroup;
|
struct SpriteGroup;
|
||||||
|
|
||||||
|
|
||||||
/* 'Real' sprite groups contain a list of other result or callback sprite
|
/* 'Real' sprite groups contain a list of other result or callback sprite
|
||||||
* groups. */
|
* groups. */
|
||||||
typedef struct RealSpriteGroup {
|
struct RealSpriteGroup {
|
||||||
// Loaded = in motion, loading = not moving
|
// Loaded = in motion, loading = not moving
|
||||||
// Each group contains several spritesets, for various loading stages
|
// Each group contains several spritesets, for various loading stages
|
||||||
|
|
||||||
|
@ -21,28 +21,28 @@ typedef struct RealSpriteGroup {
|
||||||
byte num_loading; ///< Number of loading groups
|
byte num_loading; ///< Number of loading groups
|
||||||
const SpriteGroup **loaded; ///< List of loaded groups (can be SpriteIDs or Callback results)
|
const SpriteGroup **loaded; ///< List of loaded groups (can be SpriteIDs or Callback results)
|
||||||
const SpriteGroup **loading; ///< List of loading groups (can be SpriteIDs or Callback results)
|
const SpriteGroup **loading; ///< List of loading groups (can be SpriteIDs or Callback results)
|
||||||
} RealSpriteGroup;
|
};
|
||||||
|
|
||||||
/* Shared by deterministic and random groups. */
|
/* Shared by deterministic and random groups. */
|
||||||
typedef enum VarSpriteGroupScopes {
|
enum VarSpriteGroupScope {
|
||||||
VSG_SCOPE_SELF,
|
VSG_SCOPE_SELF,
|
||||||
// Engine of consists for vehicles, city for stations.
|
// Engine of consists for vehicles, city for stations.
|
||||||
VSG_SCOPE_PARENT,
|
VSG_SCOPE_PARENT,
|
||||||
} VarSpriteGroupScope;
|
};
|
||||||
|
|
||||||
typedef enum DeterministicSpriteGroupSizes {
|
enum DeterministicSpriteGroupSize {
|
||||||
DSG_SIZE_BYTE,
|
DSG_SIZE_BYTE,
|
||||||
DSG_SIZE_WORD,
|
DSG_SIZE_WORD,
|
||||||
DSG_SIZE_DWORD,
|
DSG_SIZE_DWORD,
|
||||||
} DeterministicSpriteGroupSize;
|
};
|
||||||
|
|
||||||
typedef enum DeterministicSpriteGroupAdjustTypes {
|
enum DeterministicSpriteGroupAdjustType {
|
||||||
DSGA_TYPE_NONE,
|
DSGA_TYPE_NONE,
|
||||||
DSGA_TYPE_DIV,
|
DSGA_TYPE_DIV,
|
||||||
DSGA_TYPE_MOD,
|
DSGA_TYPE_MOD,
|
||||||
} DeterministicSpriteGroupAdjustType;
|
};
|
||||||
|
|
||||||
typedef enum DeterministicSpriteGroupAdjustOperations {
|
enum DeterministicSpriteGroupAdjustOperation {
|
||||||
DSGA_OP_ADD, // a + b
|
DSGA_OP_ADD, // a + b
|
||||||
DSGA_OP_SUB, // a - b
|
DSGA_OP_SUB, // a - b
|
||||||
DSGA_OP_SMIN, // (signed) min(a, b)
|
DSGA_OP_SMIN, // (signed) min(a, b)
|
||||||
|
@ -57,10 +57,10 @@ typedef enum DeterministicSpriteGroupAdjustOperations {
|
||||||
DSGA_OP_AND, // a & b
|
DSGA_OP_AND, // a & b
|
||||||
DSGA_OP_OR, // a | b
|
DSGA_OP_OR, // a | b
|
||||||
DSGA_OP_XOR, // a ^ b
|
DSGA_OP_XOR, // a ^ b
|
||||||
} DeterministicSpriteGroupAdjustOperation;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct DeterministicSpriteGroupAdjust {
|
struct DeterministicSpriteGroupAdjust {
|
||||||
DeterministicSpriteGroupAdjustOperation operation;
|
DeterministicSpriteGroupAdjustOperation operation;
|
||||||
DeterministicSpriteGroupAdjustType type;
|
DeterministicSpriteGroupAdjustType type;
|
||||||
byte variable;
|
byte variable;
|
||||||
|
@ -70,17 +70,17 @@ typedef struct DeterministicSpriteGroupAdjust {
|
||||||
uint32 add_val;
|
uint32 add_val;
|
||||||
uint32 divmod_val;
|
uint32 divmod_val;
|
||||||
const SpriteGroup *subroutine;
|
const SpriteGroup *subroutine;
|
||||||
} DeterministicSpriteGroupAdjust;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct DeterministicSpriteGroupRange {
|
struct DeterministicSpriteGroupRange {
|
||||||
const SpriteGroup *group;
|
const SpriteGroup *group;
|
||||||
uint32 low;
|
uint32 low;
|
||||||
uint32 high;
|
uint32 high;
|
||||||
} DeterministicSpriteGroupRange;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct DeterministicSpriteGroup {
|
struct DeterministicSpriteGroup {
|
||||||
VarSpriteGroupScope var_scope;
|
VarSpriteGroupScope var_scope;
|
||||||
DeterministicSpriteGroupSize size;
|
DeterministicSpriteGroupSize size;
|
||||||
byte num_adjusts;
|
byte num_adjusts;
|
||||||
|
@ -90,14 +90,14 @@ typedef struct DeterministicSpriteGroup {
|
||||||
|
|
||||||
// Dynamically allocated, this is the sole owner
|
// Dynamically allocated, this is the sole owner
|
||||||
const SpriteGroup *default_group;
|
const SpriteGroup *default_group;
|
||||||
} DeterministicSpriteGroup;
|
};
|
||||||
|
|
||||||
typedef enum RandomizedSpriteGroupCompareModes {
|
enum RandomizedSpriteGroupCompareMode {
|
||||||
RSG_CMP_ANY,
|
RSG_CMP_ANY,
|
||||||
RSG_CMP_ALL,
|
RSG_CMP_ALL,
|
||||||
} RandomizedSpriteGroupCompareMode;
|
};
|
||||||
|
|
||||||
typedef struct RandomizedSpriteGroup {
|
struct RandomizedSpriteGroup {
|
||||||
// Take this object:
|
// Take this object:
|
||||||
VarSpriteGroupScope var_scope;
|
VarSpriteGroupScope var_scope;
|
||||||
|
|
||||||
|
@ -111,32 +111,32 @@ typedef struct RandomizedSpriteGroup {
|
||||||
|
|
||||||
// Take the group with appropriate index:
|
// Take the group with appropriate index:
|
||||||
const SpriteGroup **groups;
|
const SpriteGroup **groups;
|
||||||
} RandomizedSpriteGroup;
|
};
|
||||||
|
|
||||||
|
|
||||||
/* This contains a callback result. A failed callback has a value of
|
/* This contains a callback result. A failed callback has a value of
|
||||||
* CALLBACK_FAILED */
|
* CALLBACK_FAILED */
|
||||||
typedef struct CallbackResultSpriteGroup {
|
struct CallbackResultSpriteGroup {
|
||||||
uint16 result;
|
uint16 result;
|
||||||
} CallbackResultSpriteGroup;
|
};
|
||||||
|
|
||||||
|
|
||||||
/* A result sprite group returns the first SpriteID and the number of
|
/* A result sprite group returns the first SpriteID and the number of
|
||||||
* sprites in the set */
|
* sprites in the set */
|
||||||
typedef struct ResultSpriteGroup {
|
struct ResultSpriteGroup {
|
||||||
SpriteID sprite;
|
SpriteID sprite;
|
||||||
byte num_sprites;
|
byte num_sprites;
|
||||||
} ResultSpriteGroup;
|
};
|
||||||
|
|
||||||
/* List of different sprite group types */
|
/* List of different sprite group types */
|
||||||
typedef enum SpriteGroupType {
|
enum SpriteGroupType {
|
||||||
SGT_INVALID,
|
SGT_INVALID,
|
||||||
SGT_REAL,
|
SGT_REAL,
|
||||||
SGT_DETERMINISTIC,
|
SGT_DETERMINISTIC,
|
||||||
SGT_RANDOMIZED,
|
SGT_RANDOMIZED,
|
||||||
SGT_CALLBACK,
|
SGT_CALLBACK,
|
||||||
SGT_RESULT,
|
SGT_RESULT,
|
||||||
} SpriteGroupType;
|
};
|
||||||
|
|
||||||
/* Common wrapper for all the different sprite group types */
|
/* Common wrapper for all the different sprite group types */
|
||||||
struct SpriteGroup {
|
struct SpriteGroup {
|
||||||
|
@ -156,7 +156,7 @@ SpriteGroup *AllocateSpriteGroup();
|
||||||
void InitializeSpriteGroupPool();
|
void InitializeSpriteGroupPool();
|
||||||
|
|
||||||
|
|
||||||
typedef struct ResolverObject {
|
struct ResolverObject {
|
||||||
uint16 callback;
|
uint16 callback;
|
||||||
uint32 callback_param1;
|
uint32 callback_param1;
|
||||||
uint32 callback_param2;
|
uint32 callback_param2;
|
||||||
|
@ -187,7 +187,7 @@ typedef struct ResolverObject {
|
||||||
void (*SetTriggers)(const struct ResolverObject*, int);
|
void (*SetTriggers)(const struct ResolverObject*, int);
|
||||||
uint32 (*GetVariable)(const struct ResolverObject*, byte, byte, bool*);
|
uint32 (*GetVariable)(const struct ResolverObject*, byte, byte, bool*);
|
||||||
const SpriteGroup *(*ResolveReal)(const struct ResolverObject*, const SpriteGroup*);
|
const SpriteGroup *(*ResolveReal)(const struct ResolverObject*, const SpriteGroup*);
|
||||||
} ResolverObject;
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Base sprite group resolver */
|
/* Base sprite group resolver */
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
#include "newgrf_cargo.h"
|
#include "newgrf_cargo.h"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
|
||||||
typedef enum {
|
enum StationClassID {
|
||||||
STAT_CLASS_BEGIN = 0, ///< the lowest valid value
|
STAT_CLASS_BEGIN = 0, ///< the lowest valid value
|
||||||
STAT_CLASS_DFLT = 0, ///< Default station class.
|
STAT_CLASS_DFLT = 0, ///< Default station class.
|
||||||
STAT_CLASS_WAYP, ///< Waypoint class.
|
STAT_CLASS_WAYP, ///< Waypoint class.
|
||||||
STAT_CLASS_MAX = 32, ///< Maximum number of classes.
|
STAT_CLASS_MAX = 32, ///< Maximum number of classes.
|
||||||
} StationClassID;
|
};
|
||||||
|
|
||||||
/** Define basic enum properties */
|
/** Define basic enum properties */
|
||||||
template <> struct EnumPropsT<StationClassID> : MakeEnumPropsT<StationClassID, byte, STAT_CLASS_BEGIN, STAT_CLASS_MAX, STAT_CLASS_MAX> {};
|
template <> struct EnumPropsT<StationClassID> : MakeEnumPropsT<StationClassID, byte, STAT_CLASS_BEGIN, STAT_CLASS_MAX, STAT_CLASS_MAX> {};
|
||||||
|
@ -27,7 +27,7 @@ DECLARE_POSTFIX_INCREMENT(StationClassID);
|
||||||
* where index is computed as (x * platforms) + platform. */
|
* where index is computed as (x * platforms) + platform. */
|
||||||
typedef byte *StationLayout;
|
typedef byte *StationLayout;
|
||||||
|
|
||||||
typedef struct StationSpec {
|
struct StationSpec {
|
||||||
uint32 grfid; ///< ID of GRF file station belongs to.
|
uint32 grfid; ///< ID of GRF file station belongs to.
|
||||||
int localidx; ///< Index within GRF file of station.
|
int localidx; ///< Index within GRF file of station.
|
||||||
|
|
||||||
|
@ -84,17 +84,17 @@ typedef struct StationSpec {
|
||||||
* evaluating callbacks.
|
* evaluating callbacks.
|
||||||
*/
|
*/
|
||||||
const struct SpriteGroup *spritegroup[NUM_CARGO + 3];
|
const struct SpriteGroup *spritegroup[NUM_CARGO + 3];
|
||||||
} StationSpec;
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Struct containing information relating to station classes.
|
* Struct containing information relating to station classes.
|
||||||
*/
|
*/
|
||||||
typedef struct StationClass {
|
struct StationClass {
|
||||||
uint32 id; ///< ID of this class, e.g. 'DFLT', 'WAYP', etc.
|
uint32 id; ///< ID of this class, e.g. 'DFLT', 'WAYP', etc.
|
||||||
StringID name; ///< Name of this class.
|
StringID name; ///< Name of this class.
|
||||||
uint stations; ///< Number of stations in this class.
|
uint stations; ///< Number of stations in this class.
|
||||||
StationSpec **spec; ///< Array of station specifications.
|
StationSpec **spec; ///< Array of station specifications.
|
||||||
} StationClass;
|
};
|
||||||
|
|
||||||
void ResetStationClasses();
|
void ResetStationClasses();
|
||||||
StationClassID AllocateStationClass(uint32 cls);
|
StationClassID AllocateStationClass(uint32 cls);
|
||||||
|
|
|
@ -30,16 +30,16 @@
|
||||||
* the grf base will not be used in order to find the string, but rather for
|
* the grf base will not be used in order to find the string, but rather for
|
||||||
* jumping from standard langID scheme to the new one.
|
* jumping from standard langID scheme to the new one.
|
||||||
*/
|
*/
|
||||||
typedef enum grf_base_languages {
|
enum grf_base_languages {
|
||||||
GRFLB_AMERICAN = 0x01,
|
GRFLB_AMERICAN = 0x01,
|
||||||
GRFLB_ENGLISH = 0x02,
|
GRFLB_ENGLISH = 0x02,
|
||||||
GRFLB_GERMAN = 0x04,
|
GRFLB_GERMAN = 0x04,
|
||||||
GRFLB_FRENCH = 0x08,
|
GRFLB_FRENCH = 0x08,
|
||||||
GRFLB_SPANISH = 0x10,
|
GRFLB_SPANISH = 0x10,
|
||||||
GRFLB_GENERIC = 0x80,
|
GRFLB_GENERIC = 0x80,
|
||||||
} grf_base_language;
|
};
|
||||||
|
|
||||||
typedef enum grf_extended_languages {
|
enum grf_extended_languages {
|
||||||
GRFLX_AMERICAN = 0x00,
|
GRFLX_AMERICAN = 0x00,
|
||||||
GRFLX_ENGLISH = 0x01,
|
GRFLX_ENGLISH = 0x01,
|
||||||
GRFLX_GERMAN = 0x02,
|
GRFLX_GERMAN = 0x02,
|
||||||
|
@ -73,13 +73,13 @@ typedef enum grf_extended_languages {
|
||||||
GRFLX_CROATIAN = 0x38,
|
GRFLX_CROATIAN = 0x38,
|
||||||
GRFLX_TURKISH = 0x3E,
|
GRFLX_TURKISH = 0x3E,
|
||||||
GRFLX_UNSPECIFIED = 0x7F,
|
GRFLX_UNSPECIFIED = 0x7F,
|
||||||
} grf_language;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct iso_grf {
|
struct iso_grf {
|
||||||
char code[6];
|
char code[6];
|
||||||
byte grfLangID;
|
byte grfLangID;
|
||||||
} iso_grf;
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ISO code VS NewGrf langID conversion array.
|
* ISO code VS NewGrf langID conversion array.
|
||||||
|
@ -170,12 +170,12 @@ public:
|
||||||
* Putting both grfid and stringid together allows us to avoid duplicates,
|
* Putting both grfid and stringid together allows us to avoid duplicates,
|
||||||
* since it is NOT SUPPOSED to happen.
|
* since it is NOT SUPPOSED to happen.
|
||||||
*/
|
*/
|
||||||
typedef struct GRFTextEntry {
|
struct GRFTextEntry {
|
||||||
uint32 grfid;
|
uint32 grfid;
|
||||||
uint16 stringid;
|
uint16 stringid;
|
||||||
StringID def_string;
|
StringID def_string;
|
||||||
GRFText *textholder;
|
GRFText *textholder;
|
||||||
} GRFTextEntry;
|
};
|
||||||
|
|
||||||
|
|
||||||
static uint _num_grf_texts = 0;
|
static uint _num_grf_texts = 0;
|
||||||
|
|
12
src/npf.h
12
src/npf.h
|
@ -35,10 +35,10 @@ enum {
|
||||||
NPF_INFINITE_PENALTY = 1000 * NPF_TILE_LENGTH
|
NPF_INFINITE_PENALTY = 1000 * NPF_TILE_LENGTH
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct NPFFindStationOrTileData { /* Meant to be stored in AyStar.targetdata */
|
struct NPFFindStationOrTileData { /* Meant to be stored in AyStar.targetdata */
|
||||||
TileIndex dest_coords; /* An indication of where the station is, for heuristic purposes, or the target tile */
|
TileIndex dest_coords; /* An indication of where the station is, for heuristic purposes, or the target tile */
|
||||||
StationID station_index; /* station index we're heading for, or INVALID_STATION when we're heading for a tile */
|
StationID station_index; /* station index we're heading for, or INVALID_STATION when we're heading for a tile */
|
||||||
} NPFFindStationOrTileData;
|
};
|
||||||
|
|
||||||
enum { /* Indices into AyStar.userdata[] */
|
enum { /* Indices into AyStar.userdata[] */
|
||||||
NPF_TYPE = 0, /* Contains a TransportTypes value */
|
NPF_TYPE = 0, /* Contains a TransportTypes value */
|
||||||
|
@ -51,18 +51,18 @@ enum { /* Indices into AyStarNode.userdata[] */
|
||||||
NPF_NODE_FLAGS,
|
NPF_NODE_FLAGS,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum { /* Flags for AyStarNode.userdata[NPF_NODE_FLAGS]. Use NPFGetBit() and NPFGetBit() to use them. */
|
enum NPFNodeFlag { /* Flags for AyStarNode.userdata[NPF_NODE_FLAGS]. Use NPFGetBit() and NPFGetBit() to use them. */
|
||||||
NPF_FLAG_SEEN_SIGNAL, /* Used to mark that a signal was seen on the way, for rail only */
|
NPF_FLAG_SEEN_SIGNAL, /* Used to mark that a signal was seen on the way, for rail only */
|
||||||
NPF_FLAG_REVERSE, /* Used to mark that this node was reached from the second start node, if applicable */
|
NPF_FLAG_REVERSE, /* Used to mark that this node was reached from the second start node, if applicable */
|
||||||
NPF_FLAG_LAST_SIGNAL_RED, /* Used to mark that the last signal on this path was red */
|
NPF_FLAG_LAST_SIGNAL_RED, /* Used to mark that the last signal on this path was red */
|
||||||
} NPFNodeFlag;
|
};
|
||||||
|
|
||||||
typedef struct NPFFoundTargetData { /* Meant to be stored in AyStar.userpath */
|
struct NPFFoundTargetData { /* Meant to be stored in AyStar.userpath */
|
||||||
uint best_bird_dist; /* The best heuristic found. Is 0 if the target was found */
|
uint best_bird_dist; /* The best heuristic found. Is 0 if the target was found */
|
||||||
uint best_path_dist; /* The shortest path. Is (uint)-1 if no path is found */
|
uint best_path_dist; /* The shortest path. Is (uint)-1 if no path is found */
|
||||||
Trackdir best_trackdir; /* The trackdir that leads to the shortest path/closest birds dist */
|
Trackdir best_trackdir; /* The trackdir that leads to the shortest path/closest birds dist */
|
||||||
AyStarNode node; /* The node within the target the search led us to */
|
AyStarNode node; /* The node within the target the search led us to */
|
||||||
} NPFFoundTargetData;
|
};
|
||||||
|
|
||||||
/* These functions below are _not_ re-entrant, in favor of speed! */
|
/* These functions below are _not_ re-entrant, in favor of speed! */
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ enum {
|
||||||
OLD_MAP_SIZE = 256 * 256
|
OLD_MAP_SIZE = 256 * 256
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct LoadgameState {
|
struct LoadgameState {
|
||||||
FILE *file;
|
FILE *file;
|
||||||
|
|
||||||
uint chunk_size;
|
uint chunk_size;
|
||||||
|
@ -41,10 +41,10 @@ typedef struct LoadgameState {
|
||||||
|
|
||||||
uint total_read;
|
uint total_read;
|
||||||
bool failed;
|
bool failed;
|
||||||
} LoadgameState;
|
};
|
||||||
|
|
||||||
/* OldChunk-Type */
|
/* OldChunk-Type */
|
||||||
typedef enum OldChunkTypes {
|
enum OldChunkType {
|
||||||
OC_SIMPLE = 0,
|
OC_SIMPLE = 0,
|
||||||
OC_NULL = 1,
|
OC_NULL = 1,
|
||||||
OC_CHUNK = 2,
|
OC_CHUNK = 2,
|
||||||
|
@ -78,20 +78,20 @@ typedef enum OldChunkTypes {
|
||||||
OC_TILE = OC_VAR_U32 | OC_FILE_U16,
|
OC_TILE = OC_VAR_U32 | OC_FILE_U16,
|
||||||
|
|
||||||
OC_END = 0 ///< End of the whole chunk, all 32bits set to zero
|
OC_END = 0 ///< End of the whole chunk, all 32bits set to zero
|
||||||
} OldChunkType;
|
};
|
||||||
|
|
||||||
DECLARE_ENUM_AS_BIT_SET(OldChunkType);
|
DECLARE_ENUM_AS_BIT_SET(OldChunkType);
|
||||||
|
|
||||||
typedef bool OldChunkProc(LoadgameState *ls, int num);
|
typedef bool OldChunkProc(LoadgameState *ls, int num);
|
||||||
|
|
||||||
typedef struct OldChunks {
|
struct OldChunks {
|
||||||
OldChunkType type; ///< Type of field
|
OldChunkType type; ///< Type of field
|
||||||
uint32 amount; ///< Amount of fields
|
uint32 amount; ///< Amount of fields
|
||||||
|
|
||||||
void *ptr; ///< Pointer where to save the data (may only be set if offset is 0)
|
void *ptr; ///< Pointer where to save the data (may only be set if offset is 0)
|
||||||
uint offset; ///< Offset from basepointer (may only be set if ptr is NULL)
|
uint offset; ///< Offset from basepointer (may only be set if ptr is NULL)
|
||||||
OldChunkProc *proc; ///< Pointer to function that is called with OC_CHUNK
|
OldChunkProc *proc; ///< Pointer to function that is called with OC_CHUNK
|
||||||
} OldChunks;
|
};
|
||||||
|
|
||||||
/* If it fails, check lines above.. */
|
/* If it fails, check lines above.. */
|
||||||
assert_compile(sizeof(TileIndex) == 4);
|
assert_compile(sizeof(TileIndex) == 4);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#ifndef OLDPOOL_H
|
#ifndef OLDPOOL_H
|
||||||
#define OLDPOOL_H
|
#define OLDPOOL_H
|
||||||
|
|
||||||
typedef struct OldMemoryPool OldMemoryPool;
|
struct OldMemoryPool;
|
||||||
|
|
||||||
/* The function that is called after a new block is added
|
/* The function that is called after a new block is added
|
||||||
start_item is the first item of the new made block */
|
start_item is the first item of the new made block */
|
||||||
|
|
|
@ -11,43 +11,43 @@
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
|
||||||
typedef struct Oblong {
|
struct Oblong {
|
||||||
int x, y;
|
int x, y;
|
||||||
int width, height;
|
int width, height;
|
||||||
} Oblong;
|
};
|
||||||
|
|
||||||
typedef struct BoundingRect {
|
struct BoundingRect {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
} BoundingRect;
|
};
|
||||||
|
|
||||||
typedef struct Pair {
|
struct Pair {
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
} Pair;
|
};
|
||||||
|
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "slope.h"
|
#include "slope.h"
|
||||||
|
|
||||||
// Forward declarations of structs.
|
// Forward declarations of structs.
|
||||||
typedef struct Vehicle Vehicle;
|
struct Vehicle;
|
||||||
typedef struct Depot Depot;
|
struct Depot;
|
||||||
typedef struct Waypoint Waypoint;
|
struct Waypoint;
|
||||||
typedef struct Window Window;
|
struct Window;
|
||||||
typedef struct Station Station;
|
struct Station;
|
||||||
typedef struct ViewPort ViewPort;
|
struct ViewPort;
|
||||||
typedef struct Town Town;
|
struct Town;
|
||||||
typedef struct NewsItem NewsItem;
|
struct NewsItem;
|
||||||
typedef struct Industry Industry;
|
struct Industry;
|
||||||
typedef struct DrawPixelInfo DrawPixelInfo;
|
struct DrawPixelInfo;
|
||||||
typedef byte VehicleOrderID; ///< The index of an order within its current vehicle (not pool related)
|
typedef byte VehicleOrderID; ///< The index of an order within its current vehicle (not pool related)
|
||||||
typedef byte CargoID;
|
typedef byte CargoID;
|
||||||
typedef byte LandscapeID;
|
typedef byte LandscapeID;
|
||||||
typedef uint32 SpriteID; ///< The number of a sprite, without mapping bits and colortables
|
typedef uint32 SpriteID; ///< The number of a sprite, without mapping bits and colortables
|
||||||
typedef struct PalSpriteID {
|
struct PalSpriteID {
|
||||||
SpriteID sprite;
|
SpriteID sprite;
|
||||||
SpriteID pal;
|
SpriteID pal;
|
||||||
} PalSpriteID;
|
};
|
||||||
typedef uint16 EngineID;
|
typedef uint16 EngineID;
|
||||||
typedef uint16 UnitID;
|
typedef uint16 UnitID;
|
||||||
typedef uint16 StringID;
|
typedef uint16 StringID;
|
||||||
|
@ -140,7 +140,7 @@ typedef TinyEnumT<Owner> OwnerByte;
|
||||||
typedef OwnerByte PlayerByte;
|
typedef OwnerByte PlayerByte;
|
||||||
|
|
||||||
|
|
||||||
typedef enum TransportTypes {
|
enum TransportType {
|
||||||
/* These constants are for now linked to the representation of bridges
|
/* These constants are for now linked to the representation of bridges
|
||||||
* and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge.
|
* and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge.
|
||||||
* In an ideal world, these constants would be used everywhere when
|
* In an ideal world, these constants would be used everywhere when
|
||||||
|
@ -153,20 +153,20 @@ typedef enum TransportTypes {
|
||||||
TRANSPORT_WATER, // = 2
|
TRANSPORT_WATER, // = 2
|
||||||
TRANSPORT_END,
|
TRANSPORT_END,
|
||||||
INVALID_TRANSPORT = 0xff,
|
INVALID_TRANSPORT = 0xff,
|
||||||
} TransportType;
|
};
|
||||||
|
|
||||||
/** Define basic enum properties */
|
/** Define basic enum properties */
|
||||||
template <> struct EnumPropsT<TransportType> : MakeEnumPropsT<TransportType, byte, TRANSPORT_BEGIN, TRANSPORT_END, INVALID_TRANSPORT> {};
|
template <> struct EnumPropsT<TransportType> : MakeEnumPropsT<TransportType, byte, TRANSPORT_BEGIN, TRANSPORT_END, INVALID_TRANSPORT> {};
|
||||||
typedef TinyEnumT<TransportType> TransportTypeByte;
|
typedef TinyEnumT<TransportType> TransportTypeByte;
|
||||||
|
|
||||||
|
|
||||||
typedef struct TileInfo {
|
struct TileInfo {
|
||||||
uint x;
|
uint x;
|
||||||
uint y;
|
uint y;
|
||||||
Slope tileh;
|
Slope tileh;
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
uint z;
|
uint z;
|
||||||
} TileInfo;
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Display Options */
|
/* Display Options */
|
||||||
|
@ -195,7 +195,7 @@ enum {
|
||||||
NUM_PRICES = 49,
|
NUM_PRICES = 49,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct Prices {
|
struct Prices {
|
||||||
int32 station_value;
|
int32 station_value;
|
||||||
int32 build_rail;
|
int32 build_rail;
|
||||||
int32 build_road;
|
int32 build_road;
|
||||||
|
@ -243,11 +243,11 @@ typedef struct Prices {
|
||||||
int32 roadveh_running;
|
int32 roadveh_running;
|
||||||
int32 ship_running;
|
int32 ship_running;
|
||||||
int32 build_industry;
|
int32 build_industry;
|
||||||
} Prices;
|
};
|
||||||
|
|
||||||
#define GAME_DIFFICULTY_NUM 18
|
#define GAME_DIFFICULTY_NUM 18
|
||||||
|
|
||||||
typedef struct GameDifficulty {
|
struct GameDifficulty {
|
||||||
int max_no_competitors;
|
int max_no_competitors;
|
||||||
int competitor_start_time;
|
int competitor_start_time;
|
||||||
int number_towns;
|
int number_towns;
|
||||||
|
@ -266,7 +266,7 @@ typedef struct GameDifficulty {
|
||||||
int line_reverse_mode;
|
int line_reverse_mode;
|
||||||
int disasters;
|
int disasters;
|
||||||
int town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff
|
int town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff
|
||||||
} GameDifficulty;
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
// Temperate
|
// Temperate
|
||||||
|
@ -317,18 +317,18 @@ enum {
|
||||||
|
|
||||||
typedef uint AcceptedCargo[NUM_CARGO];
|
typedef uint AcceptedCargo[NUM_CARGO];
|
||||||
|
|
||||||
typedef struct TileDesc {
|
struct TileDesc {
|
||||||
StringID str;
|
StringID str;
|
||||||
Owner owner;
|
Owner owner;
|
||||||
Date build_date;
|
Date build_date;
|
||||||
uint32 dparam[2];
|
uint32 dparam[2];
|
||||||
} TileDesc;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct ViewportSign {
|
||||||
int32 left;
|
int32 left;
|
||||||
int32 top;
|
int32 top;
|
||||||
byte width_1, width_2;
|
byte width_1, width_2;
|
||||||
} ViewportSign;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef void DrawTileProc(TileInfo *ti);
|
typedef void DrawTileProc(TileInfo *ti);
|
||||||
|
@ -365,7 +365,7 @@ typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID n
|
||||||
typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y);
|
typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y);
|
||||||
typedef Slope GetSlopeTilehProc(TileIndex, Slope tileh);
|
typedef Slope GetSlopeTilehProc(TileIndex, Slope tileh);
|
||||||
|
|
||||||
typedef struct {
|
struct TileTypeProcs {
|
||||||
DrawTileProc *draw_tile_proc;
|
DrawTileProc *draw_tile_proc;
|
||||||
GetSlopeZProc *get_slope_z_proc;
|
GetSlopeZProc *get_slope_z_proc;
|
||||||
ClearTileProc *clear_tile_proc;
|
ClearTileProc *clear_tile_proc;
|
||||||
|
@ -379,7 +379,7 @@ typedef struct {
|
||||||
GetProducedCargoProc *get_produced_cargo_proc;
|
GetProducedCargoProc *get_produced_cargo_proc;
|
||||||
VehicleEnterTileProc *vehicle_enter_tile_proc;
|
VehicleEnterTileProc *vehicle_enter_tile_proc;
|
||||||
GetSlopeTilehProc *get_slope_tileh_proc;
|
GetSlopeTilehProc *get_slope_tileh_proc;
|
||||||
} TileTypeProcs;
|
};
|
||||||
|
|
||||||
|
|
||||||
enum WindowClass {
|
enum WindowClass {
|
||||||
|
@ -575,11 +575,11 @@ VARDEF byte _no_scroll;
|
||||||
/** To have a concurrently running thread interface with the main program, use
|
/** To have a concurrently running thread interface with the main program, use
|
||||||
* the OTTD_SendThreadMessage() function. Actions to perform upon the message are handled
|
* the OTTD_SendThreadMessage() function. Actions to perform upon the message are handled
|
||||||
* in the ProcessSentMessage() function */
|
* in the ProcessSentMessage() function */
|
||||||
typedef enum ThreadMsgs {
|
enum ThreadMsg {
|
||||||
MSG_OTTD_NO_MESSAGE,
|
MSG_OTTD_NO_MESSAGE,
|
||||||
MSG_OTTD_SAVETHREAD_DONE,
|
MSG_OTTD_SAVETHREAD_DONE,
|
||||||
MSG_OTTD_SAVETHREAD_ERROR,
|
MSG_OTTD_SAVETHREAD_ERROR,
|
||||||
} ThreadMsg;
|
};
|
||||||
|
|
||||||
void OTTD_SendThreadMessage(ThreadMsg msg);
|
void OTTD_SendThreadMessage(ThreadMsg msg);
|
||||||
|
|
||||||
|
|
10
src/order.h
10
src/order.h
|
@ -88,8 +88,8 @@ enum {
|
||||||
* - Vehicle -> current_order
|
* - Vehicle -> current_order
|
||||||
* - REF_SHEDULE (all REFs are currently limited to 16 bits!!)
|
* - REF_SHEDULE (all REFs are currently limited to 16 bits!!)
|
||||||
*/
|
*/
|
||||||
typedef struct Order {
|
struct Order {
|
||||||
struct Order *next; ///< Pointer to next order. If NULL, end of list
|
Order *next; ///< Pointer to next order. If NULL, end of list
|
||||||
|
|
||||||
OrderTypeByte type;
|
OrderTypeByte type;
|
||||||
uint8 flags;
|
uint8 flags;
|
||||||
|
@ -99,17 +99,17 @@ typedef struct Order {
|
||||||
|
|
||||||
CargoID refit_cargo; // Refit CargoID
|
CargoID refit_cargo; // Refit CargoID
|
||||||
byte refit_subtype; // Refit subtype
|
byte refit_subtype; // Refit subtype
|
||||||
} Order;
|
};
|
||||||
|
|
||||||
#define MAX_BACKUP_ORDER_COUNT 40
|
#define MAX_BACKUP_ORDER_COUNT 40
|
||||||
|
|
||||||
typedef struct {
|
struct BackuppedOrders {
|
||||||
VehicleID clone;
|
VehicleID clone;
|
||||||
VehicleOrderID orderindex;
|
VehicleOrderID orderindex;
|
||||||
Order order[MAX_BACKUP_ORDER_COUNT + 1];
|
Order order[MAX_BACKUP_ORDER_COUNT + 1];
|
||||||
uint16 service_interval;
|
uint16 service_interval;
|
||||||
char name[32];
|
char name[32];
|
||||||
} BackuppedOrders;
|
};
|
||||||
|
|
||||||
VARDEF TileIndex _backup_orders_tile;
|
VARDEF TileIndex _backup_orders_tile;
|
||||||
VARDEF BackuppedOrders _backup_orders_data[1];
|
VARDEF BackuppedOrders _backup_orders_data[1];
|
||||||
|
|
|
@ -423,7 +423,7 @@ void FollowTrack(TileIndex tile, uint16 flags, DiagDirection direction, TPFEnumP
|
||||||
after_proc(&tpf);
|
after_proc(&tpf);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
struct StackedItem {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
uint16 cur_length; // This is the current length to this tile.
|
uint16 cur_length; // This is the current length to this tile.
|
||||||
uint16 priority; // This is the current length + estimated length to the goal.
|
uint16 priority; // This is the current length + estimated length to the goal.
|
||||||
|
@ -431,7 +431,7 @@ typedef struct {
|
||||||
byte depth;
|
byte depth;
|
||||||
byte state;
|
byte state;
|
||||||
byte first_track;
|
byte first_track;
|
||||||
} StackedItem;
|
};
|
||||||
|
|
||||||
static const Trackdir _new_trackdir[6][4] = {
|
static const Trackdir _new_trackdir[6][4] = {
|
||||||
{TRACKDIR_X_NE, INVALID_TRACKDIR, TRACKDIR_X_SW, INVALID_TRACKDIR,},
|
{TRACKDIR_X_NE, INVALID_TRACKDIR, TRACKDIR_X_SW, INVALID_TRACKDIR,},
|
||||||
|
@ -442,13 +442,13 @@ static const Trackdir _new_trackdir[6][4] = {
|
||||||
{INVALID_TRACKDIR, INVALID_TRACKDIR, TRACKDIR_RIGHT_S, TRACKDIR_RIGHT_N,},
|
{INVALID_TRACKDIR, INVALID_TRACKDIR, TRACKDIR_RIGHT_S, TRACKDIR_RIGHT_N,},
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct HashLink {
|
struct HashLink {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
uint16 typelength;
|
uint16 typelength;
|
||||||
uint16 next;
|
uint16 next;
|
||||||
} HashLink;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct NewTrackPathFinder {
|
||||||
NTPEnumProc *enum_proc;
|
NTPEnumProc *enum_proc;
|
||||||
void *userdata;
|
void *userdata;
|
||||||
TileIndex dest;
|
TileIndex dest;
|
||||||
|
@ -468,7 +468,7 @@ typedef struct {
|
||||||
|
|
||||||
HashLink links[0x400]; // hash links
|
HashLink links[0x400]; // hash links
|
||||||
|
|
||||||
} NewTrackPathFinder;
|
};
|
||||||
#define NTP_GET_LINK_OFFS(tpf, link) ((byte*)(link) - (byte*)tpf->links)
|
#define NTP_GET_LINK_OFFS(tpf, link) ((byte*)(link) - (byte*)tpf->links)
|
||||||
#define NTP_GET_LINK_PTR(tpf, link_offs) (HashLink*)((byte*)tpf->links + (link_offs))
|
#define NTP_GET_LINK_PTR(tpf, link_offs) (HashLink*)((byte*)tpf->links + (link_offs))
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ enum {
|
||||||
//#define PF_BENCH // perform simple benchmarks on the train pathfinder (not
|
//#define PF_BENCH // perform simple benchmarks on the train pathfinder (not
|
||||||
//supported on all archs)
|
//supported on all archs)
|
||||||
|
|
||||||
typedef struct TrackPathFinder TrackPathFinder;
|
struct TrackPathFinder;
|
||||||
typedef bool TPFEnumProc(TileIndex tile, void *data, Trackdir trackdir, uint length, byte *state);
|
typedef bool TPFEnumProc(TileIndex tile, void *data, Trackdir trackdir, uint length, byte *state);
|
||||||
typedef void TPFAfterProc(TrackPathFinder *tpf);
|
typedef void TPFAfterProc(TrackPathFinder *tpf);
|
||||||
|
|
||||||
|
@ -30,17 +30,17 @@ typedef bool NTPEnumProc(TileIndex tile, void *data, int track, uint length);
|
||||||
*/
|
*/
|
||||||
#define PATHFIND_HASH_TILE(tile) (TileX(tile) & 0x1F) + ((TileY(tile) & 0x1F) << 5)
|
#define PATHFIND_HASH_TILE(tile) (TileX(tile) & 0x1F) + ((TileY(tile) & 0x1F) << 5)
|
||||||
|
|
||||||
typedef struct TrackPathFinderLink {
|
struct TrackPathFinderLink {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
uint16 flags;
|
uint16 flags;
|
||||||
uint16 next;
|
uint16 next;
|
||||||
} TrackPathFinderLink;
|
};
|
||||||
|
|
||||||
typedef struct RememberData {
|
struct RememberData {
|
||||||
uint16 cur_length;
|
uint16 cur_length;
|
||||||
byte depth;
|
byte depth;
|
||||||
byte pft_var6;
|
byte pft_var6;
|
||||||
} RememberData;
|
};
|
||||||
|
|
||||||
struct TrackPathFinder {
|
struct TrackPathFinder {
|
||||||
int num_links_left;
|
int num_links_left;
|
||||||
|
@ -67,10 +67,10 @@ struct TrackPathFinder {
|
||||||
|
|
||||||
void FollowTrack(TileIndex tile, uint16 flags, DiagDirection direction, TPFEnumProc* enum_proc, TPFAfterProc* after_proc, void* data);
|
void FollowTrack(TileIndex tile, uint16 flags, DiagDirection direction, TPFEnumProc* enum_proc, TPFAfterProc* after_proc, void* data);
|
||||||
|
|
||||||
typedef struct {
|
struct FindLengthOfTunnelResult {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
int length;
|
int length;
|
||||||
} FindLengthOfTunnelResult;
|
};
|
||||||
FindLengthOfTunnelResult FindLengthOfTunnel(TileIndex tile, DiagDirection direction);
|
FindLengthOfTunnelResult FindLengthOfTunnel(TileIndex tile, DiagDirection direction);
|
||||||
|
|
||||||
void NewTrainPathfind(TileIndex tile, TileIndex dest, RailTypeMask railtypes, DiagDirection direction, NTPEnumProc* enum_proc, void* data);
|
void NewTrainPathfind(TileIndex tile, TileIndex dest, RailTypeMask railtypes, DiagDirection direction, NTPEnumProc* enum_proc, void* data);
|
||||||
|
|
32
src/player.h
32
src/player.h
|
@ -9,15 +9,15 @@
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "livery.h"
|
#include "livery.h"
|
||||||
|
|
||||||
typedef struct PlayerEconomyEntry {
|
struct PlayerEconomyEntry {
|
||||||
int32 income;
|
int32 income;
|
||||||
int32 expenses;
|
int32 expenses;
|
||||||
int32 delivered_cargo;
|
int32 delivered_cargo;
|
||||||
int32 performance_history; // player score (scale 0-1000)
|
int32 performance_history; // player score (scale 0-1000)
|
||||||
int64 company_value;
|
int64 company_value;
|
||||||
} PlayerEconomyEntry;
|
};
|
||||||
|
|
||||||
typedef struct AiBuildRec {
|
struct AiBuildRec {
|
||||||
TileIndex spec_tile;
|
TileIndex spec_tile;
|
||||||
TileIndex use_tile;
|
TileIndex use_tile;
|
||||||
byte rand_rng;
|
byte rand_rng;
|
||||||
|
@ -28,9 +28,9 @@ typedef struct AiBuildRec {
|
||||||
byte buildcmd_b;
|
byte buildcmd_b;
|
||||||
byte direction;
|
byte direction;
|
||||||
CargoID cargo;
|
CargoID cargo;
|
||||||
} AiBuildRec;
|
};
|
||||||
|
|
||||||
typedef struct PlayerAI {
|
struct PlayerAI {
|
||||||
byte state;
|
byte state;
|
||||||
byte tick; // Used to determine how often to move
|
byte tick; // Used to determine how often to move
|
||||||
uint32 state_counter; // Can hold tile index!
|
uint32 state_counter; // Can hold tile index!
|
||||||
|
@ -68,9 +68,9 @@ typedef struct PlayerAI {
|
||||||
|
|
||||||
TileIndex banned_tiles[16];
|
TileIndex banned_tiles[16];
|
||||||
byte banned_val[16];
|
byte banned_val[16];
|
||||||
} PlayerAI;
|
};
|
||||||
|
|
||||||
typedef struct Ai_PathFinderInfo {
|
struct Ai_PathFinderInfo {
|
||||||
TileIndex start_tile_tl; // tl = top-left
|
TileIndex start_tile_tl; // tl = top-left
|
||||||
TileIndex start_tile_br; // br = bottom-right
|
TileIndex start_tile_br; // br = bottom-right
|
||||||
TileIndex end_tile_tl; // tl = top-left
|
TileIndex end_tile_tl; // tl = top-left
|
||||||
|
@ -84,17 +84,17 @@ typedef struct Ai_PathFinderInfo {
|
||||||
int position; // Current position in the build-path, needed to build the path
|
int position; // Current position in the build-path, needed to build the path
|
||||||
|
|
||||||
bool rail_or_road; // true = rail, false = road
|
bool rail_or_road; // true = rail, false = road
|
||||||
} Ai_PathFinderInfo;
|
};
|
||||||
|
|
||||||
// The amount of memory reserved for the AI-special-vehicles
|
// The amount of memory reserved for the AI-special-vehicles
|
||||||
#define AI_MAX_SPECIAL_VEHICLES 100
|
#define AI_MAX_SPECIAL_VEHICLES 100
|
||||||
|
|
||||||
typedef struct Ai_SpecialVehicle {
|
struct Ai_SpecialVehicle {
|
||||||
VehicleID veh_id;
|
VehicleID veh_id;
|
||||||
uint32 flag;
|
uint32 flag;
|
||||||
} Ai_SpecialVehicle;
|
};
|
||||||
|
|
||||||
typedef struct PlayerAiNew {
|
struct PlayerAiNew {
|
||||||
uint8 state;
|
uint8 state;
|
||||||
uint tick;
|
uint tick;
|
||||||
uint idle;
|
uint idle;
|
||||||
|
@ -144,12 +144,12 @@ typedef struct PlayerAiNew {
|
||||||
int to_ic;
|
int to_ic;
|
||||||
byte to_type;
|
byte to_type;
|
||||||
|
|
||||||
} PlayerAiNew;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef uint32 PlayerFace;
|
typedef uint32 PlayerFace;
|
||||||
|
|
||||||
typedef struct Player {
|
struct Player {
|
||||||
uint32 name_2;
|
uint32 name_2;
|
||||||
uint16 name_1;
|
uint16 name_1;
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ typedef struct Player {
|
||||||
int16 engine_renew_months;
|
int16 engine_renew_months;
|
||||||
uint32 engine_renew_money;
|
uint32 engine_renew_money;
|
||||||
uint16 num_engines[TOTAL_NUM_ENGINES]; // caches the number of engines of each type the player owns (no need to save this)
|
uint16 num_engines[TOTAL_NUM_ENGINES]; // caches the number of engines of each type the player owns (no need to save this)
|
||||||
} Player;
|
};
|
||||||
|
|
||||||
uint16 GetDrawStringPlayerColor(PlayerID player);
|
uint16 GetDrawStringPlayerColor(PlayerID player);
|
||||||
|
|
||||||
|
@ -282,11 +282,11 @@ static inline RailType GetBestRailtype(const Player* p)
|
||||||
return RAILTYPE_RAIL;
|
return RAILTYPE_RAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct HighScore {
|
struct HighScore {
|
||||||
char company[100];
|
char company[100];
|
||||||
StringID title; // NO_SAVE, has troubles with changing string-numbers.
|
StringID title; // NO_SAVE, has troubles with changing string-numbers.
|
||||||
uint16 score; // do NOT change type, will break hs.dat
|
uint16 score; // do NOT change type, will break hs.dat
|
||||||
} HighScore;
|
};
|
||||||
|
|
||||||
VARDEF HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
|
VARDEF HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
|
||||||
void SaveToHighScore();
|
void SaveToHighScore();
|
||||||
|
|
|
@ -286,10 +286,10 @@ static const byte livery_height[] = {
|
||||||
3,
|
3,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct livery_d {
|
struct livery_d {
|
||||||
uint32 sel;
|
uint32 sel;
|
||||||
LiveryClass livery_class;
|
LiveryClass livery_class;
|
||||||
} livery_d;
|
};
|
||||||
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(livery_d));
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(livery_d));
|
||||||
|
|
||||||
static void ShowColourDropDownMenu(Window *w, uint32 widget)
|
static void ShowColourDropDownMenu(Window *w, uint32 widget)
|
||||||
|
|
|
@ -9,21 +9,19 @@
|
||||||
//#define HASH_STATS
|
//#define HASH_STATS
|
||||||
|
|
||||||
|
|
||||||
typedef struct Queue Queue;
|
struct Queue;
|
||||||
typedef bool Queue_PushProc(Queue* q, void* item, int priority);
|
typedef bool Queue_PushProc(Queue* q, void* item, int priority);
|
||||||
typedef void* Queue_PopProc(Queue* q);
|
typedef void* Queue_PopProc(Queue* q);
|
||||||
typedef bool Queue_DeleteProc(Queue* q, void* item, int priority);
|
typedef bool Queue_DeleteProc(Queue* q, void* item, int priority);
|
||||||
typedef void Queue_ClearProc(Queue* q, bool free_values);
|
typedef void Queue_ClearProc(Queue* q, bool free_values);
|
||||||
typedef void Queue_FreeProc(Queue* q, bool free_values);
|
typedef void Queue_FreeProc(Queue* q, bool free_values);
|
||||||
|
|
||||||
typedef struct InsSortNode InsSortNode;
|
|
||||||
struct InsSortNode {
|
struct InsSortNode {
|
||||||
void* item;
|
void* item;
|
||||||
int priority;
|
int priority;
|
||||||
InsSortNode* next;
|
InsSortNode* next;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct BinaryHeapNode BinaryHeapNode;
|
|
||||||
struct BinaryHeapNode {
|
struct BinaryHeapNode {
|
||||||
void* item;
|
void* item;
|
||||||
int priority;
|
int priority;
|
||||||
|
@ -99,7 +97,6 @@ void init_BinaryHeap(Queue* q, uint max_size);
|
||||||
/*
|
/*
|
||||||
* Hash
|
* Hash
|
||||||
*/
|
*/
|
||||||
typedef struct HashNode HashNode;
|
|
||||||
struct HashNode {
|
struct HashNode {
|
||||||
uint key1;
|
uint key1;
|
||||||
uint key2;
|
uint key2;
|
||||||
|
@ -111,7 +108,7 @@ struct HashNode {
|
||||||
* the resulting range is clearly defined.
|
* the resulting range is clearly defined.
|
||||||
*/
|
*/
|
||||||
typedef uint Hash_HashProc(uint key1, uint key2);
|
typedef uint Hash_HashProc(uint key1, uint key2);
|
||||||
typedef struct Hash {
|
struct Hash {
|
||||||
/* The hash function used */
|
/* The hash function used */
|
||||||
Hash_HashProc* hash;
|
Hash_HashProc* hash;
|
||||||
/* The amount of items in the hash */
|
/* The amount of items in the hash */
|
||||||
|
@ -123,7 +120,7 @@ typedef struct Hash {
|
||||||
/* A pointer to an array of numbuckets booleans, which will be true if
|
/* A pointer to an array of numbuckets booleans, which will be true if
|
||||||
* there are any Nodes in the bucket */
|
* there are any Nodes in the bucket */
|
||||||
bool* buckets_in_use;
|
bool* buckets_in_use;
|
||||||
} Hash;
|
};
|
||||||
|
|
||||||
/* Call these function to manipulate a hash */
|
/* Call these function to manipulate a hash */
|
||||||
|
|
||||||
|
|
24
src/rail.h
24
src/rail.h
|
@ -9,7 +9,7 @@
|
||||||
#include "direction.h"
|
#include "direction.h"
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
|
|
||||||
typedef enum RailTypes {
|
enum RailType {
|
||||||
RAILTYPE_BEGIN = 0,
|
RAILTYPE_BEGIN = 0,
|
||||||
RAILTYPE_RAIL = 0,
|
RAILTYPE_RAIL = 0,
|
||||||
RAILTYPE_ELECTRIC = 1,
|
RAILTYPE_ELECTRIC = 1,
|
||||||
|
@ -17,7 +17,7 @@ typedef enum RailTypes {
|
||||||
RAILTYPE_MAGLEV = 3,
|
RAILTYPE_MAGLEV = 3,
|
||||||
RAILTYPE_END,
|
RAILTYPE_END,
|
||||||
INVALID_RAILTYPE = 0xFF
|
INVALID_RAILTYPE = 0xFF
|
||||||
} RailType;
|
};
|
||||||
|
|
||||||
typedef byte RailTypeMask;
|
typedef byte RailTypeMask;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ typedef TinyEnumT<RailType> RailTypeByte;
|
||||||
|
|
||||||
/** These are used to specify a single track.
|
/** These are used to specify a single track.
|
||||||
* Can be translated to a trackbit with TrackToTrackbit */
|
* Can be translated to a trackbit with TrackToTrackbit */
|
||||||
typedef enum Track {
|
enum Track {
|
||||||
TRACK_BEGIN = 0,
|
TRACK_BEGIN = 0,
|
||||||
TRACK_X = 0,
|
TRACK_X = 0,
|
||||||
TRACK_Y = 1,
|
TRACK_Y = 1,
|
||||||
|
@ -40,7 +40,7 @@ typedef enum Track {
|
||||||
TRACK_RIGHT = 5,
|
TRACK_RIGHT = 5,
|
||||||
TRACK_END,
|
TRACK_END,
|
||||||
INVALID_TRACK = 0xFF
|
INVALID_TRACK = 0xFF
|
||||||
} Track;
|
};
|
||||||
|
|
||||||
/** Allow incrementing of Track variables */
|
/** Allow incrementing of Track variables */
|
||||||
DECLARE_POSTFIX_INCREMENT(Track);
|
DECLARE_POSTFIX_INCREMENT(Track);
|
||||||
|
@ -61,7 +61,7 @@ static inline Track AxisToTrack(Axis a)
|
||||||
|
|
||||||
|
|
||||||
/** Bitfield corresponding to Track */
|
/** Bitfield corresponding to Track */
|
||||||
typedef enum TrackBits {
|
enum TrackBits {
|
||||||
TRACK_BIT_NONE = 0U,
|
TRACK_BIT_NONE = 0U,
|
||||||
TRACK_BIT_X = 1U << TRACK_X,
|
TRACK_BIT_X = 1U << TRACK_X,
|
||||||
TRACK_BIT_Y = 1U << TRACK_Y,
|
TRACK_BIT_Y = 1U << TRACK_Y,
|
||||||
|
@ -81,7 +81,7 @@ typedef enum TrackBits {
|
||||||
TRACK_BIT_WORMHOLE = 0x40U,
|
TRACK_BIT_WORMHOLE = 0x40U,
|
||||||
TRACK_BIT_DEPOT = 0x80U,
|
TRACK_BIT_DEPOT = 0x80U,
|
||||||
INVALID_TRACK_BIT = 0xFF
|
INVALID_TRACK_BIT = 0xFF
|
||||||
} TrackBits;
|
};
|
||||||
|
|
||||||
/** Define basic enum properties */
|
/** Define basic enum properties */
|
||||||
template <> struct EnumPropsT<TrackBits> : MakeEnumPropsT<TrackBits, byte, TRACK_BIT_NONE, TRACK_BIT_ALL, INVALID_TRACK_BIT> {};
|
template <> struct EnumPropsT<TrackBits> : MakeEnumPropsT<TrackBits, byte, TRACK_BIT_NONE, TRACK_BIT_ALL, INVALID_TRACK_BIT> {};
|
||||||
|
@ -110,7 +110,7 @@ static inline TrackBits AxisToTrackBits(Axis a)
|
||||||
* reversing track dirs are not considered to be 'valid' except in a small
|
* reversing track dirs are not considered to be 'valid' except in a small
|
||||||
* corner in the road vehicle controller.
|
* corner in the road vehicle controller.
|
||||||
*/
|
*/
|
||||||
typedef enum Trackdirs {
|
enum Trackdir {
|
||||||
TRACKDIR_BEGIN = 0,
|
TRACKDIR_BEGIN = 0,
|
||||||
TRACKDIR_X_NE = 0,
|
TRACKDIR_X_NE = 0,
|
||||||
TRACKDIR_Y_SE = 1,
|
TRACKDIR_Y_SE = 1,
|
||||||
|
@ -130,7 +130,7 @@ typedef enum Trackdirs {
|
||||||
TRACKDIR_RVREV_NW = 15,
|
TRACKDIR_RVREV_NW = 15,
|
||||||
TRACKDIR_END,
|
TRACKDIR_END,
|
||||||
INVALID_TRACKDIR = 0xFF,
|
INVALID_TRACKDIR = 0xFF,
|
||||||
} Trackdir;
|
};
|
||||||
|
|
||||||
/** Define basic enum properties */
|
/** Define basic enum properties */
|
||||||
template <> struct EnumPropsT<Trackdir> : MakeEnumPropsT<Trackdir, byte, TRACKDIR_BEGIN, TRACKDIR_END, INVALID_TRACKDIR> {};
|
template <> struct EnumPropsT<Trackdir> : MakeEnumPropsT<Trackdir, byte, TRACKDIR_BEGIN, TRACKDIR_END, INVALID_TRACKDIR> {};
|
||||||
|
@ -138,7 +138,7 @@ typedef TinyEnumT<Trackdir> TrackdirByte;
|
||||||
|
|
||||||
/** These are a combination of tracks and directions. Values are 0-5 in one
|
/** These are a combination of tracks and directions. Values are 0-5 in one
|
||||||
* direction (corresponding to the Track enum) and 8-13 in the other direction. */
|
* direction (corresponding to the Track enum) and 8-13 in the other direction. */
|
||||||
typedef enum TrackdirBits {
|
enum TrackdirBits {
|
||||||
TRACKDIR_BIT_NONE = 0x0000,
|
TRACKDIR_BIT_NONE = 0x0000,
|
||||||
TRACKDIR_BIT_X_NE = 0x0001,
|
TRACKDIR_BIT_X_NE = 0x0001,
|
||||||
TRACKDIR_BIT_Y_SE = 0x0002,
|
TRACKDIR_BIT_Y_SE = 0x0002,
|
||||||
|
@ -155,7 +155,7 @@ typedef enum TrackdirBits {
|
||||||
TRACKDIR_BIT_RIGHT_N = 0x2000,
|
TRACKDIR_BIT_RIGHT_N = 0x2000,
|
||||||
TRACKDIR_BIT_MASK = 0x3F3F,
|
TRACKDIR_BIT_MASK = 0x3F3F,
|
||||||
INVALID_TRACKDIR_BIT = 0xFFFF,
|
INVALID_TRACKDIR_BIT = 0xFFFF,
|
||||||
} TrackdirBits;
|
};
|
||||||
|
|
||||||
/** Define basic enum properties */
|
/** Define basic enum properties */
|
||||||
template <> struct EnumPropsT<TrackdirBits> : MakeEnumPropsT<TrackdirBits, uint16, TRACKDIR_BIT_NONE, TRACKDIR_BIT_MASK, INVALID_TRACKDIR_BIT> {};
|
template <> struct EnumPropsT<TrackdirBits> : MakeEnumPropsT<TrackdirBits, uint16, TRACKDIR_BIT_NONE, TRACKDIR_BIT_MASK, INVALID_TRACKDIR_BIT> {};
|
||||||
|
@ -164,7 +164,7 @@ DECLARE_ENUM_AS_BIT_SET(TrackdirBits);
|
||||||
|
|
||||||
/** This struct contains all the info that is needed to draw and construct tracks.
|
/** This struct contains all the info that is needed to draw and construct tracks.
|
||||||
*/
|
*/
|
||||||
typedef struct RailtypeInfo {
|
struct RailtypeInfo {
|
||||||
/** Struct containing the main sprites. @note not all sprites are listed, but only
|
/** Struct containing the main sprites. @note not all sprites are listed, but only
|
||||||
* the ones used directly in the code */
|
* the ones used directly in the code */
|
||||||
struct {
|
struct {
|
||||||
|
@ -237,7 +237,7 @@ typedef struct RailtypeInfo {
|
||||||
* Offset to add to ground sprite when drawing custom waypoints / stations
|
* Offset to add to ground sprite when drawing custom waypoints / stations
|
||||||
*/
|
*/
|
||||||
byte custom_ground_offset;
|
byte custom_ground_offset;
|
||||||
} RailtypeInfo;
|
};
|
||||||
|
|
||||||
|
|
||||||
// these are the maximums used for updating signal blocks, and checking if a depot is in a pbs block
|
// these are the maximums used for updating signal blocks, and checking if a depot is in a pbs block
|
||||||
|
|
|
@ -1417,7 +1417,7 @@ void DrawDefaultWaypointSprite(int x, int y, RailType railtype)
|
||||||
DrawTileSequence(x, y, dts->ground_sprite + offset, dts->seq, 0);
|
DrawTileSequence(x, y, dts->ground_sprite + offset, dts->seq, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct SetSignalsData {
|
struct SetSignalsData {
|
||||||
int cur;
|
int cur;
|
||||||
int cur_stack;
|
int cur_stack;
|
||||||
bool stop;
|
bool stop;
|
||||||
|
@ -1435,7 +1435,7 @@ typedef struct SetSignalsData {
|
||||||
TileIndex next_tile[NUM_SSD_STACK];
|
TileIndex next_tile[NUM_SSD_STACK];
|
||||||
DiagDirectionByte next_dir[NUM_SSD_STACK];
|
DiagDirectionByte next_dir[NUM_SSD_STACK];
|
||||||
|
|
||||||
} SetSignalsData;
|
};
|
||||||
|
|
||||||
static bool SetSignalsEnumProc(TileIndex tile, void* data, Trackdir trackdir, uint length, byte* state)
|
static bool SetSignalsEnumProc(TileIndex tile, void* data, Trackdir trackdir, uint length, byte* state)
|
||||||
{
|
{
|
||||||
|
@ -1473,10 +1473,10 @@ static bool SetSignalsEnumProc(TileIndex tile, void* data, Trackdir trackdir, ui
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Struct to parse data from VehicleFromPos to SignalVehicleCheckProc */
|
/* Struct to parse data from VehicleFromPos to SignalVehicleCheckProc */
|
||||||
typedef struct SignalVehicleCheckStruct {
|
struct SignalVehicleCheckStruct {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
uint track;
|
uint track;
|
||||||
} SignalVehicleCheckStruct;
|
};
|
||||||
|
|
||||||
static void *SignalVehicleCheckProc(Vehicle *v, void *data)
|
static void *SignalVehicleCheckProc(Vehicle *v, void *data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,12 +8,12 @@
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
|
|
||||||
|
|
||||||
typedef enum RailTileType {
|
enum RailTileType {
|
||||||
RAIL_TILE_NORMAL = 0,
|
RAIL_TILE_NORMAL = 0,
|
||||||
RAIL_TILE_SIGNALS = 1,
|
RAIL_TILE_SIGNALS = 1,
|
||||||
RAIL_TILE_WAYPOINT = 2,
|
RAIL_TILE_WAYPOINT = 2,
|
||||||
RAIL_TILE_DEPOT = 3,
|
RAIL_TILE_DEPOT = 3,
|
||||||
} RailTileType;
|
};
|
||||||
|
|
||||||
static inline RailTileType GetRailTileType(TileIndex t)
|
static inline RailTileType GetRailTileType(TileIndex t)
|
||||||
{
|
{
|
||||||
|
@ -118,12 +118,12 @@ static inline WaypointID GetWaypointIndex(TileIndex t)
|
||||||
return (WaypointID)_m[t].m2;
|
return (WaypointID)_m[t].m2;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef enum SignalType {
|
enum SignalType {
|
||||||
SIGTYPE_NORMAL = 0, // normal signal
|
SIGTYPE_NORMAL = 0, // normal signal
|
||||||
SIGTYPE_ENTRY = 1, // presignal block entry
|
SIGTYPE_ENTRY = 1, // presignal block entry
|
||||||
SIGTYPE_EXIT = 2, // presignal block exit
|
SIGTYPE_EXIT = 2, // presignal block exit
|
||||||
SIGTYPE_COMBO = 3 // presignal inter-block
|
SIGTYPE_COMBO = 3 // presignal inter-block
|
||||||
} SignalType;
|
};
|
||||||
|
|
||||||
static inline SignalType GetSignalType(TileIndex t)
|
static inline SignalType GetSignalType(TileIndex t)
|
||||||
{
|
{
|
||||||
|
@ -159,10 +159,10 @@ static inline void CycleSignalSide(TileIndex t, Track track)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef enum SignalVariant {
|
enum SignalVariant {
|
||||||
SIG_ELECTRIC = 0,
|
SIG_ELECTRIC = 0,
|
||||||
SIG_SEMAPHORE = 1
|
SIG_SEMAPHORE = 1
|
||||||
} SignalVariant;
|
};
|
||||||
|
|
||||||
static inline SignalVariant GetSignalVariant(TileIndex t)
|
static inline SignalVariant GetSignalVariant(TileIndex t)
|
||||||
{
|
{
|
||||||
|
@ -183,10 +183,10 @@ static inline bool IsSignalPresent(TileIndex t, byte signalbit)
|
||||||
* simple boolean logic will do. But do try to compare to this enum instead of
|
* simple boolean logic will do. But do try to compare to this enum instead of
|
||||||
* normal boolean evaluation, since that will make future additions easier.
|
* normal boolean evaluation, since that will make future additions easier.
|
||||||
*/
|
*/
|
||||||
typedef enum SignalStates {
|
enum SignalState {
|
||||||
SIGNAL_STATE_RED = 0,
|
SIGNAL_STATE_RED = 0,
|
||||||
SIGNAL_STATE_GREEN = 1,
|
SIGNAL_STATE_GREEN = 1,
|
||||||
} SignalState;
|
};
|
||||||
|
|
||||||
static inline SignalState GetSingleSignalState(TileIndex t, byte signalbit)
|
static inline SignalState GetSingleSignalState(TileIndex t, byte signalbit)
|
||||||
{
|
{
|
||||||
|
@ -242,7 +242,7 @@ static inline SignalState GetSignalStateByTrackdir(TileIndex tile, Trackdir trac
|
||||||
RailType GetTileRailType(TileIndex tile);
|
RailType GetTileRailType(TileIndex tile);
|
||||||
|
|
||||||
|
|
||||||
typedef enum RailGroundType {
|
enum RailGroundType {
|
||||||
RAIL_GROUND_BARREN = 0,
|
RAIL_GROUND_BARREN = 0,
|
||||||
RAIL_GROUND_GRASS = 1,
|
RAIL_GROUND_GRASS = 1,
|
||||||
RAIL_GROUND_FENCE_NW = 2,
|
RAIL_GROUND_FENCE_NW = 2,
|
||||||
|
@ -256,7 +256,7 @@ typedef enum RailGroundType {
|
||||||
RAIL_GROUND_FENCE_HORIZ1 = 10,
|
RAIL_GROUND_FENCE_HORIZ1 = 10,
|
||||||
RAIL_GROUND_FENCE_HORIZ2 = 11,
|
RAIL_GROUND_FENCE_HORIZ2 = 11,
|
||||||
RAIL_GROUND_ICE_DESERT = 12,
|
RAIL_GROUND_ICE_DESERT = 12,
|
||||||
} RailGroundType;
|
};
|
||||||
|
|
||||||
static inline void SetRailGroundType(TileIndex t, RailGroundType rgt)
|
static inline void SetRailGroundType(TileIndex t, RailGroundType rgt)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
|
||||||
typedef enum RoadBits {
|
enum RoadBits {
|
||||||
ROAD_NONE = 0U,
|
ROAD_NONE = 0U,
|
||||||
ROAD_NW = 1U,
|
ROAD_NW = 1U,
|
||||||
ROAD_SW = 2U,
|
ROAD_SW = 2U,
|
||||||
|
@ -14,7 +14,7 @@ typedef enum RoadBits {
|
||||||
ROAD_X = ROAD_SW | ROAD_NE,
|
ROAD_X = ROAD_SW | ROAD_NE,
|
||||||
ROAD_Y = ROAD_NW | ROAD_SE,
|
ROAD_Y = ROAD_NW | ROAD_SE,
|
||||||
ROAD_ALL = ROAD_X | ROAD_Y
|
ROAD_ALL = ROAD_X | ROAD_Y
|
||||||
} RoadBits;
|
};
|
||||||
|
|
||||||
DECLARE_ENUM_AS_BIT_SET(RoadBits);
|
DECLARE_ENUM_AS_BIT_SET(RoadBits);
|
||||||
|
|
||||||
|
|
|
@ -599,11 +599,11 @@ static int32 ClearTile_Road(TileIndex tile, byte flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct DrawRoadTileStruct {
|
struct DrawRoadTileStruct {
|
||||||
uint16 image;
|
uint16 image;
|
||||||
byte subcoord_x;
|
byte subcoord_x;
|
||||||
byte subcoord_y;
|
byte subcoord_y;
|
||||||
} DrawRoadTileStruct;
|
};
|
||||||
|
|
||||||
#include "table/road_land.h"
|
#include "table/road_land.h"
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
|
|
||||||
|
|
||||||
typedef enum RoadTileType {
|
enum RoadTileType {
|
||||||
ROAD_TILE_NORMAL,
|
ROAD_TILE_NORMAL,
|
||||||
ROAD_TILE_CROSSING,
|
ROAD_TILE_CROSSING,
|
||||||
ROAD_TILE_DEPOT
|
ROAD_TILE_DEPOT
|
||||||
} RoadTileType;
|
};
|
||||||
|
|
||||||
static inline RoadTileType GetRoadTileType(TileIndex t)
|
static inline RoadTileType GetRoadTileType(TileIndex t)
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ static inline void ToggleSnow(TileIndex t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef enum Roadside {
|
enum Roadside {
|
||||||
ROADSIDE_BARREN = 0,
|
ROADSIDE_BARREN = 0,
|
||||||
ROADSIDE_GRASS = 1,
|
ROADSIDE_GRASS = 1,
|
||||||
ROADSIDE_PAVED = 2,
|
ROADSIDE_PAVED = 2,
|
||||||
|
@ -113,7 +113,7 @@ typedef enum Roadside {
|
||||||
ROADSIDE_TREES = 5,
|
ROADSIDE_TREES = 5,
|
||||||
ROADSIDE_GRASS_ROAD_WORKS = 6,
|
ROADSIDE_GRASS_ROAD_WORKS = 6,
|
||||||
ROADSIDE_PAVED_ROAD_WORKS = 7
|
ROADSIDE_PAVED_ROAD_WORKS = 7
|
||||||
} Roadside;
|
};
|
||||||
|
|
||||||
static inline Roadside GetRoadside(TileIndex tile)
|
static inline Roadside GetRoadside(TileIndex tile)
|
||||||
{
|
{
|
||||||
|
|
|
@ -306,11 +306,11 @@ int32 CmdSellRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
return -(int32)v->value;
|
return -(int32)v->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct RoadFindDepotData {
|
struct RoadFindDepotData {
|
||||||
uint best_length;
|
uint best_length;
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
OwnerByte owner;
|
OwnerByte owner;
|
||||||
} RoadFindDepotData;
|
};
|
||||||
|
|
||||||
static const DiagDirection _road_pf_directions[] = {
|
static const DiagDirection _road_pf_directions[] = {
|
||||||
DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_SW, DIAGDIR_SE, INVALID_DIAGDIR, INVALID_DIAGDIR,
|
DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_SW, DIAGDIR_SE, INVALID_DIAGDIR, INVALID_DIAGDIR,
|
||||||
|
@ -785,12 +785,12 @@ static void StartRoadVehSound(const Vehicle* v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct RoadVehFindData {
|
struct RoadVehFindData {
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
const Vehicle* veh;
|
const Vehicle* veh;
|
||||||
Direction dir;
|
Direction dir;
|
||||||
} RoadVehFindData;
|
};
|
||||||
|
|
||||||
static void* EnumCheckRoadVehClose(Vehicle *v, void* data)
|
static void* EnumCheckRoadVehClose(Vehicle *v, void* data)
|
||||||
{
|
{
|
||||||
|
@ -933,12 +933,12 @@ static Direction RoadVehGetSlidingDirection(const Vehicle* v, int x, int y)
|
||||||
return ChangeDir(old_dir, delta);
|
return ChangeDir(old_dir, delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct OvertakeData {
|
struct OvertakeData {
|
||||||
const Vehicle* u;
|
const Vehicle* u;
|
||||||
const Vehicle* v;
|
const Vehicle* v;
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
byte tilebits;
|
byte tilebits;
|
||||||
} OvertakeData;
|
};
|
||||||
|
|
||||||
static void* EnumFindVehToOvertake(Vehicle* v, void* data)
|
static void* EnumFindVehToOvertake(Vehicle* v, void* data)
|
||||||
{
|
{
|
||||||
|
@ -1030,11 +1030,11 @@ static int PickRandomBit(uint bits)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
struct FindRoadToChooseData {
|
||||||
TileIndex dest;
|
TileIndex dest;
|
||||||
uint maxtracklen;
|
uint maxtracklen;
|
||||||
uint mindist;
|
uint mindist;
|
||||||
} FindRoadToChooseData;
|
};
|
||||||
|
|
||||||
static bool EnumRoadTrackFindDist(TileIndex tile, void* data, Trackdir trackdir, uint length, byte* state)
|
static bool EnumRoadTrackFindDist(TileIndex tile, void* data, Trackdir trackdir, uint length, byte* state)
|
||||||
{
|
{
|
||||||
|
@ -1256,9 +1256,9 @@ enum {
|
||||||
RVC_DRIVE_THROUGH_STOP_FRAME = 7
|
RVC_DRIVE_THROUGH_STOP_FRAME = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct RoadDriveEntry {
|
struct RoadDriveEntry {
|
||||||
byte x,y;
|
byte x, y;
|
||||||
} RoadDriveEntry;
|
};
|
||||||
|
|
||||||
#include "table/roadveh.h"
|
#include "table/roadveh.h"
|
||||||
|
|
||||||
|
|
|
@ -1045,12 +1045,12 @@ static void UninitNoComp()
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
|
||||||
typedef struct ThreadedSave {
|
struct ThreadedSave {
|
||||||
uint count;
|
uint count;
|
||||||
byte ff_state;
|
byte ff_state;
|
||||||
bool saveinprogress;
|
bool saveinprogress;
|
||||||
CursorID cursor;
|
CursorID cursor;
|
||||||
} ThreadedSave;
|
};
|
||||||
|
|
||||||
/* A maximum size of of 128K * 500 = 64.000KB savegames */
|
/* A maximum size of of 128K * 500 = 64.000KB savegames */
|
||||||
STATIC_OLD_POOL(Savegame, byte, 17, 500, NULL, NULL)
|
STATIC_OLD_POOL(Savegame, byte, 17, 500, NULL, NULL)
|
||||||
|
@ -1326,7 +1326,7 @@ static void *IntToReference(uint index, SLRefType rt)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The format for a reader/writer type of a savegame */
|
/** The format for a reader/writer type of a savegame */
|
||||||
typedef struct {
|
struct SaveLoadFormat {
|
||||||
const char *name; ///< name of the compressor/decompressor (debug-only)
|
const char *name; ///< name of the compressor/decompressor (debug-only)
|
||||||
uint32 tag; ///< the 4-letter tag by which it is identified in the savegame
|
uint32 tag; ///< the 4-letter tag by which it is identified in the savegame
|
||||||
|
|
||||||
|
@ -1337,7 +1337,7 @@ typedef struct {
|
||||||
bool (*init_write)(); ///< function executed upon intialization of the saver
|
bool (*init_write)(); ///< function executed upon intialization of the saver
|
||||||
WriterProc *writer; ///< function that saves the data to the file
|
WriterProc *writer; ///< function that saves the data to the file
|
||||||
void (*uninit_write)(); ///< function executed when writing is done
|
void (*uninit_write)(); ///< function executed when writing is done
|
||||||
} SaveLoadFormat;
|
};
|
||||||
|
|
||||||
static const SaveLoadFormat _saveload_formats[] = {
|
static const SaveLoadFormat _saveload_formats[] = {
|
||||||
{"memory", 0, NULL, NULL, NULL, InitMem, WriteMem, UnInitMem},
|
{"memory", 0, NULL, NULL, NULL, InitMem, WriteMem, UnInitMem},
|
||||||
|
|
|
@ -9,20 +9,20 @@
|
||||||
|
|
||||||
#define SIZE_MAX ((size_t)-1)
|
#define SIZE_MAX ((size_t)-1)
|
||||||
|
|
||||||
typedef enum SaveOrLoadResult {
|
enum SaveOrLoadResult {
|
||||||
SL_OK = 0, // completed successfully
|
SL_OK = 0, // completed successfully
|
||||||
SL_ERROR = 1, // error that was caught before internal structures were modified
|
SL_ERROR = 1, // error that was caught before internal structures were modified
|
||||||
SL_REINIT = 2, // error that was caught in the middle of updating game state, need to clear it. (can only happen during load)
|
SL_REINIT = 2, // error that was caught in the middle of updating game state, need to clear it. (can only happen during load)
|
||||||
} SaveOrLoadResult;
|
};
|
||||||
|
|
||||||
typedef enum SaveOrLoadMode {
|
enum SaveOrLoadMode {
|
||||||
SL_INVALID = -1,
|
SL_INVALID = -1,
|
||||||
SL_LOAD = 0,
|
SL_LOAD = 0,
|
||||||
SL_SAVE = 1,
|
SL_SAVE = 1,
|
||||||
SL_OLD_LOAD = 2,
|
SL_OLD_LOAD = 2,
|
||||||
SL_PNG = 3,
|
SL_PNG = 3,
|
||||||
SL_BMP = 4,
|
SL_BMP = 4,
|
||||||
} SaveOrLoadMode;
|
};
|
||||||
|
|
||||||
SaveOrLoadResult SaveOrLoad(const char *filename, int mode);
|
SaveOrLoadResult SaveOrLoad(const char *filename, int mode);
|
||||||
void WaitTillSaved();
|
void WaitTillSaved();
|
||||||
|
@ -32,18 +32,18 @@ void DoExitSave();
|
||||||
typedef void ChunkSaveLoadProc();
|
typedef void ChunkSaveLoadProc();
|
||||||
typedef void AutolengthProc(void *arg);
|
typedef void AutolengthProc(void *arg);
|
||||||
|
|
||||||
typedef struct {
|
struct ChunkHandler {
|
||||||
uint32 id;
|
uint32 id;
|
||||||
ChunkSaveLoadProc *save_proc;
|
ChunkSaveLoadProc *save_proc;
|
||||||
ChunkSaveLoadProc *load_proc;
|
ChunkSaveLoadProc *load_proc;
|
||||||
uint32 flags;
|
uint32 flags;
|
||||||
} ChunkHandler;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct NullStruct {
|
||||||
byte null;
|
byte null;
|
||||||
} NullStruct;
|
};
|
||||||
|
|
||||||
typedef enum SLRefType {
|
enum SLRefType {
|
||||||
REF_ORDER = 0,
|
REF_ORDER = 0,
|
||||||
REF_VEHICLE = 1,
|
REF_VEHICLE = 1,
|
||||||
REF_STATION = 2,
|
REF_STATION = 2,
|
||||||
|
@ -51,7 +51,7 @@ typedef enum SLRefType {
|
||||||
REF_VEHICLE_OLD = 4,
|
REF_VEHICLE_OLD = 4,
|
||||||
REF_ROADSTOPS = 5,
|
REF_ROADSTOPS = 5,
|
||||||
REF_ENGINE_RENEWS = 6,
|
REF_ENGINE_RENEWS = 6,
|
||||||
} SLRefType;
|
};
|
||||||
|
|
||||||
#define SL_MAX_VERSION 255
|
#define SL_MAX_VERSION 255
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ enum SaveLoadTypes {
|
||||||
typedef byte SaveLoadType;
|
typedef byte SaveLoadType;
|
||||||
|
|
||||||
/** SaveLoad type struct. Do NOT use this directly but use the SLE_ macros defined just below! */
|
/** SaveLoad type struct. Do NOT use this directly but use the SLE_ macros defined just below! */
|
||||||
typedef struct SaveLoad {
|
struct SaveLoad {
|
||||||
SaveLoadType cmd; ///< the action to take with the saved/loaded type, All types need different action
|
SaveLoadType cmd; ///< the action to take with the saved/loaded type, All types need different action
|
||||||
VarType conv; ///< type of the variable to be saved, int
|
VarType conv; ///< type of the variable to be saved, int
|
||||||
uint16 length; ///< (conditional) length of the variable (eg. arrays) (max array size is 65536 elements)
|
uint16 length; ///< (conditional) length of the variable (eg. arrays) (max array size is 65536 elements)
|
||||||
|
@ -177,7 +177,7 @@ typedef struct SaveLoad {
|
||||||
* during runtime. Decision on which one to use is controlled by the function
|
* during runtime. Decision on which one to use is controlled by the function
|
||||||
* that is called to save it. address: SlGlobList, offset: SlObject */
|
* that is called to save it. address: SlGlobList, offset: SlObject */
|
||||||
void *address; ///< address of variable OR offset of variable in the struct (max offset is 65536)
|
void *address; ///< address of variable OR offset of variable in the struct (max offset is 65536)
|
||||||
} SaveLoad;
|
};
|
||||||
|
|
||||||
/* Same as SaveLoad but global variables are used (for better readability); */
|
/* Same as SaveLoad but global variables are used (for better readability); */
|
||||||
typedef SaveLoad SaveLoadGlobVarList;
|
typedef SaveLoad SaveLoadGlobVarList;
|
||||||
|
|
|
@ -24,11 +24,11 @@ ScreenshotType current_screenshot_type;
|
||||||
typedef void ScreenshotCallback(void *userdata, Pixel *buf, uint y, uint pitch, uint n);
|
typedef void ScreenshotCallback(void *userdata, Pixel *buf, uint y, uint pitch, uint n);
|
||||||
typedef bool ScreenshotHandlerProc(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette);
|
typedef bool ScreenshotHandlerProc(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette);
|
||||||
|
|
||||||
typedef struct {
|
struct ScreenshotFormat {
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *extension;
|
const char *extension;
|
||||||
ScreenshotHandlerProc *proc;
|
ScreenshotHandlerProc *proc;
|
||||||
} ScreenshotFormat;
|
};
|
||||||
|
|
||||||
//************************************************
|
//************************************************
|
||||||
//*** SCREENSHOT CODE FOR WINDOWS BITMAP (.BMP)
|
//*** SCREENSHOT CODE FOR WINDOWS BITMAP (.BMP)
|
||||||
|
@ -37,29 +37,29 @@ typedef struct {
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct BitmapFileHeader {
|
struct BitmapFileHeader {
|
||||||
uint16 type;
|
uint16 type;
|
||||||
uint32 size;
|
uint32 size;
|
||||||
uint32 reserved;
|
uint32 reserved;
|
||||||
uint32 off_bits;
|
uint32 off_bits;
|
||||||
} GCC_PACK BitmapFileHeader;
|
} GCC_PACK;
|
||||||
assert_compile(sizeof(BitmapFileHeader) == 14);
|
assert_compile(sizeof(BitmapFileHeader) == 14);
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(__WATCOMC__)
|
#if defined(_MSC_VER) || defined(__WATCOMC__)
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct BitmapInfoHeader {
|
struct BitmapInfoHeader {
|
||||||
uint32 size;
|
uint32 size;
|
||||||
int32 width, height;
|
int32 width, height;
|
||||||
uint16 planes, bitcount;
|
uint16 planes, bitcount;
|
||||||
uint32 compression, sizeimage, xpels, ypels, clrused, clrimp;
|
uint32 compression, sizeimage, xpels, ypels, clrused, clrimp;
|
||||||
} BitmapInfoHeader;
|
};
|
||||||
assert_compile(sizeof(BitmapInfoHeader) == 40);
|
assert_compile(sizeof(BitmapInfoHeader) == 40);
|
||||||
|
|
||||||
typedef struct RgbQuad {
|
struct RgbQuad {
|
||||||
byte blue, green, red, reserved;
|
byte blue, green, red, reserved;
|
||||||
} RgbQuad;
|
};
|
||||||
assert_compile(sizeof(RgbQuad) == 4);
|
assert_compile(sizeof(RgbQuad) == 4);
|
||||||
|
|
||||||
// generic .BMP writer
|
// generic .BMP writer
|
||||||
|
@ -260,7 +260,7 @@ static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *user
|
||||||
//*** SCREENSHOT CODE FOR ZSOFT PAINTBRUSH (.PCX)
|
//*** SCREENSHOT CODE FOR ZSOFT PAINTBRUSH (.PCX)
|
||||||
//************************************************
|
//************************************************
|
||||||
|
|
||||||
typedef struct {
|
struct PcxHeader {
|
||||||
byte manufacturer;
|
byte manufacturer;
|
||||||
byte version;
|
byte version;
|
||||||
byte rle;
|
byte rle;
|
||||||
|
@ -276,7 +276,7 @@ typedef struct {
|
||||||
uint16 width;
|
uint16 width;
|
||||||
uint16 height;
|
uint16 height;
|
||||||
byte filler[54];
|
byte filler[54];
|
||||||
} PcxHeader;
|
};
|
||||||
assert_compile(sizeof(PcxHeader) == 128);
|
assert_compile(sizeof(PcxHeader) == 128);
|
||||||
|
|
||||||
static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette)
|
static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette)
|
||||||
|
|
|
@ -8,11 +8,11 @@ void InitializeScreenshotFormats();
|
||||||
const char *GetScreenshotFormatDesc(int i);
|
const char *GetScreenshotFormatDesc(int i);
|
||||||
void SetScreenshotFormat(int i);
|
void SetScreenshotFormat(int i);
|
||||||
|
|
||||||
typedef enum ScreenshotType {
|
enum ScreenshotType {
|
||||||
SC_NONE,
|
SC_NONE,
|
||||||
SC_VIEWPORT,
|
SC_VIEWPORT,
|
||||||
SC_WORLD
|
SC_WORLD
|
||||||
} ScreenshotType;
|
};
|
||||||
|
|
||||||
bool MakeScreenshot();
|
bool MakeScreenshot();
|
||||||
void SetScreenshotType(ScreenshotType t);
|
void SetScreenshotType(ScreenshotType t);
|
||||||
|
|
|
@ -13,7 +13,7 @@ void SdlClose(uint32 x);
|
||||||
#ifdef DYNAMICALLY_LOADED_SDL
|
#ifdef DYNAMICALLY_LOADED_SDL
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
typedef struct SDLProcs {
|
struct SDLProcs {
|
||||||
int (SDLCALL *SDL_Init)(Uint32);
|
int (SDLCALL *SDL_Init)(Uint32);
|
||||||
int (SDLCALL *SDL_InitSubSystem)(Uint32);
|
int (SDLCALL *SDL_InitSubSystem)(Uint32);
|
||||||
char *(SDLCALL *SDL_GetError)();
|
char *(SDLCALL *SDL_GetError)();
|
||||||
|
@ -46,7 +46,7 @@ void SdlClose(uint32 x);
|
||||||
int (SDLCALL *SDL_SetColorKey)(SDL_Surface *, Uint32, Uint32);
|
int (SDLCALL *SDL_SetColorKey)(SDL_Surface *, Uint32, Uint32);
|
||||||
void (SDLCALL *SDL_WM_SetIcon)(SDL_Surface *, Uint8 *);
|
void (SDLCALL *SDL_WM_SetIcon)(SDL_Surface *, Uint8 *);
|
||||||
Uint32 (SDLCALL *SDL_MapRGB)(SDL_PixelFormat *, Uint8, Uint8, Uint8);
|
Uint32 (SDLCALL *SDL_MapRGB)(SDL_PixelFormat *, Uint8, Uint8, Uint8);
|
||||||
} SDLProcs;
|
};
|
||||||
|
|
||||||
extern SDLProcs sdl_proc;
|
extern SDLProcs sdl_proc;
|
||||||
|
|
||||||
|
|
|
@ -49,10 +49,10 @@
|
||||||
/** The patch values that are used for new games and/or modified in config file */
|
/** The patch values that are used for new games and/or modified in config file */
|
||||||
Patches _patches_newgame;
|
Patches _patches_newgame;
|
||||||
|
|
||||||
typedef struct IniFile IniFile;
|
struct IniFile;
|
||||||
typedef struct IniItem IniItem;
|
struct IniItem;
|
||||||
typedef struct IniGroup IniGroup;
|
struct IniGroup;
|
||||||
typedef struct SettingsMemoryPool SettingsMemoryPool;
|
struct SettingsMemoryPool;
|
||||||
|
|
||||||
typedef const char *SettingListCallbackProc(const IniItem *item, uint index);
|
typedef const char *SettingListCallbackProc(const IniItem *item, uint index);
|
||||||
typedef void SettingDescProc(IniFile *ini, const SettingDesc *desc, const char *grpname, void *object);
|
typedef void SettingDescProc(IniFile *ini, const SettingDesc *desc, const char *grpname, void *object);
|
||||||
|
|
|
@ -46,7 +46,7 @@ typedef TinyEnumT<SettingGuiFlagLong> SettingGuiFlag;
|
||||||
|
|
||||||
typedef int32 OnChange(int32 var);
|
typedef int32 OnChange(int32 var);
|
||||||
|
|
||||||
typedef struct SettingDescBase {
|
struct SettingDescBase {
|
||||||
const char *name; ///< name of the setting. Used in configuration file and for console
|
const char *name; ///< name of the setting. Used in configuration file and for console
|
||||||
const void *def; ///< default value given when none is present
|
const void *def; ///< default value given when none is present
|
||||||
SettingDescType cmd; ///< various flags for the variable
|
SettingDescType cmd; ///< various flags for the variable
|
||||||
|
@ -56,12 +56,12 @@ typedef struct SettingDescBase {
|
||||||
const char *many; ///< ONE/MANY_OF_MANY: string of possible values for this type
|
const char *many; ///< ONE/MANY_OF_MANY: string of possible values for this type
|
||||||
StringID str; ///< (translated) string with descriptive text; gui and console
|
StringID str; ///< (translated) string with descriptive text; gui and console
|
||||||
OnChange *proc; ///< callback procedure for when the value is changed
|
OnChange *proc; ///< callback procedure for when the value is changed
|
||||||
} SettingDescBase;
|
};
|
||||||
|
|
||||||
typedef struct SettingDesc {
|
struct SettingDesc {
|
||||||
SettingDescBase desc; ///< Settings structure (going to configuration file)
|
SettingDescBase desc; ///< Settings structure (going to configuration file)
|
||||||
SaveLoad save; ///< Internal structure (going to savegame, parts to config)
|
SaveLoad save; ///< Internal structure (going to savegame, parts to config)
|
||||||
} SettingDesc;
|
};
|
||||||
|
|
||||||
/* NOTE: The only difference between SettingDesc and SettingDescGlob is
|
/* NOTE: The only difference between SettingDesc and SettingDescGlob is
|
||||||
* that one uses global variables as a source and the other offsets
|
* that one uses global variables as a source and the other offsets
|
||||||
|
@ -72,10 +72,10 @@ typedef struct SettingDesc {
|
||||||
* offset in a certain struct */
|
* offset in a certain struct */
|
||||||
typedef SettingDesc SettingDescGlobVarList;
|
typedef SettingDesc SettingDescGlobVarList;
|
||||||
|
|
||||||
typedef enum {
|
enum IniGroupType {
|
||||||
IGT_VARIABLES = 0, ///< values of the form "landscape = hilly"
|
IGT_VARIABLES = 0, ///< values of the form "landscape = hilly"
|
||||||
IGT_LIST = 1, ///< a list of values, seperated by \n and terminated by the next group block
|
IGT_LIST = 1, ///< a list of values, seperated by \n and terminated by the next group block
|
||||||
} IniGroupType;
|
};
|
||||||
|
|
||||||
/** The patch values that are used for new games and/or modified in config file */
|
/** The patch values that are used for new games and/or modified in config file */
|
||||||
extern Patches _patches_newgame;
|
extern Patches _patches_newgame;
|
||||||
|
|
|
@ -295,12 +295,12 @@ void ShowGameOptions()
|
||||||
AllocateWindowDesc(&_game_options_desc);
|
AllocateWindowDesc(&_game_options_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
struct GameSettingData {
|
||||||
int16 min;
|
int16 min;
|
||||||
int16 max;
|
int16 max;
|
||||||
int16 step;
|
int16 step;
|
||||||
StringID str;
|
StringID str;
|
||||||
} GameSettingData;
|
};
|
||||||
|
|
||||||
static const GameSettingData _game_setting_info[] = {
|
static const GameSettingData _game_setting_info[] = {
|
||||||
{ 0, 7, 1, STR_NULL},
|
{ 0, 7, 1, STR_NULL},
|
||||||
|
@ -655,16 +655,16 @@ static const char *_patches_vehicles[] = {
|
||||||
"freight_trains",
|
"freight_trains",
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct PatchEntry {
|
struct PatchEntry {
|
||||||
const SettingDesc *setting;
|
const SettingDesc *setting;
|
||||||
uint index;
|
uint index;
|
||||||
} PatchEntry;
|
};
|
||||||
|
|
||||||
typedef struct PatchPage {
|
struct PatchPage {
|
||||||
const char **names;
|
const char **names;
|
||||||
PatchEntry *entries;
|
PatchEntry *entries;
|
||||||
byte num;
|
byte num;
|
||||||
} PatchPage;
|
};
|
||||||
|
|
||||||
/* PatchPage holds the categories, the number of elements in each category
|
/* PatchPage holds the categories, the number of elements in each category
|
||||||
* and (in NULL) a dynamic array of settings based on the string-representations
|
* and (in NULL) a dynamic array of settings based on the string-representations
|
||||||
|
|
|
@ -447,12 +447,12 @@ static void ShipArrivesAt(const Vehicle* v, Station* st)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
struct PathFindShip {
|
||||||
TileIndex skiptile;
|
TileIndex skiptile;
|
||||||
TileIndex dest_coords;
|
TileIndex dest_coords;
|
||||||
uint best_bird_dist;
|
uint best_bird_dist;
|
||||||
uint best_length;
|
uint best_length;
|
||||||
} PathFindShip;
|
};
|
||||||
|
|
||||||
static bool ShipTrackFollower(TileIndex tile, PathFindShip *pfs, int track, uint length, byte *state)
|
static bool ShipTrackFollower(TileIndex tile, PathFindShip *pfs, int track, uint length, byte *state)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "oldpool.h"
|
#include "oldpool.h"
|
||||||
|
|
||||||
typedef struct Sign {
|
struct Sign {
|
||||||
StringID str;
|
StringID str;
|
||||||
ViewportSign sign;
|
ViewportSign sign;
|
||||||
int32 x;
|
int32 x;
|
||||||
|
@ -14,7 +14,7 @@ typedef struct Sign {
|
||||||
PlayerByte owner; // placed by this player. Anyone can delete them though. OWNER_NONE for gray signs from old games.
|
PlayerByte owner; // placed by this player. Anyone can delete them though. OWNER_NONE for gray signs from old games.
|
||||||
|
|
||||||
SignID index;
|
SignID index;
|
||||||
} Sign;
|
};
|
||||||
|
|
||||||
DECLARE_OLD_POOL(Sign, Sign, 2, 16000)
|
DECLARE_OLD_POOL(Sign, Sign, 2, 16000)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#ifndef SLOPE_H
|
#ifndef SLOPE_H
|
||||||
#define SLOPE_H
|
#define SLOPE_H
|
||||||
|
|
||||||
typedef enum Slope {
|
enum Slope {
|
||||||
SLOPE_FLAT = 0x00,
|
SLOPE_FLAT = 0x00,
|
||||||
SLOPE_W = 0x01,
|
SLOPE_W = 0x01,
|
||||||
SLOPE_S = 0x02,
|
SLOPE_S = 0x02,
|
||||||
|
@ -25,7 +25,7 @@ typedef enum Slope {
|
||||||
SLOPE_STEEP_S = SLOPE_STEEP | SLOPE_WSE,
|
SLOPE_STEEP_S = SLOPE_STEEP | SLOPE_WSE,
|
||||||
SLOPE_STEEP_E = SLOPE_STEEP | SLOPE_SEN,
|
SLOPE_STEEP_E = SLOPE_STEEP | SLOPE_SEN,
|
||||||
SLOPE_STEEP_N = SLOPE_STEEP | SLOPE_ENW
|
SLOPE_STEEP_N = SLOPE_STEEP | SLOPE_ENW
|
||||||
} Slope;
|
};
|
||||||
|
|
||||||
static inline bool IsSteepSlope(Slope s)
|
static inline bool IsSteepSlope(Slope s)
|
||||||
{
|
{
|
||||||
|
|
|
@ -256,10 +256,10 @@ static const uint32 _map_height_bits[16] = {
|
||||||
MKCOLOR(0x27272727),
|
MKCOLOR(0x27272727),
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct AndOr {
|
struct AndOr {
|
||||||
uint32 mor;
|
uint32 mor;
|
||||||
uint32 mand;
|
uint32 mand;
|
||||||
} AndOr;
|
};
|
||||||
|
|
||||||
static inline uint32 ApplyMask(uint32 colour, const AndOr *mask)
|
static inline uint32 ApplyMask(uint32 colour, const AndOr *mask)
|
||||||
{
|
{
|
||||||
|
|
12
src/sound.h
12
src/sound.h
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
|
|
||||||
typedef struct MusicFileSettings {
|
struct MusicFileSettings {
|
||||||
byte playlist;
|
byte playlist;
|
||||||
byte music_vol;
|
byte music_vol;
|
||||||
byte effect_vol;
|
byte effect_vol;
|
||||||
|
@ -14,11 +14,11 @@ typedef struct MusicFileSettings {
|
||||||
bool playing;
|
bool playing;
|
||||||
bool shuffle;
|
bool shuffle;
|
||||||
char extmidi[80];
|
char extmidi[80];
|
||||||
} MusicFileSettings;
|
};
|
||||||
|
|
||||||
VARDEF MusicFileSettings msf;
|
VARDEF MusicFileSettings msf;
|
||||||
|
|
||||||
typedef struct FileEntry {
|
struct FileEntry {
|
||||||
uint32 file_offset;
|
uint32 file_offset;
|
||||||
uint32 file_size;
|
uint32 file_size;
|
||||||
uint16 rate;
|
uint16 rate;
|
||||||
|
@ -26,12 +26,12 @@ typedef struct FileEntry {
|
||||||
uint8 channels;
|
uint8 channels;
|
||||||
uint8 volume;
|
uint8 volume;
|
||||||
uint8 priority;
|
uint8 priority;
|
||||||
} FileEntry;
|
};
|
||||||
|
|
||||||
bool SoundInitialize(const char *filename);
|
bool SoundInitialize(const char *filename);
|
||||||
uint GetNumOriginalSounds();
|
uint GetNumOriginalSounds();
|
||||||
|
|
||||||
typedef enum SoundFx {
|
enum SoundFx {
|
||||||
SND_BEGIN = 0,
|
SND_BEGIN = 0,
|
||||||
SND_02_SPLAT = 0, // 0 == 0x00 !
|
SND_02_SPLAT = 0, // 0 == 0x00 !
|
||||||
SND_03_FACTORY_WHISTLE,
|
SND_03_FACTORY_WHISTLE,
|
||||||
|
@ -107,7 +107,7 @@ typedef enum SoundFx {
|
||||||
SND_47_MAGLEV_2,
|
SND_47_MAGLEV_2,
|
||||||
SND_48_DISTANT_BIRD, // 72 == 0x48
|
SND_48_DISTANT_BIRD, // 72 == 0x48
|
||||||
SND_END
|
SND_END
|
||||||
} SoundFx;
|
};
|
||||||
|
|
||||||
/** Define basic enum properties */
|
/** Define basic enum properties */
|
||||||
template <> struct EnumPropsT<SoundFx> : MakeEnumPropsT<SoundFx, byte, SND_BEGIN, SND_END, SND_END> {};
|
template <> struct EnumPropsT<SoundFx> : MakeEnumPropsT<SoundFx, byte, SND_BEGIN, SND_END, SND_END> {};
|
||||||
|
|
12
src/sprite.h
12
src/sprite.h
|
@ -8,7 +8,7 @@
|
||||||
* bounding box. Used especially for various multi-sprite buildings (like
|
* bounding box. Used especially for various multi-sprite buildings (like
|
||||||
* depots or stations): */
|
* depots or stations): */
|
||||||
|
|
||||||
typedef struct DrawTileSeqStruct {
|
struct DrawTileSeqStruct {
|
||||||
int8 delta_x; // 0x80 is sequence terminator
|
int8 delta_x; // 0x80 is sequence terminator
|
||||||
int8 delta_y;
|
int8 delta_y;
|
||||||
int8 delta_z;
|
int8 delta_z;
|
||||||
|
@ -17,19 +17,19 @@ typedef struct DrawTileSeqStruct {
|
||||||
byte size_z;
|
byte size_z;
|
||||||
SpriteID image;
|
SpriteID image;
|
||||||
SpriteID pal;
|
SpriteID pal;
|
||||||
} DrawTileSeqStruct;
|
};
|
||||||
|
|
||||||
typedef struct DrawTileSprites {
|
struct DrawTileSprites {
|
||||||
SpriteID ground_sprite;
|
SpriteID ground_sprite;
|
||||||
SpriteID ground_pal;
|
SpriteID ground_pal;
|
||||||
const DrawTileSeqStruct* seq;
|
const DrawTileSeqStruct* seq;
|
||||||
} DrawTileSprites;
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This structure is the same for both Industries and Houses.
|
* This structure is the same for both Industries and Houses.
|
||||||
* Buildings here reference a general type of construction
|
* Buildings here reference a general type of construction
|
||||||
*/
|
*/
|
||||||
typedef struct DrawBuildingsTileStruct {
|
struct DrawBuildingsTileStruct {
|
||||||
PalSpriteID ground;
|
PalSpriteID ground;
|
||||||
PalSpriteID building;
|
PalSpriteID building;
|
||||||
byte subtile_x:4;
|
byte subtile_x:4;
|
||||||
|
@ -38,7 +38,7 @@ typedef struct DrawBuildingsTileStruct {
|
||||||
byte height:4;
|
byte height:4;
|
||||||
byte dz;
|
byte dz;
|
||||||
byte draw_proc; /* this allows to specify a special drawing procedure.*/
|
byte draw_proc; /* this allows to specify a special drawing procedure.*/
|
||||||
} DrawBuildingsTileStruct;
|
};
|
||||||
|
|
||||||
// Iterate through all DrawTileSeqStructs in DrawTileSprites.
|
// Iterate through all DrawTileSeqStructs in DrawTileSprites.
|
||||||
#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
|
#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
|
||||||
|
|
|
@ -15,11 +15,11 @@
|
||||||
#endif /* SPRITE_CACHE_SIZE */
|
#endif /* SPRITE_CACHE_SIZE */
|
||||||
|
|
||||||
|
|
||||||
typedef struct SpriteCache {
|
struct SpriteCache {
|
||||||
void *ptr;
|
void *ptr;
|
||||||
uint32 file_pos;
|
uint32 file_pos;
|
||||||
int16 lru;
|
int16 lru;
|
||||||
} SpriteCache;
|
};
|
||||||
|
|
||||||
|
|
||||||
static uint _spritecache_items = 0;
|
static uint _spritecache_items = 0;
|
||||||
|
@ -55,10 +55,10 @@ static SpriteCache *AllocateSpriteCache(uint index)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct MemBlock {
|
struct MemBlock {
|
||||||
uint32 size;
|
uint32 size;
|
||||||
byte data[VARARRAY_SIZE];
|
byte data[VARARRAY_SIZE];
|
||||||
} MemBlock;
|
};
|
||||||
|
|
||||||
static uint _sprite_lru_counter;
|
static uint _sprite_lru_counter;
|
||||||
static MemBlock *_spritecache_ptr;
|
static MemBlock *_spritecache_ptr;
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
#ifndef SPRITECACHE_H
|
#ifndef SPRITECACHE_H
|
||||||
#define SPRITECACHE_H
|
#define SPRITECACHE_H
|
||||||
|
|
||||||
typedef struct Sprite {
|
struct Sprite {
|
||||||
byte info;
|
byte info;
|
||||||
byte height;
|
byte height;
|
||||||
uint16 width;
|
uint16 width;
|
||||||
int16 x_offs;
|
int16 x_offs;
|
||||||
int16 y_offs;
|
int16 y_offs;
|
||||||
byte data[VARARRAY_SIZE];
|
byte data[VARARRAY_SIZE];
|
||||||
} Sprite;
|
};
|
||||||
|
|
||||||
const void *GetRawSprite(SpriteID sprite);
|
const void *GetRawSprite(SpriteID sprite);
|
||||||
bool SpriteExists(SpriteID sprite);
|
bool SpriteExists(SpriteID sprite);
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
static const StationID INVALID_STATION = 0xFFFF;
|
static const StationID INVALID_STATION = 0xFFFF;
|
||||||
|
|
||||||
typedef struct GoodsEntry {
|
struct GoodsEntry {
|
||||||
GoodsEntry() :
|
GoodsEntry() :
|
||||||
waiting_acceptance(0),
|
waiting_acceptance(0),
|
||||||
unload_pending(0),
|
unload_pending(0),
|
||||||
|
@ -35,7 +35,7 @@ typedef struct GoodsEntry {
|
||||||
byte last_speed;
|
byte last_speed;
|
||||||
byte last_age;
|
byte last_age;
|
||||||
int32 feeder_profit;
|
int32 feeder_profit;
|
||||||
} GoodsEntry;
|
};
|
||||||
|
|
||||||
/** A Stop for a Road Vehicle */
|
/** A Stop for a Road Vehicle */
|
||||||
struct RoadStop {
|
struct RoadStop {
|
||||||
|
@ -79,11 +79,11 @@ protected:
|
||||||
static RoadStop *AllocateRaw();
|
static RoadStop *AllocateRaw();
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct StationSpecList {
|
struct StationSpecList {
|
||||||
const StationSpec *spec;
|
const StationSpec *spec;
|
||||||
uint32 grfid; /// GRF ID of this custom station
|
uint32 grfid; /// GRF ID of this custom station
|
||||||
uint8 localidx; /// Station ID within GRF of station
|
uint8 localidx; /// Station ID within GRF of station
|
||||||
} StationSpecList;
|
};
|
||||||
|
|
||||||
/** StationRect - used to track station spread out rectangle - cheaper than scanning whole map */
|
/** StationRect - used to track station spread out rectangle - cheaper than scanning whole map */
|
||||||
struct StationRect : public Rect {
|
struct StationRect : public Rect {
|
||||||
|
@ -207,13 +207,13 @@ enum {
|
||||||
HVOT_BUOY = 1 << 6
|
HVOT_BUOY = 1 << 6
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum CatchmentAreas {
|
enum CatchmentArea {
|
||||||
CA_NONE = 0,
|
CA_NONE = 0,
|
||||||
CA_BUS = 3,
|
CA_BUS = 3,
|
||||||
CA_TRUCK = 3,
|
CA_TRUCK = 3,
|
||||||
CA_TRAIN = 4,
|
CA_TRAIN = 4,
|
||||||
CA_DOCK = 5
|
CA_DOCK = 5
|
||||||
} CatchmentArea;
|
};
|
||||||
|
|
||||||
void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius);
|
void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius);
|
||||||
|
|
||||||
|
|
|
@ -449,12 +449,12 @@ void GetAcceptanceAroundTiles(AcceptedCargo accepts, TileIndex tile,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct ottd_Rectangle {
|
struct ottd_Rectangle {
|
||||||
uint min_x;
|
uint min_x;
|
||||||
uint min_y;
|
uint min_y;
|
||||||
uint max_x;
|
uint max_x;
|
||||||
uint max_y;
|
uint max_y;
|
||||||
} ottd_Rectangle;
|
};
|
||||||
|
|
||||||
static inline void MergePoint(ottd_Rectangle* rect, TileIndex tile)
|
static inline void MergePoint(ottd_Rectangle* rect, TileIndex tile)
|
||||||
{
|
{
|
||||||
|
@ -2071,11 +2071,11 @@ static void TileLoop_Station(TileIndex tile)
|
||||||
|
|
||||||
static void AnimateTile_Station(TileIndex tile)
|
static void AnimateTile_Station(TileIndex tile)
|
||||||
{
|
{
|
||||||
typedef struct AnimData {
|
struct AnimData {
|
||||||
StationGfx from; // first sprite
|
StationGfx from; // first sprite
|
||||||
StationGfx to; // last sprite
|
StationGfx to; // last sprite
|
||||||
byte delay;
|
byte delay;
|
||||||
} AnimData;
|
};
|
||||||
|
|
||||||
static const AnimData data[] = {
|
static const AnimData data[] = {
|
||||||
{ GFX_RADAR_LARGE_FIRST, GFX_RADAR_LARGE_LAST, 3 },
|
{ GFX_RADAR_LARGE_FIRST, GFX_RADAR_LARGE_LAST, 3 },
|
||||||
|
|
|
@ -153,21 +153,21 @@ static int CDECL StationRatingMaxSorter(const void *a, const void *b)
|
||||||
return (_internal_sort_order & 1) ? maxr2 - maxr1 : maxr1 - maxr2;
|
return (_internal_sort_order & 1) ? maxr2 - maxr1 : maxr1 - maxr2;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef enum StationListFlags {
|
enum StationListFlags {
|
||||||
SL_ORDER = 0x01,
|
SL_ORDER = 0x01,
|
||||||
SL_RESORT = 0x02,
|
SL_RESORT = 0x02,
|
||||||
SL_REBUILD = 0x04,
|
SL_REBUILD = 0x04,
|
||||||
} StationListFlags;
|
};
|
||||||
|
|
||||||
DECLARE_ENUM_AS_BIT_SET(StationListFlags);
|
DECLARE_ENUM_AS_BIT_SET(StationListFlags);
|
||||||
|
|
||||||
typedef struct plstations_d {
|
struct plstations_d {
|
||||||
const Station** sort_list;
|
const Station** sort_list;
|
||||||
uint16 list_length;
|
uint16 list_length;
|
||||||
byte sort_type;
|
byte sort_type;
|
||||||
StationListFlags flags;
|
StationListFlags flags;
|
||||||
uint16 resort_timer; //was byte refresh_counter;
|
uint16 resort_timer; //was byte refresh_counter;
|
||||||
} plstations_d;
|
};
|
||||||
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(plstations_d));
|
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(plstations_d));
|
||||||
|
|
||||||
void RebuildStationLists()
|
void RebuildStationLists()
|
||||||
|
|
|
@ -58,16 +58,16 @@ enum {
|
||||||
BUS_SIZE_EXT = GFX_BASE_END - GFX_BUS_BASE_EXT,
|
BUS_SIZE_EXT = GFX_BASE_END - GFX_BUS_BASE_EXT,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum HangarTiles {
|
enum HangarTile {
|
||||||
HANGAR_TILE_0 = 32,
|
HANGAR_TILE_0 = 32,
|
||||||
HANGAR_TILE_1 = 65,
|
HANGAR_TILE_1 = 65,
|
||||||
HANGAR_TILE_2 = 86,
|
HANGAR_TILE_2 = 86,
|
||||||
HANGAR_TILE_3 = 129, // added for west facing hangar
|
HANGAR_TILE_3 = 129, // added for west facing hangar
|
||||||
HANGAR_TILE_4 = 130, // added for north facing hangar
|
HANGAR_TILE_4 = 130, // added for north facing hangar
|
||||||
HANGAR_TILE_5 = 131 // added for east facing hangar
|
HANGAR_TILE_5 = 131 // added for east facing hangar
|
||||||
} HangarTiles;
|
};
|
||||||
|
|
||||||
typedef enum StationType {
|
enum StationType {
|
||||||
STATION_RAIL,
|
STATION_RAIL,
|
||||||
STATION_AIRPORT,
|
STATION_AIRPORT,
|
||||||
STATION_TRUCK,
|
STATION_TRUCK,
|
||||||
|
@ -75,7 +75,7 @@ typedef enum StationType {
|
||||||
STATION_OILRIG,
|
STATION_OILRIG,
|
||||||
STATION_DOCK,
|
STATION_DOCK,
|
||||||
STATION_BUOY
|
STATION_BUOY
|
||||||
} StationType;
|
};
|
||||||
|
|
||||||
StationType GetStationType(TileIndex);
|
StationType GetStationType(TileIndex);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
typedef void (*ParseCmdProc)(char *buf, int value);
|
typedef void (*ParseCmdProc)(char *buf, int value);
|
||||||
|
|
||||||
typedef struct LanguagePackHeader {
|
struct LanguagePackHeader {
|
||||||
uint32 ident;
|
uint32 ident;
|
||||||
uint32 version; // 32-bits of auto generated version info which is basically a hash of strings.h
|
uint32 version; // 32-bits of auto generated version info which is basically a hash of strings.h
|
||||||
char name[32]; // the international name of this language
|
char name[32]; // the international name of this language
|
||||||
|
@ -40,15 +40,15 @@ typedef struct LanguagePackHeader {
|
||||||
uint16 offsets[32]; // the offsets
|
uint16 offsets[32]; // the offsets
|
||||||
byte plural_form; // plural form index
|
byte plural_form; // plural form index
|
||||||
byte pad[3]; // pad header to be a multiple of 4
|
byte pad[3]; // pad header to be a multiple of 4
|
||||||
} LanguagePackHeader;
|
};
|
||||||
|
|
||||||
typedef struct CmdStruct {
|
struct CmdStruct {
|
||||||
const char *cmd;
|
const char *cmd;
|
||||||
ParseCmdProc proc;
|
ParseCmdProc proc;
|
||||||
long value;
|
long value;
|
||||||
int8 consumes;
|
int8 consumes;
|
||||||
byte flags;
|
byte flags;
|
||||||
} CmdStruct;
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
C_DONTCOUNT = 1,
|
C_DONTCOUNT = 1,
|
||||||
|
@ -56,11 +56,11 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct Case {
|
struct Case {
|
||||||
int caseidx;
|
int caseidx;
|
||||||
char *string;
|
char *string;
|
||||||
struct Case *next;
|
Case *next;
|
||||||
} Case;
|
};
|
||||||
|
|
||||||
static bool _masterlang;
|
static bool _masterlang;
|
||||||
static bool _translated;
|
static bool _translated;
|
||||||
|
@ -68,7 +68,7 @@ static const char* _file = "(unknown file)";
|
||||||
static int _cur_line;
|
static int _cur_line;
|
||||||
static int _errors, _warnings;
|
static int _errors, _warnings;
|
||||||
|
|
||||||
typedef struct LangString {
|
struct LangString {
|
||||||
char *name; // Name of the string
|
char *name; // Name of the string
|
||||||
char *english; // English text
|
char *english; // English text
|
||||||
char *translated; // Translated text
|
char *translated; // Translated text
|
||||||
|
@ -77,7 +77,7 @@ typedef struct LangString {
|
||||||
int line; // line of string in source-file
|
int line; // line of string in source-file
|
||||||
Case *english_case; // cases for english
|
Case *english_case; // cases for english
|
||||||
Case *translated_case; // cases for foreign
|
Case *translated_case; // cases for foreign
|
||||||
} LangString;
|
};
|
||||||
|
|
||||||
static LangString *_strings[65536];
|
static LangString *_strings[65536];
|
||||||
|
|
||||||
|
@ -106,16 +106,16 @@ static const byte _plural_form_counts[] = { 2, 1, 2, 3, 3, 3, 3, 3, 4 };
|
||||||
|
|
||||||
static const char *_cur_ident;
|
static const char *_cur_ident;
|
||||||
|
|
||||||
typedef struct CmdPair {
|
struct CmdPair {
|
||||||
const CmdStruct *a;
|
const CmdStruct *a;
|
||||||
const char *v;
|
const char *v;
|
||||||
} CmdPair;
|
};
|
||||||
|
|
||||||
typedef struct ParsedCommandStruct {
|
struct ParsedCommandStruct {
|
||||||
int np;
|
int np;
|
||||||
CmdPair pairs[32];
|
CmdPair pairs[32];
|
||||||
const CmdStruct *cmd[32]; // ordered by param #
|
const CmdStruct *cmd[32]; // ordered by param #
|
||||||
} ParsedCommandStruct;
|
};
|
||||||
|
|
||||||
// Used when generating some advanced commands.
|
// Used when generating some advanced commands.
|
||||||
static ParsedCommandStruct _cur_pcs;
|
static ParsedCommandStruct _cur_pcs;
|
||||||
|
|
|
@ -37,11 +37,11 @@ void str_strip_colours(char *str);
|
||||||
/**
|
/**
|
||||||
* Valid filter types for IsValidChar.
|
* Valid filter types for IsValidChar.
|
||||||
*/
|
*/
|
||||||
typedef enum CharSetFilter {
|
enum CharSetFilter {
|
||||||
CS_ALPHANUMERAL, //! Both numeric and alphabetic and spaces and stuff
|
CS_ALPHANUMERAL, //! Both numeric and alphabetic and spaces and stuff
|
||||||
CS_NUMERAL, //! Only numeric ones
|
CS_NUMERAL, //! Only numeric ones
|
||||||
CS_ALPHA, //! Only alphabetic values
|
CS_ALPHA, //! Only alphabetic values
|
||||||
} CharSetFilter;
|
};
|
||||||
|
|
||||||
/** Convert the given string to lowercase, only works with ASCII! */
|
/** Convert the given string to lowercase, only works with ASCII! */
|
||||||
void strtolower(char *str);
|
void strtolower(char *str);
|
||||||
|
|
|
@ -35,7 +35,7 @@ static char *GetSpecialPlayerNameString(char *buff, int ind, const int32 *argv,
|
||||||
|
|
||||||
static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei, const char* last);
|
static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei, const char* last);
|
||||||
|
|
||||||
typedef struct LanguagePack {
|
struct LanguagePack {
|
||||||
uint32 ident;
|
uint32 ident;
|
||||||
uint32 version; // 32-bits of auto generated version info which is basically a hash of strings.h
|
uint32 version; // 32-bits of auto generated version info which is basically a hash of strings.h
|
||||||
char name[32]; // the international name of this language
|
char name[32]; // the international name of this language
|
||||||
|
@ -45,7 +45,7 @@ typedef struct LanguagePack {
|
||||||
byte plural_form; // how to compute plural forms
|
byte plural_form; // how to compute plural forms
|
||||||
byte pad[3]; // pad header to be a multiple of 4
|
byte pad[3]; // pad header to be a multiple of 4
|
||||||
char data[VARARRAY_SIZE];
|
char data[VARARRAY_SIZE];
|
||||||
} LanguagePack;
|
};
|
||||||
|
|
||||||
static char **_langpack_offs;
|
static char **_langpack_offs;
|
||||||
static LanguagePack *_langpack;
|
static LanguagePack *_langpack;
|
||||||
|
@ -461,7 +461,7 @@ static const char *ParseStringChoice(const char *b, uint form, char *dst, int *d
|
||||||
return b + pos;
|
return b + pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct Units {
|
struct Units {
|
||||||
int s_m; ///< Multiplier for velocity
|
int s_m; ///< Multiplier for velocity
|
||||||
int s_s; ///< Shift for velocity
|
int s_s; ///< Shift for velocity
|
||||||
StringID velocity; ///< String for velocity
|
StringID velocity; ///< String for velocity
|
||||||
|
@ -479,7 +479,7 @@ typedef struct Units {
|
||||||
int f_m; ///< Multiplier for force
|
int f_m; ///< Multiplier for force
|
||||||
int f_s; ///< Shift for force
|
int f_s; ///< Shift for force
|
||||||
StringID force; ///< String for force
|
StringID force; ///< String for force
|
||||||
} Units;
|
};
|
||||||
|
|
||||||
/* Unit conversions */
|
/* Unit conversions */
|
||||||
static const Units units[] = {
|
static const Units units[] = {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue