diff --git a/src/conio/scale.c b/src/conio/scale.c index 6a9154c59437b977e9f0b691e73014d9372b09a8..bde688559ab8ddf46a3df0d7750272a4c1a770ab 100644 --- a/src/conio/scale.c +++ b/src/conio/scale.c @@ -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; } /* diff --git a/src/conio/sdl_con.c b/src/conio/sdl_con.c index 01fe4549562bdec577f1cb2b6d949b6895e5699a..46b575ec62ce8b93f0626d68eea4d80cded9d22f 100644 --- a/src/conio/sdl_con.c +++ b/src/conio/sdl_con.c @@ -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: