mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 23:33:02 +05:00
Compare commits
5 commits
ee109033ce
...
acf0957110
Author | SHA1 | Date | |
---|---|---|---|
|
acf0957110 | ||
|
6a524dcf46 | ||
|
dc545a9b40 | ||
|
98c9c151b2 | ||
|
a4c403e049 |
2 changed files with 25 additions and 0 deletions
|
@ -56,17 +56,30 @@ carsontrack
|
|||
car_fucko03
|
||||
chairsntable
|
||||
chairsntableml
|
||||
ci_alights1_01
|
||||
ci_astudlights
|
||||
ci_backlot1
|
||||
ci_backlot2
|
||||
ci_backlot3
|
||||
ci_backlotprops1
|
||||
ci_backlotprops2
|
||||
ci_backlotprops3
|
||||
ci_blights1_01
|
||||
ci_camera1_01
|
||||
ci_flatprop01
|
||||
ci_flatprop02
|
||||
ci_fountain
|
||||
ci_industrial1
|
||||
ci_lander
|
||||
ci_lights1_01
|
||||
ci_manintstuff
|
||||
ci_mansion1
|
||||
ci_offices
|
||||
ci_redhead1_01
|
||||
ci_setshad1
|
||||
ci_tankship
|
||||
ci_watertank
|
||||
ci_windmach
|
||||
cl_curtains
|
||||
cl_tbl_chait_tmp
|
||||
cl_tbl_chait_tmpb
|
||||
|
|
|
@ -884,6 +884,9 @@ namespace RemoveDriverStatusFix
|
|||
// ============= Apply the environment mapping on extra components =============
|
||||
namespace EnvMapsOnExtras
|
||||
{
|
||||
static RpMaterial* (*RpMatFXMaterialSetEnvMapCoefficient)(RpMaterial* material, RwReal coef);
|
||||
static int (*RpMatFXMaterialGetEffects)(const RpMaterial* material);
|
||||
|
||||
static void RemoveSpecularityFromAtomic(RpAtomic* atomic)
|
||||
{
|
||||
RpGeometry* geometry = RpAtomicGetGeometry(atomic);
|
||||
|
@ -907,6 +910,10 @@ namespace EnvMapsOnExtras
|
|||
|
||||
if (bRemoveSpecularity)
|
||||
{
|
||||
if (RpMatFXMaterialGetEffects(material) == 2) // rpMATFXEFFECTENVMAP
|
||||
{
|
||||
RpMatFXMaterialSetEnvMapCoefficient(material, 0.0f);
|
||||
}
|
||||
RpMaterialGetSurfaceProperties(material)->specular = 0.0f;
|
||||
}
|
||||
return material;
|
||||
|
@ -2495,10 +2502,15 @@ void Patch_VC_Common()
|
|||
using namespace EnvMapsOnExtras;
|
||||
|
||||
auto forAllAtomics = pattern("50 E8 ? ? ? ? 66 8B 4B 44").get_one();
|
||||
auto setEnvMapCoefficient = reinterpret_cast<decltype(RpMatFXMaterialSetEnvMapCoefficient)>(get_pattern("8B 44 24 14 81 E2 FF 00 00 00 8D 14 52 8D 0C D6 89 41 08", -0x48));
|
||||
auto getEffects = reinterpret_cast<decltype(RpMatFXMaterialGetEffects)>(get_pattern("8B 04 01 85 C0 75 01", -0xA));
|
||||
|
||||
// push eax -> push ebx
|
||||
Patch<uint8_t>(forAllAtomics.get<void>(), 0x53);
|
||||
InterceptCall(forAllAtomics.get<void>(1), orgRpClumpForAllAtomics, RpClumpForAllAtomics_ExtraComps);
|
||||
|
||||
RpMatFXMaterialSetEnvMapCoefficient = setEnvMapCoefficient;
|
||||
RpMatFXMaterialGetEffects = getEffects;
|
||||
}
|
||||
TXN_CATCH();
|
||||
|
||||
|
|
Loading…
Reference in a new issue