*********************************************************

*	2006/05/01					*
*	Madd Mugsy					*
*	Developed in VS 2003				*
*********************************************************

Source:
- Added bullet tracers (& tracerEffect to AmmoTypes.xml)
- Remedied IMP name saving, which didn't seem to upload properly

Data:
- Add bullet_tracer.sti to tilecache (will upload a full data folder w/new images at some point)



git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@45 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2006-05-01 19:19:45 +00:00
parent 07028a5737
commit dc2b482a8f
12 changed files with 197 additions and 135 deletions
+1 -1
View File
@@ -1244,7 +1244,7 @@ void Print8CharacterOnlyString( void )
BOOLEAN CheckCharacterInputForEgg( void )
{
MERC_HIRE_STRUCT HireMercStruct;
// MERC_HIRE_STRUCT HireMercStruct;
#ifndef JA2BETAVERSION
return( FALSE );
+43 -7
View File
@@ -651,13 +651,40 @@ INT32 FirstFreeBigEnoughPocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem)
void WriteOutCurrentImpCharacter( INT32 iProfileId )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: IMP.dat"));
char zImpFileName[12];
strcat(zImpFileName,IMP_MERC_FILENAME);
strcat(zImpFileName,IMP_FILENAME_SUFFIX);
WriteOutCurrentImpCharacter ( iProfileId, zImpFileName);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: Nickname.dat"));
char zFileName[12];
char temp;
for(int i=0;i < 8;i++) // Madd: I couldn't get strcpy or anything to work here... weird... if s/o wants to fix it, go ahead
{
temp = (char) gMercProfiles[iProfileId].zNickname[i];
zFileName[i] = temp;
}
strcat(zFileName,IMP_FILENAME_SUFFIX);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: %s", zFileName));
WriteOutCurrentImpCharacter ( iProfileId, zFileName);
}
void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName )
{
// grab the profile number and write out what is contained there in
HWFILE hFile;
UINT32 uiBytesWritten = 0;
// open the file for writing
hFile = FileOpen(strcat((STR)(&gMercProfiles[iProfileId].zNickname),IMP_FILENAME_SUFFIX), FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("WriteOutCurrentImpCharacter: %s", fileName));
hFile = FileOpen(fileName, FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE);
// write out the profile id
if (!FileWrite(hFile, &iProfileId, sizeof( INT32 ), &uiBytesWritten))
@@ -685,11 +712,15 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId )
BOOLEAN ImpExists ( STR nickName )
{
DWORD attribs = GetFileAttributes(strcat(nickName,IMP_FILENAME_SUFFIX));
if ( attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY) )
return TRUE;
return FALSE;
char zFileName[12];
strcpy(zFileName,nickName);
strcat(zFileName,IMP_FILENAME_SUFFIX);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("ImpExists: %s", (STR) zFileName));
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("ImpExists: %d", FileExistsNoDB(zFileName) ));
return FileExistsNoDB(zFileName);
}
void LoadImpCharacter( STR nickName )
@@ -698,8 +729,13 @@ void LoadImpCharacter( STR nickName )
HWFILE hFile;
UINT32 uiBytesRead = 0;
char zFileName[12];
strcpy(zFileName,nickName);
strcat(zFileName,IMP_FILENAME_SUFFIX);
// open the file for writing
hFile = FileOpen(strcat(nickName,IMP_FILENAME_SUFFIX), FILE_ACCESS_READ, FALSE);
hFile = FileOpen(zFileName, FILE_ACCESS_READ, FALSE);
// valid file?
if( hFile == -1 )
+1
View File
@@ -9,6 +9,7 @@ void HandleIMPConfirm( void );
BOOLEAN AddCharacterToPlayersTeam( void );
void LoadImpCharacter( STR fileName );
void WriteOutCurrentImpCharacter( INT32 iProfileId );
void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName );
void ResetIMPCharactersEyesAndMouthOffsets( UINT8 ubMercProfileID );
+11 -4
View File
@@ -342,7 +342,7 @@ void HandleTextEvent( UINT32 uiKey )
uiKey == '_' || uiKey == '.' )
{
// if the current string position is at max or great, do nothing
if( iStringPos >= 6 )
if( iStringPos >= 8 )
{
break;
}
@@ -387,6 +387,9 @@ void ProcessPlayerInputActivationString( void )
if( NumberOfMercsOnPlayerTeam() >= 18 )
return;
char charPlayerActivationString[32];
wcstombs(charPlayerActivationString,pPlayerActivationString,32);
//Madd multiple imps if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) )&&( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
{
@@ -397,10 +400,14 @@ void ProcessPlayerInputActivationString( void )
}
//Madd multiple imps else if( ( wcscmp(pPlayerActivationString, L"90210") == 0 ) && ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) )
// Madd: load characters by name:
else if ( ImpExists( (STR)pPlayerActivationString ) )
else if( wcscmp(pPlayerActivationString, L"90210") == 0 )
{
LoadImpCharacter( (STR)pPlayerActivationString );
LoadImpCharacter( IMP_MERC_FILENAME );
}
// Madd: load characters by name
else if ( ImpExists( charPlayerActivationString ) )
{
LoadImpCharacter( charPlayerActivationString );
}
else
+2
View File
@@ -12,5 +12,7 @@ void HandleImpHomePage( void );
#define MIN_GLOW_DELTA 100
#define CURSOR_HEIGHT GetFontHeight( FONT14ARIAL ) + 6
#define IMP_MERC_FILENAME "IMP"
extern INT32 GlowColorsList[][3];
#endif
+111 -116
View File
@@ -1811,15 +1811,14 @@ 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 SrcRect2, DstRect;
//INT32 iPercentage, iScalePercentage, iFactor;
//UINT32 uiStartTime, uiTimeRange, uiCurrTime;
//INT32 iX, iY, iWidth, iHeight;
//SGPRect SrcRect1;
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.
@@ -1834,63 +1833,62 @@ UINT32 LaptopScreenHandle()
PrintNumberOnTeam( );
ShowLights();
//// 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();
//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 = iScreenWidthOffset + 472 - (472-320) * iScalePercentage / 5333;
// iY = iScreenHeightOffset + 424 - (424-240) * iScalePercentage / 5333;
iX = 472 - (472 - (iScreenWidthOffset + 320)) * iScalePercentage / 5333;
iY = 424 - (424 - (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, 0, 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, iScreenWidthOffset, iScreenHeightOffset, 0, &DstRect, &SrcRect2 );
// //WANNE 2
// InvalidateScreen();
//
// //WANNE 2
// RefreshScreen( NULL );
//}
//WANNE 2
InvalidateScreen();
//WANNE 2
RefreshScreen( NULL );
}
fReDrawScreenFlag = TRUE;
}
@@ -2445,14 +2443,11 @@ BOOLEAN LeaveLapTopScreen( void )
if( !gfDontStartTransitionFromLaptop )
{
// 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;
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 );
@@ -2467,66 +2462,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 = iScreenWidthOffset + 472 - (472-320) * iScalePercentage / 5333;
// iY = iScreenHeightOffset + 424 - (424-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 = 472 - (472 - (iScreenWidthOffset + 320)) * iScalePercentage / 5333;
iY = 424 - (424 - (iScreenHeightOffset + 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, 0, 0, &DstRect, &SrcRect2 );
BltStretchVideoSurface( FRAME_BUFFER, guiSAVEBUFFER, 0, iScreenWidthOffset, iScreenHeightOffset, &DstRect, &SrcRect2 );
// InvalidateScreen();
// //gfPrintFrameBuffer = TRUE;
// RefreshScreen( NULL );
//}
InvalidateScreen();
//gfPrintFrameBuffer = TRUE;
RefreshScreen( NULL );
}
}
}
return( TRUE );
@@ -4519,8 +4514,8 @@ BOOLEAN DisplayTitleBarMaximizeGraphic(BOOLEAN fForward, BOOLEAN fInit, UINT16 u
sPosBottomY = LAPTOP_TITLE_BAR_HEIGHT;
SrcRect.iLeft = iScreenWidthOffset;
SrcRect.iTop = iScreenHeightOffset;
SrcRect.iLeft = 0;
SrcRect.iTop = 0;
SrcRect.iRight = LAPTOP_TITLE_BAR_WIDTH;
SrcRect.iBottom = LAPTOP_TITLE_BAR_HEIGHT;