Skip to content

Commit 1b1ffd3

Browse files
committed
Allow retint fix to be disabled with [AudioVisual] -> UseRetintFix=no in rulesmd.ini (#1881)
1 parent 77981ed commit 1b1ffd3

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

docs/Fixed-or-Improved-Logics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
88
- Fixed the bug that light tint created by buildings can never be removed (light tint persists even if the building is destroyed/sold) after loading a game
99
- Fixed the bug when reading a map which puts `Preview(Pack)` after `Map` lead to the game fail to draw the preview
1010
- Fixed the bug when retinting map lighting with a map action corrupted light sources.
11+
- Due to performance considerations, this fix may be disabled by setting `[AudioVisual] -> UseRetintFix=no` in `rulesmd.ini`.
1112
- Fixed the bug when deploying mindcontrolled vehicle into a building permanently transferred the control to the house which mindcontrolled it.
1213
- Fixed the bug when capturing a mind-controlled building with an engineer fail to break the mind-control link.
1314
- Removed the `EVA_BuildingCaptured` event when capturing a building considered as a vehicle.

src/Ext/Rules/Body.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "Body.h"
1+
#include "Body.h"
22
#include <Ext/Side/Body.h>
33
#include <Utilities/TemplateDef.h>
44
#include <FPSCounter.h>
@@ -287,6 +287,8 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
287287
this->LightFlashAlphaImageDetailLevel.Read(exINI, GameStrings::AudioVisual, "LightFlashAlphaImageDetailLevel");
288288
this->BuildingTypeSelectable.Read(exINI, GameStrings::General, "BuildingTypeSelectable");
289289

290+
this->UseRetintFix.Read(exINI, GameStrings::AudioVisual, "UseRetintFix");
291+
290292
this->ProneSpeed_Crawls.Read(exINI, GameStrings::General, "ProneSpeed.Crawls");
291293
this->ProneSpeed_NoCrawls.Read(exINI, GameStrings::General, "ProneSpeed.NoCrawls");
292294

@@ -559,6 +561,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
559561
.Process(this->WarheadParticleAlphaImageIsLightFlash)
560562
.Process(this->CombatLightDetailLevel)
561563
.Process(this->LightFlashAlphaImageDetailLevel)
564+
.Process(this->UseRetintFix)
562565
.Process(this->AINormalTargetingDelay)
563566
.Process(this->PlayerNormalTargetingDelay)
564567
.Process(this->AIGuardAreaTargetingDelay)

src/Ext/Rules/Body.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#pragma once
1+
#pragma once
22

33
#include <CCINIClass.h>
44
#include <RulesClass.h>
@@ -230,6 +230,8 @@ class RulesExt
230230
Valueable<int> CombatLightDetailLevel;
231231
Valueable<int> LightFlashAlphaImageDetailLevel;
232232

233+
Valueable<bool> UseRetintFix;
234+
233235
Nullable<int> AINormalTargetingDelay;
234236
Nullable<int> PlayerNormalTargetingDelay;
235237
Nullable<int> AIGuardAreaTargetingDelay;
@@ -442,6 +444,7 @@ class RulesExt
442444
, WarheadParticleAlphaImageIsLightFlash { false }
443445
, CombatLightDetailLevel { 0 }
444446
, LightFlashAlphaImageDetailLevel { 0 }
447+
, UseRetintFix { true }
445448
, AINormalTargetingDelay {}
446449
, PlayerNormalTargetingDelay {}
447450
, AIGuardAreaTargetingDelay {}

src/Ext/TAction/Hooks.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "Body.h"
22

33
#include <Ext/Anim/Body.h>
4+
#include <Ext/Rules/Body.h>
5+
46
#include <Helpers/Macro.h>
57

68
#include <HouseClass.h>
@@ -89,7 +91,7 @@ DEFINE_HOOK_AGAIN(0x6E2EF7, TActionClass_Retint_LightSourceFix, 0x3) // Green
8991
DEFINE_HOOK(0x6E2EA7, TActionClass_Retint_LightSourceFix, 0x3) // Red
9092
{
9193
// Flag the light sources to update, actually do it later and only once to prevent redundancy.
92-
RetintTemp::UpdateLightSources = true;
94+
RetintTemp::UpdateLightSources = RulesExt::Global()->UseRetintFix;
9395

9496
return 0;
9597
}

0 commit comments

Comments
 (0)