Port scores code to use PIELIGHT.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3524 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
fab4fb38df
commit
b9bcbad34c
|
@ -72,7 +72,11 @@
|
|||
#define WZCOL_MAP_OUTLINE_BAD psPalette[26]
|
||||
#define WZCOL_KEYMAP_ACTIVE psPalette[27]
|
||||
#define WZCOL_KEYMAP_FIXED psPalette[28]
|
||||
#define WZCOL_MAX 29
|
||||
#define WZCOL_MENU_SCORE_LOSS psPalette[29]
|
||||
#define WZCOL_MENU_SCORE_DESTROYED psPalette[30]
|
||||
#define WZCOL_MENU_SCORE_BUILT psPalette[31]
|
||||
#define WZCOL_MENU_SCORE_RANK psPalette[32]
|
||||
#define WZCOL_MAX 33
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
|
|
|
@ -154,6 +154,11 @@ void pie_SetColourDefines(void)
|
|||
|
||||
WZCOL_KEYMAP_ACTIVE = pal_Colour(0, 128, 0);
|
||||
WZCOL_KEYMAP_FIXED = pal_Colour(128, 0, 0);
|
||||
|
||||
WZCOL_MENU_SCORE_LOSS = pal_Colour(43, 43, 43);
|
||||
WZCOL_MENU_SCORE_DESTROYED = pal_Colour(183, 195, 127);
|
||||
WZCOL_MENU_SCORE_BUILT = pal_Colour(81, 167, 156);
|
||||
WZCOL_MENU_SCORE_RANK = pal_Colour(199, 127, 103);
|
||||
}
|
||||
|
||||
PIELIGHT pal_SetBrightness(UBYTE brightness)
|
||||
|
|
69
src/scores.c
69
src/scores.c
|
@ -117,28 +117,58 @@ const char *getDescription(int id)
|
|||
}
|
||||
}
|
||||
|
||||
static PIELIGHT getColour(int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case STR_MR_STR_LOST :
|
||||
case STR_MR_UNITS_LOST :
|
||||
return WZCOL_MENU_SCORE_LOSS;
|
||||
case STR_MR_STR_BLOWN_UP :
|
||||
case STR_MR_UNITS_KILLED :
|
||||
return WZCOL_MENU_SCORE_DESTROYED;
|
||||
case STR_MR_UNITS_BUILT :
|
||||
case STR_MR_UNITS_NOW :
|
||||
case STR_MR_STR_BUILT :
|
||||
case STR_MR_STR_NOW :
|
||||
return WZCOL_MENU_SCORE_BUILT;
|
||||
case STR_MR_LEVEL_ROOKIE :
|
||||
case STR_MR_LEVEL_GREEN :
|
||||
case STR_MR_LEVEL_TRAINED:
|
||||
case STR_MR_LEVEL_REGULAR:
|
||||
case STR_MR_LEVEL_VETERAN:
|
||||
case STR_MR_LEVEL_CRACK :
|
||||
case STR_MR_LEVEL_ELITE :
|
||||
case STR_MR_LEVEL_SPECIAL:
|
||||
case STR_MR_LEVEL_ACE :
|
||||
return WZCOL_MENU_SCORE_RANK;
|
||||
default :
|
||||
return WZCOL_BLACK;
|
||||
}
|
||||
}
|
||||
|
||||
STAT_BAR infoBars[]=
|
||||
{
|
||||
{LC_X,100,STAT_BAR_WIDTH,16,10,STR_MR_UNITS_LOST,0,FALSE,TRUE,0,165}, // left column STAT_UNIT_LOST
|
||||
{LC_X,120,STAT_BAR_WIDTH,16,20,STR_MR_UNITS_KILLED,0,FALSE,TRUE,0,81}, // STAT_UNIT_KILLED
|
||||
{LC_X,160,STAT_BAR_WIDTH,16,30,STR_MR_STR_LOST,0,FALSE,TRUE,0,165}, // STAT_STR_LOST
|
||||
{LC_X,180,STAT_BAR_WIDTH,16,40,STR_MR_STR_BLOWN_UP,0,FALSE,TRUE,0,81}, // STAT_STR_BLOWN_UP
|
||||
{LC_X,220,STAT_BAR_WIDTH,16,50,STR_MR_UNITS_BUILT,0,FALSE,TRUE,0,185}, // STAT_UNITS_BUILT
|
||||
{LC_X,240,STAT_BAR_WIDTH,16,60,STR_MR_UNITS_NOW,0,FALSE,TRUE,0,185}, // STAT_UNITS_NOW
|
||||
{LC_X,260,STAT_BAR_WIDTH,16,70,STR_MR_STR_BUILT,0,FALSE,TRUE,0,185}, // STAT_STR_BUILT
|
||||
{LC_X,280,STAT_BAR_WIDTH,16,80,STR_MR_STR_NOW,0,FALSE,FALSE,0,185}, // STAT_STR_NOW
|
||||
{LC_X,100,STAT_BAR_WIDTH,16,10,STR_MR_UNITS_LOST,0,FALSE,TRUE,0}, // left column STAT_UNIT_LOST
|
||||
{LC_X,120,STAT_BAR_WIDTH,16,20,STR_MR_UNITS_KILLED,0,FALSE,TRUE,0}, // STAT_UNIT_KILLED
|
||||
{LC_X,160,STAT_BAR_WIDTH,16,30,STR_MR_STR_LOST,0,FALSE,TRUE,0}, // STAT_STR_LOST
|
||||
{LC_X,180,STAT_BAR_WIDTH,16,40,STR_MR_STR_BLOWN_UP,0,FALSE,TRUE,0}, // STAT_STR_BLOWN_UP
|
||||
{LC_X,220,STAT_BAR_WIDTH,16,50,STR_MR_UNITS_BUILT,0,FALSE,TRUE,0}, // STAT_UNITS_BUILT
|
||||
{LC_X,240,STAT_BAR_WIDTH,16,60,STR_MR_UNITS_NOW,0,FALSE,TRUE,0}, // STAT_UNITS_NOW
|
||||
{LC_X,260,STAT_BAR_WIDTH,16,70,STR_MR_STR_BUILT,0,FALSE,TRUE,0}, // STAT_STR_BUILT
|
||||
{LC_X,280,STAT_BAR_WIDTH,16,80,STR_MR_STR_NOW,0,FALSE,FALSE,0}, // STAT_STR_NOW
|
||||
|
||||
{RC_X,100,RANK_BAR_WIDTH,16,10,STR_MR_LEVEL_ROOKIE,0,FALSE,TRUE,0,117}, // right column // STAT_ROOKIE
|
||||
{RC_X,120,RANK_BAR_WIDTH,16,20,STR_MR_LEVEL_GREEN,0,FALSE,TRUE,0,117}, // STAT_GREEN
|
||||
{RC_X,140,RANK_BAR_WIDTH,16,30,STR_MR_LEVEL_TRAINED,0,FALSE,TRUE,0,117}, // STAT_TRAINED
|
||||
{RC_X,160,RANK_BAR_WIDTH,16,40,STR_MR_LEVEL_REGULAR,0,FALSE,TRUE,0,117}, // STAT_REGULAR
|
||||
{RC_X,180,RANK_BAR_WIDTH,16,50,STR_MR_LEVEL_VETERAN,0,FALSE,TRUE,0,117}, // STAT_VETERAN
|
||||
{RC_X,200,RANK_BAR_WIDTH,16,60,STR_MR_LEVEL_CRACK,0,FALSE,TRUE,0,117}, // STAT_CRACK
|
||||
{RC_X,220,RANK_BAR_WIDTH,16,70,STR_MR_LEVEL_ELITE,0,FALSE,TRUE,0,117}, // STAT_ELITE
|
||||
{RC_X,240,RANK_BAR_WIDTH,16,80,STR_MR_LEVEL_SPECIAL,0,FALSE,TRUE,0,117}, // STAT_SPECIAL
|
||||
{RC_X,260,RANK_BAR_WIDTH,16,90,STR_MR_LEVEL_ACE,0,FALSE,TRUE,0,117}, // STAT_ACE
|
||||
{RC_X,100,RANK_BAR_WIDTH,16,10,STR_MR_LEVEL_ROOKIE,0,FALSE,TRUE,0}, // right column // STAT_ROOKIE
|
||||
{RC_X,120,RANK_BAR_WIDTH,16,20,STR_MR_LEVEL_GREEN,0,FALSE,TRUE,0}, // STAT_GREEN
|
||||
{RC_X,140,RANK_BAR_WIDTH,16,30,STR_MR_LEVEL_TRAINED,0,FALSE,TRUE,0}, // STAT_TRAINED
|
||||
{RC_X,160,RANK_BAR_WIDTH,16,40,STR_MR_LEVEL_REGULAR,0,FALSE,TRUE,0}, // STAT_REGULAR
|
||||
{RC_X,180,RANK_BAR_WIDTH,16,50,STR_MR_LEVEL_VETERAN,0,FALSE,TRUE,0}, // STAT_VETERAN
|
||||
{RC_X,200,RANK_BAR_WIDTH,16,60,STR_MR_LEVEL_CRACK,0,FALSE,TRUE,0}, // STAT_CRACK
|
||||
{RC_X,220,RANK_BAR_WIDTH,16,70,STR_MR_LEVEL_ELITE,0,FALSE,TRUE,0}, // STAT_ELITE
|
||||
{RC_X,240,RANK_BAR_WIDTH,16,80,STR_MR_LEVEL_SPECIAL,0,FALSE,TRUE,0}, // STAT_SPECIAL
|
||||
{RC_X,260,RANK_BAR_WIDTH,16,90,STR_MR_LEVEL_ACE,0,FALSE,TRUE,0}, // STAT_ACE
|
||||
|
||||
{0, 0, 0, 0, 0, 0, 0, FALSE, FALSE, 0, 0 }
|
||||
{0, 0, 0, 0, 0, 0, 0, FALSE, FALSE, 0}
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
@ -362,8 +392,9 @@ UDWORD width,height;
|
|||
|
||||
/* Black shadow */
|
||||
pie_BoxFill(x + 1, y + 3, x + length - 1, y + height - 1, WZCOL_MENU_BACKGROUND);
|
||||
|
||||
/* Solid coloured bit */
|
||||
pie_BoxFillIndex(x + 1, y + 2, x + length - 4, y + height - 4, infoBars[index].colour);
|
||||
pie_BoxFill(x + 1, y + 2, x + length - 4, y + height - 4, getColour(index));
|
||||
}
|
||||
}
|
||||
/* Now render the text by the bar */
|
||||
|
|
|
@ -63,7 +63,6 @@ UDWORD queTime; // How many game ticks before it's active?
|
|||
BOOL bQueued; // Already fired off?
|
||||
BOOL bActive; // Is this one active?
|
||||
UDWORD number; // %d string for the associated text string.
|
||||
UDWORD colour; // What colour is this bar then?
|
||||
}STAT_BAR;
|
||||
|
||||
enum
|
||||
|
|
Loading…
Reference in New Issue