PIELIGHT fix for map hightlight. Remove use of colours to communicate a boolean value.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3022 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
da7b96315c
commit
6c4c61fbb7
|
@ -71,7 +71,9 @@
|
|||
#define WZCOL_UNIT_SELECT_BORDER psPalette[22]
|
||||
#define WZCOL_UNIT_SELECT_BOX psPalette[23]
|
||||
#define WZCOL_RADAR_BACKGROUND psPalette[24]
|
||||
#define WZCOL_MAX 25
|
||||
#define WZCOL_MAP_OUTLINE_OK psPalette[25]
|
||||
#define WZCOL_MAP_OUTLINE_BAD psPalette[26]
|
||||
#define WZCOL_MAX 27
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
|
|
|
@ -160,6 +160,9 @@ void pie_SetColourDefines(void)
|
|||
WZCOL_UNIT_SELECT_BOX.byte.a = 16;
|
||||
|
||||
WZCOL_RADAR_BACKGROUND = WZCOL_MENU_BACKGROUND;
|
||||
|
||||
WZCOL_MAP_OUTLINE_OK = WZCOL_WHITE;
|
||||
WZCOL_MAP_OUTLINE_BAD = WZCOL_RED;
|
||||
}
|
||||
|
||||
PIELIGHT pal_SetBrightness(UBYTE brightness)
|
||||
|
|
|
@ -3832,7 +3832,7 @@ static void drawTerrainTile(UDWORD i, UDWORD j, BOOL onWaterEdge)
|
|||
//set tilenumber
|
||||
if ( i < (LAND_XGRD-1) && j < (LAND_YGRD-1) ) // FIXME
|
||||
{
|
||||
if (outlineColour3D == outlineOK3D)
|
||||
if (outlineTile)
|
||||
{
|
||||
oldColoursWord[0] = tileScreenInfo[i+0][j+0].light.argb;
|
||||
oldColoursWord[1] = tileScreenInfo[i+0][j+1].light.argb;
|
||||
|
@ -3944,7 +3944,7 @@ static void drawTerrainTile(UDWORD i, UDWORD j, BOOL onWaterEdge)
|
|||
|
||||
if(!onWaterEdge && bOutlined)
|
||||
{
|
||||
if(outlineColour3D == outlineOK3D)
|
||||
if (outlineTile)
|
||||
{
|
||||
tileScreenInfo[i+0][j+0].light.argb = oldColoursWord[0];
|
||||
tileScreenInfo[i+0][j+1].light.argb = oldColoursWord[1];
|
||||
|
|
18
src/hci.c
18
src/hci.c
|
@ -282,11 +282,9 @@ UDWORD selectedPlayer=0;
|
|||
//BOOL intelMapUp = FALSE;
|
||||
|
||||
//two colours used for drawing the footprint outline for objects in 2D
|
||||
UDWORD outlineOK;
|
||||
UDWORD outlineNotOK;
|
||||
//value gets set to colour used for drawing
|
||||
UDWORD outlineColour;
|
||||
UDWORD outlineColour3D;
|
||||
PIELIGHT outlineOK;
|
||||
PIELIGHT outlineNotOK;
|
||||
BOOL outlineTile = FALSE;
|
||||
|
||||
// The last widget ID from widgRunScreen
|
||||
UDWORD intLastWidget;
|
||||
|
@ -680,23 +678,18 @@ BOOL intInitialise(void)
|
|||
/* Initialise the screen to be run */
|
||||
widgStartScreen(psWScreen);
|
||||
|
||||
|
||||
|
||||
/* Note the current screen state */
|
||||
intMode = INT_NORMAL;
|
||||
|
||||
objectsChanged = FALSE;
|
||||
|
||||
//set the default colours to be used for drawing outlines in 2D
|
||||
outlineOK = iV_PaletteNearestColour(0xff,0xff,0xff);
|
||||
outlineNotOK = iV_PaletteNearestColour(0xff,0x00,0x00);
|
||||
|
||||
outlineOK = WZCOL_MAP_OUTLINE_OK;
|
||||
outlineNotOK = WZCOL_MAP_OUTLINE_BAD;
|
||||
|
||||
LOADBARCALLBACK(); // loadingScreenCallback();
|
||||
|
||||
LOADBARCALLBACK(); // loadingScreenCallback();
|
||||
|
||||
|
||||
/*Initialise the video playback buffer*/
|
||||
if (!seq_SetupVideoBuffers())
|
||||
{
|
||||
|
@ -705,7 +698,6 @@ BOOL intInitialise(void)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
LOADBARCALLBACK(); // loadingScreenCallback();
|
||||
|
||||
// reset the previous objects
|
||||
|
|
11
src/hci.h
11
src/hci.h
|
@ -298,16 +298,11 @@ extern DROID_TEMPLATE *psCurrTemplate;
|
|||
extern DROID_TEMPLATE **apsTemplateList;
|
||||
|
||||
//two colours used for drawing the footprint outline for objects in 2D
|
||||
extern UDWORD outlineOK;
|
||||
extern UDWORD outlineNotOK;
|
||||
|
||||
//two colours used for drawing the footprint outline for objects in 3D
|
||||
#define outlineOK3D 255
|
||||
#define outlineNotOK3D 14 //arbitary value!
|
||||
extern PIELIGHT outlineOK;
|
||||
extern PIELIGHT outlineNotOK;
|
||||
|
||||
//value gets set to colour used for drawing
|
||||
extern UDWORD outlineColour;
|
||||
extern UDWORD outlineColour3D;
|
||||
extern BOOL outlineTile;
|
||||
|
||||
/*Message View Buffer width and height - MAXIMUM Sizes! - only need to be
|
||||
as big as Pie View in Research Msg now*/
|
||||
|
|
|
@ -4618,20 +4618,18 @@ failed:
|
|||
if (!valid)
|
||||
{
|
||||
// Only set the hilight colour if it's the selected player.
|
||||
if(player == selectedPlayer) {
|
||||
|
||||
outlineColour = outlineNotOK;
|
||||
outlineColour3D = outlineNotOK3D;
|
||||
|
||||
if(player == selectedPlayer)
|
||||
{
|
||||
outlineTile = FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Only set the hilight colour if it's the selected player.
|
||||
if(player == selectedPlayer) {
|
||||
outlineColour = outlineOK;
|
||||
outlineColour3D = outlineOK3D;
|
||||
if (player == selectedPlayer)
|
||||
{
|
||||
outlineTile = TRUE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in New Issue