drawString -> screen_renderString

This commit is contained in:
onpon4 2015-11-06 19:36:20 -05:00
parent 67d464433d
commit 4bdf871e66
9 changed files with 38 additions and 38 deletions

View File

@ -87,8 +87,8 @@ int main(int argc, char **argv)
if (cheatAttempt && !engine.cheat)
{
clearScreen(black);
drawString("That doesn't work anymore", -1, 285, FONT_WHITE);
drawString("Try harder...", -1, 315, FONT_WHITE);
screen_renderString("That doesn't work anymore", -1, 285, FONT_WHITE);
screen_renderString("Try harder...", -1, 315, FONT_WHITE);
renderer_update();
SDL_Delay(2000);
clearScreen(black);

View File

@ -186,11 +186,6 @@ int gfx_renderString(const char *in, int x, int y, int fontColor, int wrap, SDL_
return gfx_renderStringBase(in, x, y, fontColor, wrap, dest);
}
int drawString(const char *in, int x, int y, int fontColor)
{
return gfx_renderString(in, x, y, fontColor, 0, screen);
}
/*
Draws the background surface that has been loaded
*/

View File

@ -35,7 +35,6 @@ void gfx_init();
SDL_Surface *gfx_setTransparent(SDL_Surface *sprite);
void gfx_blit(SDL_Surface *image, int x, int y, SDL_Surface *dest);
int gfx_renderString(const char *in, int x, int y, int fontColor, int wrap, SDL_Surface *dest);
extern int drawString(const char *in, int x, int y, int fontColor);
extern void drawBackGround();
extern void clearScreen(Uint32 color);
extern void delayFrame();

View File

@ -49,7 +49,7 @@ void showErrorAndExit(int errorId, const char *name)
if (errorId != 2)
{
drawString("A file error has occurred", -1, 200, FONT_RED);
screen_renderString("A file error has occurred", -1, 200, FONT_RED);
}
else
{
@ -63,24 +63,24 @@ void showErrorAndExit(int errorId, const char *name)
{
case 0:
sprintf(string, "%s was not found in the Starfighter data package", name);
drawString(string, -1, 250, FONT_WHITE);
drawString("Please try again. If this error persists, contact the authors", -1, 275, FONT_WHITE);
drawString("or reinstall the game", -1, 300, FONT_WHITE);
screen_renderString(string, -1, 250, FONT_WHITE);
screen_renderString("Please try again. If this error persists, contact the authors", -1, 275, FONT_WHITE);
screen_renderString("or reinstall the game", -1, 300, FONT_WHITE);
break;
case 1:
drawString("Project: Starfighter encountered an error whilst", -1, 250, FONT_WHITE);
drawString("attempting to load game data. Please try running", -1, 275, FONT_WHITE);
drawString("the game again. If the errors persist, reinstall the game", -1, 300, FONT_WHITE);
screen_renderString("Project: Starfighter encountered an error whilst", -1, 250, FONT_WHITE);
screen_renderString("attempting to load game data. Please try running", -1, 275, FONT_WHITE);
screen_renderString("the game again. If the errors persist, reinstall the game", -1, 300, FONT_WHITE);
break;
case 2:
drawString("Project: Starfighter encountered a critical error", -1, 250, FONT_WHITE);
drawString("while attempting to perform a required program function.", -1, 275, FONT_WHITE);
drawString("Please contact the authors with details.", -1, 300, FONT_WHITE);
screen_renderString("Project: Starfighter encountered a critical error", -1, 250, FONT_WHITE);
screen_renderString("while attempting to perform a required program function.", -1, 275, FONT_WHITE);
screen_renderString("Please contact the authors with details.", -1, 300, FONT_WHITE);
break;
}
drawString("Project: Starfighter will now exit", -1, 450, FONT_WHITE);
drawString("Press Space to continue", -1, 475, FONT_WHITE);
screen_renderString("Project: Starfighter will now exit", -1, 450, FONT_WHITE);
screen_renderString("Press Space to continue", -1, 475, FONT_WHITE);
renderer_update();

View File

@ -270,7 +270,7 @@ static bool intermission_showSystem(float x, float y, bool selectable)
r.x, r.y, systemPlanet[planet].image->w,
systemPlanet[planet].image->h))
{
drawString(systemPlanet[planet].name, -1, 545, FONT_WHITE);
screen_renderString(systemPlanet[planet].name, -1, 545, FONT_WHITE);
if ((engine.keyState[KEY_FIRE]))
{
if (game.system == 0)

View File

@ -715,13 +715,13 @@ static void drawBriefScreen()
blevelRect(140, 70, 500, 20, 0x00, 0x77, 0x00);
blevelRect(140, 90, 500, 130, 0x00, 0x33, 0x00);
drawString("Primary Objectives", 150, 74, FONT_WHITE);
screen_renderString("Primary Objectives", 150, 74, FONT_WHITE);
for (int i = 0 ; i < 3 ; i++)
{
if ((currentMission.primaryType[i] != NONE) && (currentMission.completed1[i] != OB_HIDDEN))
{
drawString(currentMission.primaryObjective[i], 160, 114 + (i * 30), FONT_WHITE);
screen_renderString(currentMission.primaryObjective[i], 160, 114 + (i * 30), FONT_WHITE);
}
}
@ -729,13 +729,13 @@ static void drawBriefScreen()
{
blevelRect(140, 230, 500, 20, 0x00, 0x77, 0x77);
blevelRect(140, 250, 500, 130, 0x00, 0x33, 0x33);
drawString("Secondary Objectives", 150, 234, FONT_WHITE);
screen_renderString("Secondary Objectives", 150, 234, FONT_WHITE);
for (int i = 0 ; i < 3 ; i++)
{
if (currentMission.secondaryType[i] != NONE)
{
drawString(currentMission.secondaryObjective[i], 160, 274 + (i * 30), FONT_WHITE);
screen_renderString(currentMission.secondaryObjective[i], 160, 274 + (i * 30), FONT_WHITE);
game.secondaryMissions++;
}
}
@ -743,7 +743,7 @@ static void drawBriefScreen()
blevelRect(140, 390, 500, 20, 0x77, 0x77, 0x00);
blevelRect(140, 410, 500, 130, 0x33, 0x33, 0x00);
drawString("Additional Information", 150, 394, FONT_WHITE);
screen_renderString("Additional Information", 150, 394, FONT_WHITE);
}
/*
@ -768,7 +768,7 @@ void missionBriefScreen()
sprintf(temp, "TIME LIMIT: %d minutes", currentMission.timeLimit1[0]);
else
sprintf(temp, "SURVIVAL FOR %d minutes", currentMission.timeLimit1[0]);
drawString(temp, -1, 500, FONT_RED);
screen_renderString(temp, -1, 500, FONT_RED);
}
switch (game.area)
@ -780,16 +780,16 @@ void missionBriefScreen()
case MISN_ELLESH:
case MISN_MARS:
case MISN_VENUS:
drawString("Phoebe Lexx will not be present", 160, 420, FONT_WHITE);
screen_renderString("Phoebe Lexx will not be present", 160, 420, FONT_WHITE);
if (game.hasWingMate2)
drawString("Ursula Lexx will not be present", 160, 450, FONT_WHITE);
screen_renderString("Ursula Lexx will not be present", 160, 450, FONT_WHITE);
break;
}
if ((game.area == MISN_URUSOR) ||
(game.area == MISN_POSWIC) ||
(game.area == MISN_EARTH))
drawString("Sid Wilson will join you on this mission", 160, 480, FONT_WHITE);
screen_renderString("Sid Wilson will join you on this mission", 160, 480, FONT_WHITE);
renderer_update();
}
@ -816,7 +816,7 @@ void missionBriefScreen()
if (game.area != MISN_INTERCEPTION)
{
drawString("PRESS ENTER TO CONTINUE...", -1, 550, FONT_WHITE);
screen_renderString("PRESS ENTER TO CONTINUE...", -1, 550, FONT_WHITE);
renderer_update();
@ -870,9 +870,9 @@ void missionFinishedScreen()
if (currentMission.primaryType[i] != NONE)
{
if ((game.area != MISN_POSWIC) || (i != 1))
drawString("COMPLETED", 550, 114 + (i * 30), FONT_GREEN);
screen_renderString("COMPLETED", 550, 114 + (i * 30), FONT_GREEN);
else
drawString("FAILED", 550, 114 + (i * 30), FONT_RED);
screen_renderString("FAILED", 550, 114 + (i * 30), FONT_RED);
}
}
@ -885,12 +885,12 @@ void missionFinishedScreen()
strcpy(temp, currentMission.secondaryObjective[i]);
if (currentMission.completed2[i] >= 1)
{
drawString("COMPLETED", 550, 274 + (i * 30), FONT_GREEN);
screen_renderString("COMPLETED", 550, 274 + (i * 30), FONT_GREEN);
game.secondaryMissionsCompleted++;
}
else
{
drawString("FAILED", 550, 274 + (i * 30), FONT_RED);
screen_renderString("FAILED", 550, 274 + (i * 30), FONT_RED);
}
}
}
@ -900,7 +900,7 @@ void missionFinishedScreen()
{
shield_bonus = player.shield * 10;
sprintf(temp, "Shield Bonus: $%.3d", shield_bonus);
drawString(temp, -1, 430, FONT_WHITE);
screen_renderString(temp, -1, 430, FONT_WHITE);
game.cash += shield_bonus;
game.cashEarned += shield_bonus;
}
@ -911,7 +911,7 @@ void missionFinishedScreen()
engine.timeTaken / 3600, (engine.timeTaken / 60) % 60,
engine.timeTaken % 60);
drawString(temp, -1, 500, FONT_WHITE);
screen_renderString(temp, -1, 500, FONT_WHITE);
// Do some mission specific stuff here...
if (game.area == MISN_HAIL)

View File

@ -37,6 +37,11 @@ void screen_blitText(int i)
screen_blit(gfx_text[i].image, (int)gfx_text[i].x, (int)gfx_text[i].y);
}
int screen_renderString(const char *in, int x, int y, int fontColor)
{
return gfx_renderString(in, x, y, fontColor, 0, screen);
}
void screen_addBuffer(int x, int y, int w, int h)
{
bRect *rect = new bRect;

View File

@ -28,6 +28,7 @@ extern bRect *screen_bufferTail;
void screen_blit(SDL_Surface *image, int x, int y);
void screen_blitText(int i);
int screen_renderString(const char *in, int x, int y, int fontColor);
void screen_addBuffer(int x, int y, int w, int h);
void screen_flushBuffer();
void screen_unBuffer();

View File

@ -301,7 +301,7 @@ void doCutscene(int scene)
if ((showMessage) && (messageBox != NULL))
screen_blit(messageBox, (screen->w - messageBox->w) / 2, screen->h - 100);
drawString("Press [Escape] to skip", -1, 580, FONT_WHITE);
screen_renderString("Press [Escape] to skip", -1, 580, FONT_WHITE);
delayFrame();