From ac3601e12c1ea068345923d85dfbefa3f4caad33 Mon Sep 17 00:00:00 2001 From: Silent Date: Thu, 7 Mar 2024 23:34:15 +0100 Subject: [PATCH] III: Apply bilinear filtering on the player skin --- SilentPatchIII/SilentPatchIII.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/SilentPatchIII/SilentPatchIII.cpp b/SilentPatchIII/SilentPatchIII.cpp index 33ae8d2..d09faea 100644 --- a/SilentPatchIII/SilentPatchIII.cpp +++ b/SilentPatchIII/SilentPatchIII.cpp @@ -530,6 +530,19 @@ namespace RemoveDriverStatusFix } +// ============= Apply bilinear filtering on the player skin ============= +namespace SkinTextureFilter +{ + static RwTexture* (*orgRwTextureCreate)(RwRaster* raster); + static RwTexture* RwTextureCreate_SetLinearFilter(RwRaster* raster) + { + RwTexture* texture = orgRwTextureCreate(raster); + RwTextureSetFilterMode(texture, rwFILTERLINEAR); + return texture; + } +} + + void InjectDelayedPatches_III_Common( bool bHasDebugMenu, const wchar_t* wcModulePath ) { using namespace Memory; @@ -1308,9 +1321,17 @@ void Patch_III_Common() // By Nick007J { auto pickNodeRandomly = get_pattern("3B 44 24 24 74 09", 4); - Patch(pickNodeRandomly, 0x75); } + + + // Apply bilinear filtering on the player skin + { + using namespace SkinTextureFilter; + + auto getSkinTexture = get_pattern("E8 ? ? ? ? 89 C3 59 55"); + InterceptCall(getSkinTexture, orgRwTextureCreate, RwTextureCreate_SetLinearFilter); + } } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)