# HG changeset patch # User tron # Date 1107677880 0 # Node ID dab90d4cbf2d59c7a1fb8f56192c858ae2f53e41 # Parent 286dda1121cad99af9baeef85f35ab8c46e2da77 (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) diff -r 286dda1121ca -r dab90d4cbf2d economy.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); diff -r 286dda1121ca -r dab90d4cbf2d functions.h --- 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); diff -r 286dda1121ca -r dab90d4cbf2d gfx.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d industry_gui.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d main_gui.c --- 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) diff -r 286dda1121ca -r dab90d4cbf2d misc.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d misc_gui.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d network.c --- 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) diff -r 286dda1121ca -r dab90d4cbf2d network_client.c --- 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 diff -r 286dda1121ca -r dab90d4cbf2d network_gui.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d network_server.c --- 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 diff -r 286dda1121ca -r dab90d4cbf2d news_gui.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d players.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d screenshot.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d settings_gui.c --- 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) { diff -r 286dda1121ca -r dab90d4cbf2d station_gui.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d strings.c --- 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; } diff -r 286dda1121ca -r dab90d4cbf2d strings.h --- /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 diff -r 286dda1121ca -r dab90d4cbf2d texteff.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d town_cmd.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d town_gui.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d ttd.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d variables.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; diff -r 286dda1121ca -r dab90d4cbf2d vehicle_gui.c --- 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" diff -r 286dda1121ca -r dab90d4cbf2d viewport.c --- 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"