Skip to content

Commit 196819b

Browse files
committed
Subsitute Config Macros because they don't work with MSVC
1 parent 773e1d8 commit 196819b

File tree

6 files changed

+65
-15
lines changed

6 files changed

+65
-15
lines changed

src/colours/colours.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,14 @@ class ColoursRandomizer
127127
/*******************************************************/
128128
ColoursRandomizer ()
129129
{
130-
RB_C_DO_CONFIG ("ColourRandomizer", RandomizeHudColours,
131-
RandomizeCarColours);
130+
if (!ConfigManager ::ReadConfig (
131+
"ColourRandomizer",
132+
std::make_pair ("RandomizeHudColours",
133+
&Config ().RandomizeHudColours),
134+
std::make_pair ("RandomizeCarColours",
135+
&Config ().RandomizeCarColours)))
136+
return;
137+
;
132138

133139
InitialiseAllComponents ();
134140

src/colours/lights.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,13 @@ class LightsRandomizer
136136
/*******************************************************/
137137
LightsRandomizer ()
138138
{
139-
RB_C_DO_CONFIG ("LightRandomizer", LightShiftFrequency, RandomizeOdds);
139+
if (!ConfigManager ::ReadConfig (
140+
"LightRandomizer",
141+
std::make_pair ("LightShiftFrequency",
142+
&Config ().LightShiftFrequency),
143+
std::make_pair ("RandomizeOdds", &Config ().RandomizeOdds)))
144+
return;
145+
;
140146

141147
InitialiseAllComponents ();
142148

src/colours/weather.cc

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,25 @@ class WeatherRandomizer
162162
/*******************************************************/
163163
WeatherRandomizer ()
164164
{
165-
RB_C_DO_CONFIG ("TimecycleRandomizer", RandomizeWeather,
166-
RandomizeTimecycle, RandomizeTimecycleOdds,
167-
RandomizeTimeOdds, RandomizeEveryFade, RainOdds,
168-
ThunderstormOdds, RandomSnow, SnowOdds);
165+
if (!ConfigManager ::ReadConfig (
166+
"TimecycleRandomizer",
167+
std::make_pair ("RandomizeWeather",
168+
&Config ().RandomizeWeather),
169+
std::make_pair ("RandomizeTimecycle",
170+
&Config ().RandomizeTimecycle),
171+
std::make_pair ("RandomizeTimecycleOdds",
172+
&Config ().RandomizeTimecycleOdds),
173+
std::make_pair ("RandomizeTimeOdds",
174+
&Config ().RandomizeTimeOdds),
175+
std::make_pair ("RandomizeEveryFade",
176+
&Config ().RandomizeEveryFade),
177+
std::make_pair ("RainOdds", &Config ().RainOdds),
178+
std::make_pair ("ThunderstormOdds",
179+
&Config ().ThunderstormOdds),
180+
std::make_pair ("RandomSnow", &Config ().RandomSnow),
181+
std::make_pair ("SnowOdds", &Config ().SnowOdds)))
182+
return;
183+
;
169184

170185
InitialiseAllComponents ();
171186

src/misc/scaleform.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ class ScaleformRandomizer
142142
/*******************************************************/
143143
ScaleformRandomizer ()
144144
{
145-
RB_C_DO_CONFIG ("ScaleformRandomizer", FailMessageOdds);
145+
if (!ConfigManager ::ReadConfig (
146+
"ScaleformRandomizer",
147+
std::make_pair ("FailMessageOdds", &Config ().FailMessageOdds)))
148+
return;
149+
;
146150

147151
InitialiseAllComponents ();
148152
REGISTER_HOOK ("89 74 ? ? e8 ? ? ? ? ? 8b cd ? 8b d0 e8", 4,

src/mission/missions.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,15 @@ class MissionRandomizer
8181
/*******************************************************/
8282
MissionRandomizer ()
8383
{
84-
RB_C_DO_CONFIG ("MissionRandomizer", Seed, ForceSeedOnSaves,
85-
ForcedMission, EnableFastSkips, LogMissionOrder);
84+
if (!ConfigManager ::ReadConfig (
85+
"MissionRandomizer", std ::make_pair ("Seed", &Config ().Seed),
86+
std::make_pair ("ForceSeedOnSaves",
87+
&Config ().ForceSeedOnSaves),
88+
std::make_pair ("ForcedMission", &Config ().ForcedMission),
89+
std::make_pair ("EnableFastSkips", &Config ().EnableFastSkips),
90+
std::make_pair ("LogMissionOrder", &Config ().LogMissionOrder)))
91+
return;
92+
;
8693

8794
InitialiseAllComponents ();
8895

src/sounds/voicelines.cc

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,23 @@ class VoiceLineRandomizer
386386
/*******************************************************/
387387
VoiceLineRandomizer ()
388388
{
389-
RB_C_DO_CONFIG ("VoiceLineRandomizer", IncludeDLCLines,
390-
TrulyRandomDuration, OrderedRandomDuration,
391-
SomeRandomDuration, NoRandomDuration,
392-
PercentageRandomOnSomeRandom,
393-
OrderedDialogueChangeFrequency);
389+
if (!ConfigManager ::ReadConfig (
390+
"VoiceLineRandomizer",
391+
std::make_pair ("IncludeDLCLines", &Config ().IncludeDLCLines),
392+
std::make_pair ("TrulyRandomDuration",
393+
&Config ().TrulyRandomDuration),
394+
std::make_pair ("OrderedRandomDuration",
395+
&Config ().OrderedRandomDuration),
396+
std::make_pair ("SomeRandomDuration",
397+
&Config ().SomeRandomDuration),
398+
std::make_pair ("NoRandomDuration",
399+
&Config ().NoRandomDuration),
400+
std::make_pair ("PercentageRandomOnSomeRandom",
401+
&Config ().PercentageRandomOnSomeRandom),
402+
std::make_pair ("OrderedDialogueChangeFrequency",
403+
&Config ().OrderedDialogueChangeFrequency)))
404+
return;
405+
;
394406

395407
InitialiseAllComponents ();
396408
InitialiseHooks ();

0 commit comments

Comments
 (0)