From 4dd6b733d6936c37e9bb67a0f60df9166f55af26 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 25 Aug 2018 16:23:01 -0400 Subject: [PATCH] MUSICPOSITION -> MUSICPOS * Added muspos level header var to lua # Conflicts: # src/dehacked.c # src/lua_maplib.c # src/p_setup.c --- src/dehacked.c | 6 +++--- src/doomstat.h | 2 +- src/lua_maplib.c | 2 ++ src/p_setup.c | 2 +- src/s_sound.c | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 3786a805a..0bb118682 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1151,8 +1151,8 @@ static void readlevelheader(MYFILE *f, INT32 num) #endif else if (fastcmp(word, "MUSICTRACK")) mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1); - else if (fastcmp(word, "MUSICPOSITION")) - mapheaderinfo[num-1]->musposition = (UINT32)get_number(word2); + else if (fastcmp(word, "MUSICPOS")) + mapheaderinfo[num-1]->muspos = (UINT32)get_number(word2); else if (fastcmp(word, "FORCECHARACTER")) { strlcpy(mapheaderinfo[num-1]->forcecharacter, word2, SKINNAMESIZE+1); @@ -1449,7 +1449,7 @@ static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum) { cutscenes[num]->scene[scenenum].musswitchflags = ((UINT16)i) & MUSIC_TRACKMASK; } - else if (fastcmp(word, "MUSICPOSITION")) + else if (fastcmp(word, "MUSICPOS")) { cutscenes[num]->scene[scenenum].musswitchposition = (UINT32)get_number(word2); } diff --git a/src/doomstat.h b/src/doomstat.h index 610c21941..723132ff6 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -225,7 +225,7 @@ typedef struct INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end. char musname[7]; ///< Music track to play. "" for no music. UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore. - UINT32 musposition; ///< Music position to jump to. + UINT32 muspos; ///< Music position to jump to. char forcecharacter[17]; ///< (SKINNAMESIZE+1) Skin to switch to or "" to disable. UINT8 weather; ///< 0 = sunny day, 1 = storm, 2 = snow, 3 = rain, 4 = blank, 5 = thunder w/o rain, 6 = rain w/o lightning, 7 = heat wave. INT16 skynum; ///< Sky number to use. diff --git a/src/lua_maplib.c b/src/lua_maplib.c index b929fc0bc..c0ce46030 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1760,6 +1760,8 @@ static int mapheaderinfo_get(lua_State *L) lua_pushstring(L, header->musname); else if (fastcmp(field,"mustrack")) lua_pushinteger(L, header->mustrack); + else if (fastcmp(field,"muspos")) + lua_pushinteger(L, header->muspos); else if (fastcmp(field,"forcecharacter")) lua_pushstring(L, header->forcecharacter); else if (fastcmp(field,"weather")) diff --git a/src/p_setup.c b/src/p_setup.c index a579f65dd..d9330f175 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -208,7 +208,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i)); mapheaderinfo[num]->musname[6] = 0; mapheaderinfo[num]->mustrack = 0; - mapheaderinfo[num]->musposition = 0; + mapheaderinfo[num]->muspos = 0; mapheaderinfo[num]->forcecharacter[0] = '\0'; mapheaderinfo[num]->weather = 0; mapheaderinfo[num]->skynum = 1; diff --git a/src/s_sound.c b/src/s_sound.c index 604b710ee..03e724a4d 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1741,7 +1741,7 @@ void S_Start(void) strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7); mapmusname[6] = 0; mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK); - mapmusposition = mapheaderinfo[gamemap-1]->musposition; + mapmusposition = mapheaderinfo[gamemap-1]->muspos; } if (cv_resetmusic.value)