MOAR MOAR
This commit is contained in:
parent
cea10fd3fb
commit
5434ce43c4
46
src/game.c
46
src/game.c
|
@ -1865,13 +1865,20 @@ static void game_doHud()
|
||||||
int shieldColor = 0;
|
int shieldColor = 0;
|
||||||
SDL_Rect bar;
|
SDL_Rect bar;
|
||||||
int fontColor;
|
int fontColor;
|
||||||
char text[25];
|
int tTextIndex;
|
||||||
|
char text[STRMAX_SHORT];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
screen_addBuffer(0, 20, screen->w, 25);
|
screen_addBuffer(0, 20, screen->w, 25);
|
||||||
screen_addBuffer(0, screen->h - 50, screen->w, 34);
|
screen_addBuffer(0, screen->h - 50, screen->w, 34);
|
||||||
|
|
||||||
if (engine.minutes > -1)
|
if (engine.minutes > -1)
|
||||||
|
{
|
||||||
|
if (game.area == MISN_MARS)
|
||||||
|
{
|
||||||
|
fontColor = FONT_WHITE;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if ((engine.minutes == 0) && (engine.seconds <= 29))
|
if ((engine.minutes == 0) && (engine.seconds <= 29))
|
||||||
fontColor = FONT_RED;
|
fontColor = FONT_RED;
|
||||||
|
@ -1879,10 +1886,19 @@ static void game_doHud()
|
||||||
fontColor = FONT_YELLOW;
|
fontColor = FONT_YELLOW;
|
||||||
else
|
else
|
||||||
fontColor = FONT_WHITE;
|
fontColor = FONT_WHITE;
|
||||||
screen_blitText(TS_TIME_T, screen->w / 2 - 140, 20);
|
}
|
||||||
sprintf(text, "%.2d:%.2d", engine.minutes, engine.seconds);
|
|
||||||
|
/// Each "%.2d" must be retained. They are replaced with the minutes and seconds left
|
||||||
|
/// to complete the mission, respectively (or, in the case of the Mars mission, the
|
||||||
|
/// minutes and seconds, respectively, until the mission is completed).
|
||||||
|
/// If you are familiar with C string formatting, they can be modified as long as
|
||||||
|
/// the "d" type remains. For example, you can replace "%.2d" with "%d" to allow the
|
||||||
|
/// timer to use single-digit numbers.
|
||||||
|
/// The ":" can also be replaced just like any text. For example, this would be fine:
|
||||||
|
/// "Time Remaining - %d minutes and %d seconds"
|
||||||
|
sprintf(text, _("Time Remaining - %.2d:%.2d"), engine.minutes, engine.seconds);
|
||||||
gfx_createTextObject(TS_TIME, text, 0, 0, fontColor);
|
gfx_createTextObject(TS_TIME, text, 0, 0, fontColor);
|
||||||
screen_blitText(TS_TIME, screen->w / 2 + 10, 21);
|
screen_blitText(TS_TIME, screen->w / 2 - gfx_textSprites[TS_TIME].image->w / 2, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.area != MISN_INTERCEPTION)
|
if (game.area != MISN_INTERCEPTION)
|
||||||
|
@ -2059,23 +2075,25 @@ static void game_doHud()
|
||||||
{
|
{
|
||||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
{
|
{
|
||||||
screen_blitText(TS_TARGET, screen->w * 11 / 16, screen->h - 50);
|
tTextIndex = TS_TARGET;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (engine.targetIndex == ALIEN_SID)
|
if (engine.targetIndex == ALIEN_SID)
|
||||||
screen_blitText(TS_TARGET_SID, screen->w * 11 / 16 + 27, screen->h - 50);
|
tTextIndex = TS_TARGET_SID;
|
||||||
else if (engine.targetIndex == ALIEN_PHOEBE)
|
else if (engine.targetIndex == ALIEN_PHOEBE)
|
||||||
screen_blitText(TS_TARGET_PHOEBE, screen->w * 11 / 16, screen->h - 50);
|
tTextIndex = TS_TARGET_PHOEBE;
|
||||||
else if (engine.targetIndex == ALIEN_KLINE)
|
else if (engine.targetIndex == ALIEN_KLINE)
|
||||||
screen_blitText(TS_TARGET_KLINE, screen->w * 11 / 16 + 9, screen->h - 50);
|
tTextIndex = TS_TARGET_KLINE;
|
||||||
else
|
else
|
||||||
screen_blitText(TS_TARGET, screen->w * 11 / 16, screen->h - 50);
|
tTextIndex = TS_TARGET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
screen_blitText(tTextIndex, screen->w * 11 / 16, screen->h - 50);
|
||||||
|
|
||||||
bar.w = MAX(screen->w / 800, 1);
|
bar.w = MAX(screen->w / 800, 1);
|
||||||
bar.h = 12;
|
bar.h = 12;
|
||||||
bar.x = screen->w * 11 / 16 + 65;
|
bar.x = screen->w * 11 / 16 + gfx_textSprites[tTextIndex].image->w + 10;
|
||||||
bar.y = screen->h - 50;
|
bar.y = screen->h - 50;
|
||||||
|
|
||||||
for (float i = 0 ; i < (engine.targetShield * aliens[engine.targetIndex].shield) ; i++)
|
for (float i = 0 ; i < (engine.targetShield * aliens[engine.targetIndex].shield) ; i++)
|
||||||
|
@ -2097,7 +2115,7 @@ static void game_doHud()
|
||||||
|
|
||||||
bar.w = screen->w / 32;
|
bar.w = screen->w / 32;
|
||||||
bar.h = 12;
|
bar.h = 12;
|
||||||
bar.x = screen->w / 32 + 55;
|
bar.x = screen->w / 32 + gfx_textSprites[TS_POWER].image->w + 10;
|
||||||
bar.y = screen->h - 29;
|
bar.y = screen->h - 29;
|
||||||
|
|
||||||
for (int i = 1 ; i <= 5 ; i++)
|
for (int i = 1 ; i <= 5 ; i++)
|
||||||
|
@ -2116,7 +2134,7 @@ static void game_doHud()
|
||||||
|
|
||||||
bar.w = screen->w / 32;
|
bar.w = screen->w / 32;
|
||||||
bar.h = 12;
|
bar.h = 12;
|
||||||
bar.x = screen->w * 5 / 16 + 65;
|
bar.x = screen->w * 5 / 16 + gfx_textSprites[TS_OUTPUT].image->w + 10;
|
||||||
bar.y = screen->h - 29;
|
bar.y = screen->h - 29;
|
||||||
SDL_FillRect(screen, &bar, yellow);
|
SDL_FillRect(screen, &bar, yellow);
|
||||||
|
|
||||||
|
@ -2137,7 +2155,7 @@ static void game_doHud()
|
||||||
|
|
||||||
bar.w = screen->w / 32;
|
bar.w = screen->w / 32;
|
||||||
bar.h = 12;
|
bar.h = 12;
|
||||||
bar.x = screen->w * 97 / 160 + 65;
|
bar.x = screen->w * 97 / 160 + gfx_textSprites[TS_COOLER].image->w + 10;
|
||||||
bar.y = screen->h - 29;
|
bar.y = screen->h - 29;
|
||||||
|
|
||||||
for (int i = 1 ; i <= 5 ; i++)
|
for (int i = 1 ; i <= 5 ; i++)
|
||||||
|
@ -2167,7 +2185,7 @@ static void game_doHud()
|
||||||
|
|
||||||
bar.w = blockSize;
|
bar.w = blockSize;
|
||||||
bar.h = 12;
|
bar.h = 12;
|
||||||
bar.x = screen->w / 32 + 65;
|
bar.x = screen->w / 32 + gfx_textSprites[TS_SHIELD].image->w + 10;
|
||||||
bar.y = screen->h - 50;
|
bar.y = screen->h - 50;
|
||||||
|
|
||||||
for (int i = 0 ; i < player.shield ; i += blockSize)
|
for (int i = 0 ; i < player.shield ; i += blockSize)
|
||||||
|
|
|
@ -1169,8 +1169,6 @@ mission begins playing here.
|
||||||
*/
|
*/
|
||||||
void mission_showStartScreen()
|
void mission_showStartScreen()
|
||||||
{
|
{
|
||||||
// TODO: Replace all "TS_*_T" objs with string formatting, plus adjust
|
|
||||||
// spacing for things like TS_SHIELD
|
|
||||||
screen_clear(black);
|
screen_clear(black);
|
||||||
renderer_update();
|
renderer_update();
|
||||||
|
|
||||||
|
@ -1182,7 +1180,6 @@ void mission_showStartScreen()
|
||||||
gfx_createTextObject(TS_TARGET_SID, _("Sid"), 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_TARGET_SID, _("Sid"), 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_TARGET_PHOEBE, _("Phoebe"), 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_TARGET_PHOEBE, _("Phoebe"), 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_TARGET_KLINE, _("Kline"), 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_TARGET_KLINE, _("Kline"), 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_TIME_T, "Time Remaining - ", 0, 0, FONT_WHITE);
|
|
||||||
gfx_createTextObject(TS_POWER, "Power", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_POWER, "Power", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_OUTPUT, "Output", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_OUTPUT, "Output", 0, 0, FONT_WHITE);
|
||||||
gfx_createTextObject(TS_COOLER, "Cooler", 0, 0, FONT_WHITE);
|
gfx_createTextObject(TS_COOLER, "Cooler", 0, 0, FONT_WHITE);
|
||||||
|
|
|
@ -340,11 +340,13 @@ static void drawShop()
|
||||||
/// "%.3d" can be changed to "%d" if you wish to not fill in space with zeroes,
|
/// "%.3d" can be changed to "%d" if you wish to not fill in space with zeroes,
|
||||||
/// e.g. render the number 5 as "5" rather than "005".
|
/// e.g. render the number 5 as "5" rather than "005".
|
||||||
sprintf(description, _("Plasma Cells: %.3d"), player.ammo[0]);
|
sprintf(description, _("Plasma Cells: %.3d"), player.ammo[0]);
|
||||||
|
// XXX: Bad positioning
|
||||||
gfx_renderUnicode(description, 430, 6, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SHIP_INFO]);
|
gfx_renderUnicode(description, 430, 6, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SHIP_INFO]);
|
||||||
/// Retain "%.2d". It is replaced with the ship's current number of rockets.
|
/// Retain "%.2d". It is replaced with the ship's current number of rockets.
|
||||||
/// "%.2d" can be changed to "%d" if you wish to not fill in space with zeroes,
|
/// "%.2d" can be changed to "%d" if you wish to not fill in space with zeroes,
|
||||||
/// e.g. render the number 3 as "3" rather than "03".
|
/// e.g. render the number 3 as "3" rather than "03".
|
||||||
sprintf(description, _("Rockets: %.2d"), player.ammo[1]);
|
sprintf(description, _("Rockets: %.2d"), player.ammo[1]);
|
||||||
|
// XXX: Bad positioning
|
||||||
gfx_renderUnicode(description, 475, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SHIP_INFO]);
|
gfx_renderUnicode(description, 475, 22, FONT_WHITE, 0, gfx_shopSprites[SHOP_S_SHIP_INFO]);
|
||||||
|
|
||||||
gfx_shopSprites[SHOP_S_ITEM_INFO] = gfx_createSurface(601, 56);
|
gfx_shopSprites[SHOP_S_ITEM_INFO] = gfx_createSurface(601, 56);
|
||||||
|
|
Loading…
Reference in New Issue