Changeset - r17625:366001a31c88
Doxyfile
Show inline comments
 
@@ -192,13 +192,13 @@ PERLMOD_MAKEVAR_PREFIX =
 
ENABLE_PREPROCESSING   = YES
 
MACRO_EXPANSION        = YES
 
EXPAND_ONLY_PREDEF     = YES
 
SEARCH_INCLUDES        = YES
 
INCLUDE_PATH           =
 
INCLUDE_FILE_PATTERNS  =
 
PREDEFINED             = ENABLE_NETWORK ENABLE_AI WITH_ZLIB WITH_LZO WITH_PNG WITH_FONTCONFIG WITH_FREETYPE WITH_ICU UNICODE _UNICODE
 
PREDEFINED             = ENABLE_NETWORK ENABLE_AI WITH_ZLIB WITH_LZO WITH_LZMA WITH_SDL WITH_PNG WITH_FONTCONFIG WITH_FREETYPE WITH_ICU UNICODE _UNICODE _GNU_SOURCE
 
EXPAND_AS_DEFINED      =
 
SKIP_FUNCTION_MACROS   = YES
 
#---------------------------------------------------------------------------
 
# Configuration::additions related to external references
 
#---------------------------------------------------------------------------
 
TAGFILES               =
src/road_cmd.cpp
Show inline comments
 
@@ -1296,12 +1296,19 @@ static void DrawTile_Road(TileInfo *ti)
 
			break;
 
		}
 
	}
 
	DrawBridgeMiddle(ti);
 
}
 

	
 
/**
 
 * Draw the road depot sprite.
 
 * @param x   The x offset to draw at.
 
 * @param y   The y offset to draw at.
 
 * @param dir The direction the depot must be facing.
 
 * @param rt  The road type of the depot to draw.
 
 */
 
void DrawRoadDepotSprite(int x, int y, DiagDirection dir, RoadType rt)
 
{
 
	PaletteID palette = COMPANY_SPRITE_COLOUR(_local_company);
 
	const DrawTileSprites *dts = (rt == ROADTYPE_TRAM) ? &_tram_depot[dir] : &_road_depot[dir];
 

	
 
	x += 33;
src/road_gui.cpp
Show inline comments
 
@@ -830,12 +830,16 @@ static const WindowDesc _build_road_scen
 
	WDP_AUTO, 0, 0,
 
	WC_SCEN_BUILD_TOOLBAR, WC_NONE,
 
	WDF_CONSTRUCTION,
 
	_nested_build_road_scen_widgets, lengthof(_nested_build_road_scen_widgets)
 
);
 

	
 
/**
 
 * Show the road building toolbar in the scenario editor.
 
 * @return The just opened toolbar.
 
 */
 
Window *ShowBuildRoadScenToolbar()
 
{
 
	_cur_roadtype = ROADTYPE_ROAD;
 
	return AllocateWindowDescFront<BuildRoadToolbarWindow>(&_build_road_scen_desc, 0);
 
}
 

	
src/road_map.h
Show inline comments
 
@@ -257,12 +257,13 @@ enum DisallowedRoadDirections {
 
	DRD_SOUTHBOUND, ///< All southbound traffic is disallowed
 
	DRD_NORTHBOUND, ///< All northbound traffic is disallowed
 
	DRD_BOTH,       ///< All directions are disallowed
 
	DRD_END
 
};
 
DECLARE_ENUM_AS_BIT_SET(DisallowedRoadDirections)
 
/** Helper information for extract tool. */
 
template <> struct EnumPropsT<DisallowedRoadDirections> : MakeEnumPropsT<DisallowedRoadDirections, byte, DRD_NONE, DRD_END, DRD_END, 2> {};
 

	
 
/**
 
 * Gets the disallowed directions
 
 * @param t the tile to get the directions from
 
 * @return the disallowed directions
 
@@ -308,33 +309,33 @@ static inline Axis GetCrossingRailAxis(T
 
	assert(IsLevelCrossing(t));
 
	return OtherAxis((Axis)GetCrossingRoadAxis(t));
 
}
 

	
 
/**
 
 * Get the road bits of a level crossing.
 
 * @param t The tile to query.
 
 * @param tile The tile to query.
 
 * @return The present road bits.
 
 */
 
static inline RoadBits GetCrossingRoadBits(TileIndex tile)
 
{
 
	return GetCrossingRoadAxis(tile) == AXIS_X ? ROAD_X : ROAD_Y;
 
}
 

	
 
/**
 
 * Get the rail track of a level crossing.
 
 * @param t The tile to query.
 
 * @param tile The tile to query.
 
 * @return The rail track.
 
 */
 
static inline Track GetCrossingRailTrack(TileIndex tile)
 
{
 
	return AxisToTrack(GetCrossingRailAxis(tile));
 
}
 

	
 
/**
 
 * Get the rail track bits of a level crossing.
 
 * @param t The tile to query.
 
 * @param tile The tile to query.
 
 * @return The rail track bits.
 
 */
 
static inline TrackBits GetCrossingRailBits(TileIndex tile)
 
{
 
	return AxisToTrackBits(GetCrossingRailAxis(tile));
 
}
src/roadstop.cpp
Show inline comments
 
@@ -13,12 +13,13 @@
 
#include "roadveh.h"
 
#include "core/pool_func.hpp"
 
#include "roadstop_base.h"
 
#include "station_base.h"
 
#include "vehicle_func.h"
 

	
 
/** The pool of roadstops. */
 
RoadStopPool _roadstop_pool("RoadStop");
 
INSTANTIATE_POOL_METHODS(RoadStop)
 

	
 
/**
 
 * De-Initializes RoadStops.
 
 */
src/saveload/cargopacket_sl.cpp
Show inline comments
 
@@ -12,12 +12,15 @@
 
#include "../stdafx.h"
 
#include "../vehicle_base.h"
 
#include "../station_base.h"
 

	
 
#include "saveload.h"
 

	
 
/**
 
 * Savegame conversion for cargopackets.
 
 */
 
/* static */ void CargoPacket::AfterLoad()
 
{
 
	if (IsSavegameVersionBefore(44)) {
 
		Vehicle *v;
 
		/* If we remove a station while cargo from it is still enroute, payment calculation will assume
 
		 * 0, 0 to be the source of the cargo, resulting in very high payments usually. v->source_xy
 
@@ -98,29 +101,36 @@ const SaveLoad *GetCargoPacketDesc()
 

	
 
		SLE_END()
 
	};
 
	return _cargopacket_desc;
 
}
 

	
 
/**
 
 * Save the cargo packets.
 
 */
 
static void Save_CAPA()
 
{
 
	CargoPacket *cp;
 

	
 
	FOR_ALL_CARGOPACKETS(cp) {
 
		SlSetArrayIndex(cp->index);
 
		SlObject(cp, GetCargoPacketDesc());
 
	}
 
}
 

	
 
/**
 
 * Load the cargo packets.
 
 */
 
static void Load_CAPA()
 
{
 
	int index;
 

	
 
	while ((index = SlIterateArray()) != -1) {
 
		CargoPacket *cp = new (index) CargoPacket();
 
		SlObject(cp, GetCargoPacketDesc());
 
	}
 
}
 

	
 
/** Chunk handlers related to cargo packets. */
 
extern const ChunkHandler _cargopacket_chunk_handlers[] = {
 
	{ 'CAPA', Save_CAPA, Load_CAPA, NULL, NULL, CH_ARRAY | CH_LAST},
 
};
src/saveload/cheat_sl.cpp
Show inline comments
 
@@ -11,12 +11,15 @@
 

	
 
#include "../stdafx.h"
 
#include "../cheat_type.h"
 

	
 
#include "saveload.h"
 

	
 
/**
 
 * Save the cheat values.
 
 */
 
static void Save_CHTS()
 
{
 
	/* Cannot use lengthof because _cheats is of type Cheats, not Cheat */
 
	byte count = sizeof(_cheats) / sizeof(Cheat);
 
	Cheat *cht = (Cheat*) &_cheats;
 
	Cheat *cht_last = &cht[count];
 
@@ -25,20 +28,24 @@ static void Save_CHTS()
 
	for (; cht != cht_last; cht++) {
 
		SlWriteByte(cht->been_used);
 
		SlWriteByte(cht->value);
 
	}
 
}
 

	
 
/**
 
 * Load the cheat values.
 
 */
 
static void Load_CHTS()
 
{
 
	Cheat *cht = (Cheat*)&_cheats;
 
	size_t count = SlGetFieldLength() / 2;
 

	
 
	for (uint i = 0; i < count; i++) {
 
		cht[i].been_used = (SlReadByte() != 0);
 
		cht[i].value     = (SlReadByte() != 0);
 
	}
 
}
 

	
 
/** Chunk handlers related to cheats. */
 
extern const ChunkHandler _cheat_chunk_handlers[] = {
 
	{ 'CHTS', Save_CHTS, Load_CHTS, NULL, NULL, CH_RIFF | CH_LAST},
 
};
src/saveload/signs_sl.cpp
Show inline comments
 
@@ -11,12 +11,13 @@
 

	
 
#include "../stdafx.h"
 
#include "../signs_base.h"
 

	
 
#include "saveload.h"
 

	
 
/** Description of a sign within the savegame. */
 
static const SaveLoad _sign_desc[] = {
 
  SLE_CONDVAR(Sign, name,  SLE_NAME,                   0, 83),
 
  SLE_CONDSTR(Sign, name,  SLE_STR, 0,                84, SL_MAX_VERSION),
 
  SLE_CONDVAR(Sign, x,     SLE_FILE_I16 | SLE_VAR_I32, 0, 4),
 
  SLE_CONDVAR(Sign, y,     SLE_FILE_I16 | SLE_VAR_I32, 0, 4),
 
  SLE_CONDVAR(Sign, x,     SLE_INT32,                  5, SL_MAX_VERSION),
 
@@ -53,9 +54,10 @@ static void Load_SIGN()
 
		if (IsSavegameVersionBefore(6, 1) || (IsSavegameVersionBefore(83) && si->owner == INVALID_OWNER)) {
 
			si->owner = OWNER_NONE;
 
		}
 
	}
 
}
 

	
 
/** Chunk handlers related to signs. */
 
extern const ChunkHandler _sign_chunk_handlers[] = {
 
	{ 'SIGN', Save_SIGN, Load_SIGN, NULL, NULL, CH_ARRAY | CH_LAST},
 
};
src/saveload/strings_sl.cpp
Show inline comments
 
@@ -112,18 +112,22 @@ void ResetOldNames()
 
void InitializeOldNames()
 
{
 
	free(_old_name_array);
 
	_old_name_array = CallocT<char>(512 * 32); // 200 * 24 would be enough for TTO savegames
 
}
 

	
 
/**
 
 * Load the NAME chunk.
 
 */
 
static void Load_NAME()
 
{
 
	int index;
 

	
 
	while ((index = SlIterateArray()) != -1) {
 
		SlArray(&_old_name_array[32 * index], SlGetFieldLength(), SLE_UINT8);
 
	}
 
}
 

	
 
/** Chunk handlers related to strings. */
 
extern const ChunkHandler _name_chunk_handlers[] = {
 
	{ 'NAME', NULL, Load_NAME, NULL, NULL, CH_ARRAY | CH_LAST},
 
};
src/script/script_scanner.hpp
Show inline comments
 
@@ -11,12 +11,13 @@
 

	
 
#ifndef SCRIPT_SCANNER_HPP
 
#define SCRIPT_SCANNER_HPP
 

	
 
#include "../fileio_type.h"
 

	
 
/** Scanner to help finding scripts. */
 
class ScriptScanner {
 
public:
 
	ScriptScanner();
 
	~ScriptScanner();
 

	
 
	/**
 
@@ -40,11 +41,11 @@ private:
 
	/**
 
	 * Scan a dir for scripts.
 
	 */
 
	void ScanDir(const char *dirname, const char *info_file_name);
 

	
 
protected:
 
	class Squirrel *engine;
 
	char main_script[1024];
 
	class Squirrel *engine; ///< The engine we're scanning with.
 
	char main_script[1024]; ///< The name of the current main script.
 
};
 

	
 
#endif /* SCRIPT_SCANNER_HPP */
src/script/squirrel_helper_type.hpp
Show inline comments
 
@@ -9,12 +9,13 @@
 

	
 
/** @file squirrel_helper_type.hpp Helper structs for converting Squirrel data structures to C++. */
 

	
 
#ifndef SQUIRREL_HELPER_TYPE_HPP
 
#define SQUIRREL_HELPER_TYPE_HPP
 

	
 
/** Definition of a simple array. */
 
struct Array {
 
	int32 size;
 
	int32 array[];
 
	int32 size;    ///< The size of the array.
 
	int32 array[]; ///< The data of the array.
 
};
 

	
 
#endif /* SQUIRREL_HELPER_TYPE_HPP */
src/sdl.cpp
Show inline comments
 
@@ -13,12 +13,13 @@
 

	
 
#ifdef WITH_SDL
 

	
 
#include "sdl.h"
 
#include <SDL.h>
 

	
 
/** Number of users of the SDL library. */
 
static int _sdl_usage;
 

	
 
#ifdef DYNAMICALLY_LOADED_SDL
 

	
 
#include "os/windows/win32.h"
 

	
 
@@ -75,13 +76,16 @@ static const char *LoadSdlDLL()
 
	}
 
	return NULL;
 
}
 

	
 
#endif /* DYNAMICALLY_LOADED_SDL */
 

	
 

	
 
/**
 
 * Open the SDL library.
 
 * @param x The subsystem to load.
 
 */
 
const char *SdlOpen(uint32 x)
 
{
 
#ifdef DYNAMICALLY_LOADED_SDL
 
	{
 
		const char *s = LoadSdlDLL();
 
		if (s != NULL) return s;
 
@@ -93,12 +97,16 @@ const char *SdlOpen(uint32 x)
 
		if (SDL_CALL SDL_InitSubSystem(x) == -1) return SDL_CALL SDL_GetError();
 
	}
 

	
 
	return NULL;
 
}
 

	
 
/**
 
 * Close the SDL library.
 
 * @param x The subsystem to close.
 
 */
 
void SdlClose(uint32 x)
 
{
 
	if (x != 0) {
 
		SDL_CALL SDL_QuitSubSystem(x);
 
	}
 
	if (--_sdl_usage == 0) {
src/settingsgen/settingsgen.cpp
Show inline comments
 
@@ -153,19 +153,24 @@ private:
 
	bool BufferHasRoom() const
 
	{
 
		uint num_blocks = this->output_buffer.Length();
 
		return num_blocks > 0 && this->output_buffer[num_blocks - 1].HasRoom();
 
	}
 

	
 
	typedef SmallVector<OutputBuffer, 2> OutputBufferVector;
 
	typedef SmallVector<OutputBuffer, 2> OutputBufferVector; ///< Vector type for output buffers.
 
	OutputBufferVector output_buffer; ///< Vector of blocks containing the stored output.
 
};
 

	
 

	
 
/** Derived class for loading INI files without going through Fio stuff. */
 
struct SettingsIniFile : IniLoadFile {
 
	/**
 
	 * Construct a new ini loader.
 
	 * @param list_group_names A \c NULL terminated list with group names that should be loaded as lists instead of variables. @see IGT_LIST
 
	 * @param seq_group_names  A \c NULL terminated list with group names that should be loaded as lists of names. @see IGT_SEQUENCE
 
	 */
 
	SettingsIniFile(const char * const *list_group_names = NULL, const char * const *seq_group_names = NULL) :
 
			IniLoadFile(list_group_names, seq_group_names)
 
	{
 
	}
 

	
 
	virtual FILE *OpenFile(const char *filename, size_t *size)
src/ship.h
Show inline comments
 
@@ -17,13 +17,13 @@
 
void GetShipSpriteSize(EngineID engine, uint &width, uint &height);
 

	
 
/**
 
 * All ships have this type.
 
 */
 
struct Ship: public SpecializedVehicle<Ship, VEH_SHIP> {
 
	TrackBitsByte state;
 
	TrackBitsByte state; ///< The "track" the ship is following.
 

	
 
	/** We don't want GCC to zero our struct! It already is zeroed and has an index! */
 
	Ship() : SpecializedVehicleBase() {}
 
	/** We want to 'destruct' the right class. */
 
	virtual ~Ship() { this->PreDestructor(); }
 

	
 
@@ -42,9 +42,13 @@ struct Ship: public SpecializedVehicle<S
 
	Trackdir GetVehicleTrackdir() const;
 
	TileIndex GetOrderStationLocation(StationID station);
 
	bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse);
 
	void UpdateCache();
 
};
 

	
 
/**
 
 * Iterate over all ships.
 
 * @param var The variable used for iteration.
 
 */
 
#define FOR_ALL_SHIPS(var) FOR_ALL_VEHICLES_OF_TYPE(Ship, var)
 

	
 
#endif /* SHIP_H */
src/ship_cmd.cpp
Show inline comments
 
@@ -147,12 +147,15 @@ static void CheckIfShipNeedsService(Vehi
 

	
 
	v->current_order.MakeGoToDepot(depot->index, ODTFB_SERVICE);
 
	v->dest_tile = depot->xy;
 
	SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
 
}
 

	
 
/**
 
 * Update the caches of this ship.
 
 */
 
void Ship::UpdateCache()
 
{
 
	this->vcache.cached_max_speed = GetVehicleProperty(this, PROP_SHIP_SPEED, ShipVehInfo(this->engine_type)->max_speed);
 

	
 
	this->UpdateVisualEffect();
 
}
src/signal_type.h
Show inline comments
 
@@ -31,10 +31,11 @@ enum SignalType {
 
	SIGTYPE_PBS_ONEWAY = 5, ///< no-entry signal
 

	
 
	SIGTYPE_END,
 
	SIGTYPE_LAST       = SIGTYPE_PBS_ONEWAY,
 
	SIGTYPE_LAST_NOPBS = SIGTYPE_COMBO
 
};
 
/** Helper information for extract tool. */
 
template <> struct EnumPropsT<SignalType> : MakeEnumPropsT<SignalType, byte, SIGTYPE_NORMAL, SIGTYPE_END, SIGTYPE_END, 3> {};
 

	
 

	
 
#endif /* SIGNAL_TYPE_H */
src/signs.cpp
Show inline comments
 
@@ -15,13 +15,13 @@
 
#include "signs_func.h"
 
#include "strings_func.h"
 
#include "core/pool_func.hpp"
 

	
 
#include "table/strings.h"
 

	
 
/* Initialize the sign-pool */
 
/** Initialize the sign-pool */
 
SignPool _sign_pool("Sign");
 
INSTANTIATE_POOL_METHODS(Sign)
 

	
 
/**
 
 * Creates a new sign
 
 */
src/signs_cmd.cpp
Show inline comments
 
@@ -18,12 +18,13 @@
 
#include "tilehighlight_func.h"
 
#include "window_func.h"
 
#include "string_func.h"
 

	
 
#include "table/strings.h"
 

	
 
/** The last built sign. */
 
SignID _new_sign_id;
 

	
 
/**
 
 * Place a sign at the given coordinates. Ownership of sign has
 
 * no effect whatsoever except for the colour the sign gets for easy recognition,
 
 * but everybody is able to rename/remove it.
src/signs_gui.cpp
Show inline comments
 
@@ -635,29 +635,41 @@ static const WindowDesc _query_sign_edit
 
	WDP_AUTO, 0, 0,
 
	WC_QUERY_STRING, WC_NONE,
 
	WDF_CONSTRUCTION | WDF_UNCLICK_BUTTONS,
 
	_nested_query_sign_edit_widgets, lengthof(_nested_query_sign_edit_widgets)
 
);
 

	
 
/**
 
 * Handle clicking on a sign.
 
 * @param si The sign that was clicked on.
 
 */
 
void HandleClickOnSign(const Sign *si)
 
{
 
	if (_ctrl_pressed && si->owner == _local_company) {
 
		RenameSign(si->index, NULL);
 
		return;
 
	}
 
	ShowRenameSignWindow(si);
 
}
 

	
 
/**
 
 * Show the window to change the text of a sign.
 
 * @param si The sign to show the window for.
 
 */
 
void ShowRenameSignWindow(const Sign *si)
 
{
 
	/* Delete all other edit windows */
 
	DeleteWindowById(WC_QUERY_STRING, 0);
 

	
 
	new SignWindow(&_query_sign_edit_desc, si);
 
}
 

	
 
/**
 
 * Close the sign window associated with the given sign.
 
 * @param sign The sign to close the window for.
 
 */
 
void DeleteRenameSignWindow(SignID sign)
 
{
 
	SignWindow *w = dynamic_cast<SignWindow *>(FindWindowById(WC_QUERY_STRING, 0));
 

	
 
	if (w != NULL && w->cur_sign == sign) delete w;
 
}
src/signs_type.h
Show inline comments
 
@@ -9,14 +9,15 @@
 

	
 
/** @file signs_type.h Types related to signs */
 

	
 
#ifndef SIGNS_TYPE_H
 
#define SIGNS_TYPE_H
 

	
 
/** The type of the IDs of signs. */
 
typedef uint16 SignID;
 
struct Sign;
 

	
 
static const SignID INVALID_SIGN = 0xFFFF;
 
static const SignID INVALID_SIGN = 0xFFFF; ///< Sentinel for an invalid sign.
 

	
 
static const uint MAX_LENGTH_SIGN_NAME_CHARS = 32; ///< The maximum length of a sign name in characters including '\0'
 

	
 
#endif /* SIGNS_TYPE_H */
src/slope_type.h
Show inline comments
 
@@ -76,12 +76,16 @@ enum Slope {
 
	SLOPE_HALFTILE_S = SLOPE_HALFTILE | (CORNER_S << 6),    ///< the south halftile is leveled (non continuous slope)
 
	SLOPE_HALFTILE_E = SLOPE_HALFTILE | (CORNER_E << 6),    ///< the east halftile is leveled (non continuous slope)
 
	SLOPE_HALFTILE_N = SLOPE_HALFTILE | (CORNER_N << 6),    ///< the north halftile is leveled (non continuous slope)
 
};
 
DECLARE_ENUM_AS_BIT_SET(Slope)
 

	
 
/**
 
 * Helper for creating a bitset of slopes.
 
 * @param x The slope to convert into a bitset.
 
 */
 
#define M(x) (1 << (x))
 
/** Constant bitset with safe slopes for building a level crossing. */
 
static const uint32 VALID_LEVEL_CROSSING_SLOPES = M(SLOPE_SEN) | M(SLOPE_ENW) | M(SLOPE_NWS) | M(SLOPE_NS) | M(SLOPE_WSE) | M(SLOPE_EW) | M(SLOPE_FLAT);
 
#undef M
 

	
 

	
src/smallmap_gui.cpp
Show inline comments
 
@@ -289,12 +289,15 @@ struct SmallMapColourScheme {
 
static const SmallMapColourScheme _heightmap_schemes[] = {
 
	{_green_map_heights,      MKCOLOUR(0x54545454)}, ///< Green colour scheme.
 
	{_dark_green_map_heights, MKCOLOUR(0x62626262)}, ///< Dark green colour scheme.
 
	{_violet_map_heights,     MKCOLOUR(0x82828282)}, ///< Violet colour scheme.
 
};
 

	
 
/**
 
 * (Re)build the colour tables for the legends.
 
 */
 
void BuildLandLegend()
 
{
 
	for (LegendAndColour *lc = _legend_land_contours; lc->legend == STR_TINY_BLACK_HEIGHT; lc++) {
 
		lc->colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[lc->height];
 
	}
 
}
 
@@ -1706,12 +1709,15 @@ static const WindowDesc _smallmap_desc(
 
	WDP_AUTO, 446, 314,
 
	WC_SMALLMAP, WC_NONE,
 
	WDF_UNCLICK_BUTTONS,
 
	_nested_smallmap_widgets, lengthof(_nested_smallmap_widgets)
 
);
 

	
 
/**
 
 * Show the smallmap window.
 
 */
 
void ShowSmallMap()
 
{
 
	AllocateWindowDescFront<SmallMapWindow>(&_smallmap_desc, 0);
 
}
 

	
 
/**
src/sound/null_s.cpp
Show inline comments
 
@@ -9,7 +9,8 @@
 

	
 
/** @file null_s.cpp The sound driver that doesn't produce sound. */
 

	
 
#include "../stdafx.h"
 
#include "null_s.h"
 

	
 
/** The factory for the null sound driver. */
 
static FSoundDriver_Null iFSoundDriver_Null;
src/sound/sdl_s.cpp
Show inline comments
 
@@ -15,14 +15,21 @@
 

	
 
#include "../mixer.h"
 
#include "../sdl.h"
 
#include "sdl_s.h"
 
#include <SDL.h>
 

	
 
/** Factory for the SDL sound driver. */
 
static FSoundDriver_SDL iFSoundDriver_SDL;
 

	
 
/**
 
 * Callback that fills the sound buffer.
 
 * @param userdata Ignored.
 
 * @param stream   The stream to put data into.
 
 * @param len      The length of the stream in bytes.
 
 */
 
static void CDECL fill_sound_buffer(void *userdata, Uint8 *stream, int len)
 
{
 
	MxMixSamples(stream, len / 4);
 
}
 

	
 
const char *SoundDriver_SDL::Start(const char * const *parm)
src/spriteloader/spriteloader.hpp
Show inline comments
 
@@ -12,14 +12,16 @@
 
#ifndef SPRITELOADER_HPP
 
#define SPRITELOADER_HPP
 

	
 
#include "../core/alloc_type.hpp"
 
#include "../gfx_type.h"
 

	
 
/** Interface for the loader of our sprites. */
 
class SpriteLoader {
 
public:
 
	/** Definition of a common pixel in OpenTTD's realm. */
 
	struct CommonPixel {
 
		uint8 r;  ///< Red-channel
 
		uint8 g;  ///< Green-channel
 
		uint8 b;  ///< Blue-channel
 
		uint8 a;  ///< Alpha-channel
 
		uint8 m;  ///< Remap-channel
src/station.cpp
Show inline comments
 
@@ -25,12 +25,13 @@
 
#include "roadstop_base.h"
 
#include "industry.h"
 
#include "core/random_func.hpp"
 

	
 
#include "table/strings.h"
 

	
 
/** The pool of stations. */
 
StationPool _station_pool("Station");
 
INSTANTIATE_POOL_METHODS(Station)
 

	
 
BaseStation::~BaseStation()
 
{
 
	free(this->name);
 
@@ -272,14 +273,14 @@ Rect Station::GetCatchmentRect() const
 

	
 
	return ret;
 
}
 

	
 
/** Rect and pointer to IndustryVector */
 
struct RectAndIndustryVector {
 
	Rect rect;
 
	IndustryVector *industries_near;
 
	Rect rect;                       ///< The rectangle to search the industries in.
 
	IndustryVector *industries_near; ///< The nearby industries.
 
};
 

	
 
/**
 
 * Callback function for Station::RecomputeIndustriesNear()
 
 * Tests whether tile is an industry and possibly adds
 
 * the industry to station's industries_near list.
src/station_map.h
Show inline comments
 
@@ -30,14 +30,14 @@ static inline StationID GetStationIndex(
 
{
 
	assert(IsTileType(t, MP_STATION));
 
	return (StationID)_m[t].m2;
 
}
 

	
 

	
 
static const int GFX_DOCK_BASE_WATER_PART          =  4;
 
static const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET =  4;
 
static const int GFX_DOCK_BASE_WATER_PART          =  4; ///< The offset for the water parts.
 
static const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET =  4; ///< The offset for the drive through parts.
 

	
 
/**
 
 * Get the station type of this tile
 
 * @param t the tile to query
 
 * @pre IsTileType(t, MP_STATION)
 
 * @return the station type
 
@@ -473,12 +473,13 @@ static inline bool IsCustomStationSpecIn
 
	return _m[t].m4 != 0;
 
}
 

	
 
/**
 
 * Set the custom station spec for this tile.
 
 * @param t Tile to set the stationspec of.
 
 * @param specindex The new spec.
 
 * @pre HasStationTileRail(t)
 
 */
 
static inline void SetCustomStationSpecIndex(TileIndex t, byte specindex)
 
{
 
	assert(HasStationTileRail(t));
 
	_m[t].m4 = specindex;
 
@@ -495,13 +496,14 @@ static inline uint GetCustomStationSpecI
 
	assert(HasStationTileRail(t));
 
	return _m[t].m4;
 
}
 

	
 
/**
 
 * Set the random bits for a station tile.
 
 * @param t Tile to set random bits for
 
 * @param t Tile to set random bits for.
 
 * @param random_bits The random bits.
 
 * @pre IsTileType(t, MP_STATION)
 
 */
 
static inline void SetStationTileRandomBits(TileIndex t, byte random_bits)
 
{
 
	assert(IsTileType(t, MP_STATION));
 
	SB(_m[t].m3, 4, 4, random_bits);
 
@@ -523,12 +525,13 @@ static inline byte GetStationTileRandomB
 
 * Make the given tile a station tile.
 
 * @param t the tile to make a station tile
 
 * @param o the owner of the station
 
 * @param sid the station to which this tile belongs
 
 * @param st the type this station tile
 
 * @param section the StationGfx to be used for this tile
 
 * @param wc The water class of the station
 
 */
 
static inline void MakeStation(TileIndex t, Owner o, StationID sid, StationType st, byte section, WaterClass wc = WATER_CLASS_INVALID)
 
{
 
	SetTileType(t, MP_STATION);
 
	SetTileOwner(t, o);
 
	SetWaterClass(t, wc);
 
@@ -596,13 +599,13 @@ static inline void MakeRoadStop(TileInde
 
 * @param station the owner of the roadstop
 
 * @param road the owner of the road
 
 * @param tram the owner of the tram
 
 * @param sid the station to which this tile belongs
 
 * @param rst the type of roadstop to make this tile
 
 * @param rt the roadtypes on this tile
 
 * @param d the direction of the roadstop
 
 * @param a the direction of the roadstop
 
 */
 
static inline void MakeDriveThroughRoadStop(TileIndex t, Owner station, Owner road, Owner tram, StationID sid, RoadStopType rst, RoadTypes rt, Axis a)
 
{
 
	MakeStation(t, station, sid, (rst == ROADSTOP_BUS ? STATION_BUS : STATION_TRUCK), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
 
	SetRoadTypes(t, rt);
 
	SetRoadOwner(t, ROADTYPE_ROAD, road);
src/statusbar_gui.cpp
Show inline comments
 
@@ -254,10 +254,13 @@ bool IsNewsTickerShown()
 
	const StatusBarWindow *w = dynamic_cast<StatusBarWindow*>(FindWindowById(WC_STATUS_BAR, 0));
 
	return w != NULL && w->ticker_scroll < StatusBarWindow::TICKER_STOP;
 
}
 

	
 
int16 *_preferred_statusbar_size = &_main_status_desc.default_width; ///< Pointer to the default size for the status toolbar.
 

	
 
/**
 
 * Show our status bar.
 
 */
 
void ShowStatusBar()
 
{
 
	new StatusBarWindow(&_main_status_desc);
 
}
src/statusbar_gui.h
Show inline comments
 
@@ -9,12 +9,13 @@
 

	
 
/** @file statusbar_gui.h Functions, definitions and such used only by the GUI. */
 

	
 
#ifndef STATUSBAR_GUI_H
 
#define STATUSBAR_GUI_H
 

	
 
/** What of the statusbar must be invalidated? */
 
enum StatusBarInvalidate {
 
	SBI_SAVELOAD_START,  ///< started saving
 
	SBI_SAVELOAD_FINISH, ///< finished saving
 
	SBI_SHOW_TICKER,     ///< start scolling news
 
	SBI_SHOW_REMINDER,   ///< show a reminder (dot on the right side of the statusbar)
 
	SBI_NEWS_DELETED,    ///< abort current news display (active news were deleted)
src/string.cpp
Show inline comments
 
@@ -157,13 +157,17 @@ char *strecpy(char *dst, const char *src
 
		DEBUG(misc, 0, "String too long for destination buffer");
 
#endif /* STRGEN || SETTINGSGEN */
 
	}
 
	return dst;
 
}
 

	
 

	
 
/**
 
 * Format, "printf", into a newly allocated string.
 
 * @param str The formatting string.
 
 * @return The formatted string. You must free this!
 
 */
 
char *CDECL str_fmt(const char *str, ...)
 
{
 
	char buf[4096];
 
	va_list va;
 

	
 
	va_start(va, str);
src/string_type.h
Show inline comments
 
@@ -26,12 +26,13 @@ enum CharSetFilter {
 
	CS_NUMERAL,           ///< Only numeric ones
 
	CS_NUMERAL_SPACE,     ///< Only numbers and spaces
 
	CS_ALPHA,             ///< Only alphabetic values
 
	CS_HEXADECIMAL,       ///< Only hexadecimal characters
 
};
 

	
 
/** Type for wide characters, i.e. non-UTF8 encoded unicode characters. */
 
typedef uint32 WChar;
 

	
 
/* The following are directional formatting codes used to get the LTR and RTL strings right:
 
 * http://www.unicode.org/unicode/reports/tr9/#Directional_Formatting_Codes */
 
static const WChar CHAR_TD_LRM = 0x200E; ///< The next character acts like a left-to-right character.
 
static const WChar CHAR_TD_RLM = 0x200F; ///< The next character acts like a right-to-left character.
src/subsidy_type.h
Show inline comments
 
@@ -17,12 +17,13 @@
 
/** What part of a subsidy is something? */
 
enum PartOfSubsidy {
 
	POS_NONE =     0, ///< nothing
 
	POS_SRC = 1 << 0, ///< bit 0 set -> town/industry is source of subsidised path
 
	POS_DST = 1 << 1, ///< bit 1 set -> town/industry is destination of subsidised path
 
};
 
/** Helper to store the PartOfSubsidy data in a single byte. */
 
typedef SimpleTinyEnumT<PartOfSubsidy, byte> PartOfSubsidyByte;
 

	
 
DECLARE_ENUM_AS_BIT_SET(PartOfSubsidy)
 

	
 
typedef uint16 SubsidyID; ///< ID of a subsidy
 
struct Subsidy;
src/waypoint_gui.cpp
Show inline comments
 
@@ -51,12 +51,17 @@ private:
 
		TileArea ta;
 
		this->wp->GetTileArea(&ta, this->vt == VEH_TRAIN ? STATION_WAYPOINT : STATION_BUOY);
 
		return ta.GetCenterTile();
 
	}
 

	
 
public:
 
	/**
 
	 * Construct the window.
 
	 * @param desc The description of the window.
 
	 * @param window_number The window number, in this case the waypoint's ID.
 
	 */
 
	WaypointWindow(const WindowDesc *desc, WindowNumber window_number) : Window()
 
	{
 
		this->wp = Waypoint::Get(window_number);
 
		this->vt = (wp->string_id == STR_SV_STNAME_WAYPOINT) ? VEH_TRAIN : VEH_SHIP;
 

	
 
		this->CreateNestedTree(desc);
0 comments (0 inline, 0 general)