Skip to content
Snippets Groups Projects
Commit 27c4296c authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix aspect_fix() to always grow, not shrink.

Add additional stderr debugging.
Don't try to correct the aspect ratio of the window.
parent ce6019fd
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3492 passed
......@@ -41,10 +41,10 @@ aspect_fix(int *x, int *y, int aspect_width, int aspect_height)
bestx = lround((double)*y * aspect_width / aspect_height);
besty = lround((double)*x * aspect_height / aspect_width);
if (bestx < *x && bestx > 0)
*x = bestx;
else
if (bestx < *x && besty > 0)
*y = besty;
else
*x = bestx;
}
/*
......
......@@ -604,7 +604,6 @@ static void setup_surfaces_locked(void)
aspect_correct(&idealmw, &idealmh, cvstat.aspect_width, cvstat.aspect_height);
idealw = cvstat.winwidth;
idealh = cvstat.winheight;
aspect_fix(&idealw, &idealh, cvstat.aspect_width, cvstat.aspect_height);
internal_scaling = window_can_scale_internally(idealw, idealh);
sdl.SetHint(SDL_HINT_RENDER_SCALE_QUALITY, internal_scaling ? "0" : "2");
......@@ -1149,12 +1148,14 @@ void sdl_video_event_thread(void *data)
dst.x = (cvstat.winwidth - dst.w) / 2;
dst.y = (cvstat.winheight - dst.h) / 2;
}
sdl.RenderCopy(renderer, texture, &src, &dst);
if (sdl.RenderCopy(renderer, texture, &src, &dst))
fprintf(stderr, "RenderCopy() failed! (%s)\n", sdl.GetError());
}
bitmap_drv_free_rect(list);
}
sdl.RenderPresent(renderer);
}
pthread_mutex_unlock(&win_mutex);
break;
case SDL_USEREVENT_SETNAME:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment