More PIELIGHT conversions. Fix colour issue in load/save dialog.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2894 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2007-11-26 22:10:31 +00:00
parent 13d1607349
commit 4dd2dfc63d
3 changed files with 28 additions and 26 deletions

View File

@ -56,7 +56,10 @@
#define WZCOL_GREEN psPalette[7] #define WZCOL_GREEN psPalette[7]
#define WZCOL_RED psPalette[8] #define WZCOL_RED psPalette[8]
#define WZCOL_YELLOW psPalette[9] #define WZCOL_YELLOW psPalette[9]
#define WZCOL_MAX 10 #define WZCOL_MENU_BACKGROUND psPalette[10]
#define WZCOL_MENU_BORDER psPalette[11]
#define WZCOL_MENU_LOAD_BORDER psPalette[12]
#define WZCOL_MAX 13
//************************************************************************* //*************************************************************************

View File

@ -141,6 +141,19 @@ void pie_SetColourDefines(void)
WZCOL_HEALTH_HIGH = WZCOL_GREEN; WZCOL_HEALTH_HIGH = WZCOL_GREEN;
WZCOL_HEALTH_MEDIUM = WZCOL_YELLOW; WZCOL_HEALTH_MEDIUM = WZCOL_YELLOW;
WZCOL_HEALTH_LOW = WZCOL_RED; WZCOL_HEALTH_LOW = WZCOL_RED;
WZCOL_MENU_BACKGROUND.byte.a = 255;
WZCOL_MENU_BACKGROUND.byte.r = 0;
WZCOL_MENU_BACKGROUND.byte.g = 1;
WZCOL_MENU_BACKGROUND.byte.b = 97;
WZCOL_MENU_BORDER.byte.a = 255;
WZCOL_MENU_BORDER.byte.r = 0;
WZCOL_MENU_BORDER.byte.g = 21;
WZCOL_MENU_BORDER.byte.b = 240;
WZCOL_MENU_LOAD_BORDER = WZCOL_BLACK;
WZCOL_MENU_LOAD_BORDER.byte.r = 133;
} }
void pal_ShutDown(void) void pal_ShutDown(void)

View File

@ -635,33 +635,29 @@ void removeWildcards(char *pStr)
static void displayLoadBanner(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pColours) static void displayLoadBanner(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pColours)
{ {
//UDWORD col; PIELIGHT col;
UBYTE col;
UDWORD x = xOffset+psWidget->x; UDWORD x = xOffset+psWidget->x;
UDWORD y = yOffset+psWidget->y; UDWORD y = yOffset+psWidget->y;
if(psWidget->pUserData) if(psWidget->pUserData)
{ {
col = COL_GREEN; col = WZCOL_GREEN;
} }
else else
{ {
col = COL_RED; col = WZCOL_MENU_LOAD_BORDER;
} }
iV_BoxFill(x,y,x+psWidget->width,y+psWidget->height,col); pie_BoxFill(x, y, x + psWidget->width, y + psWidget->height, col);
iV_BoxFill(x+2,y+2,x+psWidget->width-2,y+psWidget->height-2,COL_BLUE); pie_BoxFill(x + 2,y + 2, x + psWidget->width - 2, y + psWidget->height - 2, WZCOL_MENU_BACKGROUND);
} }
// //////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////
static void displayLoadSlot(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pColours) static void displayLoadSlot(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pColours)
{ {
UDWORD x = xOffset+psWidget->x; UDWORD x = xOffset+psWidget->x;
UDWORD y = yOffset+psWidget->y; UDWORD y = yOffset+psWidget->y;
// UWORD im = (UWORD)UNPACKDWORD_TRI_B((UDWORD)psWidget->pUserData);
// UWORD im2= (UWORD)(UNPACKDWORD_TRI_C((UDWORD)psWidget->pUserData));
char butString[64]; char butString[64];
drawBlueBox(x,y,psWidget->width,psWidget->height); //draw box drawBlueBox(x,y,psWidget->width,psWidget->height); //draw box
@ -680,11 +676,9 @@ static void displayLoadSlot(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UD
//draw text //draw text
iV_DrawText( butString, x+4, y+17); iV_DrawText( butString, x+4, y+17);
} }
} }
// //////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////
static void displayLoadSaveEdit(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pColours) static void displayLoadSaveEdit(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD *pColours)
{ {
@ -693,21 +687,13 @@ static void displayLoadSaveEdit(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset
UDWORD w = psWidget->width; UDWORD w = psWidget->width;
UDWORD h = psWidget->height; UDWORD h = psWidget->height;
iV_BoxFill(x,y,x+w,y+h,COL_RED); pie_BoxFill(x, y, x + w, y + h, WZCOL_MENU_LOAD_BORDER);
iV_BoxFill(x+1,y+1,x+w-1,y+h-1,COL_BLUE); pie_BoxFill(x + 1, y + 1, x + w - 1, y + h - 1, WZCOL_MENU_BACKGROUND);
} }
// //////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////
void drawBlueBox(UDWORD x,UDWORD y, UDWORD w, UDWORD h) void drawBlueBox(UDWORD x,UDWORD y, UDWORD w, UDWORD h)
{ {
UBYTE dark = COL_BLUE; pie_BoxFill(x - 1, y - 1, x + w + 1, y + h + 1, WZCOL_MENU_BORDER);
UBYTE light = COL_LIGHTBLUE; pie_BoxFill(x, y , x + w, y + h, WZCOL_MENU_BACKGROUND);
// box
pie_BoxFillIndex(x-1,y-1,x+w+1,y+h+1,light);
pie_BoxFillIndex(x,y,x+w,y+h,dark);
} }