Changeset - r1556:231c8be6c981
[Not reviewed]
master
0 3 0
tron - 20 years ago 2005-03-25 14:19:33
tron@openttd.org
(svn r2060) Clean up some string construction and remove now unused macro
3 files changed with 13 insertions and 21 deletions:
0 comments (0 inline, 0 general)
macros.h
Show inline comments
 
@@ -151,9 +151,4 @@ static inline void swap_tile(TileIndex *
 
	}
 
#endif
 

	
 
static inline void WRITE_LE_UINT16(void *b, uint16 x) {
 
	((byte*)b)[0] = (byte)x;
 
	((byte*)b)[1] = (byte)(x >> 8);
 
}
 

	
 
#endif /* MACROS_H */
misc_gui.c
Show inline comments
 
@@ -663,18 +663,17 @@ void GuiShowTooltips(StringID string_id)
 
}
 

	
 

	
 
static void DrawStationCoverageText(const uint *accepts, int str_x, int str_y, uint mask)
 
static void DrawStationCoverageText(const AcceptedCargo accepts,
 
	int str_x, int str_y, uint mask)
 
{
 
	char *b = _userstring;
 
	int i;
 
	char *b;
 

	
 
	b = _userstring;
 
	b = InlineString(b, STR_000D_ACCEPTS);
 

	
 
	for(i=0; i!=NUM_CARGO; i++,mask>>=1) {
 
		if (accepts[i] >= 8 && (mask&1) ) {
 
			StringID id = _cargoc.names_s[i];
 
			b = InlineString(b, id);
 
	for (i = 0; i != NUM_CARGO; i++, mask >>= 1) {
 
		if (accepts[i] >= 8 && mask & 1) {
 
			b = InlineString(b, _cargoc.names_s[i]);
 
			*b++ = ',';
 
			*b++ = ' ';
 
		}
 
@@ -684,7 +683,7 @@ static void DrawStationCoverageText(cons
 
		b = InlineString(b, STR_00D0_NOTHING);
 
		*b++ = '\0';
 
	} else {
 
		b[-2] = 0;
 
		b[-2] = '\0';
 
	}
 

	
 
	DrawStringMultiLine(str_x, str_y, STR_SPEC_USERSTRING, 144);
station_gui.c
Show inline comments
 
@@ -398,18 +398,16 @@ static void DrawStationViewWindow(Window
 
	} while (pos > -5 && ++i != 12);
 

	
 
	if (IsWindowOfPrototype(w, _station_view_widgets)) {
 
		char *b;
 
		char *b = _userstring;
 

	
 
		b = _userstring;
 
		b = InlineString(b, STR_000C_ACCEPTS);
 

	
 
		for(i=0; i!=NUM_CARGO; i++) {
 
			if ((b - _userstring) + 5 > USERSTRING_LEN - 1)
 
				break;
 
		for (i = 0; i != NUM_CARGO; i++) {
 
			if (b >= endof(_userstring) - 5 - 1) break;
 
			if (st->goods[i].waiting_acceptance & 0x8000) {
 
				b = InlineString(b, _cargoc.names_s[i]);
 
				WRITE_LE_UINT16(b, 0x202C);
 
				b += 2;
 
				*b++ = ',';
 
				*b++ = ' ';
 
			}
 
		}
 

	
 
@@ -417,7 +415,7 @@ static void DrawStationViewWindow(Window
 
			b = InlineString(b, STR_00D0_NOTHING);
 
			*b++ = '\0';
 
		} else {
 
			b[-2] = 0;
 
			b[-2] = '\0';
 
		}
 

	
 
		DrawStringMultiLine(2, 67, STR_SPEC_USERSTRING, 245);
0 comments (0 inline, 0 general)