(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)
--- a/economy.c Sun Feb 06 07:49:41 2005 +0000
+++ b/economy.c Sun Feb 06 08:18:00 2005 +0000
@@ -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 @@
/* Add a news item */
pair = SetupSubsidyDecodeParam(s, 0);
- INJECT_DPARAM(2);
+ InjectDParam(2);
p = DEREF_PLAYER(_current_player);
SetDParam(0, p->name_1);
--- a/functions.h Sun Feb 06 07:49:41 2005 +0000
+++ b/functions.h Sun Feb 06 08:18:00 2005 +0000
@@ -47,15 +47,6 @@
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);
--- a/gfx.c Sun Feb 06 07:49:41 2005 +0000
+++ b/gfx.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "gfx.h"
#include "table/palettes.h"
#include "hal.h"
--- a/industry_gui.c Sun Feb 06 07:49:41 2005 +0000
+++ b/industry_gui.c Sun Feb 06 08:18:00 2005 +0000
@@ -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"
--- a/main_gui.c Sun Feb 06 07:49:41 2005 +0000
+++ b/main_gui.c Sun Feb 06 08:18:00 2005 +0000
@@ -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 GenerateIndustries(void);
extern void GenerateTowns(void);
-extern uint GetCurrentCurrencyRate(void);
-
extern void CcTerraform(bool success, uint tile, uint32 p1, uint32 p2);
void HandleOnEditTextCancel(void)
--- a/misc.c Sun Feb 06 07:49:41 2005 +0000
+++ b/misc.c Sun Feb 06 08:18:00 2005 +0000
@@ -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"
--- a/misc_gui.c Sun Feb 06 07:49:41 2005 +0000
+++ b/misc_gui.c Sun Feb 06 08:18:00 2005 +0000
@@ -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"
--- a/network.c Sun Feb 06 07:49:41 2005 +0000
+++ b/network.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "debug.h"
+#include "strings.h"
#include "map.h"
#include "network_data.h"
@@ -44,7 +45,6 @@
/* 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)
--- a/network_client.c Sun Feb 06 07:49:41 2005 +0000
+++ b/network_client.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "debug.h"
+#include "strings.h"
#include "network_data.h"
#ifdef ENABLE_NETWORK
--- a/network_gui.c Sun Feb 06 07:49:41 2005 +0000
+++ b/network_gui.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "network.h"
#include "saveload.h"
--- a/network_server.c Sun Feb 06 07:49:41 2005 +0000
+++ b/network_server.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "debug.h"
+#include "strings.h"
#include "network_data.h"
#ifdef ENABLE_NETWORK
--- a/news_gui.c Sun Feb 06 07:49:41 2005 +0000
+++ b/news_gui.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "table/strings.h"
#include "window.h"
#include "gui.h"
--- a/players.c Sun Feb 06 07:49:41 2005 +0000
+++ b/players.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "table/strings.h"
#include "map.h"
#include "player.h"
--- a/screenshot.c Sun Feb 06 07:49:41 2005 +0000
+++ b/screenshot.c Sun Feb 06 08:18:00 2005 +0000
@@ -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"
--- a/settings_gui.c Sun Feb 06 07:49:41 2005 +0000
+++ b/settings_gui.c Sun Feb 06 08:18:00 2005 +0000
@@ -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 @@
{_patches_ai, lengthof(_patches_ai) },
};
-extern uint GetCurrentCurrencyRate(void);
static int32 ReadPE(const PatchEntry*pe)
{
--- a/station_gui.c Sun Feb 06 07:49:41 2005 +0000
+++ b/station_gui.c Sun Feb 06 08:18:00 2005 +0000
@@ -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"
--- a/strings.c Sun Feb 06 07:49:41 2005 +0000
+++ b/strings.c Sun Feb 06 08:18:00 2005 +0000
@@ -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 @@
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 @@
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 @@
if (idx == 0) {
str = STR_WAYPOINTNAME_CITY;
} else {
- InjectDparam(1);
+ InjectDParam(1);
SetDParam(1, idx + 1);
str = STR_WAYPOINTNAME_CITY_SERIAL;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/strings.h Sun Feb 06 08:18:00 2005 +0000
@@ -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
--- a/texteff.c Sun Feb 06 07:49:41 2005 +0000
+++ b/texteff.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "gfx.h"
#include "viewport.h"
#include "saveload.h"
--- a/town_cmd.c Sun Feb 06 07:49:41 2005 +0000
+++ b/town_cmd.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
+#include "strings.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"
--- a/town_gui.c Sun Feb 06 07:49:41 2005 +0000
+++ b/town_gui.c Sun Feb 06 08:18:00 2005 +0000
@@ -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"
--- a/ttd.c Sun Feb 06 07:49:41 2005 +0000
+++ b/ttd.c Sun Feb 06 08:18:00 2005 +0000
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "table/strings.h"
#include "debug.h"
+#include "strings.h"
#include "map.h"
#include "tile.h"
--- a/variables.h Sun Feb 06 07:49:41 2005 +0000
+++ b/variables.h Sun Feb 06 08:18:00 2005 +0000
@@ -412,7 +412,6 @@
#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;
--- a/vehicle_gui.c Sun Feb 06 07:49:41 2005 +0000
+++ b/vehicle_gui.c Sun Feb 06 08:18:00 2005 +0000
@@ -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"
--- a/viewport.c Sun Feb 06 07:49:41 2005 +0000
+++ b/viewport.c Sun Feb 06 08:18:00 2005 +0000
@@ -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"