uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 7cff22fcc8c4cb54e5ed7931f8877ca3bd0d5b80
parent f3b3823b0ca9493e96ac1b1fe3c5b97c922005ae
Author: neauoire <aliceffekt@gmail.com>
Date:   Wed, 29 Sep 2021 18:03:56 -0700

Returned zoom functionality

Diffstat:
Msrc/uxnemu.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -141,7 +141,8 @@ set_window_size(SDL_Window *window, int w, int h) static void set_zoom(Uint8 scale) { - if(scale == zoom || !gWindow) + zoom = clamp(scale, 1, 3); + if(!gWindow) return; set_window_size(gWindow, (ppu.width + PAD * 2) * zoom, (ppu.height + PAD * 2) * zoom); reqdraw = 1; @@ -599,12 +600,12 @@ main(int argc, char **argv) /* set default zoom */ SDL_GetCurrentDisplayMode(0, &DM); - set_zoom(clamp(DM.w / 1280, 1, 3)); + set_zoom(DM.w / 1280); /* 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(clamp(atoi(argv[++i]), 1, 3)); + set_zoom(atoi(argv[++i])); else return error("Opt", "-s No scale provided."); }