diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index f96af261c..316c39418 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -1811,14 +1811,15 @@ UINT32 LaptopScreenHandle() if( gfStartMapScreenToLaptopTransition ) { + // WANNE 2: I disabled the animation of the laptop, because the screen redrawing does not work correct! + // Madd: It'd be nice if someone who knows more about graphics than I do could re-enable this, at least for 640x480 //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; + //SGPRect SrcRect2, DstRect; + //INT32 iPercentage, iScalePercentage, iFactor; + //UINT32 uiStartTime, uiTimeRange, uiCurrTime; + //INT32 iX, iY, iWidth, iHeight; - INT32 iRealPercentage; + //INT32 iRealPercentage; SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR ); //Step 1: Build the laptop image into the save buffer. @@ -1833,62 +1834,63 @@ UINT32 LaptopScreenHandle() 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 - uiTimeRange = 1000; - iPercentage = iRealPercentage = 0; - uiStartTime = GetJA2Clock(); + //// WANNE 2 + ////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 + //uiTimeRange = 1000; + //iPercentage = iRealPercentage = 0; + //uiStartTime = GetJA2Clock(); - BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, - 640, 480 ); - BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 ); + //BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, + // 640, 480 ); + //BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 ); - PlayJA2SampleFromFile( "SOUNDS\\Laptop power up (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); - - // WANNE 2 with laptop zooming - while( iRealPercentage < 100 ) - { - uiCurrTime = GetJA2Clock(); - iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange; - iPercentage = min( iPercentage, 100 ); + //PlayJA2SampleFromFile( "SOUNDS\\Laptop power up (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); + // + //// WANNE 2 with laptop zooming + //while( iRealPercentage < 100 ) + //{ + // uiCurrTime = GetJA2Clock(); + // iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange; + // iPercentage = min( iPercentage, 100 ); - iRealPercentage = iPercentage; + // 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); + // //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; + // //Laptop source rect + // if( iPercentage < 99 ) + // iScalePercentage = 10000 / (100-iPercentage); + // else + // iScalePercentage = 5333; + // iWidth = 12 * iScalePercentage / 100; + // iHeight = 9 * iScalePercentage / 100; - iX = 472 - (472 - (iScreenWidthOffset + 320)) * iScalePercentage / 5333; - iY = 424 - (424 - (iScreenHeightOffset + 240)) * iScalePercentage / 5333; + // iX = iScreenWidthOffset + 472 - (472-320) * iScalePercentage / 5333; + // iY = iScreenHeightOffset + 424 - (424-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 ); + // 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, 0, 0, &DstRect, &SrcRect2 ); - //WANNE 2 - InvalidateScreen(); - - //WANNE 2 - RefreshScreen( NULL ); - } + // //WANNE 2 + // InvalidateScreen(); + // + // //WANNE 2 + // RefreshScreen( NULL ); + //} fReDrawScreenFlag = TRUE; } @@ -2443,11 +2445,14 @@ BOOLEAN LeaveLapTopScreen( void ) if( !gfDontStartTransitionFromLaptop ) { - SGPRect SrcRect1, SrcRect2, DstRect; - INT32 iPercentage, iScalePercentage, iFactor; - UINT32 uiStartTime, uiTimeRange, uiCurrTime; - INT32 iX, iY, iWidth, iHeight; - INT32 iRealPercentage; + // WANNE 2: I disabled the laptop animation, because the screen redrawing does not work correctly! + // Madd: It'd be nice if someone who knows more about graphics than I do could re-enable this, at least for 640x480 + + //SGPRect SrcRect1, SrcRect2, DstRect; + //INT32 iPercentage, iScalePercentage, iFactor; + //UINT32 uiStartTime, uiTimeRange, uiCurrTime; + //INT32 iX, iY, iWidth, iHeight; + //INT32 iRealPercentage; gfDontStartTransitionFromLaptop = TRUE; SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR ); @@ -2462,66 +2467,66 @@ BOOLEAN LeaveLapTopScreen( void ) 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 - uiTimeRange = 1000; - iPercentage = iRealPercentage = 100; - uiStartTime = GetJA2Clock(); + ////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 + //uiTimeRange = 1000; + //iPercentage = iRealPercentage = 100; + //uiStartTime = GetJA2Clock(); - BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, - 640, 480 ); + //BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset, + // 640, 480 ); - PlayJA2SampleFromFile( "SOUNDS\\Laptop power down (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); + //PlayJA2SampleFromFile( "SOUNDS\\Laptop power down (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN ); - // WANNE 2 - while( iRealPercentage > 0 ) - { - BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 ); + //// WANNE 2 + //while( iRealPercentage > 0 ) + //{ + // BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 ); - uiCurrTime = GetJA2Clock(); - iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange; - iPercentage = min( iPercentage, 100 ); - iPercentage = 100 - iPercentage; + // uiCurrTime = GetJA2Clock(); + // iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange; + // iPercentage = min( iPercentage, 100 ); + // iPercentage = 100 - iPercentage; - iRealPercentage = iPercentage; + // 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); + // //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 = 472 - (472 - (iScreenWidthOffset + 320)) * iScalePercentage / 5333; - iY = 424 - (424 - (iScreenHeightOffset + 240)) * iScalePercentage / 5333; + // //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 = iScreenWidthOffset + 472 - (472-320) * iScalePercentage / 5333; + // iY = iScreenHeightOffset + 424 - (424-240) * iScalePercentage / 5333; - SrcRect2.iLeft = iX - iWidth / 2; - SrcRect2.iRight = SrcRect2.iLeft + iWidth; - SrcRect2.iTop = iY - iHeight / 2; - SrcRect2.iBottom = SrcRect2.iTop + iHeight; + // 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 ); + // BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, 0, &DstRect, &SrcRect2 ); - InvalidateScreen(); - //gfPrintFrameBuffer = TRUE; - RefreshScreen( NULL ); - } + // InvalidateScreen(); + // //gfPrintFrameBuffer = TRUE; + // RefreshScreen( NULL ); + //} } } return( TRUE ); @@ -4514,8 +4519,8 @@ BOOLEAN DisplayTitleBarMaximizeGraphic(BOOLEAN fForward, BOOLEAN fInit, UINT16 u sPosBottomY = LAPTOP_TITLE_BAR_HEIGHT; - SrcRect.iLeft = 0; - SrcRect.iTop = 0; + SrcRect.iLeft = iScreenWidthOffset; + SrcRect.iTop = iScreenHeightOffset; SrcRect.iRight = LAPTOP_TITLE_BAR_WIDTH; SrcRect.iBottom = LAPTOP_TITLE_BAR_HEIGHT;