- Disabled the new music externalization code from revision 6296 (by Jazz)

o The new music code is now surrounded by a define called NEWMUSIC
o Jazz will rework the new music code in the future
o For now we have the old music code back, which should fix the mentioned bugs
-> Music in the main menu is starting again from beginning when going from preferences screen back to main menu screen
-> The battle tracks can play only 5-15 second then they start from all over again
-> The win music after tactical battle never run
-> ...

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6381 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-09-09 07:01:36 +00:00
parent e00dc9d9ea
commit f05139556f
16 changed files with 213 additions and 29 deletions
+6 -3
View File
@@ -2060,11 +2060,12 @@ void RenderAutoResolve()
SectorInfo[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].bLastKnownEnemies = 0;
SetThisSectorAsPlayerControlled( gpAR->ubSectorX, gpAR->ubSectorY, 0, TRUE );
#ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalVictory[0];
if ( MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalVictory[0] != -1 )
SetMusicModeID( MUSIC_TACTICAL_VICTORY, MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalVictory[0] );
else
#endif
SetMusicMode( MUSIC_TACTICAL_VICTORY );
LogBattleResults( LOG_VICTORY );
@@ -2085,11 +2086,12 @@ void RenderAutoResolve()
}
HandleMoraleEvent( NULL, MORALE_HEARD_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
if( ProcessLoyalty() )HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
#ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0];
if ( MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] != -1 )
SetMusicModeID( MUSIC_TACTICAL_DEATH, MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] );
else
#endif
SetMusicMode( MUSIC_TACTICAL_DEATH );
gsEnemyGainedControlOfSectorID = (INT16)SECTOR( gpAR->ubSectorX, gpAR->ubSectorY );
@@ -2106,11 +2108,12 @@ void RenderAutoResolve()
gsEnemyGainedControlOfSectorID = (INT16)SECTOR( gpAR->ubSectorX, gpAR->ubSectorY );
gsCiviliansEatenByMonsters = gpAR->ubAliveEnemies;
}
#ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0];
if ( MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] != -1 )
SetMusicModeID( MUSIC_TACTICAL_DEATH, MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] );
else
#endif
SetMusicMode( MUSIC_TACTICAL_DEATH );
LogBattleResults( LOG_DEFEAT );
+2 -1
View File
@@ -1284,11 +1284,12 @@ BOOLEAN PrepareCreaturesForBattle()
{ //creatures are attacking a town sector
//gfUseCreatureMusic = TRUE;
UseCreatureMusic(TRUE);
#ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ];
if ( MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ] != -1 )
SetMusicModeID( MUSIC_TACTICAL_NOTHING, MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ] );
else
#endif
SetMusicMode( MUSIC_TACTICAL_NOTHING );
ubCreatureHabitat = MINE_EXIT;
+18 -8
View File
@@ -537,12 +537,16 @@ static int l_AnimMercPtsrusStrategicInsertionData (lua_State *L);
static int l_SetMusicMode (lua_State *L);
static int l_MusicPlay (lua_State *L);
#ifdef NEWMUSIC
static int l_MusicPlayId (lua_State *L);
#endif
static int l_MusicSetVolume (lua_State *L);
static int l_MusicGetVolume (lua_State *L);
#ifdef NEWMUSIC
static int l_gAddMusic(lua_State *L);
static int l_SetMusicID (lua_State *L);
static int l_GetMusicID (lua_State *L);
#endif
//static int l_MusicStop (lua_State *L);
//static int l_MusicFadeOut (lua_State *L);
//static int l_MusicFadeIn (lua_State *L);
@@ -809,8 +813,9 @@ BOOLEAN LuaInternalQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY, BOOLEAN
static int l_GiveQuestRewardPoint(lua_State *L);
BOOLEAN LuaExecuteStrategicEvent( UINT8 EventCallbackID, UINT32 uiTimeStamp, UINT32 uiTimeOffset, UINT8 ubEventType, UINT8 ubFlags, UINT32 EventParam, UINT32 Init);
BOOLEAN LuaIDScripts(UINT8 Init, UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum);
#ifdef NEWMUSIC
BOOLEAN LetLuaMusicControl(UINT8 Init);
#endif
static int l_CurrentSquad (lua_State *L);
static int l_SetgfTacticalTraversal (lua_State *L);
static int l_GetgfTacticalTraversal (lua_State *L);
@@ -1304,12 +1309,13 @@ void IniFunction(lua_State *L, BOOLEAN bQuests )
lua_register(L, "PlayJA2Sample", l_PlayJA2Sample);
lua_register(L, "SetMusicMode", l_SetMusicMode );
lua_register(L, "MusicPlay", l_MusicPlay );
#ifdef NEWMUSIC
lua_register(L, "MusicIdPlay", l_MusicPlayId );
lua_register(L, "AddMusic", l_gAddMusic );
lua_register(L, "SetMusicID", l_SetMusicID );
lua_register(L, "GetMusicID", l_GetMusicID );
#endif
lua_register(L, "MusicSetVolume", l_MusicSetVolume );
lua_register(L, "MusicGetVolume", l_MusicGetVolume );
//lua_register(L, "MusicStop", l_MusicStop );
@@ -1680,7 +1686,7 @@ void IniFunction(lua_State *L, BOOLEAN bQuests )
lua_register(L,"EnvEndRainStorm", l_EnvEndRainStorm);
}
#ifdef NEWMUSIC
BOOLEAN LetLuaMusicControl(UINT8 Init)
{
const char* filename = "scripts\\Music.lua";
@@ -1699,7 +1705,7 @@ BOOLEAN LetLuaMusicControl(UINT8 Init)
return true;
}
#endif
//------------------- intro -----------
BOOLEAN LuaIntro(UINT8 Init, UINT32 uiCurrentVideo, INT8 bIntroType, UINT32 iStringToUse )
@@ -5448,7 +5454,7 @@ static int l_MusicSetVolume (lua_State *L)
}
return 0;
}
#ifdef NEWMUSIC
static int l_SetMusicID (lua_State *L)
{
if ( lua_gettop(L) >= 4 )
@@ -5608,18 +5614,22 @@ static int l_gAddMusic(lua_State *L)
return 0;
}
#endif
static int l_MusicPlay (lua_State *L)
{
if ( lua_gettop(L) >= 1 )
{
UINT32 uiNum = lua_tointeger(L,1);
#ifdef NEWMUSIC
MusicPlay( uiNum, MUSIC_OLD_TYPE, FALSE);
#else
MusicPlay( uiNum );
#endif
}
return 0;
}
#ifdef NEWMUSIC
static int l_MusicPlayId (lua_State *L)
{
if ( lua_gettop(L) >= 2 )
@@ -5632,7 +5642,7 @@ static int l_MusicPlayId (lua_State *L)
}
return 0;
}
#endif
static int l_SetMusicMode (lua_State *L)
{
if ( lua_gettop(L) >= 1 )
+3 -1
View File
@@ -872,11 +872,13 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
#ifdef ENABLE_ZOMBIES
UseCreatureMusic(HostileZombiesPresent());
#endif
#ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ];
if ( MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ] != -1 )
SetMusicModeID( MUSIC_TACTICAL_ENEMYPRESENT, MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ] );
else
#endif
SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT );
#ifdef JA2UB
+2 -1
View File
@@ -963,11 +963,12 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating
#ifdef ENABLE_ZOMBIES
UseCreatureMusic(HostileZombiesPresent());
#endif
#ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ];
if ( MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ] != -1 )
SetMusicModeID( MUSIC_TACTICAL_ENEMYPRESENT, MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ] );
else
#endif
SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT );
if( gfTacticalTraversal && pInitiatingBattleGroup == gpTacticalTraversalGroup ||
+5 -1
View File
@@ -2282,11 +2282,13 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
{
// ATE; Fade FA.T....
SetMusicFadeSpeed( 5 );
#ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ];
if ( MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ] != -1 )
SetMusicModeID( MUSIC_TACTICAL_NOTHING, MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ] );
else
#endif
SetMusicMode( MUSIC_TACTICAL_NOTHING );
}
@@ -4470,10 +4472,12 @@ void AllMercsHaveWalkedOffSector( )
// ATE; Fade FAST....
SetMusicFadeSpeed( 5 );
#ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ];
if ( MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ] != -1 )
SetMusicModeID( MUSIC_TACTICAL_NOTHING, MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ] );
else
#endif
SetMusicMode( MUSIC_TACTICAL_NOTHING );
}
}