mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 19:01:50 +00:00
Add results screen
This commit is contained in:
parent
35d0cb8eaa
commit
c4525a61a2
7 changed files with 186 additions and 1 deletions
|
|
@ -50,6 +50,7 @@ extern "C" {
|
||||||
#include "../m_cond.h"
|
#include "../m_cond.h"
|
||||||
#include "../r_skins.h"
|
#include "../r_skins.h"
|
||||||
#include "../k_battle.h"
|
#include "../k_battle.h"
|
||||||
|
#include "../k_podium.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "call-funcs.hpp"
|
#include "call-funcs.hpp"
|
||||||
|
|
@ -1393,3 +1394,17 @@ bool CallFunc_PodiumPosition(ACSVM::Thread *thread, const ACSVM::Word *argV, ACS
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
bool CallFunc_PodiumFinish(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC)
|
||||||
|
|
||||||
|
Ends the podium sequence. Doesn't do anything
|
||||||
|
outside of podium maps.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
bool CallFunc_PodiumFinish(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC)
|
||||||
|
{
|
||||||
|
(void)argV;
|
||||||
|
(void)argC;
|
||||||
|
|
||||||
|
K_FinishCeremony();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,5 +86,6 @@ bool CallFunc_LowestLap(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::W
|
||||||
bool CallFunc_EncoreMode(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
bool CallFunc_EncoreMode(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||||
|
|
||||||
bool CallFunc_PodiumPosition(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
bool CallFunc_PodiumPosition(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||||
|
bool CallFunc_PodiumFinish(ACSVM::Thread *thread, const ACSVM::Word *argV, ACSVM::Word argC);
|
||||||
|
|
||||||
#endif // __SRB2_ACS_CALL_FUNCS_HPP__
|
#endif // __SRB2_ACS_CALL_FUNCS_HPP__
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ Environment::Environment()
|
||||||
|
|
||||||
addFuncDataACS0( 500, addCallFunc(CallFunc_CameraWait));
|
addFuncDataACS0( 500, addCallFunc(CallFunc_CameraWait));
|
||||||
addFuncDataACS0( 501, addCallFunc(CallFunc_PodiumPosition));
|
addFuncDataACS0( 501, addCallFunc(CallFunc_PodiumPosition));
|
||||||
|
addFuncDataACS0( 502, addCallFunc(CallFunc_PodiumFinish));
|
||||||
}
|
}
|
||||||
|
|
||||||
ACSVM::Thread *Environment::allocThread()
|
ACSVM::Thread *Environment::allocThread()
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@
|
||||||
#include "m_random.h" // P_ClearRandom
|
#include "m_random.h" // P_ClearRandom
|
||||||
#include "k_specialstage.h"
|
#include "k_specialstage.h"
|
||||||
#include "acs/interface.h"
|
#include "acs/interface.h"
|
||||||
|
#include "k_podium.h"
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
#include "hardware/hw_main.h" // 3D View Rendering
|
#include "hardware/hw_main.h" // 3D View Rendering
|
||||||
|
|
@ -580,6 +581,11 @@ static void D_Display(void)
|
||||||
F_TitleScreenDrawer();
|
F_TitleScreenDrawer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case GS_CEREMONY:
|
||||||
|
{
|
||||||
|
K_CeremonyDrawer();
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1471,6 +1471,8 @@ void G_DoLoadLevelEx(boolean resetplayer, gamestate_t newstate)
|
||||||
if (gamestate == GS_VOTING)
|
if (gamestate == GS_VOTING)
|
||||||
Y_EndVote();
|
Y_EndVote();
|
||||||
|
|
||||||
|
K_ResetCeremony();
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
// Is this actually necessary? Doesn't F_StartTitleScreen already do a significantly more comprehensive check?
|
// Is this actually necessary? Doesn't F_StartTitleScreen already do a significantly more comprehensive check?
|
||||||
if (newstate == GS_TITLESCREEN)
|
if (newstate == GS_TITLESCREEN)
|
||||||
|
|
@ -1724,7 +1726,11 @@ boolean G_Responder(event_t *ev)
|
||||||
return true; // chat ate the event
|
return true; // chat ate the event
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo
|
if (K_CeremonyResponder(ev))
|
||||||
|
{
|
||||||
|
D_StartTitle();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (gamestate == GS_CONTINUING)
|
else if (gamestate == GS_CONTINUING)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
107
src/k_podium.c
107
src/k_podium.c
|
|
@ -46,6 +46,8 @@
|
||||||
#include "k_menu.h"
|
#include "k_menu.h"
|
||||||
#include "k_grandprix.h"
|
#include "k_grandprix.h"
|
||||||
|
|
||||||
|
static boolean s_podiumDone = false;
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
boolean K_PodiumSequence(void)
|
boolean K_PodiumSequence(void)
|
||||||
|
|
||||||
|
|
@ -103,6 +105,31 @@ boolean K_StartCeremony(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void K_FinishCeremony(void)
|
||||||
|
|
||||||
|
See header file for description.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
void K_FinishCeremony(void)
|
||||||
|
{
|
||||||
|
if (K_PodiumSequence() == false)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_podiumDone = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void K_ResetCeremony(void)
|
||||||
|
|
||||||
|
See header file for description.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
void K_ResetCeremony(void)
|
||||||
|
{
|
||||||
|
s_podiumDone = false;
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
void K_CeremonyTicker(boolean run)
|
void K_CeremonyTicker(boolean run)
|
||||||
|
|
||||||
|
|
@ -130,3 +157,83 @@ void K_CeremonyTicker(boolean run)
|
||||||
camera[0].subsector = titlemapcam.mobj->subsector;
|
camera[0].subsector = titlemapcam.mobj->subsector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
boolean K_CeremonyResponder(event_t *event)
|
||||||
|
|
||||||
|
See header file for description.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
boolean K_CeremonyResponder(event_t *event)
|
||||||
|
{
|
||||||
|
INT32 key = event->data1;
|
||||||
|
|
||||||
|
if (s_podiumDone == false)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remap virtual keys (mouse & joystick buttons)
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case KEY_MOUSE1:
|
||||||
|
key = KEY_ENTER;
|
||||||
|
break;
|
||||||
|
case KEY_MOUSE1 + 1:
|
||||||
|
key = KEY_BACKSPACE;
|
||||||
|
break;
|
||||||
|
case KEY_JOY1:
|
||||||
|
case KEY_JOY1 + 2:
|
||||||
|
key = KEY_ENTER;
|
||||||
|
break;
|
||||||
|
case KEY_JOY1 + 3:
|
||||||
|
key = 'n';
|
||||||
|
break;
|
||||||
|
case KEY_JOY1 + 1:
|
||||||
|
key = KEY_BACKSPACE;
|
||||||
|
break;
|
||||||
|
case KEY_HAT1:
|
||||||
|
key = KEY_UPARROW;
|
||||||
|
break;
|
||||||
|
case KEY_HAT1 + 1:
|
||||||
|
key = KEY_DOWNARROW;
|
||||||
|
break;
|
||||||
|
case KEY_HAT1 + 2:
|
||||||
|
key = KEY_LEFTARROW;
|
||||||
|
break;
|
||||||
|
case KEY_HAT1 + 3:
|
||||||
|
key = KEY_RIGHTARROW;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event->type != ev_keydown)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void K_CeremonyDrawer(void)
|
||||||
|
|
||||||
|
See header file for description.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
void K_CeremonyDrawer(void)
|
||||||
|
{
|
||||||
|
if (s_podiumDone == true)
|
||||||
|
{
|
||||||
|
V_DrawFadeScreen(0xFF00, 16);
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH / 2, 64, 0, "STUFF GOES HERE");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (timeinmap < 16)
|
||||||
|
{
|
||||||
|
// Level fade-in
|
||||||
|
V_DrawCustomFadeScreen(((levelfadecol == 0) ? "FADEMAP1" : "FADEMAP0"), 31-(timeinmap*2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,27 @@ boolean K_PodiumSequence(void);
|
||||||
boolean K_StartCeremony(void);
|
boolean K_StartCeremony(void);
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void K_FinishCeremony(void);
|
||||||
|
|
||||||
|
Called at the end of the podium cutscene,
|
||||||
|
displays the ranking screen and starts
|
||||||
|
accepting input.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
|
||||||
|
void K_FinishCeremony(void);
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void K_ResetCeremony(void);
|
||||||
|
|
||||||
|
Called on level load, to reset all of the
|
||||||
|
podium variables.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
|
||||||
|
void K_ResetCeremony(void);
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
void K_CeremonyTicker(boolean run);
|
void K_CeremonyTicker(boolean run);
|
||||||
|
|
||||||
|
|
@ -72,6 +93,34 @@ boolean K_StartCeremony(void);
|
||||||
void K_CeremonyTicker(boolean run);
|
void K_CeremonyTicker(boolean run);
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void K_CeremonyResponder(event_t *ev);
|
||||||
|
|
||||||
|
Responder function to be ran during the podium
|
||||||
|
cutscene mode gamestate. Handles key presses
|
||||||
|
ending the podium scene.
|
||||||
|
|
||||||
|
Input Arguments:-
|
||||||
|
ev - The player input event.
|
||||||
|
|
||||||
|
Return:-
|
||||||
|
true to end the podium cutscene and return
|
||||||
|
to the title screen, otherwise false.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
|
||||||
|
boolean K_CeremonyResponder(event_t *ev);
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void K_CeremonyDrawer(void);
|
||||||
|
|
||||||
|
Handles the ranking screen and other HUD for
|
||||||
|
the podium cutscene.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
|
||||||
|
void K_CeremonyDrawer(void);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue