From b865d8e479ec16288fa51a40ebf20a91c74dd57d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 13 May 2019 02:18:46 -0700 Subject: [PATCH] SDL: Fix initialization ordering issues --- src/platform/sdl/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/platform/sdl/main.c b/src/platform/sdl/main.c index 450e1868a..21e4459b7 100644 --- a/src/platform/sdl/main.c +++ b/src/platform/sdl/main.c @@ -90,6 +90,12 @@ int main(int argc, char** argv) { 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); @@ -106,11 +112,6 @@ int main(int argc, char** argv) { 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))) { struct VFile* vf = VFileOpen(args.cheatsFile, O_RDONLY);