tlac: rename DrawSprites stuff to Draw2D, use a better hook for it
This commit is contained in:
@@ -143,11 +143,11 @@ namespace TLAC::Components
|
||||
}
|
||||
}
|
||||
|
||||
void ComponentsManager::UpdateDrawSprites()
|
||||
void ComponentsManager::UpdateDraw2D()
|
||||
{
|
||||
for (auto& component : components)
|
||||
{
|
||||
component->UpdateDrawSprites();
|
||||
component->UpdateDraw2D();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace TLAC::Components
|
||||
void Update();
|
||||
void UpdateInput();
|
||||
void UpdatePostInput();
|
||||
void UpdateDrawSprites();
|
||||
void UpdateDraw2D();
|
||||
void OnFocusGain();
|
||||
void OnFocusLost();
|
||||
void Dispose();
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace TLAC::Components
|
||||
|
||||
virtual void UpdateInput() {};
|
||||
virtual void UpdatePostInput() {};
|
||||
virtual void UpdateDrawSprites() {};
|
||||
virtual void UpdateDraw2D() {};
|
||||
virtual void OnFocusGain() {};
|
||||
virtual void OnFocusLost() {};
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace TLAC::Components
|
||||
}
|
||||
}
|
||||
|
||||
void Pause::UpdateDrawSprites()
|
||||
void Pause::UpdateDraw2D()
|
||||
{
|
||||
if (isPaused && showUI)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace TLAC::Components
|
||||
virtual void Initialize(ComponentsManager*) override;
|
||||
virtual void Update() override;
|
||||
virtual void UpdatePostInput() override;
|
||||
virtual void UpdateDrawSprites() override;
|
||||
virtual void UpdateDraw2D() override;
|
||||
|
||||
static bool pause; // set pause to change pause state
|
||||
static bool giveUp; // set give up to end current song
|
||||
|
||||
@@ -8,7 +8,7 @@ constexpr uint8_t JNE_OPCODE = 0x85;
|
||||
|
||||
//constexpr uint64_t ENGINE_UPDATE_HOOK_TARGET_ADDRESS = 0x000000014018CC40;
|
||||
constexpr uint64_t ENGINE_UPDATE_INPUT_ADDRESS = 0x000000014018CBB0;
|
||||
constexpr uint64_t ENGINE_DRAW_SPRITES_ADDRESS = 0x0000000140500EA0;
|
||||
constexpr uint64_t ENGINE_DRAW_2D_ADDRESS = 0x0000000140501F70;
|
||||
constexpr uint64_t ENGINE_FINISH_DRAW_ADDRESS = 0x0000000140192730;
|
||||
|
||||
constexpr uint64_t CURRENT_GAME_STATE_ADDRESS = 0x0000000140EDA810;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#pragma comment(lib, "detours.lib")
|
||||
|
||||
void(__cdecl* divaEngineUpdate)() = (void(__cdecl*)())0x14018CC40;
|
||||
void(__cdecl* divaEngineDrawSprites)(void* addr, int idk) = (void(__cdecl*)(void* addr, int idk))ENGINE_DRAW_SPRITES_ADDRESS;
|
||||
void(__cdecl* divaEngineDraw2D)(void* addr) = (void(__cdecl*)(void* addr))ENGINE_DRAW_2D_ADDRESS;
|
||||
|
||||
LRESULT CALLBACK MessageWindowProcessCallback(HWND, UINT, WPARAM, LPARAM);
|
||||
DWORD WINAPI WindowMessageDispatcher(LPVOID);
|
||||
@@ -127,9 +127,9 @@ namespace TLAC
|
||||
ComponentsManager.OnFocusLost();
|
||||
}
|
||||
|
||||
void UpdateDrawSprites()
|
||||
void UpdateDraw2D()
|
||||
{
|
||||
ComponentsManager.UpdateDrawSprites();
|
||||
ComponentsManager.UpdateDraw2D();
|
||||
}
|
||||
|
||||
void InitializeExtraSettings()
|
||||
@@ -348,11 +348,10 @@ void hookedEngineUpdate()
|
||||
//divaEngineUpdate();
|
||||
}
|
||||
|
||||
void hookedEngineDrawSprites(void* addr, int idk)
|
||||
void hookedEngineDraw2D(void* addr)
|
||||
{
|
||||
divaEngineDrawSprites(addr, idk);
|
||||
if (idk == 0x0a)
|
||||
TLAC::UpdateDrawSprites();
|
||||
TLAC::UpdateDraw2D();
|
||||
divaEngineDraw2D(addr);
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||
@@ -378,7 +377,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReser
|
||||
|
||||
DetourTransactionBegin();
|
||||
DetourUpdateThread(GetCurrentThread());
|
||||
DetourAttach(&(PVOID&)divaEngineDrawSprites, hookedEngineDrawSprites);
|
||||
DetourAttach(&(PVOID&)divaEngineDraw2D, hookedEngineDraw2D);
|
||||
DetourTransactionCommit();
|
||||
|
||||
TLAC::InitializeExtraSettings();
|
||||
|
||||
Reference in New Issue
Block a user