From 407a579bfca9aade20afa5a5616deca10ab7ccac Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sat, 29 Sep 2018 14:48:18 +0200 Subject: [PATCH] GL: take pixel scaling into account for OSD buttons and text coords Fixes OSD with Wacky Races and JoJo's Bizarre Adventure --- core/rend/gles/gles.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/rend/gles/gles.cpp b/core/rend/gles/gles.cpp index f70a2e0f4..c550097e4 100644 --- a/core/rend/gles/gles.cpp +++ b/core/rend/gles/gles.cpp @@ -1197,10 +1197,10 @@ static void DrawButton(float* xy, u32 state) vtx.z=1; - float x=xy[0]; - float y=xy[1]; - float w=xy[2]; - float h=xy[3]; + float x = xy[0] * scale_x; + float y = xy[1] * scale_y; + float w = xy[2] * scale_x; + float h = xy[3] * scale_y; vtx.col[0]=vtx.col[1]=vtx.col[2]=(0x7F-0x40*state/255)*vjoy_pos[13][0]; @@ -1294,12 +1294,12 @@ static void DrawRightedText(float yy, float scale, int transparency, const char* vtx.z=1; - float w=float(strlen(text)*14)*scale; + float w = float(strlen(text) * 14) * scale * scale_x; - float x = 320 + 240 * screen_width / screen_height - w; - float y=yy; - float h=16.0f*scale; - w=14.0f*scale; + float x = (ShaderUniforms.scale_coefs[2] + 1) / ShaderUniforms.scale_coefs[0] - w; + float y = yy * scale_y; + float h = 16.0f * scale * scale_y; + w = 14.0f * scale * scale_x; float step=32.0f/512.0f; float step2=4.0f/512.0f;