diff options
author | rubidium <rubidium@openttd.org> | 2008-03-31 07:25:49 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-03-31 07:25:49 +0000 |
commit | a0895d57fa4cc30e49bef6a689b1a73cf4c3d02a (patch) | |
tree | 15543e5435aa9c7caac61ef628a1dfdc780cddb9 | |
parent | b1e1c134200a18ec8178a933f7bf0442492f60f6 (diff) | |
download | openttd-a0895d57fa4cc30e49bef6a689b1a73cf4c3d02a.tar.xz |
(svn r12501) -Codechange: split signs.h.
-rw-r--r-- | projects/openttd_vs80.vcproj | 10 | ||||
-rw-r--r-- | projects/openttd_vs90.vcproj | 10 | ||||
-rw-r--r-- | source.list | 4 | ||||
-rw-r--r-- | src/main_gui.cpp | 2 | ||||
-rw-r--r-- | src/network/network_internal.h | 2 | ||||
-rw-r--r-- | src/oldloader.cpp | 2 | ||||
-rw-r--r-- | src/openttd.cpp | 3 | ||||
-rw-r--r-- | src/signs.cpp | 3 | ||||
-rw-r--r-- | src/signs_base.h (renamed from src/signs.h) | 28 | ||||
-rw-r--r-- | src/signs_func.h | 21 | ||||
-rw-r--r-- | src/signs_gui.cpp | 3 | ||||
-rw-r--r-- | src/signs_type.h | 15 | ||||
-rw-r--r-- | src/strings.cpp | 2 | ||||
-rw-r--r-- | src/terraform_gui.cpp | 2 | ||||
-rw-r--r-- | src/viewport.cpp | 3 |
15 files changed, 75 insertions, 35 deletions
diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index ff901243f..ec5bb6673 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -1320,7 +1320,15 @@ > </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 diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj index 1af13cafc..df74b8624 100644 --- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -1317,7 +1317,15 @@ > </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 diff --git a/source.list b/source.list index bde85dec9..fdde4965e 100644 --- a/source.list +++ b/source.list @@ -238,7 +238,9 @@ 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 diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 3bf1ed798..e43bfd7ba 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -16,7 +16,7 @@ #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" diff --git a/src/network/network_internal.h b/src/network/network_internal.h index ae4c56c5a..f44d36133 100644 --- a/src/network/network_internal.h +++ b/src/network/network_internal.h @@ -45,7 +45,7 @@ enum { /** 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 diff --git a/src/oldloader.cpp b/src/oldloader.cpp index a5bf88f71..a84cb66fe 100644 --- a/src/oldloader.cpp +++ b/src/oldloader.cpp @@ -13,7 +13,7 @@ #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" diff --git a/src/openttd.cpp b/src/openttd.cpp index 81cfef80d..a82636b6f 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -44,7 +44,8 @@ #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" diff --git a/src/signs.cpp b/src/signs.cpp index 7444bf024..4b3146b22 100644 --- a/src/signs.cpp +++ b/src/signs.cpp @@ -6,7 +6,8 @@ #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" diff --git a/src/signs.h b/src/signs_base.h index ebf32f243..3fd945b5a 100644 --- a/src/signs.h +++ b/src/signs_base.h @@ -1,14 +1,13 @@ /* $Id$ */ -/** @file signs.h */ +/** @file signs_base.h Base class for signs. */ -#ifndef SIGNS_H -#define SIGNS_H +#ifndef SIGNS_BASE_H +#define SIGNS_BASE_H +#include "signs_type.h" #include "oldpool.h" -typedef uint16 SignID; -struct Sign; DECLARE_OLD_POOL(Sign, Sign, 2, 16000) struct Sign : PoolItem<Sign, SignID, &_Sign_pool> { @@ -30,13 +29,6 @@ struct Sign : PoolItem<Sign, SignID, &_Sign_pool> { inline bool IsValid() const { return this->owner != INVALID_PLAYER; } }; -enum { - INVALID_SIGN = 0xFFFF, -}; - -extern SignID _new_sign_id; - - static inline SignID GetMaxSignIndex() { /* TODO - This isn't the real content of the function, but @@ -61,14 +53,4 @@ static inline bool IsValidSignID(uint index) #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) -extern bool _sign_sort_dirty; - -void UpdateAllSignVirtCoords(); -void PlaceProc_Sign(TileIndex tile); - -/* signs_gui.cpp */ -void ShowRenameSignWindow(const Sign *si); - -void ShowSignList(); - -#endif /* SIGNS_H */ +#endif /* SIGNS_BASE_H */ diff --git a/src/signs_func.h b/src/signs_func.h new file mode 100644 index 000000000..5a38ba748 --- /dev/null +++ b/src/signs_func.h @@ -0,0 +1,21 @@ +/* $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 */ diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index ce533954c..2e01f260a 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -8,7 +8,8 @@ #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" diff --git a/src/signs_type.h b/src/signs_type.h new file mode 100644 index 000000000..7f1dc5f4f --- /dev/null +++ b/src/signs_type.h @@ -0,0 +1,15 @@ +/* $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 */ diff --git a/src/strings.cpp b/src/strings.cpp index 62e822438..2fcb7055c 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -20,7 +20,7 @@ #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" diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 935f39afc..a215bd475 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -13,7 +13,7 @@ #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" diff --git a/src/viewport.cpp b/src/viewport.cpp index 96e8dff88..659834fd1 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -12,7 +12,8 @@ #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" |