mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
Merge branch 'public_next'
This commit is contained in:
commit
f163633591
5 changed files with 22 additions and 2 deletions
|
@ -1162,6 +1162,8 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
|||
mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1);
|
||||
else if (fastcmp(word, "MUSICPOS"))
|
||||
mapheaderinfo[num-1]->muspos = (UINT32)get_number(word2);
|
||||
else if (fastcmp(word, "MUSICINTERFADEOUT"))
|
||||
mapheaderinfo[num-1]->musinterfadeout = (UINT32)get_number(word2);
|
||||
else if (fastcmp(word, "MUSICINTER"))
|
||||
deh_strlcpy(mapheaderinfo[num-1]->musintername, word2,
|
||||
sizeof(mapheaderinfo[num-1]->musintername), va("Level header %d: intermission music", num));
|
||||
|
|
|
@ -323,6 +323,7 @@ typedef struct
|
|||
nightsgrades_t *grades; ///< NiGHTS grades. Allocated dynamically for space reasons. Be careful.
|
||||
|
||||
// Music stuff.
|
||||
UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds
|
||||
char musintername[7]; ///< Intermission screen music.
|
||||
|
||||
// Lua stuff.
|
||||
|
|
|
@ -2033,6 +2033,8 @@ static int mapheaderinfo_get(lua_State *L)
|
|||
lua_pushinteger(L, header->mustrack);
|
||||
else if (fastcmp(field,"muspos"))
|
||||
lua_pushinteger(L, header->muspos);
|
||||
else if (fastcmp(field,"musinterfadeout"))
|
||||
lua_pushinteger(L, header->musinterfadeout);
|
||||
else if (fastcmp(field,"musintername"))
|
||||
lua_pushstring(L, header->musintername);
|
||||
else if (fastcmp(field,"forcecharacter"))
|
||||
|
|
|
@ -213,6 +213,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
|||
mapheaderinfo[num]->musname[6] = 0;
|
||||
mapheaderinfo[num]->mustrack = 0;
|
||||
mapheaderinfo[num]->muspos = 0;
|
||||
mapheaderinfo[num]->musinterfadeout = 0;
|
||||
mapheaderinfo[num]->musintername[0] = '\0';
|
||||
mapheaderinfo[num]->forcecharacter[0] = '\0';
|
||||
mapheaderinfo[num]->weather = 0;
|
||||
|
|
|
@ -833,7 +833,14 @@ void Y_Ticker(void)
|
|||
|
||||
if (!intertic) // first time only
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
|
||||
if (mapheaderinfo[gamemap-1]->musinterfadeout
|
||||
#ifdef _WIN32
|
||||
// can't fade midi due to win32 volume hack
|
||||
&& S_MusicType() != MU_MID
|
||||
#endif
|
||||
)
|
||||
S_FadeOutStopMusic(mapheaderinfo[gamemap-1]->musinterfadeout);
|
||||
else if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
|
||||
S_ChangeMusicInternal(mapheaderinfo[gamemap-1]->musintername, false); // don't loop it
|
||||
else
|
||||
S_ChangeMusicInternal("lclear", false); // don't loop it
|
||||
|
@ -901,7 +908,14 @@ void Y_Ticker(void)
|
|||
|
||||
if (!intertic) // first time only
|
||||
{
|
||||
if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
|
||||
if (mapheaderinfo[gamemap-1]->musinterfadeout
|
||||
#ifdef _WIN32
|
||||
// can't fade midi due to win32 volume hack
|
||||
&& S_MusicType() != MU_MID
|
||||
#endif
|
||||
)
|
||||
S_FadeOutStopMusic(mapheaderinfo[gamemap-1]->musinterfadeout);
|
||||
else if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
|
||||
S_ChangeMusicInternal(mapheaderinfo[gamemap-1]->musintername, false); // don't loop it
|
||||
else
|
||||
S_ChangeMusicInternal("lclear", false); // don't loop it
|
||||
|
|
Loading…
Reference in a new issue