all repos — mgba @ 84c010783c18fcb53ffddc83ba818055c90da758

mGBA Game Boy Advance Emulator

SDL: Simplify setting full screen mode with SDL1
Cameron Cawley ccawley2011@gmail.com
Tue, 21 May 2019 21:24:03 +0100
commit

84c010783c18fcb53ffddc83ba818055c90da758

parent

3aae19a8073a60587a908e1029a253cc42b7b9d3

M src/platform/sdl/gl-common.csrc/platform/sdl/gl-common.c

@@ -51,9 +51,9 @@ }

#else SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); #ifdef COLOR_16_BIT - SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_OPENGL | SDL_RESIZABLE | (SDL_FULLSCREEN * renderer->fullscreen)); + SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_OPENGL | SDL_RESIZABLE | (SDL_FULLSCREEN * renderer->player.fullscreen)); #else - SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_OPENGL | SDL_RESIZABLE | (SDL_FULLSCREEN * renderer->fullscreen)); + SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_OPENGL | SDL_RESIZABLE | (SDL_FULLSCREEN * renderer->player.fullscreen)); #endif SDL_WM_SetCaption(projectName, ""); #endif
M src/platform/sdl/main.csrc/platform/sdl/main.c

@@ -131,12 +131,8 @@ mCoreLoadConfig(renderer.core);

renderer.viewportWidth = renderer.core->opts.width; renderer.viewportHeight = renderer.core->opts.height; -#if SDL_VERSION_ATLEAST(2, 0, 0) renderer.player.fullscreen = renderer.core->opts.fullscreen; renderer.player.windowUpdated = 0; -#else - renderer.fullscreen = renderer.core->opts.fullscreen; -#endif renderer.lockAspectRatio = renderer.core->opts.lockAspectRatio; renderer.lockIntegerScaling = renderer.core->opts.lockIntegerScaling;
M src/platform/sdl/main.hsrc/platform/sdl/main.h

@@ -54,8 +54,6 @@ SDL_Window* window;

SDL_Texture* sdlTex; SDL_Renderer* sdlRenderer; SDL_GLContext* glCtx; -#else - bool fullscreen; #endif unsigned width;
M src/platform/sdl/sdl-events.hsrc/platform/sdl/sdl-events.h

@@ -63,10 +63,10 @@ struct mSDLPlayer {

size_t playerId; struct mInputMap* bindings; struct SDL_JoystickCombo* joystick; + int fullscreen; int windowUpdated; #if SDL_VERSION_ATLEAST(2, 0, 0) SDL_Window* window; - int fullscreen; struct mSDLRumble { struct mRumble d;
M src/platform/sdl/sw-sdl1.csrc/platform/sdl/sw-sdl1.c

@@ -22,9 +22,9 @@ }

bool mSDLSWInit(struct mSDLRenderer* renderer) { #ifdef COLOR_16_BIT - SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_DOUBLEBUF | SDL_HWSURFACE | (SDL_FULLSCREEN * renderer->fullscreen)); + SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 16, SDL_DOUBLEBUF | SDL_HWSURFACE | (SDL_FULLSCREEN * renderer->player.fullscreen)); #else - SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_DOUBLEBUF | SDL_HWSURFACE | (SDL_FULLSCREEN * renderer->fullscreen)); + SDL_SetVideoMode(renderer->viewportWidth, renderer->viewportHeight, 32, SDL_DOUBLEBUF | SDL_HWSURFACE | (SDL_FULLSCREEN * renderer->player.fullscreen)); #endif SDL_WM_SetCaption(projectName, "");