III: Apply bilinear filtering on the player skin

This commit is contained in:
Silent 2024-03-07 23:34:15 +01:00
parent 50c6a9bda3
commit ac3601e12c
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1

View File

@ -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<uint8_t>(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)