More conversions, incl. status screen
This commit is contained in:
parent
bf01637f57
commit
d38c82ea69
22
src/game.c
22
src/game.c
|
@ -1877,12 +1877,12 @@ static void game_doHud()
|
||||||
if (player.ammo[0] <= 25) fontColor = FONT_YELLOW;
|
if (player.ammo[0] <= 25) fontColor = FONT_YELLOW;
|
||||||
if (player.ammo[0] <= 10) fontColor = FONT_RED;
|
if (player.ammo[0] <= 10) fontColor = FONT_RED;
|
||||||
}
|
}
|
||||||
screen_blitTextInPlace(TS_PLASMA_T);
|
screen_blitText(TS_PLASMA_T, screen->w * 5 / 16, screen->h - 50);
|
||||||
sprintf(text, "%.3d", player.ammo[0]);
|
sprintf(text, "%.3d", player.ammo[0]);
|
||||||
gfx_createTextObject(TS_PLASMA, text, 0, 0, fontColor);
|
gfx_createTextObject(TS_PLASMA, text, 0, 0, fontColor);
|
||||||
screen_blitText(TS_PLASMA, screen->w * 5 / 16 + 70, screen->h - 49);
|
screen_blitText(TS_PLASMA, screen->w * 5 / 16 + 70, screen->h - 49);
|
||||||
|
|
||||||
screen_blitTextInPlace(TS_AMMO_T);
|
screen_blitText(TS_AMMO_T, screen->w / 2, screen->h - 50);
|
||||||
|
|
||||||
if ((player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_LASER))
|
if ((player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_LASER))
|
||||||
{
|
{
|
||||||
|
@ -2001,18 +2001,18 @@ static void game_doHud()
|
||||||
{
|
{
|
||||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
{
|
{
|
||||||
screen_blitTextInPlace(TS_TARGET);
|
screen_blitText(TS_TARGET, screen->w * 11 / 16, screen->h - 50);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (engine.targetIndex == ALIEN_SID)
|
if (engine.targetIndex == ALIEN_SID)
|
||||||
screen_blitTextInPlace(TS_TARGET_SID);
|
screen_blitText(TS_TARGET_SID, screen->w * 11 / 16 + 27, screen->h - 50);
|
||||||
else if (engine.targetIndex == ALIEN_PHOEBE)
|
else if (engine.targetIndex == ALIEN_PHOEBE)
|
||||||
screen_blitTextInPlace(TS_TARGET_PHOEBE);
|
screen_blitText(TS_TARGET_PHOEBE, screen->w * 11 / 16, screen->h - 50);
|
||||||
else if (engine.targetIndex == ALIEN_KLINE)
|
else if (engine.targetIndex == ALIEN_KLINE)
|
||||||
screen_blitTextInPlace(TS_TARGET_KLINE);
|
screen_blitText(TS_TARGET_KLINE, screen->w * 11 / 16 + 9, screen->h - 50);
|
||||||
else
|
else
|
||||||
screen_blitTextInPlace(TS_TARGET);
|
screen_blitText(TS_TARGET, screen->w * 11 / 16, screen->h - 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
bar.w = MAX(screen->w / 800, 1);
|
bar.w = MAX(screen->w / 800, 1);
|
||||||
|
@ -2035,7 +2035,7 @@ static void game_doHud()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
screen_blitTextInPlace(TS_POWER);
|
screen_blitText(TS_POWER, screen->w / 32, screen->h - 30);
|
||||||
|
|
||||||
bar.w = screen->w / 32;
|
bar.w = screen->w / 32;
|
||||||
bar.h = 12;
|
bar.h = 12;
|
||||||
|
@ -2054,7 +2054,7 @@ static void game_doHud()
|
||||||
bar.x += screen->w * 3 / 80;
|
bar.x += screen->w * 3 / 80;
|
||||||
}
|
}
|
||||||
|
|
||||||
screen_blitTextInPlace(TS_OUTPUT);
|
screen_blitText(TS_OUTPUT, screen->w * 5 / 16, screen->h - 30);
|
||||||
|
|
||||||
bar.w = screen->w / 32;
|
bar.w = screen->w / 32;
|
||||||
bar.h = 12;
|
bar.h = 12;
|
||||||
|
@ -2075,7 +2075,7 @@ static void game_doHud()
|
||||||
bar.x += screen->w * 3 / 80;
|
bar.x += screen->w * 3 / 80;
|
||||||
}
|
}
|
||||||
|
|
||||||
screen_blitTextInPlace(TS_COOLER);
|
screen_blitText(TS_COOLER, screen->w * 97 / 160, screen->h - 30);
|
||||||
|
|
||||||
bar.w = screen->w / 32;
|
bar.w = screen->w / 32;
|
||||||
bar.h = 12;
|
bar.h = 12;
|
||||||
|
@ -2095,7 +2095,7 @@ static void game_doHud()
|
||||||
bar.x += screen->w * 3 / 80;
|
bar.x += screen->w * 3 / 80;
|
||||||
}
|
}
|
||||||
|
|
||||||
screen_blitTextInPlace(TS_SHIELD);
|
screen_blitText(TS_SHIELD, screen->w / 32, screen->h - 50);
|
||||||
if (player.shield < 1)
|
if (player.shield < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,6 @@ static void intermission_setStatusLines()
|
||||||
char string[50];
|
char string[50];
|
||||||
char difficulty[50];
|
char difficulty[50];
|
||||||
int timeTaken = game.timeTaken;
|
int timeTaken = game.timeTaken;
|
||||||
int y;
|
|
||||||
|
|
||||||
switch (game.difficulty)
|
switch (game.difficulty)
|
||||||
{
|
{
|
||||||
|
@ -332,22 +331,10 @@ static void intermission_setStatusLines()
|
||||||
gfx_createTextObject(TS_URSULA_DEATHS, "", 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", 0, 0, FONT_WHITE);
|
||||||
|
|
||||||
snprintf(string, sizeof string, "Total Time : %2d:%02d:%02d", timeTaken / 3600, (timeTaken / 60) % 60, timeTaken % 60);
|
snprintf(string, sizeof string, "Total Time : %2d:%02d:%02d", timeTaken / 3600, (timeTaken / 60) % 60, timeTaken % 60);
|
||||||
gfx_createTextObject(TS_STATUS_FOOTER, string, -1, screen->h - 126, FONT_WHITE);
|
gfx_createTextObject(TS_STATUS_FOOTER, string, 0, 0, FONT_WHITE);
|
||||||
|
|
||||||
y = screen->h - 130;
|
|
||||||
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
|
|
||||||
{
|
|
||||||
y += 20;
|
|
||||||
if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER) ||
|
|
||||||
(i == TS_URSULA_HEADER))
|
|
||||||
y += 25;
|
|
||||||
|
|
||||||
gfx_textSprites[i].x = (screen->w - (screen->w * 7 / 8)) / 2 + 25;
|
|
||||||
gfx_textSprites[i].y = y;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -698,13 +685,13 @@ static void intermission_showStatus(SDL_Surface *infoSurface)
|
||||||
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
|
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
|
||||||
{
|
{
|
||||||
gfx_textSprites[i].y -= speed;
|
gfx_textSprites[i].y -= speed;
|
||||||
if ((gfx_textSprites[i].y > 80) && (gfx_textSprites[i].y < 70 + infoSurface->h))
|
if ((gfx_textSprites[i].y > 10) && (gfx_textSprites[i].y < infoSurface->h))
|
||||||
screen_blitTextInPlace(i);
|
screen_blitText(i, x + 25, 70);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gfx_textSprites[TS_STATUS_FOOTER - 1].y < 65)
|
if (gfx_textSprites[TS_STATUS_FOOTER - 1].y < -5)
|
||||||
{
|
{
|
||||||
y = 70 + infoSurface->h;
|
y = infoSurface->h;
|
||||||
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
|
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
|
||||||
{
|
{
|
||||||
y += 20;
|
y += 20;
|
||||||
|
@ -720,8 +707,8 @@ static void intermission_showStatus(SDL_Surface *infoSurface)
|
||||||
|
|
||||||
screen_drawRect(x, infoSurface->h + 70, infoSurface->w, 20, 0x00, 0x00, 0x99);
|
screen_drawRect(x, infoSurface->h + 70, infoSurface->w, 20, 0x00, 0x00, 0x99);
|
||||||
|
|
||||||
screen_blitTextInPlace(TS_STATUS_HEADER);
|
screen_blitText(TS_STATUS_HEADER, -1, 83);
|
||||||
screen_blitTextInPlace(TS_STATUS_FOOTER);
|
screen_blitText(TS_STATUS_FOOTER, -1, screen->h - 126);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void intermission_createCommsSurface(SDL_Surface *comms)
|
static void intermission_createCommsSurface(SDL_Surface *comms)
|
||||||
|
|
|
@ -1046,26 +1046,26 @@ void mission_showStartScreen()
|
||||||
renderer_update();
|
renderer_update();
|
||||||
|
|
||||||
gfx_loadSprites();
|
gfx_loadSprites();
|
||||||
gfx_createTextObject(TS_SHIELD, "Shield", screen->w / 32, screen->h - 50, FONT_WHITE);
|
gfx_createTextObject(TS_SHIELD, "Shield", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_PLASMA_T, "Plasma:", screen->w * 5 / 16, screen->h - 50, FONT_WHITE);
|
gfx_createTextObject(TS_PLASMA_T, "Plasma:", 0, 0, FONT_WHITE);
|
||||||
|
|
||||||
if (player.weaponType[1] == W_CHARGER)
|
if (player.weaponType[1] == W_CHARGER)
|
||||||
gfx_createTextObject(TS_AMMO_T, "Charge", screen->w / 2, screen->h - 50, FONT_WHITE);
|
gfx_createTextObject(TS_AMMO_T, "Charge", 0, 0, FONT_WHITE);
|
||||||
else if (player.weaponType[1] == W_LASER)
|
else if (player.weaponType[1] == W_LASER)
|
||||||
gfx_createTextObject(TS_AMMO_T, "Heat", screen->w / 2 + 20, screen->h - 50, FONT_WHITE);
|
gfx_createTextObject(TS_AMMO_T, "Heat", 20, 0, FONT_WHITE);
|
||||||
else
|
else
|
||||||
gfx_createTextObject(TS_AMMO_T, "Rockets:", screen->w / 2, screen->h - 50, FONT_WHITE);
|
gfx_createTextObject(TS_AMMO_T, "Rockets:", 0, 0, FONT_WHITE);
|
||||||
|
|
||||||
gfx_createTextObject(TS_TARGET, "Target", screen->w * 11 / 16, screen->h - 50, FONT_WHITE);
|
gfx_createTextObject(TS_TARGET, "Target", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_TARGET_SID, "Sid", screen->w * 11 / 16 + 27, screen->h - 50, FONT_WHITE);
|
gfx_createTextObject(TS_TARGET_SID, "Sid", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_TARGET_PHOEBE, "Phoebe", screen->w * 11 / 16, screen->h - 50, FONT_WHITE);
|
gfx_createTextObject(TS_TARGET_PHOEBE, "Phoebe", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_TARGET_KLINE, "Kline", screen->w * 11 / 16 + 9, screen->h - 50, FONT_WHITE);
|
gfx_createTextObject(TS_TARGET_KLINE, "Kline", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_CASH_T, "Cash: $", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_CASH_T, "Cash: $", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_OBJECTIVES_T, "Objectives Remaining:", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_OBJECTIVES_T, "Objectives Remaining:", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_TIME_T, "Time Remaining - ", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_TIME_T, "Time Remaining - ", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_POWER, "Power", screen->w / 32, screen->h - 30, FONT_WHITE);
|
gfx_createTextObject(TS_POWER, "Power", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_OUTPUT, "Output", screen->w * 5 / 16, screen->h - 30, FONT_WHITE);
|
gfx_createTextObject(TS_OUTPUT, "Output", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_COOLER, "Cooler", screen->w * 97 / 160, screen->h - 30, FONT_WHITE);
|
gfx_createTextObject(TS_COOLER, "Cooler", 0, 0, FONT_WHITE);
|
||||||
audio_playRandomTrack();
|
audio_playRandomTrack();
|
||||||
|
|
||||||
if (game.area != MISN_INTERCEPTION)
|
if (game.area != MISN_INTERCEPTION)
|
||||||
|
|
Loading…
Reference in New Issue