summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-08-27 10:04:33 +0000
committerDarkvater <darkvater@openttd.org>2006-08-27 10:04:33 +0000
commit2f6a4bc1a92aeb4904e5e84e23fa28d0307a303c (patch)
tree7b7c2c5ef41754f3d2854fc5337bb50a88959b3b
parent5dec21ff0f3b0b7dce51254d1254d548a9f91093 (diff)
downloadopenttd-2f6a4bc1a92aeb4904e5e84e23fa28d0307a303c.tar.xz
(svn r6169) -Codechange: Use GetString() instead of GetStringWithArgs() which should be
integral to strings.c
-rw-r--r--misc_gui.c7
-rw-r--r--network_gui.c6
-rw-r--r--station_gui.c9
-rw-r--r--strings.c2
-rw-r--r--strings.h1
-rw-r--r--town_gui.c9
6 files changed, 14 insertions, 20 deletions
diff --git a/misc_gui.c b/misc_gui.c
index a569ab500..4deead899 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -105,10 +105,9 @@ static void LandInfoWndProc(Window *w, WindowEvent *e)
// If the accepted value is less than 8, show it in 1/8:ths
if (lid->ac[i] < 8) {
- int32 argv[2];
- argv[0] = lid->ac[i];
- argv[1] = _cargoc.names_s[i];
- p = GetStringWithArgs(p, STR_01D1_8, argv);
+ SetDParam(0, lid->ac[i]);
+ SetDParam(1, _cargoc.names_s[i]);
+ p = GetString(p, STR_01D1_8);
} else {
p = GetString(p, _cargoc.names_s[i]);
}
diff --git a/network_gui.c b/network_gui.c
index 044e4d666..4c530cbb8 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -1512,11 +1512,9 @@ static const char *ChatTabCompletionNextItem(uint *item)
const Town *t;
FOR_ALL_TOWNS_FROM(t, *item - MAX_CLIENT_INFO) {
- int32 temp[1];
-
/* Get the town-name via the string-system */
- temp[0] = t->townnameparts;
- GetStringWithArgs(chat_tab_temp_buffer, t->townnametype, temp);
+ SetDParam(0, t->townnameparts);
+ GetString(chat_tab_temp_buffer, t->townnametype);
return &chat_tab_temp_buffer[0];
}
}
diff --git a/station_gui.c b/station_gui.c
index 28d12983b..5d76f020c 100644
--- a/station_gui.c
+++ b/station_gui.c
@@ -77,16 +77,15 @@ static int CDECL StationNameSorter(const void *a, const void *b)
const Station* st1 = *(const Station**)a;
const Station* st2 = *(const Station**)b;
char buf1[64];
- int32 argv[1];
int r;
- argv[0] = st1->index;
- GetStringWithArgs(buf1, STR_STATION, argv);
+ SetDParam(0, st1->index);
+ GetString(buf1, STR_STATION);
if (st2 != _last_station) {
_last_station = st2;
- argv[0] = st2->index;
- GetStringWithArgs(_bufcache, STR_STATION, argv);
+ SetDParam(0, st2->index);
+ GetString(_bufcache, STR_STATION);
}
r = strcmp(buf1, _bufcache); // sort by name
diff --git a/strings.c b/strings.c
index 3e1e9462b..269eddc17 100644
--- a/strings.c
+++ b/strings.c
@@ -168,7 +168,7 @@ static const char *GetStringPtr(StringID string)
// These 8 bits will only be set when FormatString wants to print
// the string in a different case. No one else except FormatString
// should set those bits, therefore string CANNOT be StringID, but uint32.
-char *GetStringWithArgs(char *buffr, uint string, const int32 *argv)
+static char *GetStringWithArgs(char *buffr, uint string, const int32 *argv)
{
uint index = GB(string, 0, 11);
uint tab = GB(string, 11, 5);
diff --git a/strings.h b/strings.h
index f984bd480..8194fc958 100644
--- a/strings.h
+++ b/strings.h
@@ -12,7 +12,6 @@ static inline char* InlineString(char* buf, uint16 string)
}
char *GetString(char *buffr, uint16 string);
-char *GetStringWithArgs(char *buffr, uint string, const int32 *argv);
extern char _userstring[128];
diff --git a/town_gui.c b/town_gui.c
index cc0b0d240..1cc5269f8 100644
--- a/town_gui.c
+++ b/town_gui.c
@@ -376,18 +376,17 @@ static int CDECL TownNameSorter(const void *a, const void *b)
const Town* tb = *(const Town**)b;
char buf1[64];
int r;
- int32 argv[1];
- argv[0] = ta->index;
- GetStringWithArgs(buf1, STR_TOWN, argv);
+ SetDParam(0, ta->index);
+ GetString(buf1, STR_TOWN);
/* If 'b' is the same town as in the last round, use the cached value
* We do this to speed stuff up ('b' is called with the same value a lot of
* times after eachother) */
if (tb != _last_town) {
_last_town = tb;
- argv[0] = tb->index;
- GetStringWithArgs(_bufcache, STR_TOWN, argv);
+ SetDParam(0, tb->index);
+ GetString(_bufcache, STR_TOWN);
}
r = strcmp(buf1, _bufcache);