Changeset - r1309:4100b4013e37
[Not reviewed]
master
0 24 1
tron - 19 years ago 2005-02-06 08:18:00
tron@openttd.org
(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)
25 files changed with 41 insertions and 18 deletions:
0 comments (0 inline, 0 general)
economy.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h" // XXX InjectDParam()
 
#include "table/strings.h"
 
#include "map.h"
 
#include "news.h"
 
#include "player.h"
 
#include "station.h"
 
#include "vehicle.h"
 
@@ -1188,13 +1189,13 @@ static bool CheckSubsidised(Station *fro
 
			s->age = 12;
 
			s->from = from->index;
 
			s->to = to->index;
 

	
 
			/* Add a news item */
 
			pair = SetupSubsidyDecodeParam(s, 0);
 
			INJECT_DPARAM(2);
 
			InjectDParam(2);
 

	
 
			p = DEREF_PLAYER(_current_player);
 
			SetDParam(0, p->name_1);
 
			SetDParam(1, p->name_2);
 
			AddNewsItem(
 
				STR_2031_SERVICE_SUBSIDY_AWARDED + _opt.diff.subsidy_multiplier,
functions.h
Show inline comments
 
@@ -44,21 +44,12 @@ static inline Point RemapCoords(int x, i
 

	
 
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);
 
void DrawClearLandTile(TileInfo *ti, byte set);
 
void DrawClearLandFence(TileInfo *ti, byte img);
 
void TileLoopClearHelper(uint tile);
gfx.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h"
 
#include "gfx.h"
 
#include "table/palettes.h"
 
#include "hal.h"
 

	
 
static void GfxMainBlitter(byte *sprite, int x, int y, int mode);
 

	
industry_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "map.h"
 
//#include "gui.h"
 
#include "window.h"
 
#include "gfx.h"
 
#include "command.h"
main_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "tile.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "viewport.h"
 
@@ -42,14 +43,12 @@ static byte _terraform_size = 1;
 
static byte _last_built_railtype;
 
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)
 
{
 
	switch(_rename_what) {
 
#ifdef ENABLE_NETWORK
misc.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h" // XXX GetParam*
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "gfx.h"
 
#include "assert.h"
 
#include "saveload.h"
misc_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
network.c
Show inline comments
 
#include "stdafx.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "map.h"
 
#include "network_data.h"
 

	
 
#if defined(WITH_REV)
 
	extern const char _openttd_revision[];
 
#elif defined(WITH_REV_HACK)
 
@@ -41,13 +42,12 @@ static byte _network_clients_connected =
 
// The index counter for new clients (is never decreased)
 
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)
 
{
 
	NetworkClientInfo *ci;
 

	
network_client.c
Show inline comments
 
#include "stdafx.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "network_data.h"
 

	
 
#ifdef ENABLE_NETWORK
 

	
 
#include "table/strings.h"
 
#include "network_client.h"
network_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h"
 
#include "network.h"
 
#include "saveload.h"
 

	
 
#include "hal.h" // for file list
 

	
 
#ifdef ENABLE_NETWORK
network_server.c
Show inline comments
 
#include "stdafx.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "network_data.h"
 

	
 
#ifdef ENABLE_NETWORK
 

	
 
#include "table/strings.h"
 
#include "network_server.h"
news_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "news.h"
players.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "player.h"
 
#include "town.h"
 
#include "vehicle.h"
 
#include "station.h"
screenshot.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "gfx.h"
 
#include "viewport.h"
 
#include "player.h"
 
#include "gui.h"
 
#include "screenshot.h"
settings_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h" // XXX GetCurrentCurrencyRate()
 
#include "table/strings.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "gfx.h"
 
#include "command.h"
 
#include "engine.h"
 
@@ -723,13 +724,12 @@ static const PatchPage _patches_page[] =
 
	{_patches_vehicles,			lengthof(_patches_vehicles) },
 
	{_patches_stations,			lengthof(_patches_stations) },
 
	{_patches_economy,			lengthof(_patches_economy) },
 
	{_patches_ai,						lengthof(_patches_ai) },
 
};
 

	
 
extern uint GetCurrentCurrencyRate(void);
 

	
 
static int32 ReadPE(const PatchEntry*pe)
 
{
 
	switch(pe->type) {
 
	case PE_BOOL:   return *(bool*)pe->variable;
 
	case PE_UINT8:  return *(uint8*)pe->variable;
station_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "station.h"
 
#include "gfx.h"
 
#include "player.h"
strings.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "namegen.h"
 
#include "station.h"
 
#include "town.h"
 
#include "vehicle.h"
 
#include "news.h"
 
@@ -106,13 +107,13 @@ byte *GetString(byte *buffr, uint16 stri
 
	if (index >= _langtab_num[tab])
 
		error("!String 0x%X is invalid. Probably because an old version of the .lng file.\n", 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));
 
}
 

	
 

	
 
int32 GetParamInt32(void)
 
@@ -440,13 +441,13 @@ static byte *DecodeString(byte *buff, co
 
			buff = GetString(buff, cargo_str);
 
			break;
 
		}
 

	
 
		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);
 
				break;
 
			}
 
			SetDParam(0, st->town->townnametype);
 
@@ -477,13 +478,13 @@ static byte *DecodeString(byte *buff, co
 
				str = cp->town_or_string;
 
			} else {
 
				idx = (cp->town_or_string >> 8) & 0x3F;
 
				if (idx == 0) {
 
					str = STR_WAYPOINTNAME_CITY;
 
				} else {
 
					InjectDparam(1);
 
					InjectDParam(1);
 
					SetDParam(1, idx + 1);
 
					str = STR_WAYPOINTNAME_CITY_SERIAL;
 
				}
 
				SetDParam(0, cp->town_or_string & 0xFF);
 
			}
 

	
strings.h
Show inline comments
 
new file 100644
 
#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
texteff.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h"
 
#include "gfx.h"
 
#include "viewport.h"
 
#include "saveload.h"
 
#include "hal.h"
 
#include "console.h"
 
#include <stdarg.h> /* va_list */
town_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "tile.h"
 
#include "viewport.h"
 
#include "town.h"
 
#include "command.h"
town_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "town.h"
 
#include "window.h"
 
#include "gfx.h"
 
#include "viewport.h"
 
#include "gui.h"
ttd.c
Show inline comments
 
#include "stdafx.h"
 
#include "table/strings.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "map.h"
 
#include "tile.h"
 

	
 
#define VARDEF
 
#include "ttd.h"
 
#include "gfx.h"
variables.h
Show inline comments
 
@@ -409,13 +409,12 @@ 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;
 

	
 
/* landscape.c */
 
extern const byte _tileh_to_sprite[32];
 

	
vehicle_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "vehicle.h"
 
#include "window.h"
 
#include "engine.h"
 
#include "gui.h"
 
#include "command.h"
viewport.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "debug.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "viewport.h"
 
#include "window.h"
 
#include "vehicle.h"
 
#include "station.h"
0 comments (0 inline, 0 general)