commit 718a74641e2c2077982798f5ff5a992e9ed3ead0
parent 2822e598ed150d12cbfcc0efc83dbae68a8f6eb4
Author: neauoire <aliceffekt@gmail.com>
Date: Wed, 22 Sep 2021 11:21:57 -0700
Removed flickering on initial resize
Diffstat:
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/uxnemu.c b/src/uxnemu.c
@@ -598,23 +598,24 @@ main(int argc, char **argv)
/* unused */ uxn_port(&u, 0xe, nil_talk);
/* unused */ uxn_port(&u, 0xf, nil_talk);
- if(!init())
- return error("Init", "Failed to initialize emulator.");
- if(!set_size(WIDTH, HEIGHT, 0))
- return error("Window", "Failed to set window size.");
- /* default zoom */
+ /* set default zoom */
SDL_GetCurrentDisplayMode(0, &DM);
- set_zoom(DM.w / 1000);
- /* zoom from flags */
+ zoom = clamp(DM.w / 1280, 1, 3);
+ /* get default zoom from flags */
for(i = 1; i < argc - 1; i++) {
if(strcmp(argv[i], "-s") == 0) {
if((i + 1) < argc - 1)
- set_zoom(atoi(argv[++i]));
+ zoom = clamp(atoi(argv[++i]), 1, 3);
else
return error("Opt", "-s No scale provided.");
}
}
+ if(!init())
+ return error("Init", "Failed to initialize emulator.");
+ if(!set_size(WIDTH, HEIGHT, 0))
+ return error("Window", "Failed to set window size.");
+
run(&u);
quit();
return 0;