SDL: Fix initialization ordering issues

This commit is contained in:
Vicki Pfau 2019-05-13 02:18:46 -07:00
parent 509c80abad
commit b865d8e479
1 changed files with 6 additions and 5 deletions

View File

@ -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);