Changeset - r15175:66e0817dc450
[Not reviewed]
master
0 30 0
rubidium - 14 years ago 2010-05-13 10:14:29
rubidium@openttd.org
(svn r19814) -Codechange: give some more unnamed enums a name, in case they consisted of unrelated values use static const (u)int
30 files changed with 82 insertions and 125 deletions:
0 comments (0 inline, 0 general)
src/ai/ai_instance.cpp
Show inline comments
 
@@ -457,15 +457,13 @@ static byte _ai_sl_byte;
 

	
 
static const SaveLoad _ai_byte[] = {
 
	SLEG_VAR(_ai_sl_byte, SLE_UINT8),
 
	SLE_END()
 
};
 

	
 
enum {
 
	AISAVE_MAX_DEPTH = 25, ///< The maximum recursive depth for items stored in the savegame.
 
};
 
static const uint AISAVE_MAX_DEPTH = 25; ///< The maximum recursive depth for items stored in the savegame.
 

	
 
/* static */ bool AIInstance::SaveObject(HSQUIRRELVM vm, SQInteger index, int max_depth, bool test)
 
{
 
	if (max_depth == 0) {
 
		AILog::Error("Savedata can only be nested to 25 deep. No data saved.");
 
		return false;
src/airport.h
Show inline comments
 
@@ -13,20 +13,19 @@
 
#define AIRPORT_H
 

	
 
#include "direction_type.h"
 
#include "tile_type.h"
 

	
 
/** Some airport-related constants */
 
enum {
 
	MAX_TERMINALS =  10,                    ///< maximum number of terminals per airport
 
	MAX_HELIPADS  =   4,                    ///< maximum number of helipads per airport
 
	MAX_ELEMENTS  = 255,                    ///< maximum number of aircraft positions at airport
 
	NUM_AIRPORTTILES = 256,                 ///< total number of airport tiles
 
	NEW_AIRPORTTILE_OFFSET = 74,            ///< offset of first newgrf airport tile
 
	INVALID_AIRPORTTILE = NUM_AIRPORTTILES, ///< id for an invalid airport tile
 
};
 
static const uint MAX_TERMINALS =  10;                       ///< maximum number of terminals per airport
 
static const uint MAX_HELIPADS  =   4;                       ///< maximum number of helipads per airport
 
static const uint MAX_ELEMENTS  = 255;                       ///< maximum number of aircraft positions at airport
 

	
 
static const uint NUM_AIRPORTTILES       = 256;              ///< total number of airport tiles
 
static const uint NEW_AIRPORTTILE_OFFSET = 74;               ///< offset of first newgrf airport tile
 
static const uint INVALID_AIRPORTTILE    = NUM_AIRPORTTILES; ///< id for an invalid airport tile
 

	
 
/** Airport types */
 
enum AirportTypes {
 
	AT_SMALL         =   0,
 
	AT_LARGE         =   1,
 
	AT_HELIPORT      =   2,
src/airport_gui.cpp
Show inline comments
 
@@ -53,13 +53,13 @@ static void PlaceAirport(TileIndex tile)
 
	uint32 p1 = GetAirportSpecFromClass(_selected_airport_class, _selected_airport_index)->GetIndex();
 
	CommandContainer cmdcont = { tile, p1, p2, CMD_BUILD_AIRPORT | CMD_MSG(STR_ERROR_CAN_T_BUILD_AIRPORT_HERE), CcBuildAirport, "" };
 
	ShowSelectStationIfNeeded(cmdcont, TileArea(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE));
 
}
 

	
 
/** Widget number of the airport build window. */
 
enum {
 
enum AirportToolbarWidgets {
 
	ATW_AIRPORT,
 
	ATW_DEMOLISH,
 
};
 

	
 

	
 
static void BuildAirClick_Airport(Window *w)
src/company_gui.cpp
Show inline comments
 
@@ -31,18 +31,16 @@
 
#include "company_base.h"
 
#include "core/geometry_func.hpp"
 

	
 
#include "table/strings.h"
 

	
 
/** Company GUI constants. */
 
enum {
 
	FIRST_GUI_CALL = INT_MAX,  ///< default value to specify this is the first call of the resizable gui
 
static const int FIRST_GUI_CALL = INT_MAX; ///< default value to specify this is the first call of the resizable gui
 

	
 
	EXP_LINESPACE  = 2,        ///< Amount of vertical space for a horizontal (sub-)total line.
 
	EXP_BLOCKSPACE = 10,       ///< Amount of vertical space between two blocks of numbers.
 
};
 
static const uint EXP_LINESPACE  = 2;      ///< Amount of vertical space for a horizontal (sub-)total line.
 
static const uint EXP_BLOCKSPACE = 10;     ///< Amount of vertical space between two blocks of numbers.
 

	
 
static void DoSelectCompanyManagerFace(Window *parent);
 

	
 
/** Standard unsorted list of expenses. */
 
static ExpensesType _expenses_list_1[] = {
 
	EXPENSES_CONSTRUCTION,
src/console_gui.cpp
Show inline comments
 
@@ -18,19 +18,16 @@
 
#include "string_func.h"
 
#include "gfx_func.h"
 
#include "settings_type.h"
 
#include "console_func.h"
 
#include "rev.h"
 

	
 

	
 
enum {
 
	ICON_HISTORY_SIZE       = 20,
 
	ICON_LINE_SPACING       =  2,
 
	ICON_RIGHT_BORDERWIDTH  = 10,
 
	ICON_BOTTOM_BORDERWIDTH = 12,
 
};
 
static const uint ICON_HISTORY_SIZE       = 20;
 
static const uint ICON_LINE_SPACING       =  2;
 
static const uint ICON_RIGHT_BORDERWIDTH  = 10;
 
static const uint ICON_BOTTOM_BORDERWIDTH = 12;
 

	
 
/**
 
 * Container for a single line of console output
 
 */
 
struct IConsoleLine {
 
	static IConsoleLine *front; ///< The front of the console backlog buffer
 
@@ -443,13 +440,13 @@ static void IConsoleHistoryNavigate(int 
 
{
 
	if (_iconsole_history[0] == NULL) return; // Empty history
 
	int i = _iconsole_historypos + direction;
 

	
 
	/* watch out for overflows, just wrap around */
 
	if (i < 0) i = ICON_HISTORY_SIZE - 1;
 
	if (i >= ICON_HISTORY_SIZE) i = 0;
 
	if ((uint)i >= ICON_HISTORY_SIZE) i = 0;
 

	
 
	if (direction > 0) {
 
		if (_iconsole_history[i] == NULL) i = 0;
 
	}
 

	
 
	if (direction < 0) {
src/currency.cpp
Show inline comments
 
@@ -59,13 +59,13 @@ CurrencySpec _currency_specs[NUM_CURRENC
 
/**
 
 * These enums are only declared in order to make sens
 
 * out of the TTDPatch_To_OTTDIndex array that will follow
 
 * Every currency used by Ottd is there, just in case TTDPatch will
 
 * add those missing in its code
 
 **/
 
enum {
 
enum Currencies {
 
	CURR_GBP,
 
	CURR_USD,
 
	CURR_EUR,
 
	CURR_YEN,
 
	CURR_ATS,
 
	CURR_BEF,
src/date.cpp
Show inline comments
 
@@ -52,13 +52,13 @@ static const uint16 _month_date_from_yea
 
	M( 9, 1), M( 9, 2), M( 9, 3), M( 9, 4), M( 9, 5), M( 9, 6), M( 9, 7), M( 9, 8), M( 9, 9), M( 9, 10), M( 9, 11), M( 9, 12), M( 9, 13), M( 9, 14), M( 9, 15), M( 9, 16), M( 9, 17), M( 9, 18), M( 9, 19), M( 9, 20), M( 9, 21), M( 9, 22), M( 9, 23), M( 9, 24), M( 9, 25), M( 9, 26), M( 9, 27), M( 9, 28), M( 9, 29), M( 9, 30), M( 9, 31),
 
	M(10, 1), M(10, 2), M(10, 3), M(10, 4), M(10, 5), M(10, 6), M(10, 7), M(10, 8), M(10, 9), M(10, 10), M(10, 11), M(10, 12), M(10, 13), M(10, 14), M(10, 15), M(10, 16), M(10, 17), M(10, 18), M(10, 19), M(10, 20), M(10, 21), M(10, 22), M(10, 23), M(10, 24), M(10, 25), M(10, 26), M(10, 27), M(10, 28), M(10, 29), M(10, 30),
 
	M(11, 1), M(11, 2), M(11, 3), M(11, 4), M(11, 5), M(11, 6), M(11, 7), M(11, 8), M(11, 9), M(11, 10), M(11, 11), M(11, 12), M(11, 13), M(11, 14), M(11, 15), M(11, 16), M(11, 17), M(11, 18), M(11, 19), M(11, 20), M(11, 21), M(11, 22), M(11, 23), M(11, 24), M(11, 25), M(11, 26), M(11, 27), M(11, 28), M(11, 29), M(11, 30), M(11, 31),
 
};
 
#undef M
 

	
 
enum {
 
enum DaysTillMonth {
 
	ACCUM_JAN = 0,
 
	ACCUM_FEB = ACCUM_JAN + 31,
 
	ACCUM_MAR = ACCUM_FEB + 29,
 
	ACCUM_APR = ACCUM_MAR + 31,
 
	ACCUM_MAY = ACCUM_APR + 30,
 
	ACCUM_JUN = ACCUM_MAY + 31,
src/fontcache.cpp
Show inline comments
 
@@ -36,16 +36,14 @@ static FT_Face _face_small = NULL;
 
static FT_Face _face_medium = NULL;
 
static FT_Face _face_large = NULL;
 
static int _ascender[FS_END];
 

	
 
FreeTypeSettings _freetype;
 

	
 
enum {
 
	FACE_COLOUR = 1,
 
	SHADOW_COLOUR = 2,
 
};
 
static const byte FACE_COLOUR   = 1;
 
static const byte SHADOW_COLOUR = 2;
 

	
 
/** Get the font loaded into a Freetype face by using a font-name.
 
 * If no appropiate font is found, the function returns an error */
 
#ifdef WIN32
 
#include <windows.h>
 
#include <shlobj.h> /* SHGetFolderPath */
src/gamelog.cpp
Show inline comments
 
@@ -82,17 +82,15 @@ void GamelogReset()
 

	
 
	_gamelog_action  = NULL;
 
	_gamelog_actions = 0;
 
	_current_action  = NULL;
 
}
 

	
 
enum {
 
	GAMELOG_BUF_LEN = 1024 ///< length of buffer for one line of text
 
};
 
static const uint GAMELOG_BUF_LEN = 1024; ///< length of buffer for one line of text
 

	
 
static int _dbgofs = 0; ///< offset in current output buffer
 
static uint _dbgofs = 0; ///< offset in current output buffer
 

	
 
static void AddDebugText(char *buf, const char *s, ...) WARN_FORMAT(2, 3);
 

	
 
static void AddDebugText(char *buf, const char *s, ...)
 
{
 
	if (GAMELOG_BUF_LEN <= _dbgofs) return;
src/gfx.cpp
Show inline comments
 
@@ -71,16 +71,15 @@ static ReusableBuffer<uint8> _cursor_bac
 
 * @ingroup dirty
 
 */
 
static Rect _invalid_rect;
 
static const byte *_colour_remap_ptr;
 
static byte _string_colourremap[3]; ///< Recoloursprite for stringdrawing. The grf loader ensures, that ST_FONT sprites only use colours 0 to 2.
 

	
 
enum {
 
	DIRTY_BLOCK_HEIGHT   = 8,
 
	DIRTY_BLOCK_WIDTH    = 64,
 
};
 
static const uint DIRTY_BLOCK_HEIGHT   = 8;
 
static const uint DIRTY_BLOCK_WIDTH    = 64;
 

	
 
static uint _dirty_bytes_per_line = 0;
 
static byte *_dirty_blocks = NULL;
 

	
 
void GfxScroll(int left, int top, int width, int height, int xo, int yo)
 
{
 
	Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
src/industry_cmd.cpp
Show inline comments
 
@@ -2184,16 +2184,14 @@ static void ReportNewsProductionChangeIn
 
		percent >= 0 ? STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_SMOOTH : STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_SMOOTH,
 
		ns,
 
		ind->index
 
	);
 
}
 

	
 
enum {
 
	PERCENT_TRANSPORTED_60 = 153,
 
	PERCENT_TRANSPORTED_80 = 204,
 
};
 
static const uint PERCENT_TRANSPORTED_60 = 153;
 
static const uint PERCENT_TRANSPORTED_80 = 204;
 

	
 
/** Change industry production or do closure
 
 * @param i Industry for which changes are performed
 
 * @param monthly true if it's the monthly call, false if it's the random call
 
 */
 
static void ChangeIndustryProduction(Industry *i, bool monthly)
src/misc_gui.cpp
Show inline comments
 
@@ -76,19 +76,19 @@ static const WindowDesc _land_info_desc(
 
	WC_LAND_INFO, WC_NONE,
 
	0,
 
	_nested_land_info_widgets, lengthof(_nested_land_info_widgets)
 
);
 

	
 
class LandInfoWindow : public Window {
 
	enum {
 
	enum LandInfoLines {
 
		LAND_INFO_CENTERED_LINES   = 12,                       ///< Up to 12 centered lines
 
		LAND_INFO_MULTICENTER_LINE = LAND_INFO_CENTERED_LINES, ///< One multicenter line
 
		LAND_INFO_LINE_END,
 
	};
 

	
 
		LAND_INFO_LINE_BUFF_SIZE = 512,
 
	};
 
	static const uint LAND_INFO_LINE_BUFF_SIZE = 512;
 

	
 
public:
 
	char landinfo_data[LAND_INFO_LINE_END][LAND_INFO_LINE_BUFF_SIZE];
 
	TileIndex tile;
 

	
 
	virtual void OnPaint()
src/music/qtmidi.cpp
Show inline comments
 
@@ -38,15 +38,13 @@
 
#undef Rect
 
#undef Point
 

	
 
static FMusicDriver_QtMidi iFMusicDriver_QtMidi;
 

	
 

	
 
enum {
 
	midiType = 'Midi' ///< OSType code for MIDI songs.
 
};
 
static const uint MIDI_TYPE = 'Midi' ///< OSType code for MIDI songs.
 

	
 

	
 
/**
 
 * Sets the @c OSType of a given file to @c 'Midi', but only if it's not
 
 * already set.
 
 *
 
@@ -58,15 +56,15 @@ static void SetMIDITypeIfNeeded(const FS
 

	
 
	assert(ref);
 

	
 
	if (noErr != FSGetCatalogInfo(ref, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo, &catalogInfo, NULL, NULL, NULL)) return;
 
	if (!(catalogInfo.nodeFlags & kFSNodeIsDirectoryMask)) {
 
		FileInfo * const info = (FileInfo *) catalogInfo.finderInfo;
 
		if (info->fileType != midiType && !(info->finderFlags & kIsAlias)) {
 
		if (info->fileType != MIDI_TYPE && !(info->finderFlags & kIsAlias)) {
 
			OSErr e;
 
			info->fileType = midiType;
 
			info->fileType = MIDI_TYPE;
 
			e = FSSetCatalogInfo(ref, kFSCatInfoFinderInfo, &catalogInfo);
 
			if (e == noErr) {
 
				DEBUG(driver, 3, "qtmidi: changed filetype to 'Midi'");
 
			} else {
 
				DEBUG(driver, 0, "qtmidi: changing filetype to 'Midi' failed - error %d", e);
 
			}
 
@@ -158,13 +156,13 @@ static void InitQuickTimeIfNeeded()
 
		(noErr == EnterMovies());
 
	if (!_quicktime_started) DEBUG(driver, 0, "qtmidi: Quicktime initialization failed!");
 
}
 

	
 

	
 
/** Possible states of the QuickTime music driver. */
 
enum {
 
enum QTStates {
 
	QT_STATE_IDLE, ///< No file loaded.
 
	QT_STATE_PLAY, ///< File loaded, playing.
 
	QT_STATE_STOP, ///< File loaded, stopped.
 
};
 

	
 

	
src/network/network_chat_gui.cpp
Show inline comments
 
@@ -32,15 +32,13 @@
 
#include "table/strings.h"
 

	
 
/* The draw buffer must be able to contain the chat message, client name and the "[All]" message,
 
 * some spaces and possible translations of [All] to other languages. */
 
assert_compile((int)DRAW_STRING_BUFFER >= (int)NETWORK_CHAT_LENGTH + NETWORK_NAME_LENGTH + 40);
 

	
 
enum {
 
	NETWORK_CHAT_LINE_SPACING = 3,
 
};
 
static const uint NETWORK_CHAT_LINE_SPACING = 3;
 

	
 
struct ChatMessage {
 
	char message[DRAW_STRING_BUFFER];
 
	TextColour colour;
 
	Date end_date;
 
};
src/network/network_content_gui.cpp
Show inline comments
 
@@ -222,16 +222,14 @@ enum NetworkContentListWindowWidgets {
 
};
 

	
 
/** Window that lists the content that's at the content server */
 
class NetworkContentListWindow : public QueryStringBaseWindow, ContentCallback {
 
	typedef GUIList<const ContentInfo*> GUIContentList;
 

	
 
	enum {
 
		EDITBOX_MAX_SIZE = 50,
 
		EDITBOX_MAX_LENGTH = 300,
 
	};
 
	static const uint EDITBOX_MAX_SIZE   =  50;
 
	static const uint EDITBOX_MAX_LENGTH = 300;
 

	
 
	/** Runtime saved values */
 
	static Listing last_sorting;
 
	static Filtering last_filtering;
 
	/** The sorter functions */
 
	static GUIContentList::SortFunction * const sorter_funcs[];
src/network/network_gamelist.cpp
Show inline comments
 
@@ -129,17 +129,15 @@ void NetworkGameListRemoveItem(NetworkGa
 
			return;
 
		}
 
		prev_item = item;
 
	}
 
}
 

	
 
enum {
 
	MAX_GAME_LIST_REQUERY_COUNT  = 10, ///< How often do we requery in number of times per server?
 
	REQUERY_EVERY_X_GAMELOOPS    = 60, ///< How often do we requery in time?
 
	REFRESH_GAMEINFO_X_REQUERIES = 50, ///< Refresh the game info itself after REFRESH_GAMEINFO_X_REQUERIES * REQUERY_EVERY_X_GAMELOOPS game loops
 
};
 
static const uint MAX_GAME_LIST_REQUERY_COUNT  = 10; ///< How often do we requery in number of times per server?
 
static const uint REQUERY_EVERY_X_GAMELOOPS    = 60; ///< How often do we requery in time?
 
static const uint REFRESH_GAMEINFO_X_REQUERIES = 50; ///< Refresh the game info itself after REFRESH_GAMEINFO_X_REQUERIES * REQUERY_EVERY_X_GAMELOOPS game loops
 

	
 
/** Requeries the (game) servers we have not gotten a reply from */
 
void NetworkGameListRequery()
 
{
 
	NetworkGameListHandleDelayedInsert();
 

	
src/network/network_udp.cpp
Show inline comments
 
@@ -33,17 +33,15 @@
 

	
 
static ThreadMutex *_network_udp_mutex = ThreadMutex::New();
 

	
 
/** Session key to register ourselves to the master server */
 
static uint64 _session_key = 0;
 

	
 
enum {
 
	ADVERTISE_NORMAL_INTERVAL = 30000, // interval between advertising in ticks (15 minutes)
 
	ADVERTISE_RETRY_INTERVAL  =   300, // readvertise when no response after this many ticks (9 seconds)
 
	ADVERTISE_RETRY_TIMES     =     3  // give up readvertising after this much failed retries
 
};
 
static const uint ADVERTISE_NORMAL_INTERVAL = 30000; ///< interval between advertising in ticks (15 minutes)
 
static const uint ADVERTISE_RETRY_INTERVAL  =   300; ///< readvertise when no response after this many ticks (9 seconds)
 
static const uint ADVERTISE_RETRY_TIMES     =     3; ///< give up readvertising after this much failed retries
 

	
 
NetworkUDPSocketHandler *_udp_client_socket = NULL; ///< udp client socket
 
NetworkUDPSocketHandler *_udp_server_socket = NULL; ///< udp server socket
 
NetworkUDPSocketHandler *_udp_master_socket = NULL; ///< udp master socket
 

	
 
///*** Communication with the masterserver ***/
src/newgrf.cpp
Show inline comments
 
@@ -177,15 +177,13 @@ public:
 
		if (data > end) throw OTTDByteReaderSignal();
 
	}
 
};
 

	
 
typedef void (*SpecialSpriteHandler)(ByteReader *buf);
 

	
 
enum {
 
	MAX_STATIONS = 256,
 
};
 
static const uint MAX_STATIONS = 256;
 

	
 
/* Temporary data used when loading only */
 
struct GRFTempEngineData {
 
	uint16 cargo_allowed;
 
	uint16 cargo_disallowed;
 
	RailTypeLabel railtypelabel;
 
@@ -6606,13 +6604,13 @@ static void FinaliseAirportsArray()
 
				}
 
			}
 
		}
 

	
 
		AirportTileSpec **&airporttilespec = (*file)->airtspec;
 
		if (airporttilespec != NULL) {
 
			for (int i = 0; i < NUM_AIRPORTTILES; i++) {
 
			for (uint i = 0; i < NUM_AIRPORTTILES; i++) {
 
				if (airporttilespec[i] != NULL && airporttilespec[i]->enabled) {
 
					_airporttile_mngr.SetEntitySpec(airporttilespec[i]);
 
				}
 
			}
 
		}
 
	}
src/newgrf_engine.cpp
Show inline comments
 
@@ -151,13 +151,13 @@ static int MapOldSubType(const Vehicle *
 
		default: NOT_REACHED();
 
	}
 
}
 

	
 

	
 
/* TTDP style aircraft movement states for GRF Action 2 Var 0xE2 */
 
enum {
 
enum TTDPAircraftMovementStates {
 
	AMS_TTDP_HANGAR,
 
	AMS_TTDP_TO_HANGAR,
 
	AMS_TTDP_TO_PAD1,
 
	AMS_TTDP_TO_PAD2,
 
	AMS_TTDP_TO_PAD3,
 
	AMS_TTDP_TO_ENTRY_2_AND_3,
 
@@ -287,13 +287,13 @@ static byte MapAircraftMovementState(con
 
			return AMS_TTDP_HANGAR;
 
	}
 
}
 

	
 

	
 
/* TTDP style aircraft movement action for GRF Action 2 Var 0xE6 */
 
enum {
 
enum TTDPAircraftMovementActions {
 
	AMA_TTDP_IN_HANGAR,
 
	AMA_TTDP_ON_PAD1,
 
	AMA_TTDP_ON_PAD2,
 
	AMA_TTDP_ON_PAD3,
 
	AMA_TTDP_HANGAR_TO_PAD1,
 
	AMA_TTDP_HANGAR_TO_PAD2,
src/newgrf_gui.cpp
Show inline comments
 
@@ -144,16 +144,14 @@ private:
 
	static GUIGRFConfigList::FilterFunction * const filter_funcs[];
 
	GUIGRFConfigList grfs;
 

	
 
	const GRFConfig *sel;
 
	int sel_pos;
 

	
 
	enum {
 
		EDITBOX_MAX_SIZE = 50,
 
		EDITBOX_MAX_LENGTH = 300,
 
	};
 
	static const uint EDITBOX_MAX_SIZE   =  50;
 
	static const uint EDITBOX_MAX_LENGTH = 300;
 

	
 
	/**
 
	 * (Re)build the grf as its amount has changed because
 
	 * an item has been added or deleted for example
 
	 */
 
	void BuildGrfList()
src/newgrf_station.cpp
Show inline comments
 
@@ -32,15 +32,13 @@
 
#include "core/random_func.hpp"
 

	
 
#include "table/strings.h"
 

	
 
static StationClass _station_classes[STAT_CLASS_MAX];
 

	
 
enum {
 
	MAX_SPECLIST = 255,
 
};
 
static const uint MAX_SPECLIST = 255;
 

	
 
enum TriggerArea {
 
	TA_TILE,
 
	TA_PLATFORM,
 
	TA_WHOLE,
 
};
src/osk_gui.cpp
Show inline comments
 
@@ -48,13 +48,13 @@ enum OskWidgets {
 
	OSK_WIDGET_ZXCVB_LAST = OSK_WIDGET_ZXCVB_FIRST + 11,     ///< Last widget of the zxcvb row.
 
};
 

	
 
char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1];
 
static WChar _keyboard[2][OSK_KEYBOARD_ENTRIES];
 

	
 
enum {
 
enum KeyStateBits {
 
	KEYS_NONE,
 
	KEYS_SHIFT,
 
	KEYS_CAPS
 
};
 
static byte _keystate = KEYS_NONE;
 

	
src/pathfinder/npf/npf.cpp
Show inline comments
 
@@ -18,58 +18,56 @@
 
#include "../../roadstop_base.h"
 
#include "../pathfinder_func.h"
 
#include "../pathfinder_type.h"
 
#include "../follow_track.hpp"
 
#include "aystar.h"
 

	
 
enum {
 
	NPF_HASH_BITS = 12, ///< The size of the hash used in pathfinding. Just changing this value should be sufficient to change the hash size. Should be an even value.
 
	/* Do no change below values */
 
	NPF_HASH_SIZE = 1 << NPF_HASH_BITS,
 
	NPF_HASH_HALFBITS = NPF_HASH_BITS / 2,
 
	NPF_HASH_HALFMASK = (1 << NPF_HASH_HALFBITS) - 1
 
};
 
static const uint NPF_HASH_BITS = 12; ///< The size of the hash used in pathfinding. Just changing this value should be sufficient to change the hash size. Should be an even value.
 
/* Do no change below values */
 
static const uint NPF_HASH_SIZE = 1 << NPF_HASH_BITS;
 
static const uint NPF_HASH_HALFBITS = NPF_HASH_BITS / 2;
 
static const uint NPF_HASH_HALFMASK = (1 << NPF_HASH_HALFBITS) - 1;
 

	
 
/* Meant to be stored in AyStar.targetdata */
 
/** Meant to be stored in AyStar.targetdata */
 
struct NPFFindStationOrTileData {
 
	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
 
	bool reserve_path;        ///< Indicates whether the found path should be reserved
 
	StationType station_type; ///< The type of station we're heading for
 
	bool not_articulated;     ///< The (road) vehicle is not articulated
 
	const Vehicle *v;         ///< The vehicle we are pathfinding for
 
};
 

	
 
/* Indices into AyStar.userdata[] */
 
enum {
 
/** Indices into AyStar.userdata[] */
 
enum AyStarUserDataType {
 
	NPF_TYPE = 0,  ///< Contains a TransportTypes value
 
	NPF_SUB_TYPE,  ///< Contains the sub transport type
 
	NPF_OWNER,     ///< Contains an Owner value
 
	NPF_RAILTYPES, ///< Contains a bitmask the compatible RailTypes of the engine when NPF_TYPE == TRANSPORT_RAIL. Unused otherwise.
 
};
 

	
 
/* Indices into AyStarNode.userdata[] */
 
enum {
 
/** Indices into AyStarNode.userdata[] */
 
enum AyStarNodeUserDataType {
 
	NPF_TRACKDIR_CHOICE = 0, ///< The trackdir chosen to get here
 
	NPF_NODE_FLAGS,
 
};
 

	
 
/* Flags for AyStarNode.userdata[NPF_NODE_FLAGS]. Use NPFSetFlag() and NPFGetFlag() to use them. */
 
/** Flags for AyStarNode.userdata[NPF_NODE_FLAGS]. Use NPFSetFlag() and NPFGetFlag() to use them. */
 
enum NPFNodeFlag {
 
	NPF_FLAG_SEEN_SIGNAL,       ///< Used to mark that a signal was seen on the way, for rail only
 
	NPF_FLAG_2ND_SIGNAL,        ///< Used to mark that two signals were seen, rail only
 
	NPF_FLAG_3RD_SIGNAL,        ///< Used to mark that three signals were seen, rail only
 
	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_BLOCK, ///< Used to mark that the last signal on this path was a block signal
 
	NPF_FLAG_IGNORE_START_TILE, ///< Used to mark that the start tile is invalid, and searching should start from the second tile on
 
	NPF_FLAG_TARGET_RESERVED,   ///< Used to mark that the possible reservation target is already reserved
 
	NPF_FLAG_IGNORE_RESERVED,   ///< Used to mark that reserved tiles should be considered impassable
 
};
 

	
 
/* Meant to be stored in AyStar.userpath */
 
/** Meant to be stored in AyStar.userpath */
 
struct NPFFoundTargetData {
 
	uint best_bird_dist;    ///< The best heuristic found. Is 0 if the target was found
 
	uint best_path_dist;    ///< The shortest path. Is UINT_MAX if no path is found
 
	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
 
	bool res_okay;          ///< True if a path reservation could be made
src/rail_cmd.cpp
Show inline comments
 
@@ -2126,13 +2126,13 @@ static void DrawTrackBits(TileInfo *ti, 
 

	
 
/** Enums holding the offsets from base signal sprite,
 
 * according to the side it is representing.
 
 * The addtion of 2 per enum is necessary in order to "jump" over the
 
 * green state sprite, all signal sprites being in pair,
 
 * starting with the off-red state */
 
enum {
 
enum SignalOffsets {
 
	SIGNAL_TO_SOUTHWEST =  0,
 
	SIGNAL_TO_NORTHEAST =  2,
 
	SIGNAL_TO_SOUTHEAST =  4,
 
	SIGNAL_TO_NORTHWEST =  6,
 
	SIGNAL_TO_EAST      =  8,
 
	SIGNAL_TO_WEST      = 10,
src/signal.cpp
Show inline comments
 
@@ -17,18 +17,16 @@
 
#include "functions.h"
 
#include "train.h"
 
#include "company_base.h"
 

	
 

	
 
/** these are the maximums used for updating signal blocks */
 
enum {
 
	SIG_TBU_SIZE    =  64, ///< number of signals entering to block
 
	SIG_TBD_SIZE    = 256, ///< number of intersections - open nodes in current block
 
	SIG_GLOB_SIZE   = 128, ///< number of open blocks (block can be opened more times until detected)
 
	SIG_GLOB_UPDATE =  64, ///< how many items need to be in _globset to force update
 
};
 
static const uint SIG_TBU_SIZE    =  64; ///< number of signals entering to block
 
static const uint SIG_TBD_SIZE    = 256; ///< number of intersections - open nodes in current block
 
static const uint SIG_GLOB_SIZE   = 128; ///< number of open blocks (block can be opened more times until detected)
 
static const uint SIG_GLOB_UPDATE =  64; ///< how many items need to be in _globset to force update
 

	
 
assert_compile(SIG_GLOB_UPDATE <= SIG_GLOB_SIZE);
 

	
 
/** incidating trackbits with given enterdir */
 
static const TrackBits _enterdir_to_trackbits[DIAGDIR_END] = {
 
	TRACK_BIT_3WAY_NE,
src/statusbar_gui.cpp
Show inline comments
 
@@ -80,18 +80,16 @@ enum StatusbarWidget {
 

	
 
struct StatusBarWindow : Window {
 
	bool saving;
 
	int ticker_scroll;
 
	int reminder_timeout;
 

	
 
	enum {
 
		TICKER_STOP    = 1640, ///< scrolling is finished when counter reaches this value
 
		REMINDER_START =   91, ///< initial value of the reminder counter (right dot on the right)
 
		REMINDER_STOP  =    0, ///< reminder disappears when counter reaches this value
 
		COUNTER_STEP   =    2, ///< this is subtracted from active counters every tick
 
	};
 
	static const int TICKER_STOP    = 1640; ///< scrolling is finished when counter reaches this value
 
	static const int REMINDER_START =   91; ///< initial value of the reminder counter (right dot on the right)
 
	static const int REMINDER_STOP  =    0; ///< reminder disappears when counter reaches this value
 
	static const int COUNTER_STEP   =    2; ///< this is subtracted from active counters every tick
 

	
 
	StatusBarWindow(const WindowDesc *desc) : Window()
 
	{
 
		CLRBITS(this->flags4, WF_WHITE_BORDER_MASK);
 
		this->ticker_scroll    =   TICKER_STOP;
 
		this->reminder_timeout = REMINDER_STOP;
src/toolbar_gui.cpp
Show inline comments
 
@@ -208,17 +208,15 @@ static void PopupMainToolbMenu(Window *w
 
	}
 
	ShowDropDownList(w, list, 0, widget, 140, true, true);
 
	SndPlayFx(SND_15_BEEP);
 
}
 

	
 
/** Enum for the Company Toolbar's network related buttons */
 
enum {
 
	CTMN_CLIENT_LIST = -1, ///< Show the client list
 
	CTMN_NEW_COMPANY = -2, ///< Create a new company
 
	CTMN_SPECTATE    = -3, ///< Become spectator
 
};
 
static const int CTMN_CLIENT_LIST = -1; ///< Show the client list
 
static const int CTMN_NEW_COMPANY = -2; ///< Create a new company
 
static const int CTMN_SPECTATE    = -3; ///< Become spectator
 

	
 
/**
 
 * Pop up a generic company list menu.
 
 */
 
static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0)
 
{
src/train_gui.cpp
Show inline comments
 
@@ -123,16 +123,14 @@ struct CargoSummaryItem {
 
	FORCEINLINE bool operator != (const CargoSummaryItem &other) const
 
	{
 
		return this->cargo != other.cargo || this->subtype != other.subtype;
 
	}
 
};
 

	
 
enum {
 
	TRAIN_DETAILS_MIN_INDENT = 32, ///< Minimum indent level in the train details window
 
	TRAIN_DETAILS_MAX_INDENT = 72, ///< Maximum indent level in the train details window; wider than this and we start on a new line
 
};
 
static const uint TRAIN_DETAILS_MIN_INDENT = 32; ///< Minimum indent level in the train details window
 
static const uint TRAIN_DETAILS_MAX_INDENT = 72; ///< Maximum indent level in the train details window; wider than this and we start on a new line
 

	
 
/** Container for the cargo summary information. */
 
typedef SmallVector<CargoSummaryItem, 2> CargoSummary;
 
/** Reused container of cargo details */
 
static CargoSummary _cargo_summary;
 

	
 
@@ -304,13 +302,13 @@ void DrawTrainDetails(const Train *v, in
 
		int sprite_y_offset = 4 + (FONT_HEIGHT_NORMAL - 10) / 2;
 
		int line_height = WD_MATRIX_TOP + FONT_HEIGHT_NORMAL + WD_MATRIX_BOTTOM;
 
		for (; v != NULL && vscroll_pos > -vscroll_cap; v = v->GetNextVehicle()) {
 
			GetCargoSummaryOfArticulatedVehicle(v, &_cargo_summary);
 

	
 
			/* Draw sprites */
 
			int dx = 0;
 
			uint dx = 0;
 
			int px = x;
 
			const Train *u = v;
 
			do {
 
				Point offset;
 
				int width = u->GetDisplayImageWidth(&offset);
 
				if (vscroll_pos <= 0 && vscroll_pos > -vscroll_cap) {
src/video/allegro_v.cpp
Show inline comments
 
@@ -315,16 +315,14 @@ static uint32 ConvertAllegroKeyIntoMy()
 
	DEBUG(driver, 0, "Scancode character pressed %u", scancode);
 
	DEBUG(driver, 0, "Unicode character pressed %u", unicode);
 
#endif
 
	return (key << 16) + unicode;
 
}
 

	
 
enum {
 
	LEFT_BUTTON,
 
	RIGHT_BUTTON,
 
};
 
static const uint LEFT_BUTTON  = 0;
 
static const uint RIGHT_BUTTON = 1;
 

	
 
static void PollEvent()
 
{
 
	poll_mouse();
 

	
 
	bool mouse_action = false;
src/video/cocoa/event.mm
Show inline comments
 
@@ -46,13 +46,13 @@
 
 * C++ and objective C code can't be joined in all cases (classes stuff).
 
 * Read http://developer.apple.com/releasenotes/Cocoa/Objective-C++.html for more information.
 
 */
 

	
 

	
 
/* Right Mouse Button Emulation enum */
 
enum {
 
enum RightMouseButtonEmulationState {
 
	RMBE_COMMAND,
 
	RMBE_CONTROL,
 
	RMBE_OFF,
 
};
 

	
 

	
0 comments (0 inline, 0 general)