# HG changeset patch # User Matti Hamalainen # Date 1424895076 -7200 # Node ID 81ff7111fedfafbb51626b9f45ab361bf08c5a8d # Parent ff18d2511843e548da9e117c5111b8bb067f6224 Adjust aspect ration stuff in view64. diff -r ff18d2511843 -r 81ff7111fedf tools/view64.c --- a/tools/view64.c Wed Feb 25 22:01:23 2015 +0200 +++ b/tools/view64.c Wed Feb 25 22:11:16 2015 +0200 @@ -280,9 +280,8 @@ break; case SDL_VIDEORESIZE: - optScrWidth = event.resize.w; + optScrWidth = event.resize.w; optScrHeight = event.resize.h; - if (!dmInitializeVideo(&screen)) goto error; @@ -299,13 +298,17 @@ if (needRedraw) { + float aspect = (float) bmap.height / (float) bmap.width; + int sheight = optScrWidth * aspect * C64_SCR_PAR_XY; + int ypos = (optScrHeight - sheight) / 2; + if (SDL_MUSTLOCK(screen) != 0 && SDL_LockSurface(screen) != 0) { dmError("Can't lock surface.\n"); goto error; } - dmScaledBlitSurface8to8(surf, 0, 0, screen->w, screen->h, screen); + dmScaledBlitSurface8to8(surf, 0, ypos, optScrWidth, sheight, screen); SDL_SetColors(screen, (SDL_Color *)dmC64Palette, 0, C64_NCOLORS); if (SDL_MUSTLOCK(screen) != 0)