From c2437894fa899047c7ef5da7c88cfb0358f576e4 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 15 Nov 2022 13:57:41 +0100 Subject: [PATCH] GL: fixed irregular sized v210 display fixed `-d gl` of `-t testcard:size=47x32:codec=v210` or `..size=48x32` The problem was perhaps with truncation of a number slightly below nearest integer. Result was a "broken" bar of a testcard (in midst it was shifted by one horizontal pixel). Quite a huge eps is needed in macOS - .49999 cut-off was not sufficient for `size=$((48*53))x$((32*53))`. --- src/video_display/gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_display/gl.cpp b/src/video_display/gl.cpp index 9b6852889..ac5348a1b 100644 --- a/src/video_display/gl.cpp +++ b/src/video_display/gl.cpp @@ -196,7 +196,7 @@ void main(void) { // interpolate (0,1) texcoords to [0,719] int texcoordDenormX; - texcoordDenormX = int(gl_TexCoord[0].x * imageWidth - .5); + texcoordDenormX = int(gl_TexCoord[0].x * imageWidth - .4999); // 0 1 1 2 3 3 4 5 5 6 7 7 etc. int yOffset;