misc_gui.c
changeset 534 17ab2f22ff74
parent 507 8aa8100b0b22
child 541 e1cd34389f79
--- a/misc_gui.c	Wed Dec 01 21:35:14 2004 +0000
+++ b/misc_gui.c	Thu Dec 02 22:53:07 2004 +0000
@@ -29,45 +29,43 @@
 {
 	LandInfoData *lid;
 	StringID str;
-	uint32 *b;
 
 	if (e->event == WE_PAINT) {
+		int idx = 0;
 		int i;
 
 		DrawWindowWidgets(w);
 
 		lid = WP(w,void_d).data;
 
-		SET_DPARAM32(0, lid->td.dparam[0]);
+		SetDParam(0, lid->td.dparam[0]);
 		DrawStringCentered(140, 16, lid->td.str, 13);
 
-		SET_DPARAM16(0, STR_01A6_N_A);
+		SetDParam(0, STR_01A6_N_A);
 		if (lid->td.owner != OWNER_NONE && lid->td.owner != OWNER_WATER)
 			GetNameOfOwner(lid->td.owner, lid->tile);
 		DrawStringCentered(140, 27, STR_01A7_OWNER, 0);
 
 		str = STR_01A4_COST_TO_CLEAR_N_A;
 		if (lid->costclear != CMD_ERROR) {
-			SET_DPARAM32(0, lid->costclear);
+			SetDParam(0, lid->costclear);
 			str = STR_01A5_COST_TO_CLEAR;
 		}
 		DrawStringCentered(140, 38, str, 0);
 
 		snprintf(_userstring, USERSTRING_LEN, "%.4X", lid->tile);
-		SET_DPARAM16(0, GET_TILE_X(lid->tile));
-		SET_DPARAM16(1, GET_TILE_Y(lid->tile));
-		SET_DPARAM16(2, STR_SPEC_USERSTRING);
+		SetDParam(0, GET_TILE_X(lid->tile));
+		SetDParam(1, GET_TILE_Y(lid->tile));
+		SetDParam(2, STR_SPEC_USERSTRING);
 		DrawStringCentered(140, 49, STR_LANDINFO_COORDS, 0);
 
-		SET_DPARAM16(0, STR_01A9_NONE);
+		SetDParam(0, STR_01A9_NONE);
 		if (lid->town != NULL) {
-			SET_DPARAM16(0, lid->town->townnametype);
-			SET_DPARAM32(1, lid->town->townnameparts);
+			SetDParam(0, lid->town->townnametype);
+			SetDParam(1, lid->town->townnameparts);
 		}
 		DrawStringCentered(140,60, STR_01A8_LOCAL_AUTHORITY, 0);
 
-		b = &GET_DPARAM(0);
-
 		str = STR_01CE_CARGO_ACCEPTED - 1;
 
 		/* XXX if a tile accepts more cargo types than there are template strings
@@ -75,12 +73,10 @@
 		for (i = 0; i < NUM_CARGO; ++i) {
 			if (lid->ac[i] > 0) {
 				if (lid->ac[i] < 8) {
-					SET_DPARAMX16(b, 0, STR_01D1_8);
-					SET_DPARAMX8(b, 1, lid->ac[i]);
-					b += 2;
+					SetDParam(idx++, STR_01D1_8);
+					SetDParam(idx++, lid->ac[i]);
 				}
-				SET_DPARAMX16(b, 0, _cargoc.names_s[i]);
-				b++;
+				SetDParam(idx++, _cargoc.names_s[i]);
 				str++;
 			}
 		}
@@ -89,7 +85,7 @@
 			DrawStringMultiCenter(140, 76, str, 276);
 
 		if (lid->td.build_date != 0) {
-			SET_DPARAM16(0,lid->td.build_date);
+			SetDParam(0,lid->td.build_date);
 			DrawStringCentered(140,71, STR_BUILD_DATE, 0);
 		}
 	}
@@ -413,7 +409,7 @@
 					_errmsg_message_1,
 					238);
 		} else {
-			Player *p = DEREF_PLAYER(GET_DPARAMX8(_errmsg_decode_params,2));
+			Player *p = DEREF_PLAYER(GetDParamX(_errmsg_decode_params,2));
 			DrawPlayerFace(p->face, p->player_color, 2, 16);
 
 			DrawStringMultiCenter(
@@ -476,7 +472,7 @@
 	if (!_errmsg_duration)
 		return;
 
-	if (_errmsg_message_1 != STR_013B_OWNED_BY || GET_DPARAMX8(_errmsg_decode_params,2) >= 8) {
+	if (_errmsg_message_1 != STR_013B_OWNED_BY || GetDParamX(_errmsg_decode_params,2) >= 8) {
 
 		if ( (x|y) != 0) {
 			pt = RemapCoords2(x, y);
@@ -522,7 +518,7 @@
 		cost = -cost;
 		msg = STR_0807_ESTIMATED_INCOME;
 	}
-	SET_DPARAM32(0, cost);
+	SetDParam(0, cost);
 	ShowErrorMessage(-1, msg, x, y);
 }
 
@@ -536,7 +532,7 @@
 		cost = -cost;
 		msg = STR_0803_INCOME;
 	}
-	SET_DPARAM32(0, cost);
+	SetDParam(0, cost);
 	AddTextEffect(msg, pt.x, pt.y, 0x250);
 }
 
@@ -772,7 +768,7 @@
 	case WE_PAINT: {
 //		int x;
 
-		SET_DPARAM16(0, WP(w,querystr_d).caption);
+		SetDParam(0, WP(w,querystr_d).caption);
 		DrawWindowWidgets(w);
 
 		DrawEditBox(w, 5);
@@ -999,9 +995,9 @@
 static void GenerateFileName(void)
 {
 	const Player *p = DEREF_PLAYER(_local_player);
-	SET_DPARAM16(0, p->name_1);
-	SET_DPARAM32(1, p->name_2);
-	SET_DPARAM16(2, _date);
+	SetDParam(0, p->name_1);
+	SetDParam(1, p->name_2);
+	SetDParam(2, _date);
 	GetString(_edit_str_buf, STR_4004);
 }
 
@@ -1475,14 +1471,14 @@
 
 			if (ce->type == CE_BOOL) {
 				DrawFrameRect(x+20, y+1, x+30+9, y+9, (*(bool*)ce->variable)?6:4, (*(bool*)ce->variable)?0x20:0);
-				SET_DPARAM16(0, *(bool*)ce->variable ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF);
+				SetDParam(0, *(bool*)ce->variable ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF);
 
 			}	else if (ce->type == CE_CLICK) {
 				DrawFrameRect(x+20, y+1, x+30+9, y+9, 0, (WP(w,def_d).data_1==i*2+1)?0x20:0x00);
 				if(i==0)
-					SET_DPARAM64(0, (int64) 10000000);
+					SetDParam64(0, (int64) 10000000);
 				else
-					SET_DPARAM16(0, false);
+					SetDParam(0, false);
 
 			} else {
 				DrawFrameRect(x+20, y+1, x+20+9, y+9, 3, clk == i*2+1 ? 0x20 : 0);
@@ -1496,11 +1492,11 @@
 				if(ce->str==STR_CHEAT_SWITCH_CLIMATE)
 					val += STR_TEMPERATE_LANDSCAPE;
 
-				SET_DPARAM16(0, val);
+				SetDParam(0, val);
 
 				// display date for change date cheat
 				if(ce->str==STR_CHEAT_CHANGE_DATE)
-					SET_DPARAM16(0, _date);
+					SetDParam(0, _date);
 
 				// draw colored flag for change player cheat
 				if(ce->str==STR_CHEAT_CHANGE_PLAYER)