mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
ACS: add Music_Dim function, API to g_musicfade
This commit is contained in:
parent
de651b6d6c
commit
78da8bb816
3 changed files with 33 additions and 0 deletions
|
|
@ -2399,6 +2399,37 @@ bool CallFunc_MusicRemap(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
bool CallFunc_MusicDim(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC)
|
||||||
|
|
||||||
|
Fade level music into or out of silence.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
bool CallFunc_MusicDim(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC)
|
||||||
|
{
|
||||||
|
// 0: int fade time (tics) - time to fade between full volume and silence
|
||||||
|
// 1: [int duration (tics)] - silent duration (not including fade in and fade out), -1 = infinite (default if omitted)
|
||||||
|
|
||||||
|
// If a dim is ongoing, do not interrupt it
|
||||||
|
if (g_musicfade.start < leveltime && g_musicfade.end < leveltime)
|
||||||
|
{
|
||||||
|
g_musicfade.start = leveltime;
|
||||||
|
}
|
||||||
|
|
||||||
|
tic_t fade = argV[0];
|
||||||
|
tic_t duration = INFTICS;
|
||||||
|
|
||||||
|
if (argC > 1 && argV[1] >= 0)
|
||||||
|
{
|
||||||
|
duration = argV[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
g_musicfade.end = duration != INFTICS ? leveltime + duration + 2*fade : INFTICS;
|
||||||
|
g_musicfade.fade = fade;
|
||||||
|
g_musicfade.ticked = false;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
bool CallFunc_Freeze(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC)
|
bool CallFunc_Freeze(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ bool CallFunc_ExitLevel(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::W
|
||||||
bool CallFunc_MusicPlay(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
bool CallFunc_MusicPlay(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||||
bool CallFunc_MusicStopAll(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
bool CallFunc_MusicStopAll(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||||
bool CallFunc_MusicRemap(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
bool CallFunc_MusicRemap(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||||
|
bool CallFunc_MusicDim(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||||
|
|
||||||
bool CallFunc_DialogueSetSpeaker(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
bool CallFunc_DialogueSetSpeaker(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||||
bool CallFunc_DialogueSetCustomSpeaker(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
bool CallFunc_DialogueSetCustomSpeaker(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,7 @@ Environment::Environment()
|
||||||
addFuncDataACS0( 509, addCallFunc(CallFunc_MusicStopAll));
|
addFuncDataACS0( 509, addCallFunc(CallFunc_MusicStopAll));
|
||||||
addFuncDataACS0( 510, addCallFunc(CallFunc_MusicRemap));
|
addFuncDataACS0( 510, addCallFunc(CallFunc_MusicRemap));
|
||||||
addFuncDataACS0( 511, addCallFunc(CallFunc_Freeze));
|
addFuncDataACS0( 511, addCallFunc(CallFunc_Freeze));
|
||||||
|
addFuncDataACS0( 512, addCallFunc(CallFunc_MusicDim));
|
||||||
|
|
||||||
addFuncDataACS0( 600, addCallFunc(CallFunc_DialogueSetSpeaker));
|
addFuncDataACS0( 600, addCallFunc(CallFunc_DialogueSetSpeaker));
|
||||||
addFuncDataACS0( 601, addCallFunc(CallFunc_DialogueSetCustomSpeaker));
|
addFuncDataACS0( 601, addCallFunc(CallFunc_DialogueSetCustomSpeaker));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue