1
0
Fork 0

(svn r6169) -Codechange: Use GetString() instead of GetStringWithArgs() which should be

integral to strings.c
release/0.5
Darkvater 2006-08-27 10:04:33 +00:00
parent 5dec21ff0f
commit 2f6a4bc1a9
6 changed files with 14 additions and 20 deletions

View File

@ -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 the accepted value is less than 8, show it in 1/8:ths
if (lid->ac[i] < 8) { if (lid->ac[i] < 8) {
int32 argv[2]; SetDParam(0, lid->ac[i]);
argv[0] = lid->ac[i]; SetDParam(1, _cargoc.names_s[i]);
argv[1] = _cargoc.names_s[i]; p = GetString(p, STR_01D1_8);
p = GetStringWithArgs(p, STR_01D1_8, argv);
} else { } else {
p = GetString(p, _cargoc.names_s[i]); p = GetString(p, _cargoc.names_s[i]);
} }

View File

@ -1512,11 +1512,9 @@ static const char *ChatTabCompletionNextItem(uint *item)
const Town *t; const Town *t;
FOR_ALL_TOWNS_FROM(t, *item - MAX_CLIENT_INFO) { FOR_ALL_TOWNS_FROM(t, *item - MAX_CLIENT_INFO) {
int32 temp[1];
/* Get the town-name via the string-system */ /* Get the town-name via the string-system */
temp[0] = t->townnameparts; SetDParam(0, t->townnameparts);
GetStringWithArgs(chat_tab_temp_buffer, t->townnametype, temp); GetString(chat_tab_temp_buffer, t->townnametype);
return &chat_tab_temp_buffer[0]; return &chat_tab_temp_buffer[0];
} }
} }

View File

@ -77,16 +77,15 @@ static int CDECL StationNameSorter(const void *a, const void *b)
const Station* st1 = *(const Station**)a; const Station* st1 = *(const Station**)a;
const Station* st2 = *(const Station**)b; const Station* st2 = *(const Station**)b;
char buf1[64]; char buf1[64];
int32 argv[1];
int r; int r;
argv[0] = st1->index; SetDParam(0, st1->index);
GetStringWithArgs(buf1, STR_STATION, argv); GetString(buf1, STR_STATION);
if (st2 != _last_station) { if (st2 != _last_station) {
_last_station = st2; _last_station = st2;
argv[0] = st2->index; SetDParam(0, st2->index);
GetStringWithArgs(_bufcache, STR_STATION, argv); GetString(_bufcache, STR_STATION);
} }
r = strcmp(buf1, _bufcache); // sort by name r = strcmp(buf1, _bufcache); // sort by name

View File

@ -168,7 +168,7 @@ static const char *GetStringPtr(StringID string)
// These 8 bits will only be set when FormatString wants to print // These 8 bits will only be set when FormatString wants to print
// the string in a different case. No one else except FormatString // the string in a different case. No one else except FormatString
// should set those bits, therefore string CANNOT be StringID, but uint32. // 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 index = GB(string, 0, 11);
uint tab = GB(string, 11, 5); uint tab = GB(string, 11, 5);

View File

@ -12,7 +12,6 @@ static inline char* InlineString(char* buf, uint16 string)
} }
char *GetString(char *buffr, uint16 string); char *GetString(char *buffr, uint16 string);
char *GetStringWithArgs(char *buffr, uint string, const int32 *argv);
extern char _userstring[128]; extern char _userstring[128];

View File

@ -376,18 +376,17 @@ static int CDECL TownNameSorter(const void *a, const void *b)
const Town* tb = *(const Town**)b; const Town* tb = *(const Town**)b;
char buf1[64]; char buf1[64];
int r; int r;
int32 argv[1];
argv[0] = ta->index; SetDParam(0, ta->index);
GetStringWithArgs(buf1, STR_TOWN, argv); GetString(buf1, STR_TOWN);
/* If 'b' is the same town as in the last round, use the cached value /* 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 * We do this to speed stuff up ('b' is called with the same value a lot of
* times after eachother) */ * times after eachother) */
if (tb != _last_town) { if (tb != _last_town) {
_last_town = tb; _last_town = tb;
argv[0] = tb->index; SetDParam(0, tb->index);
GetStringWithArgs(_bufcache, STR_TOWN, argv); GetString(_bufcache, STR_TOWN);
} }
r = strcmp(buf1, _bufcache); r = strcmp(buf1, _bufcache);