diff --git a/README.txt b/README.txt index bd7b8be..daaecb7 100644 --- a/README.txt +++ b/README.txt @@ -52,7 +52,6 @@ Project: Starfighter depends on the following libraries to build: * SDL2 * SDL2_image * SDL2_mixer -* SDL2_gfx Once you have all dependencies installed, you can do the following: diff --git a/configure.ac b/configure.ac index f53da92..ce9cc0e 100644 --- a/configure.ac +++ b/configure.ac @@ -22,9 +22,9 @@ STARFIGHTER_CFLAGS="-DVERSION=\\\"$PACKAGE_VERSION\\\"" # Checks for libraries. PKG_CHECK_EXISTS([SDL2_mixer], [ - PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_gfx SDL2_mixer]) + PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_mixer]) ], [ - PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image SDL2_gfx]) + PKG_CHECK_MODULES([SDL], [sdl2 SDL2_image]) STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DNOSOUND" echo "Note: SDL_mixer not found; audio will not be supported." ]) diff --git a/src/gfx.cpp b/src/gfx.cpp index f1664f2..79b08db 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -23,7 +23,6 @@ along with this program. If not, see . #include "SDL.h" #include "SDL_image.h" -#include "SDL2_rotozoom.h" #include "defs.h" #include "structs.h" @@ -490,7 +489,6 @@ void gfx_free() void gfx_loadBackground(const char *filename) { SDL_Surface *new_bg; - double scale; if (gfx_background != NULL) { @@ -499,8 +497,9 @@ void gfx_loadBackground(const char *filename) } new_bg = gfx_loadImage(filename); SDL_SetColorKey(new_bg, 0, 0); - scale = MAX((double)screen->w / new_bg->w, (double)screen->h / new_bg->h); - gfx_background = zoomSurface(new_bg, scale, scale, 0); + gfx_background = gfx_createSurface(screen->w, screen->h); + SDL_SetColorKey(gfx_background, 0, 0); + SDL_BlitScaled(new_bg, NULL, gfx_background, NULL); SDL_FreeSurface(new_bg); } diff --git a/src/title.cpp b/src/title.cpp index 1cbe2d0..bde67d2 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -426,13 +426,13 @@ int title_show() if (!skip) { gfx_renderString("Copyright Parallel Realities 2003", - 5, screen->h - 60, FONT_WHITE, 0, gfx_background); + 5, gfx_background->h - 60, FONT_WHITE, 0, gfx_background); gfx_renderString("Copyright Guus Sliepen, Astrid S. de Wijn and others 2012", - 5, screen->h - 40, FONT_WHITE, 0, gfx_background); + 5, gfx_background->h - 40, FONT_WHITE, 0, gfx_background); gfx_renderString("Copyright 2015-2017 Julie Marchant", - 5, screen->h - 20, FONT_WHITE, 0, gfx_background); - gfx_renderString(buildVersion, screen->w - 6 - strlen(buildVersion) * 9, - screen->h - 20, FONT_WHITE, 0, gfx_background); + 5, gfx_background->h - 20, FONT_WHITE, 0, gfx_background); + gfx_renderString(buildVersion, gfx_background->w - 6 - strlen(buildVersion) * 9, + gfx_background->h - 20, FONT_WHITE, 0, gfx_background); screen_addBuffer(0, 0, screen->w, screen->h); skip = 1; }