[Materials] Add material compare hook.
- It takes forever to run with it on because there are so many comparisons and logging it takes a while
This commit is contained in:
parent
43db338a5a
commit
b3e6da21dc
@ -126,6 +126,24 @@ namespace Components
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
int Materials::MaterialComparePrint(Game::Material* m1, Game::Material* m2)
|
||||
{
|
||||
static Game::Material* a = m1;
|
||||
static Game::Material* b = m2;
|
||||
int result = 0;
|
||||
__asm
|
||||
{
|
||||
push m1
|
||||
push m2
|
||||
mov eax, 0x5235B0
|
||||
call eax
|
||||
add esp, 8
|
||||
mov result, eax
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Materials::Materials()
|
||||
@ -160,6 +178,9 @@ namespace Components
|
||||
Utils::Hook::Nop(0x51F5AC, 5);
|
||||
Utils::Hook::Nop(0x51F4C4, 5);
|
||||
}
|
||||
|
||||
Logger::Print("%d\n", sizeof(int (*)(Game::Material*, Game::Material*)));
|
||||
Utils::Hook::Set<int (*)(Game::Material*, Game::Material*)>(0x523894, static_cast<int (*)(Game::Material*, Game::Material*)>(Materials::MaterialComparePrint));
|
||||
#endif
|
||||
|
||||
// Renderer::OnFrame([] ()
|
||||
|
@ -28,6 +28,7 @@ namespace Components
|
||||
#ifdef DEBUG
|
||||
static void DumpImageCfg(int, const char*, const char* material);
|
||||
static void DumpImageCfgPath(int, const char*, const char* material);
|
||||
static int MaterialComparePrint(Game::Material* m1, Game::Material* m2);
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user