From e36a1e82e78a72844c38485436245aadd61804f6 Mon Sep 17 00:00:00 2001 From: onpon4 Date: Sun, 5 Feb 2017 16:40:59 -0500 Subject: [PATCH] Changed the game to use true fullscreen. The fake "windowed fullscreen" is less invasive, but it sometimes causes ugly artifacts and as a general rule isn't really all that useful. However, I also defined it in defs.h, so that it can be more easily changed in the future. --- src/defs.h | 2 ++ src/engine.cpp | 2 +- src/intermission.cpp | 2 +- src/mission.cpp | 6 +++--- src/player.cpp | 2 +- src/title.cpp | 3 +-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/defs.h b/src/defs.h index 9c58004..18da025 100644 --- a/src/defs.h +++ b/src/defs.h @@ -57,6 +57,8 @@ along with this program. If not, see . #define PATH_MAX 4096 #endif +#define FULLSCREEN SDL_WINDOW_FULLSCREEN + #define STARS_NUM 200 // Object Flags diff --git a/src/engine.cpp b/src/engine.cpp index fcd534f..d32652e 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -250,7 +250,7 @@ void engine_setMode() } SDL_SetWindowIcon(window, gfx_loadImage("gfx/alienDevice.png")); - SDL_SetWindowFullscreen(window, engine.fullScreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); + SDL_SetWindowFullscreen(window, engine.fullScreen ? FULLSCREEN : 0); renderer = SDL_CreateRenderer(window, -1, 0); diff --git a/src/intermission.cpp b/src/intermission.cpp index 02157ae..1c9cc66 100644 --- a/src/intermission.cpp +++ b/src/intermission.cpp @@ -1173,7 +1173,7 @@ static void intermission_doOptions(SDL_Surface *optionsSurface, int x, int y) { if (!engine.fullScreen) { - SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); + SDL_SetWindowFullscreen(window, FULLSCREEN); engine.fullScreen = 1; } } diff --git a/src/mission.cpp b/src/mission.cpp index 146f154..9fa293f 100644 --- a/src/mission.cpp +++ b/src/mission.cpp @@ -1070,16 +1070,16 @@ void mission_showStartScreen() case MISN_ELLESH: case MISN_MARS: case MISN_VENUS: - screen_renderString("Phoebe Lexx will not be present", 160, screen->h / 2 + 115, FONT_WHITE); + screen_renderString("Phoebe Lexx will not be present", screen->w / 2 - 240, screen->h / 2 + 115, FONT_WHITE); if (game.hasWingMate2) - screen_renderString("Ursula Lexx will not be present", 160, screen->h / 2 + 145, FONT_WHITE); + screen_renderString("Ursula Lexx will not be present", screen->w / 2 - 240, screen->h / 2 + 145, FONT_WHITE); break; } if ((game.area == MISN_URUSOR) || (game.area == MISN_POSWIC) || (game.area == MISN_EARTH)) - screen_renderString("Sid Wilson will join you on this mission", 160, screen->h / 2 + 175, FONT_WHITE); + screen_renderString("Sid Wilson will join you on this mission", screen->w / 2 - 240, screen->h / 2 + 175, FONT_WHITE); renderer_update(); } diff --git a/src/player.cpp b/src/player.cpp index e903abd..d07b6cf 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -279,7 +279,7 @@ void player_getInput() if (engine.keyState[KEY_FULLSCREEN]) { engine.fullScreen = !engine.fullScreen; - SDL_SetWindowFullscreen(window, engine.fullScreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); + SDL_SetWindowFullscreen(window, engine.fullScreen ? FULLSCREEN : 0); engine.keyState[KEY_FULLSCREEN] = 0; } } diff --git a/src/title.cpp b/src/title.cpp index 82f9645..1cbe2d0 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -551,8 +551,7 @@ int title_show() { engine.fullScreen = !engine.fullScreen; SDL_SetWindowFullscreen(window, - (engine.fullScreen ? - SDL_WINDOW_FULLSCREEN_DESKTOP : 0)); + (engine.fullScreen ? FULLSCREEN : 0)); selectedOption = listLength; } else if (selectedOption == 4)