(svn r12501) -Codechange: split signs.h.
--- a/projects/openttd_vs80.vcproj Mon Mar 31 07:11:18 2008 +0000
+++ b/projects/openttd_vs80.vcproj Mon Mar 31 07:25:49 2008 +0000
@@ -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
--- a/projects/openttd_vs90.vcproj Mon Mar 31 07:11:18 2008 +0000
+++ b/projects/openttd_vs90.vcproj Mon Mar 31 07:25:49 2008 +0000
@@ -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
--- a/source.list Mon Mar 31 07:11:18 2008 +0000
+++ b/source.list Mon Mar 31 07:25:49 2008 +0000
@@ -238,7 +238,9 @@
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
--- a/src/main_gui.cpp Mon Mar 31 07:11:18 2008 +0000
+++ b/src/main_gui.cpp Mon Mar 31 07:25:49 2008 +0000
@@ -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"
--- a/src/network/network_internal.h Mon Mar 31 07:11:18 2008 +0000
+++ b/src/network/network_internal.h Mon Mar 31 07:25:49 2008 +0000
@@ -45,7 +45,7 @@
/** 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
--- a/src/oldloader.cpp Mon Mar 31 07:11:18 2008 +0000
+++ b/src/oldloader.cpp Mon Mar 31 07:25:49 2008 +0000
@@ -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"
--- a/src/openttd.cpp Mon Mar 31 07:11:18 2008 +0000
+++ b/src/openttd.cpp Mon Mar 31 07:25:49 2008 +0000
@@ -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"
--- a/src/signs.cpp Mon Mar 31 07:11:18 2008 +0000
+++ b/src/signs.cpp Mon Mar 31 07:25:49 2008 +0000
@@ -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"
--- a/src/signs.h Mon Mar 31 07:11:18 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/* $Id$ */
-
-/** @file signs.h */
-
-#ifndef SIGNS_H
-#define SIGNS_H
-
-#include "oldpool.h"
-
-typedef uint16 SignID;
-struct Sign;
-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; }
-};
-
-enum {
- INVALID_SIGN = 0xFFFF,
-};
-
-extern SignID _new_sign_id;
-
-
-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)
-
-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 */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/signs_base.h Mon Mar 31 07:25:49 2008 +0000
@@ -0,0 +1,56 @@
+/* $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 */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/signs_func.h Mon Mar 31 07:25:49 2008 +0000
@@ -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 */
--- a/src/signs_gui.cpp Mon Mar 31 07:11:18 2008 +0000
+++ b/src/signs_gui.cpp Mon Mar 31 07:25:49 2008 +0000
@@ -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"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/signs_type.h Mon Mar 31 07:25:49 2008 +0000
@@ -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 */
--- a/src/strings.cpp Mon Mar 31 07:11:18 2008 +0000
+++ b/src/strings.cpp Mon Mar 31 07:25:49 2008 +0000
@@ -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"
--- a/src/terraform_gui.cpp Mon Mar 31 07:11:18 2008 +0000
+++ b/src/terraform_gui.cpp Mon Mar 31 07:25:49 2008 +0000
@@ -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"
--- a/src/viewport.cpp Mon Mar 31 07:11:18 2008 +0000
+++ b/src/viewport.cpp Mon Mar 31 07:25:49 2008 +0000
@@ -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"