mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-26 04:51:43 +00:00
Special Stages: fade out music near the finish line
This commit is contained in:
parent
1a0b927cf2
commit
92c451538a
3 changed files with 41 additions and 0 deletions
|
|
@ -10663,6 +10663,12 @@ void K_KartUpdatePosition(player_t *player)
|
|||
player->topinfirst = 0;
|
||||
}
|
||||
|
||||
// Special stages: fade out music near the finish line
|
||||
if (P_IsLocalPlayer(player))
|
||||
{
|
||||
K_FadeOutSpecialMusic(player->distancetofinish);
|
||||
}
|
||||
|
||||
player->position = position;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "z_zone.h"
|
||||
#include "k_waypoint.h"
|
||||
#include "k_objects.h"
|
||||
#include "music.h"
|
||||
|
||||
struct specialstageinfo specialstageinfo;
|
||||
|
||||
|
|
@ -127,6 +128,11 @@ void K_TickSpecialStage(void)
|
|||
K_MoveExitBeam();
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
mobj_t *K_GetPossibleSpecialTarget(void)
|
||||
|
||||
See header file for description.
|
||||
--------------------------------------------------*/
|
||||
mobj_t *K_GetPossibleSpecialTarget(void)
|
||||
{
|
||||
if (specialstageinfo.valid == false)
|
||||
|
|
@ -141,3 +147,20 @@ mobj_t *K_GetPossibleSpecialTarget(void)
|
|||
|
||||
return specialstageinfo.ufo;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------
|
||||
void K_FadeOutSpecialMusic(UINT32 distance)
|
||||
|
||||
See header file for description.
|
||||
--------------------------------------------------*/
|
||||
void K_FadeOutSpecialMusic(UINT32 distance)
|
||||
{
|
||||
if (specialstageinfo.valid == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const UINT32 threshold = FixedMul(16000, mapobjectscale);
|
||||
|
||||
Music_LevelVolume(min(distance, threshold) * 100 / threshold);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,18 @@ void K_TickSpecialStage(void);
|
|||
|
||||
mobj_t *K_GetPossibleSpecialTarget(void);
|
||||
|
||||
/*--------------------------------------------------
|
||||
void K_FadeOutSpecialMusic(UINT32 distance)
|
||||
|
||||
Fade level music out at the end of a special stage.
|
||||
|
||||
Input Arguments:-
|
||||
distance - Distance from the finish line.
|
||||
|
||||
--------------------------------------------------*/
|
||||
|
||||
void K_FadeOutSpecialMusic(UINT32 distance);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue