summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-02-06 08:18:00 +0000
committertron <tron@openttd.org>2005-02-06 08:18:00 +0000
commit0381073e56049b39df7fa28cc082a41829951724 (patch)
treee7f49d247bb563381139e0a730ab1ece0b430e89
parent0b8876e946b3a9b38b57d9688512cb7a54148720 (diff)
downloadopenttd-0381073e56049b39df7fa28cc082a41829951724.tar.xz
(svn r1813) Declare functions implemented in strings.c in their own shiny new header (though i think some of these function don't belong into strings.c)
-rw-r--r--economy.c3
-rw-r--r--functions.h9
-rw-r--r--gfx.c1
-rw-r--r--industry_gui.c1
-rw-r--r--main_gui.c3
-rw-r--r--misc.c1
-rw-r--r--misc_gui.c1
-rw-r--r--network.c2
-rw-r--r--network_client.c1
-rw-r--r--network_gui.c1
-rw-r--r--network_server.c1
-rw-r--r--news_gui.c1
-rw-r--r--players.c1
-rw-r--r--screenshot.c1
-rw-r--r--settings_gui.c2
-rw-r--r--station_gui.c1
-rw-r--r--strings.c7
-rw-r--r--strings.h15
-rw-r--r--texteff.c1
-rw-r--r--town_cmd.c1
-rw-r--r--town_gui.c1
-rw-r--r--ttd.c1
-rw-r--r--variables.h1
-rw-r--r--vehicle_gui.c1
-rw-r--r--viewport.c1
25 files changed, 41 insertions, 18 deletions
diff --git a/economy.c b/economy.c
index c42fdfaa2..66aaff6f2 100644
--- a/economy.c
+++ b/economy.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h" // XXX InjectDParam()
#include "table/strings.h"
#include "map.h"
#include "news.h"
@@ -1191,7 +1192,7 @@ static bool CheckSubsidised(Station *from, Station *to, byte cargo_type)
/* Add a news item */
pair = SetupSubsidyDecodeParam(s, 0);
- INJECT_DPARAM(2);
+ InjectDParam(2);
p = DEREF_PLAYER(_current_player);
SetDParam(0, p->name_1);
diff --git a/functions.h b/functions.h
index 9808f7ccb..2659b4bf4 100644
--- a/functions.h
+++ b/functions.h
@@ -47,15 +47,6 @@ static inline Point RemapCoords2(int x, int y)
return RemapCoords(x, y, GetSlopeZ(x, y));
}
-/* game.c */
-byte *GetString(byte *buffr, uint16 string);
-void InjectDparam(int amount);
-
-int32 GetParamInt32(void);
-int GetParamInt16(void);
-int GetParamInt8(void);
-int GetParamUint16(void);
-
/* clear_land.c */
void DrawHillyLandTile(TileInfo *ti);
diff --git a/gfx.c b/gfx.c
index bc9c6eea1..5c6e1751e 100644
--- a/gfx.c
+++ b/gfx.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "gfx.h"
#include "table/palettes.h"
#include "hal.h"
diff --git a/industry_gui.c b/industry_gui.c
index b503f1f57..579100a26 100644
--- a/industry_gui.c
+++ b/industry_gui.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "debug.h"
+#include "strings.h"
#include "table/strings.h"
#include "map.h"
//#include "gui.h"
diff --git a/main_gui.c b/main_gui.c
index 3a754e69b..680e04f41 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"
@@ -45,8 +46,6 @@ extern void GenerateWorld(int mode, uint log_x, uint log_y);
extern void GenerateIndustries(void);
extern void GenerateTowns(void);
-extern uint GetCurrentCurrencyRate(void);
-
extern void CcTerraform(bool success, uint tile, uint32 p1, uint32 p2);
void HandleOnEditTextCancel(void)
diff --git a/misc.c b/misc.c
index c4e0a8df1..546aeeaa8 100644
--- a/misc.c
+++ b/misc.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h" // XXX GetParam*
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
diff --git a/misc_gui.c b/misc_gui.c
index 6dcb30c65..882e21d5c 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "debug.h"
+#include "strings.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
diff --git a/network.c b/network.c
index 5b6a46427..2a72de771 100644
--- a/network.c
+++ b/network.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "debug.h"
+#include "strings.h"
#include "map.h"
#include "network_data.h"
@@ -44,7 +45,6 @@ static uint16 _network_client_index = NETWORK_SERVER_INDEX + 1;
/* Some externs / forwards */
extern void ShowJoinStatusWindow(void);
extern void StateGameLoop(void);
-extern uint GetCurrentCurrencyRate(void);
// Function that looks up the CI for a given client-index
NetworkClientInfo *NetworkFindClientInfoFromIndex(uint16 client_index)
diff --git a/network_client.c b/network_client.c
index 8deec2fd3..6a42b75d0 100644
--- a/network_client.c
+++ b/network_client.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "debug.h"
+#include "strings.h"
#include "network_data.h"
#ifdef ENABLE_NETWORK
diff --git a/network_gui.c b/network_gui.c
index f5aea33e3..95b4707e0 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "network.h"
#include "saveload.h"
diff --git a/network_server.c b/network_server.c
index 0fee52779..594f7856a 100644
--- a/network_server.c
+++ b/network_server.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "debug.h"
+#include "strings.h"
#include "network_data.h"
#ifdef ENABLE_NETWORK
diff --git a/news_gui.c b/news_gui.c
index a17946c90..b8931a36c 100644
--- a/news_gui.c
+++ b/news_gui.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "table/strings.h"
#include "window.h"
#include "gui.h"
diff --git a/players.c b/players.c
index a33307cc2..a48b4ac7c 100644
--- a/players.c
+++ b/players.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "table/strings.h"
#include "map.h"
#include "player.h"
diff --git a/screenshot.c b/screenshot.c
index d0e0107d3..b7129a4a9 100644
--- a/screenshot.c
+++ b/screenshot.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "debug.h"
+#include "strings.h"
#include "table/strings.h"
#include "gfx.h"
#include "viewport.h"
diff --git a/settings_gui.c b/settings_gui.c
index af394b3ae..e1e0512a6 100644
--- a/settings_gui.c
+++ b/settings_gui.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h" // XXX GetCurrentCurrencyRate()
#include "table/strings.h"
#include "window.h"
#include "gui.h"
@@ -726,7 +727,6 @@ static const PatchPage _patches_page[] = {
{_patches_ai, lengthof(_patches_ai) },
};
-extern uint GetCurrentCurrencyRate(void);
static int32 ReadPE(const PatchEntry*pe)
{
diff --git a/station_gui.c b/station_gui.c
index 8453c555f..d628211df 100644
--- a/station_gui.c
+++ b/station_gui.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "debug.h"
+#include "strings.h"
#include "table/strings.h"
#include "window.h"
#include "gui.h"
diff --git a/strings.c b/strings.c
index 4925bbf5b..a089aa4a3 100644
--- a/strings.c
+++ b/strings.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "table/strings.h"
#include "namegen.h"
#include "station.h"
@@ -109,7 +110,7 @@ byte *GetString(byte *buffr, uint16 string)
return DecodeString(buffr, GetStringPtr(string));
}
-void InjectDparam(int amount)
+void InjectDParam(int amount)
{
memmove(_decode_parameters + amount, _decode_parameters, sizeof(_decode_parameters) - amount * sizeof(uint32));
}
@@ -443,7 +444,7 @@ static byte *DecodeString(byte *buff, const byte *str)
case 0x9A: { // {STATION}
Station *st;
- InjectDparam(1);
+ InjectDParam(1);
st = GetStation(GetDParam(1));
if (!st->xy) { // station doesn't exist anymore
buff = GetString(buff, STR_UNKNOWN_DESTINATION);
@@ -480,7 +481,7 @@ static byte *DecodeString(byte *buff, const byte *str)
if (idx == 0) {
str = STR_WAYPOINTNAME_CITY;
} else {
- InjectDparam(1);
+ InjectDParam(1);
SetDParam(1, idx + 1);
str = STR_WAYPOINTNAME_CITY_SERIAL;
}
diff --git a/strings.h b/strings.h
new file mode 100644
index 000000000..bff978c92
--- /dev/null
+++ b/strings.h
@@ -0,0 +1,15 @@
+#ifndef STRINGS_H
+#define STRINGS_H
+
+byte *GetString(byte *buffr, uint16 string);
+
+void InjectDParam(int amount);
+
+int32 GetParamInt32(void);
+int GetParamInt16(void);
+int GetParamInt8(void);
+int GetParamUint16(void);
+
+uint GetCurrentCurrencyRate(void);
+
+#endif
diff --git a/texteff.c b/texteff.c
index 3e5f6fc89..73789bd06 100644
--- a/texteff.c
+++ b/texteff.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "gfx.h"
#include "viewport.h"
#include "saveload.h"
diff --git a/town_cmd.c b/town_cmd.c
index ad7dd4847..7c9737a05 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"
diff --git a/town_gui.c b/town_gui.c
index 84b5a319c..a5441bbb4 100644
--- a/town_gui.c
+++ b/town_gui.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "debug.h"
+#include "strings.h"
#include "table/strings.h"
#include "town.h"
#include "window.h"
diff --git a/ttd.c b/ttd.c
index 7dbf115e4..46e9b2d10 100644
--- a/ttd.c
+++ b/ttd.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "table/strings.h"
#include "debug.h"
+#include "strings.h"
#include "map.h"
#include "tile.h"
diff --git a/variables.h b/variables.h
index 895ca3aaa..9ac5800ef 100644
--- a/variables.h
+++ b/variables.h
@@ -412,7 +412,6 @@ static inline uint32 GetDParam(uint n)
#define COPY_IN_DPARAM(offs,src,num) memcpy(_decode_parameters + offs, src, sizeof(uint32) * (num))
#define COPY_OUT_DPARAM(dst,offs,num) memcpy(dst,_decode_parameters + offs, sizeof(uint32) * (num))
-#define INJECT_DPARAM(n) InjectDparam(n);
#define SET_EXPENSES_TYPE(x) _yearly_expenses_type = x;
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 9344fc2b9..2a932380d 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "debug.h"
+#include "strings.h"
#include "table/strings.h"
#include "vehicle.h"
#include "window.h"
diff --git a/viewport.c b/viewport.c
index 737a5c350..4718a8c46 100644
--- a/viewport.c
+++ b/viewport.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "debug.h"
+#include "strings.h"
#include "table/strings.h"
#include "map.h"
#include "viewport.h"