mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
S_UpdateSoundTest: Add a "dotracks" parameter
- Integrates the maps with multiple tracks into the Next/Prev sequence, if true. - For testing, currently active - but I may add features later that would be more fitting.
This commit is contained in:
parent
4f4976024c
commit
8bd3786895
3 changed files with 25 additions and 7 deletions
|
|
@ -15,7 +15,7 @@ static void M_SoundTestMainControl(INT32 choice)
|
|||
{
|
||||
soundtest.playing = true;
|
||||
//soundtest.sequence = true;
|
||||
S_UpdateSoundTestDef(false, false);
|
||||
S_UpdateSoundTestDef(false, false, false);
|
||||
}
|
||||
else if (cv_soundtest.value != 0)
|
||||
{
|
||||
|
|
@ -44,7 +44,7 @@ static void M_SoundTestNextPrev(INT32 choice)
|
|||
{
|
||||
(void)choice;
|
||||
|
||||
S_UpdateSoundTestDef((currentMenu->menuitems[itemOn].mvar1 < 0), false);
|
||||
S_UpdateSoundTestDef((currentMenu->menuitems[itemOn].mvar1 < 0), true, false);
|
||||
}
|
||||
|
||||
static void M_SoundTestTrack(INT32 choice)
|
||||
|
|
|
|||
|
|
@ -1475,7 +1475,7 @@ static boolean S_SoundTestDefLocked(musicdef_t *def)
|
|||
return M_MapLocked(def->sequence.map+1);
|
||||
}
|
||||
|
||||
void S_UpdateSoundTestDef(boolean reverse, boolean skipnull)
|
||||
void S_UpdateSoundTestDef(boolean reverse, boolean dotracks, boolean skipnull)
|
||||
{
|
||||
musicdef_t *newdef;
|
||||
|
||||
|
|
@ -1483,6 +1483,13 @@ void S_UpdateSoundTestDef(boolean reverse, boolean skipnull)
|
|||
|
||||
if (reverse == false)
|
||||
{
|
||||
if (dotracks == true && soundtest.current != NULL
|
||||
&& soundtest.currenttrack < soundtest.current->numtracks-1)
|
||||
{
|
||||
soundtest.currenttrack++;
|
||||
goto updatetrackonly;
|
||||
}
|
||||
|
||||
newdef = (soundtest.current != NULL)
|
||||
? soundtest.current->sequence.next
|
||||
: soundtest.sequence.next;
|
||||
|
|
@ -1499,10 +1506,17 @@ void S_UpdateSoundTestDef(boolean reverse, boolean skipnull)
|
|||
{
|
||||
musicdef_t *def, *lastdef = NULL;
|
||||
|
||||
if (dotracks == true && soundtest.current != NULL
|
||||
&& soundtest.currenttrack > 0)
|
||||
{
|
||||
soundtest.currenttrack--;
|
||||
goto updatetrackonly;
|
||||
}
|
||||
|
||||
if (soundtest.current == soundtest.sequence.next
|
||||
&& skipnull == false)
|
||||
{
|
||||
goto conclusion;
|
||||
goto updatecurrent;
|
||||
}
|
||||
|
||||
for (def = soundtest.sequence.next; def; def = def->sequence.next)
|
||||
|
|
@ -1522,10 +1536,14 @@ void S_UpdateSoundTestDef(boolean reverse, boolean skipnull)
|
|||
}
|
||||
}
|
||||
|
||||
conclusion:
|
||||
updatecurrent:
|
||||
soundtest.current = newdef;
|
||||
soundtest.currenttrack = 0;
|
||||
soundtest.currenttrack =
|
||||
(reverse == true && dotracks == true && newdef != NULL)
|
||||
? newdef->numtracks-1
|
||||
: 0;
|
||||
|
||||
updatetrackonly:
|
||||
if (soundtest.playing == true)
|
||||
{
|
||||
S_SoundTestPlay();
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ extern struct soundtest
|
|||
} soundtest;
|
||||
|
||||
void S_PopulateSoundTestSequence(void);
|
||||
void S_UpdateSoundTestDef(boolean reverse, boolean skipnull);
|
||||
void S_UpdateSoundTestDef(boolean reverse, boolean dotracks, boolean skipnull);
|
||||
void S_SoundTestPlay(void);
|
||||
void S_SoundTestStop(boolean pause);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue