Merge branch 'main' of git.sr.ht:~rabbits/uxn into ppu-slow
This commit is contained in:
commit
92e44e4314
|
@ -141,7 +141,8 @@ set_window_size(SDL_Window *window, int w, int h)
|
||||||
static void
|
static void
|
||||||
set_zoom(Uint8 scale)
|
set_zoom(Uint8 scale)
|
||||||
{
|
{
|
||||||
if(scale == zoom || !gWindow)
|
zoom = clamp(scale, 1, 3);
|
||||||
|
if(!gWindow)
|
||||||
return;
|
return;
|
||||||
set_window_size(gWindow, (ppu.width + PAD * 2) * zoom, (ppu.height + PAD * 2) * zoom);
|
set_window_size(gWindow, (ppu.width + PAD * 2) * zoom, (ppu.height + PAD * 2) * zoom);
|
||||||
ppu.reqdraw = 1;
|
ppu.reqdraw = 1;
|
||||||
|
@ -595,12 +596,12 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
/* set default zoom */
|
/* set default zoom */
|
||||||
SDL_GetCurrentDisplayMode(0, &DM);
|
SDL_GetCurrentDisplayMode(0, &DM);
|
||||||
set_zoom(clamp(DM.w / 1280, 1, 3));
|
set_zoom(DM.w / 1280);
|
||||||
/* get default zoom from flags */
|
/* get default zoom from flags */
|
||||||
for(i = 1; i < argc - 1; i++) {
|
for(i = 1; i < argc - 1; i++) {
|
||||||
if(strcmp(argv[i], "-s") == 0) {
|
if(strcmp(argv[i], "-s") == 0) {
|
||||||
if((i + 1) < argc - 1)
|
if((i + 1) < argc - 1)
|
||||||
set_zoom(clamp(atoi(argv[++i]), 1, 3));
|
set_zoom(atoi(argv[++i]));
|
||||||
else
|
else
|
||||||
return error("Opt", "-s No scale provided.");
|
return error("Opt", "-s No scale provided.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue