From f1b7d31c8e26adabb8392fe9d19964698c93c329 Mon Sep 17 00:00:00 2001 From: OV2 Date: Fri, 4 Mar 2011 00:38:16 +0100 Subject: [PATCH] Win32: fix osd for all hires filter scales --- win32/win32_display.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win32/win32_display.cpp b/win32/win32_display.cpp index bc385c2a..8d166e90 100644 --- a/win32/win32_display.cpp +++ b/win32/win32_display.cpp @@ -789,7 +789,7 @@ void WinDisplayStringFromBottom (const char *string, int linesFromBottom, int pi static int font_width = 8, font_height = 9; static void *displayScreen; -int displayPpl, displayWidth, displayHeight, displayScale,fontwidth_scaled,fontheight_scaled; +int displayPpl, displayWidth, displayHeight, displayScale, fontwidth_scaled, fontheight_scaled; void WinSetCustomDisplaySurface(void *screen, int ppl, int width, int height, int scale) { @@ -797,7 +797,7 @@ void WinSetCustomDisplaySurface(void *screen, int ppl, int width, int height, in displayPpl=ppl; displayWidth=width; displayHeight=height; - displayScale=scale; + displayScale=max(1,width/IPPU.RenderedScreenWidth); fontwidth_scaled=font_width*displayScale; fontheight_scaled=font_height*displayScale; } @@ -926,7 +926,7 @@ void WinDisplayStringInBuffer (const char *string, int linesFromBottom, int pixe if (linesFromBottom <= 0) linesFromBottom = 1; - screenPtrType *dst = (screenPtrType *)displayScreen + (displayHeight - fontheight_scaled * linesFromBottom) * displayPpl + (int)(pixelsFromLeft * (2*(float)displayWidth/IPPU.RenderedScreenWidth - displayScale)); + screenPtrType *dst = (screenPtrType *)displayScreen + (displayHeight - fontheight_scaled * linesFromBottom) * displayPpl + (int)(pixelsFromLeft * (float)displayWidth/IPPU.RenderedScreenWidth); int len = strlen(string); int max_chars = displayWidth / (fontwidth_scaled - displayScale);