Adjusted the status screen.

Several pointless lines have been removed, and I've added a workaround
to fix a segfault that was happening when Phoebe or Ursula were not
wingmates yet.
This commit is contained in:
onpon4 2016-01-09 22:15:28 -05:00
parent edacc25821
commit 9dedf500c8
2 changed files with 14 additions and 30 deletions

View File

@ -487,7 +487,7 @@ enum {
SHOP_S_MAX SHOP_S_MAX
}; };
// Text sprites (main menu) // Text sprites
enum { enum {
// Main menu // Main menu
TS_PRESENTS = MAX_INFOLINES, TS_PRESENTS = MAX_INFOLINES,
@ -532,7 +532,6 @@ enum {
// Status // Status
TS_STATUS_HEADER, TS_STATUS_HEADER,
TS_MISSIONS_COMPLETED,
TS_SHOTS_FIRED, TS_SHOTS_FIRED,
TS_HITS_SCORED, TS_HITS_SCORED,
TS_ACCURACY, TS_ACCURACY,
@ -546,7 +545,6 @@ enum {
TS_CHRIS_POWERUP_PICKUPS, TS_CHRIS_POWERUP_PICKUPS,
TS_CHRIS_MINES_KILLED, TS_CHRIS_MINES_KILLED,
TS_CHRIS_SLAVES_RESCUED, TS_CHRIS_SLAVES_RESCUED,
TS_CHRIS_CARGO_PICKUPS,
TS_PHOEBE_HEADER, TS_PHOEBE_HEADER,
TS_PHOEBE_KILLS, TS_PHOEBE_KILLS,
TS_PHOEBE_DEATHS, TS_PHOEBE_DEATHS,

View File

@ -39,32 +39,9 @@ These are set only once.
static void intermission_setStatusLines() static void intermission_setStatusLines()
{ {
char string[50]; char string[50];
int total = 0;
int completed = 0;
int timeTaken = game.timeTaken; int timeTaken = game.timeTaken;
int y; int y;
// XXX: Magic number
for (int i = 0 ; i < 10 ; i++)
{
if (systemPlanet[i].missionNumber > -1)
{
switch(systemPlanet[i].missionCompleted)
{
case 0:
total++;
break;
case 1:
total++;
completed++;
break;
}
}
}
sprintf(string, "Missions Completed : %d/%d", completed, total);
gfx_createTextObject(TS_MISSIONS_COMPLETED, string, 0, 0, FONT_WHITE);
sprintf(string, "Shots Fired : %d", game.shots); sprintf(string, "Shots Fired : %d", game.shots);
gfx_createTextObject(TS_SHOTS_FIRED, string, 0, 0, FONT_WHITE); gfx_createTextObject(TS_SHOTS_FIRED, string, 0, 0, FONT_WHITE);
@ -94,7 +71,7 @@ static void intermission_setStatusLines()
sprintf(string, "Rockets Picked Up : %d", game.rocketPickups); sprintf(string, "Rockets Picked Up : %d", game.rocketPickups);
gfx_createTextObject(TS_CHRIS_ROCKET_PICKUPS, string, 0, 0, FONT_WHITE); gfx_createTextObject(TS_CHRIS_ROCKET_PICKUPS, string, 0, 0, FONT_WHITE);
sprintf(string, "Powerups Picked Up : %d", game.rocketPickups); sprintf(string, "Powerups Picked Up : %d", game.powerups);
gfx_createTextObject(TS_CHRIS_POWERUP_PICKUPS, string, 0, 0, FONT_WHITE); gfx_createTextObject(TS_CHRIS_POWERUP_PICKUPS, string, 0, 0, FONT_WHITE);
sprintf(string, "Mines Destroyed : %d", game.minesKilled); sprintf(string, "Mines Destroyed : %d", game.minesKilled);
@ -103,9 +80,6 @@ static void intermission_setStatusLines()
sprintf(string, "Slaves Rescued : %d", game.slavesRescued); sprintf(string, "Slaves Rescued : %d", game.slavesRescued);
gfx_createTextObject(TS_CHRIS_SLAVES_RESCUED, string, 0, 0, FONT_WHITE); gfx_createTextObject(TS_CHRIS_SLAVES_RESCUED, string, 0, 0, FONT_WHITE);
sprintf(string, "Cargo Picked Up : %d", game.cargoPickups);
gfx_createTextObject(TS_CHRIS_CARGO_PICKUPS, string, 0, 0, FONT_WHITE);
if (game.hasWingMate1) if (game.hasWingMate1)
{ {
gfx_createTextObject(TS_PHOEBE_HEADER, "*** Phoebe ***", 0, 0, FONT_WHITE); gfx_createTextObject(TS_PHOEBE_HEADER, "*** Phoebe ***", 0, 0, FONT_WHITE);
@ -116,6 +90,12 @@ static void intermission_setStatusLines()
sprintf(string, "Ejections : %d", game.wingMate1Ejects); sprintf(string, "Ejections : %d", game.wingMate1Ejects);
gfx_createTextObject(TS_PHOEBE_DEATHS, string, 0, 0, FONT_WHITE); gfx_createTextObject(TS_PHOEBE_DEATHS, string, 0, 0, FONT_WHITE);
} }
else
{
gfx_createTextObject(TS_PHOEBE_HEADER, "", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_PHOEBE_KILLS, "", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_PHOEBE_DEATHS, "", 0, 0, FONT_WHITE);
}
if (game.hasWingMate2) if (game.hasWingMate2)
{ {
@ -127,6 +107,12 @@ static void intermission_setStatusLines()
sprintf(string, "Ejections : %d", game.wingMate2Ejects); sprintf(string, "Ejections : %d", game.wingMate2Ejects);
gfx_createTextObject(TS_URSULA_DEATHS, string, 0, 0, FONT_WHITE); gfx_createTextObject(TS_URSULA_DEATHS, string, 0, 0, FONT_WHITE);
} }
else
{
gfx_createTextObject(TS_URSULA_HEADER, "", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_URSULA_KILLS, "", 0, 0, FONT_WHITE);
gfx_createTextObject(TS_URSULA_DEATHS, "", 0, 0, FONT_WHITE);
}
gfx_createTextObject(TS_STATUS_HEADER, "Current Status", -1, 83, FONT_WHITE); gfx_createTextObject(TS_STATUS_HEADER, "Current Status", -1, 83, FONT_WHITE);