mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Data and Source v1.13 Mod High Resolution version from 2006-03-01
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@23 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+123
-109
@@ -1,3 +1,4 @@
|
||||
// WANNE 2 <changed some lines>
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Laptop All.h"
|
||||
#include "HelpScreen.h"
|
||||
@@ -1783,6 +1784,7 @@ void HandleLapTopHandles()
|
||||
|
||||
extern BOOLEAN gfPrintFrameBuffer;
|
||||
|
||||
// WANNE 2 <change laptop zooming>
|
||||
UINT32 LaptopScreenHandle()
|
||||
{
|
||||
//User just changed modes. This is determined by the button callbacks
|
||||
@@ -1803,13 +1805,16 @@ UINT32 LaptopScreenHandle()
|
||||
}
|
||||
|
||||
if( gfStartMapScreenToLaptopTransition )
|
||||
{ //Everything is set up to start the transition animation.
|
||||
SGPRect SrcRect1, SrcRect2, DstRect;
|
||||
INT32 iPercentage, iScalePercentage, iFactor;
|
||||
UINT32 uiStartTime, uiTimeRange, uiCurrTime;
|
||||
INT32 iX, iY, iWidth, iHeight;
|
||||
{
|
||||
// WANNE 2: I disabled the animation of the laptop, because the screen redrawing does not work correct!
|
||||
|
||||
INT32 iRealPercentage;
|
||||
//Everything is set up to start the transition animation.
|
||||
//SGPRect SrcRect2, DstRect;
|
||||
//INT32 iPercentage, iScalePercentage, iFactor;
|
||||
//UINT32 uiStartTime, uiTimeRange, uiCurrTime;
|
||||
//INT32 iX, iY, iWidth, iHeight;
|
||||
|
||||
//INT32 iRealPercentage;
|
||||
|
||||
SetCurrentCursorFromDatabase( VIDEO_NO_CURSOR );
|
||||
//Step 1: Build the laptop image into the save buffer.
|
||||
@@ -1824,62 +1829,64 @@ 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 <change>
|
||||
////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 );
|
||||
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);
|
||||
|
||||
//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;
|
||||
// //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;
|
||||
// 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, 0, iScreenWidthOffset, iScreenHeightOffset, &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 );
|
||||
//}
|
||||
|
||||
InvalidateScreen();
|
||||
RefreshScreen( NULL );
|
||||
}
|
||||
fReDrawScreenFlag = TRUE;
|
||||
}
|
||||
|
||||
@@ -1941,12 +1948,14 @@ UINT32 LaptopScreenHandle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( fPausedReDrawScreenFlag )
|
||||
{
|
||||
fReDrawScreenFlag = TRUE;
|
||||
fPausedReDrawScreenFlag = FALSE;
|
||||
}
|
||||
|
||||
// WANNE 2 <redraw>
|
||||
if( fReDrawScreenFlag )
|
||||
{
|
||||
RenderLapTopImage();
|
||||
@@ -2075,6 +2084,7 @@ UINT32 LaptopScreenHandle()
|
||||
// render frame rate
|
||||
DisplayFrameRate( );
|
||||
|
||||
// WANNE 2 <redraw>
|
||||
// invalidate screen if redrawn
|
||||
if( fReDrawScreenFlag == TRUE )
|
||||
{
|
||||
@@ -2430,11 +2440,13 @@ 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!
|
||||
|
||||
//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 );
|
||||
@@ -2449,65 +2461,67 @@ 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 );
|
||||
while( iRealPercentage > 0 )
|
||||
{
|
||||
BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 );
|
||||
//PlayJA2SampleFromFile( "SOUNDS\\Laptop power down (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
|
||||
|
||||
uiCurrTime = GetJA2Clock();
|
||||
iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange;
|
||||
iPercentage = min( iPercentage, 100 );
|
||||
iPercentage = 100 - iPercentage;
|
||||
//// WANNE 2
|
||||
//while( iRealPercentage > 0 )
|
||||
//{
|
||||
// BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, 640, 480 );
|
||||
|
||||
iRealPercentage = iPercentage;
|
||||
// uiCurrTime = GetJA2Clock();
|
||||
// iPercentage = (uiCurrTime-uiStartTime) * 100 / uiTimeRange;
|
||||
// iPercentage = min( iPercentage, 100 );
|
||||
// iPercentage = 100 - 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);
|
||||
// iRealPercentage = iPercentage;
|
||||
|
||||
//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;
|
||||
// //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);
|
||||
|
||||
SrcRect2.iLeft = iX - iWidth / 2;
|
||||
SrcRect2.iRight = SrcRect2.iLeft + iWidth;
|
||||
SrcRect2.iTop = iY - iHeight / 2;
|
||||
SrcRect2.iBottom = SrcRect2.iTop + iHeight;
|
||||
// //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;
|
||||
|
||||
BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, iScreenWidthOffset, iScreenHeightOffset, &DstRect, &SrcRect2 );
|
||||
// SrcRect2.iLeft = iX - iWidth / 2;
|
||||
// SrcRect2.iRight = SrcRect2.iLeft + iWidth;
|
||||
// SrcRect2.iTop = iY - iHeight / 2;
|
||||
// SrcRect2.iBottom = SrcRect2.iTop + iHeight;
|
||||
|
||||
InvalidateScreen();
|
||||
//gfPrintFrameBuffer = TRUE;
|
||||
RefreshScreen( NULL );
|
||||
}
|
||||
}
|
||||
// BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, 0, &DstRect, &SrcRect2 );
|
||||
|
||||
// InvalidateScreen();
|
||||
// //gfPrintFrameBuffer = TRUE;
|
||||
// RefreshScreen( NULL );
|
||||
//}
|
||||
}
|
||||
}
|
||||
return( TRUE );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user