SDL: Fix initialization ordering issues
Vicki Pfau vi@endrift.com
Mon, 13 May 2019 02:18:46 -0700
1 files changed,
6 insertions(+),
5 deletions(-)
jump to
M
src/platform/sdl/main.c
→
src/platform/sdl/main.c
@@ -90,6 +90,12 @@ printf("Could not run game. Are you sure the file exists and is a compatible game?\n");
freeArguments(&args); return 1; } + + if (!renderer.core->init(renderer.core)) { + freeArguments(&args); + return 1; + } + renderer.core->desiredVideoDimensions(renderer.core, &renderer.width, &renderer.height); #ifdef BUILD_GL mSDLGLCreate(&renderer);@@ -105,11 +111,6 @@ renderer.ratio = 1;
} opts.width = renderer.width * renderer.ratio; opts.height = renderer.height * renderer.ratio; - - if (!renderer.core->init(renderer.core)) { - freeArguments(&args); - return 1; - } struct mCheatDevice* device = NULL; if (args.cheatsFile && (device = renderer.core->cheatDevice(renderer.core))) {