mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Bugfix for scrolling in high resolutions (by Moa)
It was possible to scroll beyond the render area in upper right corner which caused graphical artifacts. http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/324891/Re_Code_Snippets.html#Post324891 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6376 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+10
-11
@@ -4175,6 +4175,16 @@ BOOLEAN ApplyScrolling( INT16 sTempRenderCenterX, INT16 sTempRenderCenterY, BOOL
|
||||
// Force adjustment, if true
|
||||
if ( fForceAdjust )
|
||||
{
|
||||
if ( fOutRight )
|
||||
{
|
||||
CorrectRenderCenter( (INT16)( gsTRX - sX_S ) , sScreenCenterY , &sNewScreenX, &sNewScreenY );
|
||||
FromScreenToCellCoordinates( sNewScreenX, sNewScreenY , &sTempPosX_W, &sTempPosY_W );
|
||||
|
||||
sTempRenderCenterX = sTempPosX_W;
|
||||
sTempRenderCenterY = sTempPosY_W;
|
||||
fScrollGood = TRUE;
|
||||
}
|
||||
|
||||
if ( fOutTop )
|
||||
{
|
||||
// Adjust screen coordinates on the Y!
|
||||
@@ -4208,17 +4218,6 @@ BOOLEAN ApplyScrolling( INT16 sTempRenderCenterX, INT16 sTempRenderCenterY, BOOL
|
||||
|
||||
fScrollGood = TRUE;
|
||||
}
|
||||
|
||||
if ( fOutRight )
|
||||
{
|
||||
CorrectRenderCenter( (INT16)( gsTRX - sX_S ) , sScreenCenterY , &sNewScreenX, &sNewScreenY );
|
||||
FromScreenToCellCoordinates( sNewScreenX, sNewScreenY , &sTempPosX_W, &sTempPosY_W );
|
||||
|
||||
sTempRenderCenterX = sTempPosX_W;
|
||||
sTempRenderCenterY = sTempPosY_W;
|
||||
fScrollGood = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user