Skip to content

Commit 998c172

Browse files
committed
Move the center of the screen half a pixel
The PS2 assumes the 0,0 pixel at the center of the screen. OpenGL (at least) assumes the 0,0 pixel at the top left. When the screen width/height is even, this causes a slight discrepancy.
1 parent bca5e72 commit 998c172

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Source/gs/GSH_OpenGL/GSH_OpenGL.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,12 @@ void CGSH_OpenGL::SetRenderingContext(uint64 primReg)
651651
m_nPrimOfsX = offset.GetX();
652652
m_nPrimOfsY = offset.GetY();
653653

654+
// Account for the fact that PS2 assumes the pixel center at the bottom left,
655+
// but OpenGL at the center of the screen. On even resolutions this causes a slight
656+
// discrepancy.
657+
m_nPrimOfsX -= 0.5f;
658+
m_nPrimOfsY -= 0.5f;
659+
654660
CHECKGLERROR();
655661

656662
m_renderState.isValid = true;

0 commit comments

Comments
 (0)