MUSICPOSITION -> MUSICPOS

* Added muspos level header var to lua
This commit is contained in:
mazmazz 2018-08-25 16:21:34 -04:00
parent 26d309992a
commit 6bb5280fbc
5 changed files with 8 additions and 6 deletions

View file

@ -1151,8 +1151,8 @@ static void readlevelheader(MYFILE *f, INT32 num)
#endif #endif
else if (fastcmp(word, "MUSICTRACK")) else if (fastcmp(word, "MUSICTRACK"))
mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1); mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1);
else if (fastcmp(word, "MUSICPOSITION")) else if (fastcmp(word, "MUSICPOS"))
mapheaderinfo[num-1]->musposition = (UINT32)get_number(word2); mapheaderinfo[num-1]->muspos = (UINT32)get_number(word2);
else if (fastcmp(word, "MUSICPOSTBOSS")) else if (fastcmp(word, "MUSICPOSTBOSS"))
deh_strlcpy(mapheaderinfo[num-1]->muspostbossname, word2, deh_strlcpy(mapheaderinfo[num-1]->muspostbossname, word2,
sizeof(mapheaderinfo[num-1]->muspostbossname), va("Level header %d: post-boss music", num)); sizeof(mapheaderinfo[num-1]->muspostbossname), va("Level header %d: post-boss music", num));
@ -1456,7 +1456,7 @@ static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum)
{ {
cutscenes[num]->scene[scenenum].musswitchflags = ((UINT16)i) & MUSIC_TRACKMASK; 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); cutscenes[num]->scene[scenenum].musswitchposition = (UINT32)get_number(word2);
} }

View file

@ -225,7 +225,7 @@ typedef struct
INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end. INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end.
char musname[7]; ///< Music track to play. "" for no music. 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. 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. 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. 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. INT16 skynum; ///< Sky number to use.

View file

@ -1760,6 +1760,8 @@ static int mapheaderinfo_get(lua_State *L)
lua_pushstring(L, header->musname); lua_pushstring(L, header->musname);
else if (fastcmp(field,"mustrack")) else if (fastcmp(field,"mustrack"))
lua_pushinteger(L, header->mustrack); lua_pushinteger(L, header->mustrack);
else if (fastcmp(field,"muspos"))
lua_pushinteger(L, header->muspos);
else if (fastcmp(field,"muspostbossname")) else if (fastcmp(field,"muspostbossname"))
lua_pushstring(L, header->muspostbossname); lua_pushstring(L, header->muspostbossname);
else if (fastcmp(field,"muspostbosstrack")) else if (fastcmp(field,"muspostbosstrack"))

View file

@ -208,7 +208,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i)); snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i));
mapheaderinfo[num]->musname[6] = 0; mapheaderinfo[num]->musname[6] = 0;
mapheaderinfo[num]->mustrack = 0; mapheaderinfo[num]->mustrack = 0;
mapheaderinfo[num]->musposition = 0; mapheaderinfo[num]->muspos = 0;
mapheaderinfo[num]->muspostbossname[6] = 0; mapheaderinfo[num]->muspostbossname[6] = 0;
mapheaderinfo[num]->muspostbosstrack = 0; mapheaderinfo[num]->muspostbosstrack = 0;
mapheaderinfo[num]->muspostbosspos = 0; mapheaderinfo[num]->muspostbosspos = 0;

View file

@ -1741,7 +1741,7 @@ void S_Start(void)
strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7); strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7);
mapmusname[6] = 0; mapmusname[6] = 0;
mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK); mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK);
mapmusposition = mapheaderinfo[gamemap-1]->musposition; mapmusposition = mapheaderinfo[gamemap-1]->muspos;
} }
if (cv_resetmusic.value) if (cv_resetmusic.value)