From 1d02b3c71ef74b512a2d91342e223bfe01c3fc91 Mon Sep 17 00:00:00 2001 From: onpon4 Date: Fri, 20 Nov 2015 14:11:12 -0500 Subject: [PATCH] More cleanup. --- src/gfx.cpp | 17 ++++++----------- src/gfx.h | 5 ++--- src/intermission.cpp | 2 +- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/gfx.cpp b/src/gfx.cpp index 54d4901..ce356f4 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -222,7 +222,7 @@ void gfx_putPixel(SDL_Surface *surface, int x, int y, Uint32 pixel) } } -void drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col) +void gfx_drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col) { int counter = 0; @@ -257,16 +257,11 @@ void drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col) } } -void drawLine(int x1, int y1, int x2, int y2, int col) -{ - drawLine(screen, x1, y1, x2, y2, col); -} - /* A quick(?) circle draw function. This code was posted to the SDL mailing list... I didn't write it myself. */ -void circle(int xc, int yc, int R, SDL_Surface *PIX, int col) +void gfx_drawCircle(int xc, int yc, int R, SDL_Surface *PIX, int col) { int x = 0, xx = 0; int y = R, yy = 2 * R; @@ -313,10 +308,10 @@ void blevelRect(SDL_Surface *dest, int x, int y, int w, int h, Uint8 red, Uint8 SDL_Rect r = {(int16_t)x, (int16_t)y, (uint16_t)w, (uint16_t)h}; SDL_FillRect(dest, &r, SDL_MapRGB(screen->format, red, green, blue)); - drawLine(dest, x, y, x + w, y, SDL_MapRGB(screen->format, 255, 255, 255)); - drawLine(dest, x, y, x, y + h, SDL_MapRGB(screen->format, 255, 255, 255)); - drawLine(dest, x, y + h, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128)); - drawLine(dest, x + w, y + 1, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128)); + gfx_drawLine(dest, x, y, x + w, y, SDL_MapRGB(screen->format, 255, 255, 255)); + gfx_drawLine(dest, x, y, x, y + h, SDL_MapRGB(screen->format, 255, 255, 255)); + gfx_drawLine(dest, x, y + h, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128)); + gfx_drawLine(dest, x + w, y + 1, x + w, y + h, SDL_MapRGB(screen->format, 128, 128, 128)); } void blevelRect(int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue) diff --git a/src/gfx.h b/src/gfx.h index 34f4310..fc1364c 100644 --- a/src/gfx.h +++ b/src/gfx.h @@ -36,9 +36,8 @@ 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); void gfx_putPixel(SDL_Surface *surface, int x, int y, Uint32 pixel); -extern void drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col); -extern void drawLine(int x1, int y1, int x2, int y2, int col); -extern void circle(int xc, int yc, int R, SDL_Surface *PIX, int col); +void gfx_drawLine(SDL_Surface *dest, int x1, int y1, int x2, int y2, int col); +void gfx_drawCircle(int xc, int yc, int R, SDL_Surface *PIX, int col); extern void blevelRect(SDL_Surface *dest, int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue); extern void blevelRect(int x, int y, int w, int h, Uint8 red, Uint8 green, Uint8 blue); extern SDL_Surface *createSurface(int width, int height); diff --git a/src/intermission.cpp b/src/intermission.cpp index 8ef460e..7d9db0b 100644 --- a/src/intermission.cpp +++ b/src/intermission.cpp @@ -254,7 +254,7 @@ static bool intermission_showSystem(float x, float y, bool selectable) x *= 0.75; y *= 0.75; - circle(400, 250, i, screen, darkGrey); + gfx_drawCircle(400, 250, i, screen, darkGrey); r.x = int(400 + (sinf(x) * i)); r.y = int(250 + (cosf(y) * i));