Some more cleanup.

This commit is contained in:
onpon4 2015-11-03 20:26:56 -05:00
parent cce6d11510
commit 7c67112a8b
3 changed files with 16 additions and 16 deletions

View File

@ -99,7 +99,7 @@ void gfx_blit(SDL_Surface *image, int x, int y, SDL_Surface *dest)
In 16 bit mode this is slow. VERY slow. Don't write directly to a surface
that constantly needs updating (eg - the main game screen)
*/
static int renderString(const char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest)
static int gfx_renderStringBase(const char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest)
{
int i;
int splitword;
@ -172,29 +172,29 @@ static int renderString(const char *in, int x, int y, int fontColor, signed char
return area.y;
}
int drawString(const char *in, int x, int y, int fontColor, signed char wrap, SDL_Surface *dest)
int gfx_renderString(const char *in, int x, int y, int fontColor, int wrap, SDL_Surface *dest)
{
renderString(in, x, y - 1, FONT_OUTLINE, wrap, dest);
renderString(in, x, y + 1, FONT_OUTLINE, wrap, dest);
renderString(in, x, y + 2, FONT_OUTLINE, wrap, dest);
renderString(in, x - 1, y, FONT_OUTLINE, wrap, dest);
renderString(in, x - 2, y, FONT_OUTLINE, wrap, dest);
renderString(in, x + 1, y, FONT_OUTLINE, wrap, dest);
return renderString(in, x, y, fontColor, wrap, dest);
gfx_renderStringBase(in, x, y - 1, FONT_OUTLINE, wrap, dest);
gfx_renderStringBase(in, x, y + 1, FONT_OUTLINE, wrap, dest);
gfx_renderStringBase(in, x, y + 2, FONT_OUTLINE, wrap, dest);
gfx_renderStringBase(in, x - 1, y, FONT_OUTLINE, wrap, dest);
gfx_renderStringBase(in, x - 2, y, FONT_OUTLINE, wrap, dest);
gfx_renderStringBase(in, x + 1, y, FONT_OUTLINE, wrap, dest);
return gfx_renderStringBase(in, x, y, fontColor, wrap, dest);
}
int drawString(const char *in, int x, int y, int fontColor, SDL_Surface *dest)
{
if (x == -1)
x = (dest->w - (strlen(in) * 9)) / 2;
return drawString(in, x, y, fontColor, 0, dest);
return gfx_renderString(in, x, y, fontColor, 0, dest);
}
int drawString(const char *in, int x, int y, int fontColor)
{
if (x == -1)
x = (800 - (strlen(in) * 9)) / 2;
return drawString(in, x, y, fontColor, 0, screen);
x = (screen->w - (strlen(in) * 9)) / 2;
return gfx_renderString(in, x, y, fontColor, 0, screen);
}
/*
@ -477,7 +477,7 @@ void createMessageBox(SDL_Surface *face, const char *message, signed char transp
x = 10;
}
drawString(message, x, 5, FONT_WHITE, 1, messageBox);
gfx_renderString(message, x, 5, FONT_WHITE, 1, messageBox);
}
void freeGraphics()

View File

@ -34,7 +34,7 @@ extern SDL_Surface *messageBox;
void gfx_init();
SDL_Surface *gfx_setTransparent(SDL_Surface *sprite);
void gfx_blit(SDL_Surface *image, int x, int y, SDL_Surface *dest);
extern int drawString(const char *in, int x, int y, int fontColor, signed char wrap, 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, SDL_Surface *dest);
extern int drawString(const char *in, int x, int y, int fontColor);
extern void drawBackGround();

View File

@ -431,7 +431,7 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
}
else
{
newY = drawString(string, 80, y, col, 1, comms) + 25;
newY = gfx_renderString(string, 80, y, col, 1, comms) + 25;
if (newY < y + 60)
newY += (60 - (newY - y));
y = newY;
@ -441,7 +441,7 @@ static void intermission_createMissionDetailSurface(SDL_Surface *comms, int miss
fclose(fp);
blevelRect(comms, 5, comms->h - 28, 180, 20, 0x25, 0x00, 0x00);
drawString("RETURN TO MESSAGES", 15, comms->h - 25, FONT_WHITE, 1, comms);
gfx_renderString("RETURN TO MESSAGES", 15, comms->h - 25, FONT_WHITE, 1, comms);
engine.commsSection = 1;
}