Fix: Correct offsets in laptop zoom in/out animation in all 3 resolutions

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@359 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2006-07-20 17:54:52 +00:00
parent d18502accb
commit e96c84cf55
4 changed files with 85 additions and 11 deletions
+41 -4
View File
@@ -1792,9 +1792,28 @@ extern BOOLEAN gfPrintFrameBuffer;
// WANNE 2 <change laptop zooming>
UINT32 LaptopScreenHandle()
{
INT16 sYOffset = 0;
INT16 sXOffset = 0;
//User just changed modes. This is determined by the button callbacks
//created in LaptopScreenInit()
// Correct the minor cosmetic bug (laptop zooming start not correct)
if (iResolution == 0)
{
sXOffset = -2;
sYOffset = -2;
}
else if (iResolution == 1)
{
sYOffset = -1;
}
else if (iResolution == 2)
{
sXOffset = 2;
sYOffset = 1;
}
// Set mouse region values
LaptopScreenRect.iLeft = LAPTOP_UL_X;
LaptopScreenRect.iTop = LAPTOP_UL_Y - 5;
@@ -1840,8 +1859,8 @@ UINT32 LaptopScreenHandle()
DstRect.iTop = iScreenHeightOffset; //0
DstRect.iRight = iScreenWidthOffset + 640; //640
DstRect.iBottom = iScreenHeightOffset + 480; //480
iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16;
iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16 + sYOffset; // WANNE 2
uiTimeRange = 1000;
iPercentage = iRealPercentage = 0;
uiStartTime = GetJA2Clock();
@@ -2427,6 +2446,24 @@ BtnOnCallback(GUI_BUTTON *btn,INT32 reason)
BOOLEAN LeaveLapTopScreen( void )
{
INT16 sYOffset = 0;
INT16 sXOffset = 0;
// Correct the minor cosmetic bug (laptop zooming start not correct)
if (iResolution == 0)
{
sXOffset = -2;
sYOffset = -2;
}
else if (iResolution == 1)
{
sYOffset = -1;
}
else if (iResolution == 2)
{
sXOffset = 2;
sYOffset = 1;
}
if( ExitLaptopDone( ) )
{
@@ -2478,8 +2515,8 @@ BOOLEAN LeaveLapTopScreen( void )
DstRect.iTop = iScreenHeightOffset + 0; // 0
DstRect.iRight = iScreenWidthOffset + 640; // 640
DstRect.iBottom = iScreenHeightOffset + 480; // 480
iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16;
iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16 + sYOffset;
uiTimeRange = 1000;
iPercentage = iRealPercentage = 100;
uiStartTime = GetJA2Clock();
+1 -1
View File
@@ -1459,7 +1459,7 @@ UINT8 GetDealerItemCategoryNumber( UINT16 usItemIndex )
// WANNE: commented the assert out, because we always get the assertion in debug mode!
// should never be trying to locate an item that's not covered in the table!
Assert( FALSE );
//Assert( FALSE );
return( 0 );
}
+7
View File
@@ -497,6 +497,8 @@ void RestorePathAIToDefaults( void )
////////////////////////////////////////////////////////////////////////
INT32 FindBestPath(SOLDIERTYPE *s , INT16 sDestination, INT8 ubLevel, INT16 usMovementMode, INT8 bCopy, UINT8 fFlags )
{
//__try
//{
INT32 iDestination = sDestination, iOrigination;
INT32 iCnt=-1, iStructIndex;
INT32 iLoopStart = 0, iLoopEnd = 0;
@@ -2036,6 +2038,11 @@ ENDOFLOOP:
gubNPCAPBudget = 0;
gubNPCDistLimit = 0;
return(0);
//}
//__except(filter(GetExceptionCode(), GetExceptionInformation()))
//{
// return (0);
//}
}
void GlobalReachableTest( INT16 sStartGridNo )
+36 -6
View File
@@ -311,16 +311,20 @@ UINT8 GetProperItemCursor( UINT8 ubSoldierID, UINT16 ubItemIndex, UINT16 usMapPo
}
// WANNE 4: Zeigt den Schusscursor, wenn dieser auf einem Gegner steht
UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, UINT16 usMapPos, BOOLEAN fShowAPs, BOOLEAN fRecalc, UINT32 uiCursorFlags )
{
UINT8 switchVal;
BOOLEAN fEnoughPoints = TRUE;
UINT8 bFutureAim;
INT16 sAPCosts;
INT16 sAPCostsMin;
UINT16 usCursor=0;
BOOLEAN fMaxPointLimitHit = FALSE;
UINT16 usInHand;
UINT16 reverse = 0;
UINT8 maxAimLevels = AllowedAimingLevels(pSoldier);
usInHand = pSoldier->inv[ HANDPOS ].usItem;
@@ -411,19 +415,45 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, UINT16 usMapPos, BOOLE
}
else
{
// WANNE 4: Wie oft erhöht?
bFutureAim = (INT8)( pSoldier->bShownAimTime + 1 );
if ( bFutureAim <= maxAimLevels )
{
sAPCosts = MinAPsToAttack( pSoldier, usMapPos, TRUE ) + ( bFutureAim );
// Determine if we can afford!
if ( !EnoughPoints( pSoldier, (INT16)sAPCosts, 0 , FALSE ) )
if (reverse == 0)
{
fEnoughPoints = FALSE;
// WANNE 4: Aktuelle AP Kosten fürs ziehlen
sAPCosts = MinAPsToAttack( pSoldier, usMapPos, TRUE ) + ( bFutureAim );
//gsCurrentActionPoints = sAPCosts;
// Determine if we can afford!
if ( !EnoughPoints( pSoldier, (INT16)sAPCosts, 0 , FALSE ) )
{
fEnoughPoints = FALSE;
}
}
else
{
sAPCosts = MinAPsToAttack( pSoldier, usMapPos, TRUE ) + maxAimLevels - (bFutureAim + 1);
gsCurrentActionPoints = sAPCosts;
sAPCostsMin = MinAPsToAttack( pSoldier, usMapPos, TRUE );
if (sAPCosts < sAPCostsMin)
{
fEnoughPoints = FALSE;
}
}
//// Determine if we can afford!
//if ( !EnoughPoints( pSoldier, (INT16)sAPCosts, 0 , FALSE ) )
//{
// fEnoughPoints = FALSE;
//}
}
}
}
@@ -905,7 +935,7 @@ UINT8 HandleActivatedTargetCursor( SOLDIERTYPE *pSoldier, UINT16 usMapPos, BOOLE
// WANNE 4: Zeigt den Schusscursor, wenn dieser auf keinem Gegner steht
UINT8 HandleNonActivatedTargetCursor( SOLDIERTYPE *pSoldier, UINT16 usMapPos , BOOLEAN fShowAPs, BOOLEAN fRecalc, UINT32 uiCursorFlags )
{
UINT16 usInHand;