mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
New events EVENT_PLAYLEVELMUSICSLOT and EVENT_CONTINUELEVELMUSICSLOT.
Called when a music track will be started from the beginning, and when the current track is continued after loading a save, etc. The requested track is passed into PLAYLEVELMUSICSLOT via ud.m_volume_number and ud.m_level_number. git-svn-id: https://svn.eduke32.com/eduke32@6624 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d41a013a57
commit
e7cbf0b1a9
6 changed files with 27 additions and 0 deletions
|
@ -146,6 +146,8 @@ enum GameEvent_t {
|
|||
EVENT_MENUCURSORRIGHT,
|
||||
EVENT_MENUCURSORSHADE,
|
||||
EVENT_MENUSHADESELECTED,
|
||||
EVENT_PLAYLEVELMUSICSLOT,
|
||||
EVENT_CONTINUELEVELMUSICSLOT,
|
||||
#ifdef LUNATIC
|
||||
EVENT_ANIMATEALLSPRITES,
|
||||
#endif
|
||||
|
|
|
@ -748,6 +748,8 @@ const char *EventNames[MAXEVENTS] =
|
|||
"EVENT_MENUCURSORRIGHT",
|
||||
"EVENT_MENUCURSORSHADE",
|
||||
"EVENT_MENUSHADESELECTED",
|
||||
"EVENT_PLAYLEVELMUSICSLOT",
|
||||
"EVENT_CONTINUELEVELMUSICSLOT",
|
||||
#ifdef LUNATIC
|
||||
"EVENT_ANIMATEALLSPRITES",
|
||||
#endif
|
||||
|
|
|
@ -1942,6 +1942,10 @@ int G_EnterLevel(int gameMode)
|
|||
{
|
||||
S_PlayLevelMusicOrNothing(mii);
|
||||
}
|
||||
else
|
||||
{
|
||||
S_ContinueLevelMusic();
|
||||
}
|
||||
}
|
||||
|
||||
if (gameMode & (MODE_GAME|MODE_EOL))
|
||||
|
|
|
@ -2161,6 +2161,8 @@ static void postloadplayer(int32_t savegamep)
|
|||
ud.music_level = g_musicIndex % MAXLEVELS;
|
||||
S_PlayLevelMusicOrNothing(musicIdx);
|
||||
}
|
||||
else
|
||||
S_ContinueLevelMusic();
|
||||
|
||||
if (ud.config.MusicToggle)
|
||||
S_PauseMusic(0);
|
||||
|
|
|
@ -277,6 +277,17 @@ static void S_SetMusicIndex(unsigned int m)
|
|||
|
||||
int S_TryPlayLevelMusic(unsigned int m)
|
||||
{
|
||||
auto m_volume_number = ud.m_volume_number;
|
||||
auto m_level_number = ud.m_level_number;
|
||||
ud.m_volume_number = m / MAXLEVELS;
|
||||
ud.m_level_number = m % MAXLEVELS;
|
||||
int retval = VM_OnEvent(EVENT_PLAYLEVELMUSICSLOT, g_player[myconnectindex].ps->i, myconnectindex);
|
||||
ud.m_volume_number = m_volume_number;
|
||||
ud.m_level_number = m_level_number;
|
||||
|
||||
if (retval < 0)
|
||||
return 0;
|
||||
|
||||
char const * musicfn = g_mapInfo[m].musicfn;
|
||||
if (musicfn != NULL)
|
||||
{
|
||||
|
@ -323,6 +334,11 @@ void S_PlaySpecialMusicOrNothing(unsigned int m)
|
|||
}
|
||||
}
|
||||
|
||||
void S_ContinueLevelMusic(void)
|
||||
{
|
||||
VM_OnEvent(EVENT_CONTINUELEVELMUSICSLOT, g_player[myconnectindex].ps->i, myconnectindex);
|
||||
}
|
||||
|
||||
int32_t S_GetMusicPosition(void)
|
||||
{
|
||||
int32_t position = 0;
|
||||
|
|
|
@ -100,6 +100,7 @@ int S_TryPlayLevelMusic(unsigned int);
|
|||
void S_PlayLevelMusicOrNothing(unsigned int);
|
||||
int S_TryPlaySpecialMusic(unsigned int);
|
||||
void S_PlaySpecialMusicOrNothing(unsigned int);
|
||||
void S_ContinueLevelMusic(void);
|
||||
int32_t S_PlaySound(int32_t num);
|
||||
int32_t S_PlaySound3D(int32_t num,int32_t i,const vec3_t *pos);
|
||||
void S_SoundShutdown(void);
|
||||
|
|
Loading…
Reference in a new issue