Skip to content

Commit

Permalink
Underworld font readiness
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIndra55 committed Aug 18, 2024
1 parent 4fb82e9 commit 6efd22e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ void Options::DrawOptions() noexcept
{
ImGui::Begin("Options", &m_show);

#ifndef TR8
if (ImGui::CollapsingHeader("General"))
{
DrawComboOption("IntroSkip", "Legal screen and intros", { "Don't skip", "Skip legal", "Skip legal and intros" });
DrawCheckOption("NoCinematicBars", "Disable cinematic bars");
DrawCheckOption("NoMotionBlur", "Disable motion blur");
}
#endif

if (ImGui::CollapsingHeader("Camera"))
{
Expand Down
11 changes: 10 additions & 1 deletion src/game/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct VertexPool;

enum MainState
{
#ifndef TR8
MS_NONE,
MS_PLAYGAME,
MS_LOADLEVEL,
Expand All @@ -20,7 +21,15 @@ enum MainState
MS_SHOW_STATIC_SCREEN,
MS_QUITGAME,
MS_PLAY_DARKCHRONICLE_CINEMATIC,
MS_PLAY_DARKCHRONICLE_CINEMATICMOVIE,
MS_PLAY_DARKCHRONICLE_CINEMATICMOVIE
#else
MS_NONE,
MS_PLAYGAME,
MS_LOADLEVEL,
MS_PLAY_CINEMATIC = 5,
MS_SHOW_STATIC_SCREEN = 6,
MS_DISPLAY_MAIN_MENU = 10
#endif
};

struct WipeInfo
Expand Down
2 changes: 1 addition & 1 deletion src/modules/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void MainMenu::OnFrame()
{
#ifndef TR8
// Shows the watermark in th main menu
auto mainState = *(int*)GET_ADDRESS(0x10E5868, 0x838838, 0x000000);
auto mainState = *(int*)GET_ADDRESS(0x10E5868, 0x838838, 0xE7ED60);

if (mainState == MS_DISPLAY_MAIN_MENU && !m_noWatermark.GetValue())
{
Expand Down
8 changes: 4 additions & 4 deletions src/render/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void Font::GetCursor(float* x, float* y) noexcept

void Font::SetScale(float scaleX, float scaleY) noexcept
{
auto addr = GET_ADDRESS(0x431860, 0x433E60, 0x000000);
auto addr = GET_ADDRESS(0x431860, 0x433E60, 0x474D50);

Hooking::Call(addr, scaleX, scaleY);
}
Expand Down Expand Up @@ -87,14 +87,14 @@ void Font::PrintFormatted(const char* formatted, int backdrop) const noexcept

float Font::GetTextWidth(const char* text) const noexcept
{
auto addr = GET_ADDRESS(0x431EA0, 0x434510, 0x000000);
auto addr = GET_ADDRESS(0x431EA0, 0x434510, 0x4758C0);

return Hooking::ThisCallReturn<float>(addr, this, text);
}

float Font::GetHeight() const noexcept
{
auto addr = GET_ADDRESS(0x431E20, 0x434440, 0x000000);
auto addr = GET_ADDRESS(0x431E20, 0x434440, 0x475870);

return Hooking::ThisCallReturn<float>(addr, this);
}
Expand All @@ -104,7 +104,7 @@ void Font::OnFlush(std::function<void()> callback) noexcept
if (!s_callback)
{
// TODO pattern
auto addr = GET_ADDRESS(0x432570, 0x434C40, 0x476D80);
auto addr = GET_ADDRESS(0x432570, 0x434C40, 0x5C5A30);

MH_CreateHook((void*)addr, Flush, (void**)&s_Flush);
MH_EnableHook(MH_ALL_HOOKS);
Expand Down

0 comments on commit 6efd22e

Please sign in to comment.