Changeset - r8790:550c9960067a
[Not reviewed]
master
1 12 3
rubidium - 16 years ago 2008-03-31 07:25:49
rubidium@openttd.org
(svn r12501) -Codechange: split signs.h.
16 files changed with 126 insertions and 86 deletions:
0 comments (0 inline, 0 general)
projects/openttd_vs80.vcproj
Show inline comments
 
@@ -1317,13 +1317,21 @@
 
			</File>
 
			<File
 
				RelativePath=".\..\src\signal_type.h"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\signs.h"
 
				RelativePath=".\..\src\signs_base.h"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\signs_func.h"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\signs_type.h"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\slope_func.h"
 
				>
 
			</File>
projects/openttd_vs90.vcproj
Show inline comments
 
@@ -1314,13 +1314,21 @@
 
			</File>
 
			<File
 
				RelativePath=".\..\src\signal_type.h"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\signs.h"
 
				RelativePath=".\..\src\signs_base.h"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\signs_func.h"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\signs_type.h"
 
				>
 
			</File>
 
			<File
 
				RelativePath=".\..\src\slope_func.h"
 
				>
 
			</File>
source.list
Show inline comments
 
@@ -235,13 +235,15 @@ video/sdl_v.h
 
settings_func.h
 
settings_internal.h
 
settings_type.h
 
ship.h
 
signal_func.h
 
signal_type.h
 
signs.h
 
signs_base.h
 
signs_func.h
 
signs_type.h
 
slope_func.h
 
slope_type.h
 
sound_func.h
 
sound_type.h
 
sprite.h
 
spritecache.h
src/main_gui.cpp
Show inline comments
 
@@ -13,13 +13,13 @@
 
#include "textbuf_gui.h"
 
#include "viewport_func.h"
 
#include "command_func.h"
 
#include "news_func.h"
 
#include "town.h"
 
#include "console.h"
 
#include "signs.h"
 
#include "signs_func.h"
 
#include "waypoint.h"
 
#include "variables.h"
 
#include "train.h"
 
#include "roadveh.h"
 
#include "bridge_map.h"
 
#include "screenshot.h"
src/network/network_internal.h
Show inline comments
 
@@ -42,13 +42,13 @@ enum {
 
	/** Maximum number of internet interfaces supported. */
 
	MAX_INTERFACES = 9,
 

	
 
	/** How many vehicle/station types we put over the network */
 
	NETWORK_VEHICLE_TYPES = 5,
 
	NETWORK_STATION_TYPES = 5,
 
}
 
};
 

	
 
struct NetworkPlayerInfo {
 
	char company_name[NETWORK_NAME_LENGTH];         ///< Company name
 
	char password[NETWORK_PASSWORD_LENGTH];         ///< The password for the player
 
	Year inaugurated_year;                          ///< What year the company started in
 
	Money company_value;                            ///< The company value
src/oldloader.cpp
Show inline comments
 
@@ -10,13 +10,13 @@
 
#include "player_func.h"
 
#include "player_base.h"
 
#include "aircraft.h"
 
#include "roadveh.h"
 
#include "ship.h"
 
#include "train.h"
 
#include "signs.h"
 
#include "signs_base.h"
 
#include "debug.h"
 
#include "depot.h"
 
#include "newgrf_config.h"
 
#include "ai/ai.h"
 
#include "ai/default/default.h"
 
#include "zoom_func.h"
src/openttd.cpp
Show inline comments
 
@@ -41,13 +41,14 @@
 
#include "fios.h"
 
#include "airport.h"
 
#include "aircraft.h"
 
#include "console.h"
 
#include "screenshot.h"
 
#include "network/network.h"
 
#include "signs.h"
 
#include "signs_base.h"
 
#include "signs_func.h"
 
#include "depot.h"
 
#include "waypoint.h"
 
#include "ai/ai.h"
 
#include "train.h"
 
#include "yapf/yapf.h"
 
#include "settings_func.h"
src/signs.cpp
Show inline comments
 
@@ -3,13 +3,14 @@
 
/** @file signs.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "landscape.h"
 
#include "player_func.h"
 
#include "signs.h"
 
#include "signs_base.h"
 
#include "signs_func.h"
 
#include "saveload.h"
 
#include "command_func.h"
 
#include "variables.h"
 
#include "misc/autoptr.hpp"
 
#include "strings_func.h"
 
#include "viewport_func.h"
src/signs.h
Show inline comments
 
deleted file
src/signs_base.h
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/** @file signs_base.h Base class for signs. */
 

	
 
#ifndef SIGNS_BASE_H
 
#define SIGNS_BASE_H
 

	
 
#include "signs_type.h"
 
#include "oldpool.h"
 

	
 
DECLARE_OLD_POOL(Sign, Sign, 2, 16000)
 

	
 
struct Sign : PoolItem<Sign, SignID, &_Sign_pool> {
 
	char *name;
 
	ViewportSign sign;
 
	int32        x;
 
	int32        y;
 
	byte         z;
 
	PlayerByte   owner; // placed by this player. Anyone can delete them though. OWNER_NONE for gray signs from old games.
 

	
 
	/**
 
	 * Creates a new sign
 
	 */
 
	Sign(PlayerID owner = INVALID_PLAYER);
 

	
 
	/** Destroy the sign */
 
	~Sign();
 

	
 
	inline bool IsValid() const { return this->owner != INVALID_PLAYER; }
 
};
 

	
 
static inline SignID GetMaxSignIndex()
 
{
 
	/* TODO - This isn't the real content of the function, but
 
	 *  with the new pool-system this will be replaced with one that
 
	 *  _really_ returns the highest index. Now it just returns
 
	 *  the next safe value we are sure about everything is below.
 
	 */
 
	return GetSignPoolSize() - 1;
 
}
 

	
 
static inline uint GetNumSigns()
 
{
 
	extern uint _total_signs;
 
	return _total_signs;
 
}
 

	
 
static inline bool IsValidSignID(uint index)
 
{
 
	return index < GetSignPoolSize() && GetSign(index)->IsValid();
 
}
 

	
 
#define FOR_ALL_SIGNS_FROM(ss, start) for (ss = GetSign(start); ss != NULL; ss = (ss->index + 1U < GetSignPoolSize()) ? GetSign(ss->index + 1U) : NULL) if (ss->IsValid())
 
#define FOR_ALL_SIGNS(ss) FOR_ALL_SIGNS_FROM(ss, 0)
 

	
 
#endif /* SIGNS_BASE_H */
src/signs_func.h
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/** @file signs_func.h Functions related to signs. */
 

	
 
#ifndef SIGNS_FUNC_H
 
#define SIGNS_FUNC_H
 

	
 
#include "signs_type.h"
 

	
 
extern SignID _new_sign_id;
 
extern bool _sign_sort_dirty;
 

	
 
void UpdateAllSignVirtCoords();
 
void PlaceProc_Sign(TileIndex tile);
 

	
 
/* signs_gui.cpp */
 
void ShowRenameSignWindow(const Sign *si);
 

	
 
void ShowSignList();
 

	
 
#endif /* SIGNS_FUNC_H */
src/signs_gui.cpp
Show inline comments
 
@@ -5,13 +5,14 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "gui.h"
 
#include "textbuf_gui.h"
 
#include "window_gui.h"
 
#include "player_gui.h"
 
#include "signs.h"
 
#include "signs_base.h"
 
#include "signs_func.h"
 
#include "debug.h"
 
#include "variables.h"
 
#include "command_func.h"
 
#include "strings_func.h"
 
#include "core/alloc_func.hpp"
 
#include "window_func.h"
src/signs_type.h
Show inline comments
 
new file 100644
 
/* $Id$ */
 

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

	
 
#ifndef SIGNS_TYPE_H
 
#define SIGNS_TYPE_H
 

	
 
typedef uint16 SignID;
 
struct Sign;
 

	
 
enum {
 
	INVALID_SIGN = 0xFFFF,
 
};
 

	
 
#endif /* SIGNS_TYPE_H */
src/strings.cpp
Show inline comments
 
@@ -17,13 +17,13 @@
 
#include "industry.h"
 
#include "fileio.h"
 
#include "cargotype.h"
 
#include "group.h"
 
#include "debug.h"
 
#include "newgrf_townname.h"
 
#include "signs.h"
 
#include "signs_base.h"
 
#include "newgrf_engine.h"
 
#include "spritecache.h"
 
#include "fontcache.h"
 
#include "gui.h"
 
#include "strings_func.h"
 
#include "functions.h"
src/terraform_gui.cpp
Show inline comments
 
@@ -10,13 +10,13 @@
 
#include "player_base.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport_func.h"
 
#include "gfx_func.h"
 
#include "command_func.h"
 
#include "signs.h"
 
#include "signs_func.h"
 
#include "variables.h"
 
#include "functions.h"
 
#include "sound_func.h"
 
#include "station_base.h"
 
#include "unmovable_map.h"
 
#include "textbuf_gui.h"
src/viewport.cpp
Show inline comments
 
@@ -9,13 +9,14 @@
 
#include "gui.h"
 
#include "spritecache.h"
 
#include "landscape.h"
 
#include "viewport_func.h"
 
#include "station_base.h"
 
#include "town.h"
 
#include "signs.h"
 
#include "signs_base.h"
 
#include "signs_func.h"
 
#include "waypoint.h"
 
#include "variables.h"
 
#include "train.h"
 
#include "roadveh.h"
 
#include "vehicle_gui.h"
 
#include "blitter/factory.hpp"
0 comments (0 inline, 0 general)