Changeset - r17675:70155598b958
[Not reviewed]
master
0 4 0
alberth - 13 years ago 2011-05-14 18:38:54
alberth@openttd.org
(svn r22460) -Doc: Semantic documentation fixes, and doxygen additions (partly by planetmaker).
4 files changed with 32 insertions and 16 deletions:
0 comments (0 inline, 0 general)
src/fileio.cpp
Show inline comments
 
@@ -30,14 +30,16 @@
 
#include <algorithm>
 

	
 
/*************************************************/
 
/* FILE IO ROUTINES ******************************/
 
/*************************************************/
 

	
 
/** Size of the #Fio data buffer. */
 
#define FIO_BUFFER_SIZE 512
 

	
 
/** Structure for keeping several open files with just one data buffer. */
 
struct Fio {
 
	byte *buffer, *buffer_end;             ///< position pointer in local buffer and last valid byte of buffer
 
	size_t pos;                            ///< current (system) position in file
 
	FILE *cur_fh;                          ///< current file handle
 
	const char *filename;                  ///< current filename
 
	FILE *handles[MAX_FILE_SLOTS];         ///< array of file handles we can have open
 
@@ -47,26 +49,31 @@ struct Fio {
 
#if defined(LIMITED_FDS)
 
	uint open_handles;                     ///< current amount of open handles
 
	uint usage_count[MAX_FILE_SLOTS];      ///< count how many times this file has been opened
 
#endif /* LIMITED_FDS */
 
};
 

	
 
static Fio _fio;
 
static Fio _fio; ///< #Fio instance.
 

	
 
/** Whether the working directory should be scanned. */
 
static bool _do_scan_working_directory = true;
 

	
 
extern char *_config_file;
 
extern char *_highscore_file;
 

	
 
/* Get current position in file */
 
/** Get current position in file. */
 
size_t FioGetPos()
 
{
 
	return _fio.pos + (_fio.buffer - _fio.buffer_end);
 
}
 

	
 
/**
 
 * Get the filename associated with a slot.
 
 * @param slot Index of queried file.
 
 * @return Name of the file.
 
 */
 
const char *FioGetFilename(uint8 slot)
 
{
 
	return _fio.shortnames[slot];
 
}
 

	
 
void FioSeekTo(size_t pos, int mode)
src/group.h
Show inline comments
 
@@ -4,30 +4,31 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file group.h Base class from groups. */
 
/** @file group.h Base class for groups and group functions. */
 

	
 
#ifndef GROUP_H
 
#define GROUP_H
 

	
 
#include "group_type.h"
 
#include "core/pool_type.hpp"
 
#include "company_type.h"
 
#include "vehicle_type.h"
 
#include "engine_type.h"
 

	
 
typedef Pool<Group, GroupID, 16, 64000> GroupPool;
 
extern GroupPool _group_pool;
 
extern GroupPool _group_pool; ///< Pool of groups.
 

	
 
/** Group data. */
 
struct Group : GroupPool::PoolItem<&_group_pool> {
 
	char *name;                             ///< Group Name
 

	
 
	uint16 num_vehicle;                     ///< Number of vehicles wich belong to the group
 
	uint16 num_vehicle;                     ///< Number of vehicles in the group
 
	OwnerByte owner;                        ///< Group Owner
 
	VehicleTypeByte vehicle_type;           ///< Vehicle type of the group
 

	
 
	bool replace_protection;                ///< If set to true, the global autoreplace have no effect on the group
 
	uint16 *num_engines;                    ///< Caches the number of engines of each type the company owns (no need to save this)
 

	
 
@@ -66,18 +67,26 @@ static inline uint GetGroupArraySize()
 

	
 
	return num;
 
}
 

	
 
uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e);
 

	
 
/**
 
 * Increase the number of vehicles by one in a group.
 
 * @param id_g Group id.
 
 */
 
static inline void IncreaseGroupNumVehicle(GroupID id_g)
 
{
 
	Group *g = Group::GetIfValid(id_g);
 
	if (g != NULL) g->num_vehicle++;
 
}
 

	
 
/**
 
 * Decrease the number of vehicles by one in a group.
 
 * @param id_g Group id.
 
 */
 
static inline void DecreaseGroupNumVehicle(GroupID id_g)
 
{
 
	Group *g = Group::GetIfValid(id_g);
 
	if (g != NULL) g->num_vehicle--;
 
}
 

	
src/openttd.h
Show inline comments
 
@@ -33,20 +33,20 @@ enum SwitchMode {
 
	SM_GENRANDLAND,
 
	SM_LOAD_SCENARIO,
 
	SM_START_HEIGHTMAP,
 
	SM_LOAD_HEIGHTMAP,
 
};
 

	
 
/* Display Options */
 
/** Display Options */
 
enum DisplayOptions {
 
	DO_SHOW_TOWN_NAMES     = 0,
 
	DO_SHOW_STATION_NAMES  = 1,
 
	DO_SHOW_SIGNS          = 2,
 
	DO_FULL_ANIMATION      = 3,
 
	DO_FULL_DETAIL         = 5,
 
	DO_SHOW_WAYPOINT_NAMES = 6,
 
	DO_SHOW_TOWN_NAMES     = 0, ///< Display town names.
 
	DO_SHOW_STATION_NAMES  = 1, ///< Display station names.
 
	DO_SHOW_SIGNS          = 2, ///< Display signs.
 
	DO_FULL_ANIMATION      = 3, ///< Perform palette animation.
 
	DO_FULL_DETAIL         = 5, ///< Also draw details of track and roads.
 
	DO_SHOW_WAYPOINT_NAMES = 6, ///< Display waypoint names.
 
};
 

	
 
extern GameMode _game_mode;
 
extern SwitchMode _switch_mode;
 
extern bool _exit_game;
 

	
 
@@ -56,13 +56,13 @@ enum PauseMode {
 
	PM_PAUSED_NORMAL         = 1 << 0, ///< A game normally paused
 
	PM_PAUSED_SAVELOAD       = 1 << 1, ///< A game paused for saving/loading
 
	PM_PAUSED_JOIN           = 1 << 2, ///< A game paused for 'pause_on_join'
 
	PM_PAUSED_ERROR          = 1 << 3, ///< A game paused because a (critical) error
 
	PM_PAUSED_ACTIVE_CLIENTS = 1 << 4, ///< A game paused for 'min_active_clients'
 

	
 
	/* Pause mode bits when paused for network reasons */
 
	/** Pause mode bits when paused for network reasons. */
 
	PMB_PAUSED_NETWORK = PM_PAUSED_ACTIVE_CLIENTS | PM_PAUSED_JOIN,
 
};
 
DECLARE_ENUM_AS_BIT_SET(PauseMode)
 
typedef SimpleTinyEnumT<PauseMode, byte> PauseModeByte;
 

	
 
/** The current pause mode */
src/station_cmd.cpp
Show inline comments
 
@@ -159,33 +159,33 @@ static bool CMSAMine(TileIndex tile)
 
	return false;
 
}
 

	
 
/**
 
 * Check whether the tile is water.
 
 * @param tile the tile to investigate.
 
 * @return true if and only if the tile is a mine
 
 * @return true if and only if the tile is a water tile
 
 */
 
static bool CMSAWater(TileIndex tile)
 
{
 
	return IsTileType(tile, MP_WATER) && IsWater(tile);
 
}
 

	
 
/**
 
 * Check whether the tile is a tree.
 
 * @param tile the tile to investigate.
 
 * @return true if and only if the tile is a mine
 
 * @return true if and only if the tile is a tree tile
 
 */
 
static bool CMSATree(TileIndex tile)
 
{
 
	return IsTileType(tile, MP_TREES);
 
}
 

	
 
/**
 
 * Check whether the tile is a forest.
 
 * @param tile the tile to investigate.
 
 * @return true if and only if the tile is a mine
 
 * @return true if and only if the tile is a forest
 
 */
 
static bool CMSAForest(TileIndex tile)
 
{
 
	/* No industry */
 
	if (!IsTileType(tile, MP_INDUSTRY)) return false;
 

	
0 comments (0 inline, 0 general)