- New Feature: Fast transition of laptop, strategy and fast www sites loading

o 3 new INI properties: DISABLE_LAPTOP_TRANSITION, FAST_WWW_SITES_LOADING, DISABLE_STRATEGIC_TRANSITION
o In a multiplayer games, for all 3 ini-properties fast loading is enabled!

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4806 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2011-11-18 10:06:23 +00:00
parent f5e3733f62
commit 849b1c4901
5 changed files with 224 additions and 196 deletions
+9
View File
@@ -1295,6 +1295,7 @@ void LoadGameExternalOptions()
// HEADROCK HAM 3.6: Determines whether the extrapolated daily costs of mercs are figured into the "Daily Expenses" display. 0 = No, just facility costs. 1 = Only mercs with a fixed daily rate. 2 = All mercs, including AIM contracts.
gGameExternalOptions.ubIncludeContractsInExpenses = iniReader.ReadInteger("Strategic Interface Settings","INCLUDE_CONTRACTS_IN_PROJECTED_EXPENSES_WINDOW", 1, 0, 2);
gGameExternalOptions.fDisableStrategicTransition = iniReader.ReadBoolean("Strategic Interface Settings","DISABLE_STRATEGIC_TRANSITION", FALSE);
//################# Strategic Progress Settings ##################
@@ -1387,6 +1388,14 @@ void LoadGameExternalOptions()
// CHRISL: Determine how Skyrider should handle landing in enemy occupied sectors
gGameExternalOptions.ubSkyriderHotLZ = iniReader.ReadInteger("Strategic Gameplay Settings", "ALLOW_SKYRIDER_HOT_LZ", 0);
//################# Laptop Settings ##################
gGameExternalOptions.fDisableLaptopTransition = iniReader.ReadBoolean("Laptop Settings", "DISABLE_LAPTOP_TRANSITION", FALSE);
gGameExternalOptions.fFastWWWSitesLoading = iniReader.ReadBoolean("Laptop Settings", "FAST_WWW_SITES_LOADING", FALSE);
//################# Bobby Ray Settings ##################
+5
View File
@@ -640,6 +640,11 @@ typedef struct
// CHRISL: Skyrider and enemy occupied sectors
UINT8 ubSkyriderHotLZ;
// WANNE: Fast loading settings
BOOLEAN fDisableLaptopTransition;
BOOLEAN fFastWWWSitesLoading;
BOOLEAN fDisableStrategicTransition;
// CPT: Cover System Settings
UINT8 ubStealthTraitCoverValue;
UINT8 ubStealthEffectiveness;
+161 -151
View File
@@ -1857,102 +1857,105 @@ UINT32 LaptopScreenHandle()
// just entered
if(gfEnterLapTop)
{
EnterLaptop();
CreateLaptopButtons();
gfEnterLapTop=FALSE;
EnterLaptop();
CreateLaptopButtons();
gfEnterLapTop=FALSE;
}
if( gfStartMapScreenToLaptopTransition )
{
//Everything is set up to start the transition animation.
//SGPRect SrcRect1;
SGPRect SrcRect2, DstRect;
INT32 iPercentage, iScalePercentage, iFactor;
UINT32 uiStartTime, uiTimeRange, uiCurrTime;
INT32 iX, iY, iWidth, iHeight;
INT32 iLaptopMonitorCenterX, iLaptopMonitorCenterY;
INT32 iRealPercentage;
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
//Step 1: Build the laptop image into the save buffer.
gfStartMapScreenToLaptopTransition = FALSE;
RestoreBackgroundRects();
RenderLapTopImage();
HighLightRegion(giCurrentRegion);
RenderLaptop();
RenderButtons();
PrintDate( );
PrintBalance( );
PrintNumberOnTeam( );
ShowLights();
//Step 2: The mapscreen image is in the EXTRABUFFER, and laptop is in the SAVEBUFFER
// Start transitioning the screen.
DstRect.iLeft = iScreenWidthOffset; //0
DstRect.iTop = iScreenHeightOffset; //0
DstRect.iRight = iScreenWidthOffset + 640; //640
DstRect.iBottom = iScreenHeightOffset + 480; //480
iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16 + sYOffset;
uiTimeRange = 1000;
iPercentage = iRealPercentage = 0;
uiStartTime = GetJA2Clock();
BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset,
640, 480 );
// Lesh: moved into loop
//BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset,
// SCREEN_WIDTH - iScreenWidthOffset, SCREEN_HEIGHT - iScreenHeightOffset );
PlayJA2SampleFromFile( "SOUNDS\\Laptop power up (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
while( iRealPercentage < 100 )
if (!gGameExternalOptions.fDisableLaptopTransition)
{
// Lesh: restore mapscreen so laptop zooming won't leave "graphical trail
BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset,
SCREEN_WIDTH - iScreenWidthOffset, SCREEN_HEIGHT - iScreenHeightOffset );
//Everything is set up to start the transition animation.
//SGPRect SrcRect1;
SGPRect SrcRect2, DstRect;
INT32 iPercentage, iScalePercentage, iFactor;
UINT32 uiStartTime, uiTimeRange, uiCurrTime;
INT32 iX, iY, iWidth, iHeight;
INT32 iLaptopMonitorCenterX, iLaptopMonitorCenterY;
uiCurrTime = GetJA2Clock();
iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange;
iPercentage = min( iPercentage, 100 );
INT32 iRealPercentage;
iRealPercentage = iPercentage;
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
//Step 1: Build the laptop image into the save buffer.
RestoreBackgroundRects();
RenderLapTopImage();
HighLightRegion(giCurrentRegion);
RenderLaptop();
RenderButtons();
PrintDate( );
PrintBalance( );
PrintNumberOnTeam( );
ShowLights();
//Factor the percentage so that it is modified by a gravity falling acceleration effect.
iFactor = (iPercentage - 50) * 2;
if( iPercentage < 50 )
iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5);
else
iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.5);
//Step 2: The mapscreen image is in the EXTRABUFFER, and laptop is in the SAVEBUFFER
// Start transitioning the screen.
DstRect.iLeft = iScreenWidthOffset; //0
DstRect.iTop = iScreenHeightOffset; //0
DstRect.iRight = iScreenWidthOffset + 640; //640
DstRect.iBottom = iScreenHeightOffset + 480; //480
iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16 + sYOffset;
uiTimeRange = 1000;
iPercentage = iRealPercentage = 0;
uiStartTime = GetJA2Clock();
//Laptop source rect
if( iPercentage < 99 )
iScalePercentage = 10000 / (100-iPercentage);
else
iScalePercentage = 5333;
iWidth = 12 * iScalePercentage / 100;
iHeight = 9 * iScalePercentage / 100;
BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset,
640, 480 );
// Lesh: moved into loop
//BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset,
// SCREEN_WIDTH - iScreenWidthOffset, SCREEN_HEIGHT - iScreenHeightOffset );
iX = iLaptopMonitorCenterX - (iLaptopMonitorCenterX - (iScreenWidthOffset + 320)) * iScalePercentage / 5333;
iY = iLaptopMonitorCenterY - (iLaptopMonitorCenterY - (iScreenHeightOffset + 240)) * iScalePercentage / 5333;
PlayJA2SampleFromFile( "SOUNDS\\Laptop power up (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
SrcRect2.iLeft = iX - iWidth / 2;
SrcRect2.iRight = SrcRect2.iLeft + iWidth;
SrcRect2.iTop = iY - iHeight / 2;
SrcRect2.iBottom = SrcRect2.iTop + iHeight;
while( iRealPercentage < 100 )
{
// Lesh: restore mapscreen so laptop zooming won't leave "graphical trail
BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset,
SCREEN_WIDTH - iScreenWidthOffset, SCREEN_HEIGHT - iScreenHeightOffset );
BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, 0, &DstRect, &SrcRect2 );
uiCurrTime = GetJA2Clock();
iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange;
iPercentage = min( iPercentage, 100 );
InvalidateScreen();
iRealPercentage = iPercentage;
RefreshScreen( NULL );
//Factor the percentage so that it is modified by a gravity falling acceleration effect.
iFactor = (iPercentage - 50) * 2;
if( iPercentage < 50 )
iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5);
else
iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.5);
//Laptop source rect
if( iPercentage < 99 )
iScalePercentage = 10000 / (100-iPercentage);
else
iScalePercentage = 5333;
iWidth = 12 * iScalePercentage / 100;
iHeight = 9 * iScalePercentage / 100;
iX = iLaptopMonitorCenterX - (iLaptopMonitorCenterX - (iScreenWidthOffset + 320)) * iScalePercentage / 5333;
iY = iLaptopMonitorCenterY - (iLaptopMonitorCenterY - (iScreenHeightOffset + 240)) * iScalePercentage / 5333;
SrcRect2.iLeft = iX - iWidth / 2;
SrcRect2.iRight = SrcRect2.iLeft + iWidth;
SrcRect2.iTop = iY - iHeight / 2;
SrcRect2.iBottom = SrcRect2.iTop + iHeight;
BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, 0, &DstRect, &SrcRect2 );
InvalidateScreen();
RefreshScreen( NULL );
}
fReDrawScreenFlag = TRUE;
}
fReDrawScreenFlag = TRUE;
}
//DO NOT MOVE THIS FUNCTION CALL!!!
//This determines if the help screen should be active
@@ -2514,100 +2517,104 @@ BOOLEAN LeaveLapTopScreen( void )
gfDontStartTransitionFromLaptop = TRUE;
}
SetPendingNewScreen(guiExitScreen);
SetPendingNewScreen(guiExitScreen);
if( !gfDontStartTransitionFromLaptop )
{
SGPRect SrcRect1, SrcRect2, DstRect;
INT32 iPercentage, iScalePercentage, iFactor;
UINT32 uiStartTime, uiTimeRange, uiCurrTime;
INT32 iX, iY, iWidth, iHeight;
INT32 iRealPercentage;
INT32 iLaptopMonitorCenterX, iLaptopMonitorCenterY;
gfDontStartTransitionFromLaptop = TRUE;
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
//Step 1: Build the laptop image into the save buffer.
RestoreBackgroundRects();
RenderLapTopImage();
HighLightRegion(giCurrentRegion);
RenderLaptop();
RenderButtons();
PrintDate( );
PrintBalance( );
PrintNumberOnTeam( );
ShowLights();
//Step 2: The mapscreen image is in the EXTRABUFFER, and laptop is in the SAVEBUFFER
// Start transitioning the screen.
DstRect.iLeft = iScreenWidthOffset + 0; // 0
DstRect.iTop = iScreenHeightOffset + 0; // 0
DstRect.iRight = iScreenWidthOffset + 640; // 640
DstRect.iBottom = iScreenHeightOffset + 480; // 480
iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16 + sYOffset;
uiTimeRange = 1000;
iPercentage = iRealPercentage = 100;
uiStartTime = GetJA2Clock();
BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset,
640, 480 );
PlayJA2SampleFromFile( "SOUNDS\\Laptop power down (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
while( iRealPercentage > 0 )
if (!gGameExternalOptions.fDisableLaptopTransition)
{
BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset,
SCREEN_WIDTH - iScreenWidthOffset, SCREEN_HEIGHT - iScreenHeightOffset );
SGPRect SrcRect1, SrcRect2, DstRect;
INT32 iPercentage, iScalePercentage, iFactor;
UINT32 uiStartTime, uiTimeRange, uiCurrTime;
INT32 iX, iY, iWidth, iHeight;
INT32 iRealPercentage;
INT32 iLaptopMonitorCenterX, iLaptopMonitorCenterY;
uiCurrTime = GetJA2Clock();
iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange;
iPercentage = min( iPercentage, 100 );
iPercentage = 100 - iPercentage;
iRealPercentage = iPercentage;
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
//Step 1: Build the laptop image into the save buffer.
RestoreBackgroundRects();
RenderLapTopImage();
HighLightRegion(giCurrentRegion);
RenderLaptop();
RenderButtons();
PrintDate( );
PrintBalance( );
PrintNumberOnTeam( );
ShowLights();
//Factor the percentage so that it is modified by a gravity falling acceleration effect.
iFactor = (iPercentage - 50) * 2;
if( iPercentage < 50 )
iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5);
else
iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.5);
//Step 2: The mapscreen image is in the EXTRABUFFER, and laptop is in the SAVEBUFFER
// Start transitioning the screen.
DstRect.iLeft = iScreenWidthOffset + 0; // 0
DstRect.iTop = iScreenHeightOffset + 0; // 0
DstRect.iRight = iScreenWidthOffset + 640; // 640
DstRect.iBottom = iScreenHeightOffset + 480; // 480
iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16 + sYOffset;
uiTimeRange = 1000;
iPercentage = iRealPercentage = 100;
uiStartTime = GetJA2Clock();
//Mapscreen source rect
SrcRect1.iLeft = iScreenWidthOffset + 464 * iPercentage / 100;
SrcRect1.iRight = iScreenWidthOffset + 640 - 163 * iPercentage / 100;
SrcRect1.iTop = iScreenHeightOffset + 417 * iPercentage / 100;
SrcRect1.iBottom = iScreenHeightOffset + 480 - 55 * iPercentage / 100;
//Laptop source rect
if( iPercentage < 99 )
iScalePercentage = 10000 / (100-iPercentage);
else
iScalePercentage = 5333;
iWidth = 12 * iScalePercentage / 100;
iHeight = 9 * iScalePercentage / 100;
BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset,
640, 480 );
iX = iLaptopMonitorCenterX - (iLaptopMonitorCenterX - (iScreenWidthOffset + 320)) * iScalePercentage / 5333;
iY = iLaptopMonitorCenterY - (iLaptopMonitorCenterY - (iScreenHeightOffset + 240)) * iScalePercentage / 5333;
PlayJA2SampleFromFile( "SOUNDS\\Laptop power down (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
SrcRect2.iLeft = iX - iWidth / 2;
SrcRect2.iRight = SrcRect2.iLeft + iWidth;
SrcRect2.iTop = iY - iHeight / 2;
SrcRect2.iBottom = SrcRect2.iTop + iHeight;
while( iRealPercentage > 0 )
{
BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset,
SCREEN_WIDTH - iScreenWidthOffset, SCREEN_HEIGHT - iScreenHeightOffset );
BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, iScreenWidthOffset, iScreenHeightOffset, &DstRect, &SrcRect2 );
uiCurrTime = GetJA2Clock();
iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange;
iPercentage = min( iPercentage, 100 );
iPercentage = 100 - iPercentage;
InvalidateScreen();
//gfPrintFrameBuffer = TRUE;
RefreshScreen( NULL );
iRealPercentage = iPercentage;
//Factor the percentage so that it is modified by a gravity falling acceleration effect.
iFactor = (iPercentage - 50) * 2;
if( iPercentage < 50 )
iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5);
else
iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.5);
//Mapscreen source rect
SrcRect1.iLeft = iScreenWidthOffset + 464 * iPercentage / 100;
SrcRect1.iRight = iScreenWidthOffset + 640 - 163 * iPercentage / 100;
SrcRect1.iTop = iScreenHeightOffset + 417 * iPercentage / 100;
SrcRect1.iBottom = iScreenHeightOffset + 480 - 55 * iPercentage / 100;
//Laptop source rect
if( iPercentage < 99 )
iScalePercentage = 10000 / (100-iPercentage);
else
iScalePercentage = 5333;
iWidth = 12 * iScalePercentage / 100;
iHeight = 9 * iScalePercentage / 100;
iX = iLaptopMonitorCenterX - (iLaptopMonitorCenterX - (iScreenWidthOffset + 320)) * iScalePercentage / 5333;
iY = iLaptopMonitorCenterY - (iLaptopMonitorCenterY - (iScreenHeightOffset + 240)) * iScalePercentage / 5333;
SrcRect2.iLeft = iX - iWidth / 2;
SrcRect2.iRight = SrcRect2.iLeft + iWidth;
SrcRect2.iTop = iY - iHeight / 2;
SrcRect2.iBottom = SrcRect2.iTop + iHeight;
BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, iScreenWidthOffset, iScreenHeightOffset, &DstRect, &SrcRect2 );
InvalidateScreen();
//gfPrintFrameBuffer = TRUE;
RefreshScreen( NULL );
}
}
}
}
return( TRUE );
}
BOOLEAN HandleExit( void )
{
// static BOOLEAN fSentImpWarningAlready = FALSE;
@@ -3837,6 +3844,9 @@ BOOLEAN DisplayLoadPending( void )
INT32 iUnitTime;
INT16 sXPosition = 0, sYPosition = 0;
if (gGameExternalOptions.fFastWWWSitesLoading)
gfTemporaryDisablingOfLoadPendingFlag = TRUE;
// if merc webpage, make it longer
//TEMP disables the loadpending
if( gfTemporaryDisablingOfLoadPendingFlag )
+13 -12
View File
@@ -2421,6 +2421,11 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = false;
gGameExternalOptions.fQuietRealTimeSneak = false;
// WANNE: Enable fast loading
gGameExternalOptions.fDisableLaptopTransition = true;
gGameExternalOptions.fFastWWWSitesLoading = true;
gGameExternalOptions.fDisableStrategicTransition = true;
// WANNE: fix HOT DAY in night at arrival by night.
// Explanation: If game starting time + first arrival delay < 07:00 (111600) -> we arrive before the sun rises or
// if game starting time + first arrival delay >= 21:00 (162000) -> we arrive after the sun goes down
@@ -2528,10 +2533,7 @@ void reapplySETTINGS()
LaptopSaveInfo.ubLastMercAvailableId = 7;
gGameExternalOptions.fEnableSlayForever =1;
LaptopSaveInfo.gubPlayersMercAccountStatus = 4;
// Set fast loading of WWW sites
gfTemporaryDisablingOfLoadPendingFlag = TRUE;
// WANNE: This should fix the bug playing a "tilt" sound and showing the mini laptop graphic on the screen, when opening the laptop / option screen from map screen
gfDontStartTransitionFromLaptop = TRUE;
@@ -2624,6 +2626,11 @@ void reapplySETTINGS()
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = false;
gGameExternalOptions.fQuietRealTimeSneak = false;
// WANNE: Enable fast loading
gGameExternalOptions.fDisableLaptopTransition = true;
gGameExternalOptions.fFastWWWSitesLoading = true;
gGameExternalOptions.fDisableStrategicTransition = true;
// WANNE: fix HOT DAY in night at arrival by night.
// Explanation: If game starting time + first arrival delay < 07:00 (111600) -> we arrive before the sun rises or
// if game starting time + first arrival delay >= 21:00 (162000) -> we arrive after the sun goes down
@@ -4773,10 +4780,7 @@ void connect_client ( void )
LaptopSaveInfo.ubLastMercAvailableId = 7;
gGameExternalOptions.fEnableSlayForever = 1;
LaptopSaveInfo.gubPlayersMercAccountStatus = 4;
// Set fast loading of WWW sites
gfTemporaryDisablingOfLoadPendingFlag = TRUE;
// WANNE: This should fix the bug playing a "tilt" sound and showing the mini laptop graphic on the screen, when opening the laptop / option screen from map screen from map screen
gfDontStartTransitionFromLaptop = TRUE;
@@ -4975,10 +4979,7 @@ void client_disconnect (void)
allowlaptop=false;
TEAM=0;
// Reset fast loading of WWW pages
gfTemporaryDisablingOfLoadPendingFlag = FALSE;
// clear local client cache
memset(client_names,0,sizeof(char)*4*30);
memset(client_edges,0,sizeof(int)*5);
+36 -33
View File
@@ -1285,43 +1285,46 @@ void BeginLoadScreen( void )
if( guiCurrentScreen == MAP_SCREEN && !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME) && !AreInMeanwhile() )
{
DstRect.iLeft = 0;
DstRect.iTop = 0;
DstRect.iRight = SCREEN_WIDTH;
DstRect.iBottom = SCREEN_HEIGHT;
uiTimeRange = 2000;
iPercentage = 0;
iLastShadePercentage = 0;
uiStartTime = GetJA2Clock();
BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
PlayJA2SampleFromFile( "SOUNDS\\Final Psionic Blast 01 (16-44).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
while( iPercentage < 100 )
if (!gGameExternalOptions.fDisableStrategicTransition)
{
uiCurrTime = GetJA2Clock();
iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange;
iPercentage = min( iPercentage, 100 );
DstRect.iLeft = 0;
DstRect.iTop = 0;
DstRect.iRight = SCREEN_WIDTH;
DstRect.iBottom = SCREEN_HEIGHT;
uiTimeRange = 2000;
iPercentage = 0;
iLastShadePercentage = 0;
uiStartTime = GetJA2Clock();
//Factor the percentage so that it is modified by a gravity falling acceleration effect.
iFactor = (iPercentage - 50) * 2;
if( iPercentage < 50 )
iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5);
else
iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.05);
if( iPercentage > 50 )
BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
PlayJA2SampleFromFile( "SOUNDS\\Final Psionic Blast 01 (16-44).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
while( iPercentage < 100 )
{
ShadowVideoSurfaceRectUsingLowPercentTable( guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
uiCurrTime = GetJA2Clock();
iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange;
iPercentage = min( iPercentage, 100 );
//Factor the percentage so that it is modified by a gravity falling acceleration effect.
iFactor = (iPercentage - 50) * 2;
if( iPercentage < 50 )
iPercentage = (UINT32)(iPercentage + iPercentage * iFactor * 0.01 + 0.5);
else
iPercentage = (UINT32)(iPercentage + (100-iPercentage) * iFactor * 0.01 + 0.05);
if( iPercentage > 50 )
{
ShadowVideoSurfaceRectUsingLowPercentTable( guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
}
SrcRect.iLeft = 536 * iPercentage / 100;
SrcRect.iRight = SCREEN_WIDTH - iPercentage / 20;
SrcRect.iTop = 367 * iPercentage / 100;
SrcRect.iBottom = SCREEN_HEIGHT - 39 * iPercentage / 100;
BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, 0, &SrcRect, &DstRect );
InvalidateScreen();
RefreshScreen( NULL );
}
SrcRect.iLeft = 536 * iPercentage / 100;
SrcRect.iRight = SCREEN_WIDTH - iPercentage / 20;
SrcRect.iTop = 367 * iPercentage / 100;
SrcRect.iBottom = SCREEN_HEIGHT - 39 * iPercentage / 100;
BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, 0, &SrcRect, &DstRect );
InvalidateScreen();
RefreshScreen( NULL );
}
}