diff --git a/GameSettings.cpp b/GameSettings.cpp index 7f1c04c2f..8454294b1 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -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 ################## diff --git a/GameSettings.h b/GameSettings.h index 883988608..5d793b798 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -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; diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index 959ffee09..e6b929e99 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -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 ) diff --git a/Multiplayer/client.cpp b/Multiplayer/client.cpp index 14488bef4..1ca3d2b22 100644 --- a/Multiplayer/client.cpp +++ b/Multiplayer/client.cpp @@ -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); diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index 459208343..f3b2cd494 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -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 ); } }