Merged New Inventory Project into main branch

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2008-03-08 15:15:25 +00:00
parent e16d166277
commit 43ca24dda8
649 changed files with 93359 additions and 82507 deletions
+58 -57
View File
@@ -36,7 +36,7 @@ INT8 bBattleModeSong;
INT8 gbFadeSpeed = 1;
CHAR8 *szMusicList[NUM_MUSIC]=
CHAR8 *szMusicList[NUM_MUSIC]=
{
"MUSIC\\marimbad 2.wav",
"MUSIC\\menumix1.wav",
@@ -56,7 +56,7 @@ CHAR8 *szMusicList[NUM_MUSIC]=
};
BOOLEAN gfForceMusicToTense = FALSE;
BOOLEAN gfDontRestartSong = FALSE;
BOOLEAN gfDontRestartSong = FALSE;
BOOLEAN StartMusicBasedOnMode( );
void DoneFadeOutDueToEndMusic( void );
@@ -65,25 +65,25 @@ extern void HandleEndDemoInCreatureLevel( );
BOOLEAN NoEnemiesInSight( )
{
SOLDIERTYPE *pSoldier;
SOLDIERTYPE *pSoldier;
INT32 cnt;
// Loop through our guys
// End the turn of player charactors
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
// look for all mercs on the same team,
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pSoldier++ )
{
if ( pSoldier->bActive && pSoldier->bLife >= OKLIFE )
// look for all mercs on the same team,
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pSoldier++ )
{
if ( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE )
{
if ( pSoldier->bOppCnt != 0 )
if ( pSoldier->aiData.bOppCnt != 0 )
{
return( FALSE );
return( FALSE );
}
}
}
return( TRUE );
}
@@ -100,18 +100,18 @@ void MusicStopCallback( void *pData );
BOOLEAN MusicPlay(UINT32 uiNum)
{
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return FALSE;
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
//return FALSE;
SOUNDPARMS spParms;
SOUNDPARMS spParms;
if(fMusicPlaying)
MusicStop();
memset(&spParms, 0xff, sizeof(SOUNDPARMS));
spParms.uiPriority=PRIORITY_MAX;
spParms.uiVolume=0;
spParms.uiLoop=1; // Lesh: only 1 line added
spParms.uiLoop=1; // Lesh: only 1 line added
spParms.EOSCallback = MusicStopCallback;
@@ -121,7 +121,7 @@ BOOLEAN MusicPlay(UINT32 uiNum)
if(uiMusicHandle!=SOUND_ERROR)
{
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music PLay %d %d", uiMusicHandle, gubMusicMode ) );
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music PLay %d %d", uiMusicHandle, gubMusicMode ) );
gfMusicEnded = FALSE;
fMusicPlaying=TRUE;
@@ -129,7 +129,7 @@ BOOLEAN MusicPlay(UINT32 uiNum)
return(TRUE);
}
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music PLay %d %d", uiMusicHandle, gubMusicMode ) );
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music PLay %d %d", uiMusicHandle, gubMusicMode ) );
return(FALSE);
}
@@ -143,36 +143,36 @@ BOOLEAN MusicPlay(UINT32 uiNum)
//********************************************************************************
BOOLEAN MusicSetVolume(UINT32 uiVolume)
{
INT32 uiOldMusicVolume = uiMusicVolume;
INT32 uiOldMusicVolume = uiMusicVolume;
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return FALSE;
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
//return FALSE;
uiMusicVolume=__min(uiVolume, 127);
uiMusicVolume=__min(uiVolume, 127);
if(uiMusicHandle!=NO_SAMPLE)
{
// get volume and if 0 stop music!
if ( uiMusicVolume == 0 )
{
gfDontRestartSong = TRUE;
MusicStop( );
return( TRUE );
}
// get volume and if 0 stop music!
if ( uiMusicVolume == 0 )
{
gfDontRestartSong = TRUE;
MusicStop( );
return( TRUE );
}
SoundSetVolume(uiMusicHandle, uiMusicVolume);
return(TRUE);
}
// If here, check if we need to re-start music
// Have we re-started?
if ( uiMusicVolume > 0 && uiOldMusicVolume == 0 )
{
StartMusicBasedOnMode( );
}
// If here, check if we need to re-start music
// Have we re-started?
if ( uiMusicVolume > 0 && uiOldMusicVolume == 0 )
{
StartMusicBasedOnMode( );
}
return(FALSE);
}
@@ -201,8 +201,8 @@ UINT32 MusicGetVolume(void)
BOOLEAN MusicStop(void)
{
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return(FALSE);
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return(FALSE);
if(uiMusicHandle!=NO_SAMPLE)
@@ -269,8 +269,8 @@ BOOLEAN MusicPoll( BOOLEAN fForce )
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"MusicPoll");
// WANNE: We want music in windowed mode
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
//return(TRUE);
//if( 1==iScreenMode ) /* on Windowed mode, skip the music? was coded for WINDOWED_MODE that way...*/
// return(TRUE);
INT32 iVol;
@@ -281,7 +281,7 @@ BOOLEAN MusicPoll( BOOLEAN fForce )
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"MusicPoll: Handle Sound every sound overhead time");
// Handle Sound every sound overhead time....
if ( COUNTERDONE( MUSICOVERHEAD ) )
if ( COUNTERDONE( MUSICOVERHEAD ) )
{
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"MusicPoll: Reset counter");
// Reset counter
@@ -343,17 +343,17 @@ BOOLEAN MusicPoll( BOOLEAN fForce )
SetMusicMode( MUSIC_TACTICAL_NOTHING );
}
}
else
else
{
if ( !gfDontRestartSong )
{
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"MusicPoll: don't restart song, StartMusicBasedOnMode");
StartMusicBasedOnMode( );
}
}
}
gfMusicEnded = FALSE;
gfDontRestartSong = FALSE;
gfDontRestartSong = FALSE;
}
}
@@ -370,10 +370,10 @@ BOOLEAN SetMusicMode( UINT8 ubMusicMode )
// OK, check if we want to restore
if ( ubMusicMode == MUSIC_RESTORE )
{
if ( bPreviousMode == MUSIC_TACTICAL_VICTORY || bPreviousMode == MUSIC_TACTICAL_DEATH )
{
bPreviousMode = MUSIC_TACTICAL_NOTHING;
}
if ( bPreviousMode == MUSIC_TACTICAL_VICTORY || bPreviousMode == MUSIC_TACTICAL_DEATH )
{
bPreviousMode = MUSIC_TACTICAL_NOTHING;
}
ubMusicMode = bPreviousMode;
}
@@ -382,19 +382,19 @@ BOOLEAN SetMusicMode( UINT8 ubMusicMode )
// Save previous mode...
bPreviousMode = gubOldMusicMode;
}
// if different, start a new music song
if ( gubOldMusicMode != ubMusicMode )
{
// Set mode....
gubMusicMode = ubMusicMode;
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music New Mode %d %d", uiMusicHandle, gubMusicMode ) );
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music New Mode %d %d", uiMusicHandle, gubMusicMode ) );
gbVictorySongCount = 0;
gbDeathSongCount = 0;
if(uiMusicHandle!=NO_SAMPLE )
if(uiMusicHandle!=NO_SAMPLE )
{
// Fade out old music
MusicFadeOut( );
@@ -435,7 +435,7 @@ BOOLEAN StartMusicBasedOnMode( )
switch( gubMusicMode )
{
case MUSIC_MAIN_MENU:
// ATE: Don't fade in
// ATE: Don't fade in
gbFadeSpeed = (INT8)uiMusicVolume;
MusicPlay( MENUMIX_MUSIC );
break;
@@ -446,7 +446,7 @@ BOOLEAN StartMusicBasedOnMode( )
break;
case MUSIC_TACTICAL_NOTHING:
// ATE: Don't fade in
// ATE: Don't fade in
gbFadeSpeed = (INT8)uiMusicVolume;
if( gfUseCreatureMusic )
{
@@ -474,7 +474,7 @@ BOOLEAN StartMusicBasedOnMode( )
break;
case MUSIC_TACTICAL_BATTLE:
// ATE: Don't fade in
// ATE: Don't fade in
gbFadeSpeed = (INT8)uiMusicVolume;
if( gfUseCreatureMusic )
{
@@ -519,9 +519,9 @@ BOOLEAN StartMusicBasedOnMode( )
void MusicStopCallback( void *pData )
{
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music EndCallback %d %d", uiMusicHandle, gubMusicMode ) );
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "Music EndCallback %d %d", uiMusicHandle, gubMusicMode ) );
gfMusicEnded = TRUE;
gfMusicEnded = TRUE;
uiMusicHandle = NO_SAMPLE;
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Music EndCallback completed" );
@@ -555,3 +555,4 @@ void DoneFadeOutDueToEndMusic( void )
//SetPendingNewScreen( MAINMENU_SCREEN );
}