All pastes #973062 Raw Edit

Unnamed

public diff v1 · immutable
·published 2008-04-05 22:03 UTC
rendered paste body
Index: lib/ivis_common/piepalette.h===================================================================--- lib/ivis_common/piepalette.h	(revision 4504)+++ lib/ivis_common/piepalette.h	(working copy)@@ -61,8 +61,10 @@ #define WZCOL_CONS_TEXT_USER_ALLY	psPalette[36] #define WZCOL_CONS_TEXT_USER_ENEMY	psPalette[37] #define WZCOL_CONS_TEXT_DEBUG		psPalette[38]+#define WZCOL_GREY					psPalette[39]+#define WZCOL_MAP_PREVIEW_AIPLAYER  psPalette[40] -#define WZCOL_MAX			39+#define WZCOL_MAX			41  //************************************************************************* Index: lib/ivis_opengl/piepalette.c===================================================================--- lib/ivis_opengl/piepalette.c	(revision 4504)+++ lib/ivis_opengl/piepalette.c	(working copy)@@ -27,7 +27,8 @@ void pal_Init(void) { 	// TODO: Read these from file so that mod-makers can change them-+	WZCOL_MAP_PREVIEW_AIPLAYER = pal_Colour(0, 0x7f, 0);+	WZCOL_GREY = pal_Colour(0x55, 0x55, 0x55); 	WZCOL_WHITE = pal_Colour(UBYTE_MAX, UBYTE_MAX, UBYTE_MAX); 	WZCOL_BLACK = pal_Colour(1, 1, 1); 	WZCOL_GREEN = pal_Colour(0, UBYTE_MAX, 0);Index: src/game.c===================================================================--- src/game.c	(revision 4504)+++ src/game.c	(working copy)@@ -79,7 +79,7 @@ #include "multistat.h" #include "wrappers.h" -+extern PIELIGHT clanColours[MAX_PLAYERS]; #define MAX_SAVE_NAME_SIZE_V19	40 #define MAX_SAVE_NAME_SIZE	60 @@ -11674,8 +11674,10 @@ 	STRUCT_SAVEHEADER		*psHeader; 	char			aFileName[256]; 	UDWORD			xx,yy,x,y,count,fileSize,sizeOfSaveStruture;+	UDWORD	playerid =0; 	char			*pFileData = NULL; 	LEVEL_DATASET	*psLevel;+	PIELIGHT color = WZCOL_BLACK ;  	levFindDataSet(game.map, &psLevel); 	strcpy(aFileName,psLevel->apDataFiles[0]);@@ -11765,6 +11767,7 @@  			xx = map_coord(psSaveStructure2->x); 			yy = map_coord(psSaveStructure2->y);+			playerid = psSaveStructure2->player; 		} 		else if (psHeader->version < VERSION_14) 		{@@ -11799,6 +11802,7 @@  			xx = map_coord(psSaveStructure12->x); 			yy = map_coord(psSaveStructure12->y);+			playerid = psSaveStructure12->player; 		} 		else if (psHeader->version <= VERSION_14) 		{@@ -11834,6 +11838,7 @@  			xx = map_coord(psSaveStructure14->x); 			yy = map_coord(psSaveStructure14->y);+			playerid = psSaveStructure14->player; 		} 		else if (psHeader->version <= VERSION_16) 		{@@ -11870,6 +11875,7 @@  			xx = map_coord(psSaveStructure15->x); 			yy = map_coord(psSaveStructure15->y);+			playerid = psSaveStructure15->player; 		} 		else if (psHeader->version <= VERSION_19) 		{@@ -11908,6 +11914,7 @@  			xx = map_coord(psSaveStructure17->x); 			yy = map_coord(psSaveStructure17->y);+			playerid = psSaveStructure17->player; 		} 		else if (psHeader->version <= VERSION_20) 		{@@ -11943,6 +11950,7 @@  			xx = map_coord(psSaveStructure20->x); 			yy = map_coord(psSaveStructure20->y);+			playerid = psSaveStructure20->player; 		} 		else 		{@@ -11981,16 +11989,32 @@  			xx = map_coord(psSaveStructure->x); 			yy = map_coord(psSaveStructure->y);+			playerid = psSaveStructure->player; 		}+		// if human player, then use clan color.  If AI, then use something else.+		if( isHumanPlayer(playerid) )+		{+			playerid = (UDWORD) getPlayerColour(playerid);+			color.argb = clanColours[playerid].argb;+			// kludge to fix black, so you can see it on some maps.+			if ( playerid == 3 )	// in this case 3 = pallete entry for black.+			{	+	+				color = WZCOL_GREY;+			}+		}+		else+		{	// Use a dark green color for the AI+			color = WZCOL_MAP_PREVIEW_AIPLAYER ;+		}  		for(x = (xx*scale);x < (xx*scale)+scale ;x++) 		{ 			for(y = (yy*scale);y< (yy*scale)+scale ;y++) 			{-				// 0xff0000 = red. use COL_LIGHTRED instead?-				backDropSprite[3 * (((offY + y) * BACKDROP_HACK_WIDTH) + x + offX)] = 0xff;-				backDropSprite[3 * (((offY + y) * BACKDROP_HACK_WIDTH) + x + offX) + 1] = 0x0;-				backDropSprite[3 * (((offY + y) * BACKDROP_HACK_WIDTH) + x + offX) + 2] = 0x0;+				backDropSprite[3 * (((offY + y) * BACKDROP_HACK_WIDTH) + x + offX)] = color.byte.r;	 +				backDropSprite[3 * (((offY + y) * BACKDROP_HACK_WIDTH) + x + offX) + 1] = color.byte.g;+				backDropSprite[3 * (((offY + y) * BACKDROP_HACK_WIDTH) + x + offX) + 2] = color.byte.b; 			} 		} 	}Index: src/multiint.c===================================================================--- src/multiint.c	(revision 4504)+++ src/multiint.c	(working copy)@@ -825,6 +825,11 @@ 			break; 		} 	}+	addBlueForm(MULTIOP_OPTIONS, MULTIOP_MAP_PREVIEW, _("Map Preview"), MCOL0, MROW9, MULTIOP_BLUEFORMW, 27);+						//hilight correct entry+	addMultiBut(psWScreen,MULTIOP_MAP_PREVIEW,MULTIOP_MAP_BUT,MCOL4-8,2,MULTIOP_BUTW,MULTIOP_BUTH,+				_("Click to see Map"), IMAGE_FOG_OFF,IMAGE_FOG_OFF_HI,true);+			widgSetButtonState(psWScreen, MULTIOP_MAP_BUT,0); //1 = OFF  0=ON   	// cancel 	addMultiBut(psWScreen,MULTIOP_OPTIONS,CON_CANCEL,@@ -1572,6 +1577,9 @@ 			strcpy(game.map,widgGetString(psWScreen, MULTIOP_MAP)); 			addGameOptions(false); 			break;+		case MULTIOP_MAP_BUT:+			loadMapPreview();+			break; 		} 	} @@ -1827,7 +1835,9 @@ 	case CON_CANCEL: 		stopJoining(); 		break;-+	case MULTIOP_MAP_BUT:+		loadMapPreview();+		break; 	default: 		break; 	}Index: src/multiint.h===================================================================--- src/multiint.h	(revision 4504)+++ src/multiint.h	(working copy)@@ -262,6 +262,9 @@  #define MULTIOP_PLAYCHOOSER		10321 #define MULTIOP_PLAYCHOOSER_END	10330++#define MULTIOP_MAP_PREVIEW 920000+#define MULTIOP_MAP_BUT		920002 // /////////////////////////////// // Many Button Variations.. Index: src/radar.c===================================================================--- src/radar.c	(revision 4504)+++ src/radar.c	(working copy)@@ -66,7 +66,7 @@ static PIELIGHT		tileColours[MAX_TILES]; static UDWORD		*radarBuffer; -static PIELIGHT clanColours[MAX_PLAYERS]=+PIELIGHT clanColours[MAX_PLAYERS]= {	// see frontend2.png for team color order. 	// [r,g,b,a] 	{{0,255,0,255}},		// green  Player 0