Skip to content

Commit 3cf8f78

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 59697b2 commit 3cf8f78

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
@@ -650,6 +650,12 @@ void CGSH_OpenGL::SetRenderingContext(uint64 primReg)
650650
m_nPrimOfsX = offset.GetX();
651651
m_nPrimOfsY = offset.GetY();
652652

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

655661
m_renderState.isValid = true;

0 commit comments

Comments
 (0)