Skip to content

Commit

Permalink
jkCredits misc
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyquagsire23 committed Dec 14, 2021
1 parent fe32020 commit 47b5258
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 6 deletions.
16 changes: 16 additions & 0 deletions src/Main/jkCredits.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,19 @@ void jkCredits_Initialize(char *fpath)
jkCredits_fontSmall = stdFont_Load("ui\\sft\\creditsmall.sft", 0, 0);
jkCredits_bInitted = 1;
}

void jkCredits_Shutdown()
{
if ( jkCredits_fontLarge )
{
stdFont_Free(jkCredits_fontLarge);
jkCredits_fontLarge = 0;
}
if ( jkCredits_fontSmall )
{
stdFont_Free(jkCredits_fontSmall);
jkCredits_fontSmall = 0;
}
stdStrTable_Free(&jkCredits_table);
jkCredits_bInitted = 0;
}
7 changes: 5 additions & 2 deletions src/Main/jkCredits.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
#define jkCredits_Shutdown_ADDR (0x00421710)
#define jkCredits_Show_ADDR (0x00421760)
#define jkCredits_Skip_ADDR (0x00421AC0)
#define jkCredits_sub_421B50_ADDR (0x00421B50)
#define jkCredits_Tick_ADDR (0x00421B50)
#define jkCredits_Handler_ADDR (0x00421F60)

void jkCredits_Initialize(char *fpath);
void jkCredits_Shutdown();

static void (*jkCredits_Shutdown)() = (void*)jkCredits_Shutdown_ADDR;
static int (*jkCredits_Show)() = (void*)jkCredits_Show_ADDR;
static void (*jkCredits_Skip)() = (void*)jkCredits_Skip_ADDR;
static int (*jkCredits_Tick)() = (void*)jkCredits_Tick_ADDR;

//static void (*jkCredits_Initialize)() = (void*)jkCredits_Initialize_ADDR;

Expand Down
9 changes: 9 additions & 0 deletions src/Main/jkHud.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,3 +1041,12 @@ void jkHud_Tally()
break;
}
}

void jkHud_idk_time()
{
jkHud_chatStrPos = 0;
jkHud_bChatOpen = 0;
jkDev_sub_41FC90(103);
stdControl_Flush();
stdControl_bDisableKeyboard = 0;
}
3 changes: 2 additions & 1 deletion src/Main/jkHud.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ void jkHud_EndTarget();
int jkHud_SortPlayerScore(const jkHudPlayerScore *a1, const jkHudPlayerScore *a2);
int jkHud_SortTeamScore(const jkHudTeamScore *a1, const jkHudTeamScore *a2);
void jkHud_Tally();
void jkHud_idk_time();

//static int (*jkHud_Startup)() = (void*)jkHud_Startup_ADDR;
//static void (*jkHud_Shutdown)() = (void*)jkHud_Shutdown_ADDR;
//static void (*jkHud_Chat)() = (void*)jkHud_Chat_ADDR;
//static void (*jkHud_Tally)() = (void*)jkHud_Tally_ADDR;

//static int (*jkHud_ClearRects)() = (void*)jkHud_ClearRects_ADDR;
static void (*jkHud_idk_time)() = (void*)jkHud_idk_time_ADDR;
//static void (*jkHud_idk_time)() = (void*)jkHud_idk_time_ADDR;
//static void (*jkHud_SendChat)(char a1) = (void*)jkHud_SendChat_ADDR;
//static void (*jkHud_Draw)() = (void*)jkHud_Draw_ADDR;
//static void (*jkHud_Close)() = (void*)jkHud_Close_ADDR;
Expand Down
31 changes: 28 additions & 3 deletions src/Main/jkMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "Engine/sithTime.h"
#include "Main/jkSmack.h"
#include "Main/jkGame.h"
#include "Main/jkCredits.h"
#include "Main/jkCutscene.h"
#include "Main/jkHudInv.h"
#include "Main/jkHud.h"
Expand Down Expand Up @@ -54,9 +55,6 @@
#define jkMain_CutsceneShow ((void*)(0x00404450))
#define jkMain_CutsceneTick ((void*)(0x00404460))
#define jkMain_CutsceneLeave ((void*)(0x00404470))
#define jkMain_CreditsShow ((void*)(0x00404480))
#define jkMain_CreditsTick ((void*)(0x004044B0))
#define jkMain_CreditsLeave ((void*)(0x004044E0))

static jkEpisodeEntry* jkMain_pEpisodeEnt = NULL;
static jkEpisodeEntry* jkMain_pEpisodeEnt2 = NULL;
Expand Down Expand Up @@ -1094,6 +1092,33 @@ void jkMain_VideoLeave(int a1, int a2)
jkMain_CdSwitch(0, 1);
}

void jkMain_CreditsShow()
{
if ( !jkCredits_Show() )
{
if ( jkGuiRend_thing_five )
jkGuiRend_thing_four = 1;
jkSmack_stopTick = 1;
jkSmack_nextGuiState = 3;
}
}

void jkMain_CreditsTick()
{
if ( jkCredits_Tick() )
{
if ( jkGuiRend_thing_five )
jkGuiRend_thing_four = 1;
jkSmack_stopTick = 1;
jkSmack_nextGuiState = 3;
}
}

void jkMain_CreditsLeave()
{
jkCredits_Skip();
}

#ifdef SDL2_RENDER
void jkMain_FixRes()
{
Expand Down
4 changes: 4 additions & 0 deletions src/Main/jkMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ void jkMain_VideoShow(int a1, int a2);
void jkMain_VideoTick(int a2);
void jkMain_VideoLeave(int a1, int a2);

void jkMain_CreditsShow();
void jkMain_CreditsTick();
void jkMain_CreditsLeave();

//static int (*jkMain_loadFile)(char *a1) = (void*)jk_loadFile_ADDR;;

//static int (*jkMain_EndLevel)(int a1) = (void*)jkMain_EndLevel_ADDR;
Expand Down

0 comments on commit 47b5258

Please sign in to comment.