diff options
author | eray orçunus <erayorcunus@gmail.com> | 2019-06-29 15:55:19 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2019-06-29 15:55:19 +0200 |
commit | 0974447f585a457ea7d68187db28bcec5aa269e2 (patch) | |
tree | 6f7cf38dc4ea9a17b1bc6125fcc69758cf535e34 /src/modelinfo | |
parent | Merge branch 'master' of git://github.com/GTAmodding/re3 into erorcun (diff) | |
parent | fix (diff) | |
download | re3-0974447f585a457ea7d68187db28bcec5aa269e2.tar re3-0974447f585a457ea7d68187db28bcec5aa269e2.tar.gz re3-0974447f585a457ea7d68187db28bcec5aa269e2.tar.bz2 re3-0974447f585a457ea7d68187db28bcec5aa269e2.tar.lz re3-0974447f585a457ea7d68187db28bcec5aa269e2.tar.xz re3-0974447f585a457ea7d68187db28bcec5aa269e2.tar.zst re3-0974447f585a457ea7d68187db28bcec5aa269e2.zip |
Diffstat (limited to 'src/modelinfo')
-rw-r--r-- | src/modelinfo/ModelInfo.cpp | 18 | ||||
-rw-r--r-- | src/modelinfo/ModelInfo.h | 1 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.cpp | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp index acc40824..454a73f1 100644 --- a/src/modelinfo/ModelInfo.cpp +++ b/src/modelinfo/ModelInfo.cpp @@ -175,6 +175,23 @@ CModelInfo::IsBoatModel(int32 id) ((CVehicleModelInfo*)GetModelInfo(id))->m_vehicleType == VEHICLE_TYPE_BOAT; } +void +CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level) +{ + int i; + CBaseModelInfo *mi; + CColModel *colmodel; + + for(i = 0; i < MODELINFOSIZE; i++){ + mi = GetModelInfo(i); + if(mi){ + colmodel = mi->GetColModel(); + if(colmodel && colmodel->level != LEVEL_NONE && colmodel->level != level) + colmodel->RemoveCollisionVolumes(); + } + } +} + STARTPATCHES InjectHook(0x50B310, CModelInfo::Initialise, PATCH_JUMP); InjectHook(0x50B5B0, CModelInfo::ShutDown, PATCH_JUMP); @@ -184,4 +201,5 @@ STARTPATCHES InjectHook(0x50BAD0, CModelInfo::AddPedModel, PATCH_JUMP); InjectHook(0x50BA60, CModelInfo::AddVehicleModel, PATCH_JUMP); InjectHook(0x50B860, (CBaseModelInfo *(*)(const char*, int*))CModelInfo::GetModelInfo, PATCH_JUMP); + InjectHook(0x50BBC0, CModelInfo::RemoveColModelsFromOtherLevels, PATCH_JUMP); ENDPATCHES diff --git a/src/modelinfo/ModelInfo.h b/src/modelinfo/ModelInfo.h index 30be96ca..d20367d1 100644 --- a/src/modelinfo/ModelInfo.h +++ b/src/modelinfo/ModelInfo.h @@ -36,4 +36,5 @@ public: } static bool IsBoatModel(int32 id); + static void RemoveColModelsFromOtherLevels(eLevelName level); }; diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp index 36a6f301..2f1d2027 100644 --- a/src/modelinfo/VehicleModelInfo.cpp +++ b/src/modelinfo/VehicleModelInfo.cpp @@ -1006,7 +1006,9 @@ CVehicleModelInfo::SetEnvironmentMapCB(RpMaterial *material, void *data) if(RpMaterialGetTexture(material) == 0) RpMaterialSetTexture(material, gpWhiteTexture); RpMatFXMaterialSetEffects(material, rpMATFXEFFECTENVMAP); +#ifndef PS2_MATFX spec *= 0.5f; // Tone down a bit for PC +#endif RpMatFXMaterialSetupEnvMap(material, (RwTexture*)data, pMatFxIdentityFrame, false, spec); } return material; |