all repos — mgba @ b865d8e479ec16288fa51a40ebf20a91c74dd57d

mGBA Game Boy Advance Emulator

SDL: Fix initialization ordering issues
Vicki Pfau vi@endrift.com
Mon, 13 May 2019 02:18:46 -0700
commit

b865d8e479ec16288fa51a40ebf20a91c74dd57d

parent

509c80abad8221564a0bfade571d868e9e8247af

1 files changed, 6 insertions(+), 5 deletions(-)

jump to
M src/platform/sdl/main.csrc/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))) {