Skip to content

Commit 86fefe3

Browse files
committed
TREE_WIND_EFFECT is enabled by default
Removed always enabled define..
1 parent 5b68e8e commit 86fefe3

File tree

7 files changed

+13
-28
lines changed

7 files changed

+13
-28
lines changed

src/Common/Config.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
/* Visual */
2323
#define DETAIL_RADIUS // detail draw radius (by K.D.)
24-
#define TREE_WIND_EFFECT // configurable tree sway, can be used to have trees sway more during storms or lightly on clear days.
2524

2625
/* Tweaks: */
2726
//#define FP_DEATH // first person death view

src/Layers/xrRender/FTreeVisual.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,30 +91,26 @@ struct FTreeVisual_setup
9191
Fvector4 wave;
9292
Fvector4 wind;
9393

94-
FTreeVisual_setup() { dwFrame = 0; }
94+
FTreeVisual_setup(): dwFrame(0), scale(0) {}
95+
9596
void calculate()
9697
{
9798
dwFrame = Device.dwFrame;
9899

99-
float tm_rot = PI_MUL_2 * Device.fTimeGlobal / ps_r__Tree_w_rot;
100+
const float tm_rot = PI_MUL_2 * Device.fTimeGlobal / ps_r__Tree_w_rot;
100101

101102
// Calc wind-vector3, scale
102-
#ifdef TREE_WIND_EFFECT
103-
CEnvDescriptor& env = *g_pGamePersistent->Environment().CurrentEnv;
104-
103+
105104
wind.set(_sin(tm_rot), 0, _cos(tm_rot), 0);
106105
wind.normalize();
106+
107107
#if RENDER!=R_R1
108+
CEnvDescriptor& env = *g_pGamePersistent->Environment().CurrentEnv;
108109
float fValue = env.m_fTreeAmplitudeIntensity;
109-
wind.mul(fValue); // dir1*amplitude
110-
#else // R1
111-
wind.mul(ps_r__Tree_w_amp); // dir1*amplitude
112-
#endif //-RENDER!=R_R1
113-
#else //!TREE_WIND_EFFECT
114-
wind.set(_sin(tm_rot), 0, _cos(tm_rot), 0);
115-
wind.normalize();
110+
wind.mul(fValue); // dir1*amplitude
111+
#else
116112
wind.mul(ps_r__Tree_w_amp); // dir1*amplitude
117-
#endif //-TREE_WIND_EFFECT
113+
#endif
118114

119115
scale = 1.f / float(FTreeVisual_quant);
120116

src/Layers/xrRenderPC_R2/r2.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ static class cl_water_intensity : public R_constant_setup
8585
}
8686
} binder_water_intensity;
8787

88-
#ifdef TREE_WIND_EFFECT
8988
static class cl_tree_amplitude_intensity : public R_constant_setup
9089
{
9190
void setup(R_constant* C) override
@@ -95,7 +94,7 @@ static class cl_tree_amplitude_intensity : public R_constant_setup
9594
RCache.set_c(C, fValue, fValue, fValue, 0);
9695
}
9796
} binder_tree_amplitude_intensity;
98-
#endif
97+
// XXX: do we need to register this binder?
9998

10099
static class cl_sun_shafts_intensity : public R_constant_setup
101100
{

src/Layers/xrRenderPC_R3/r3.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ static class cl_water_intensity : public R_constant_setup
9696
}
9797
} binder_water_intensity;
9898

99-
#ifdef TREE_WIND_EFFECT
10099
static class cl_tree_amplitude_intensity : public R_constant_setup
101100
{
102101
void setup(R_constant* C) override
@@ -106,7 +105,7 @@ static class cl_tree_amplitude_intensity : public R_constant_setup
106105
RCache.set_c(C, fValue, fValue, fValue, 0);
107106
}
108107
} binder_tree_amplitude_intensity;
109-
#endif
108+
// XXX: do we need to register this binder?
110109

111110
static class cl_sun_shafts_intensity : public R_constant_setup
112111
{

src/Layers/xrRenderPC_R4/r4.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ static class cl_water_intensity : public R_constant_setup
101101
}
102102
} binder_water_intensity;
103103

104-
#ifdef TREE_WIND_EFFECT
105104
static class cl_tree_amplitude_intensity : public R_constant_setup
106105
{
107106
void setup(R_constant* C) override
@@ -111,7 +110,7 @@ static class cl_tree_amplitude_intensity : public R_constant_setup
111110
RCache.set_c(C, fValue, fValue, fValue, 0);
112111
}
113112
} binder_tree_amplitude_intensity;
114-
#endif
113+
// XXX: do we need to register this binder?
115114

116115
static class cl_sun_shafts_intensity : public R_constant_setup
117116
{

src/xrEngine/Environment.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,8 @@ class ENGINE_API CEnvDescriptor
168168
float m_fSunShaftsIntensity;
169169
float m_fWaterIntensity;
170170

171-
#ifdef TREE_WIND_EFFECT
172171
float m_fTreeAmplitudeIntensity;
173-
#endif
172+
174173

175174
// int lens_flare_id;
176175
// int tb_id;

src/xrEngine/Environment_misc.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,7 @@ CEnvDescriptor::CEnvDescriptor(shared_str const& identifier) : m_identifier(iden
218218
m_fSunShaftsIntensity = 0;
219219
m_fWaterIntensity = 1;
220220

221-
#ifdef TREE_WIND_EFFECT
222221
m_fTreeAmplitudeIntensity = 0.01;
223-
#endif
224222

225223
lens_flare_id = "";
226224
tb_id = "";
@@ -299,10 +297,8 @@ void CEnvDescriptor::load(CEnvironment& environment, CInifile& config)
299297
if (config.line_exist(m_identifier.c_str(), "water_intensity"))
300298
m_fWaterIntensity = config.r_float(m_identifier.c_str(), "water_intensity");
301299

302-
#ifdef TREE_WIND_EFFECT
303300
if (config.line_exist(m_identifier.c_str(), "tree_amplitude_intensity"))
304301
m_fTreeAmplitudeIntensity = config.r_float(m_identifier.c_str(), "tree_amplitude_intensity");
305-
#endif
306302

307303
C_CHECK(clouds_color);
308304
C_CHECK(sky_color);
@@ -445,9 +441,7 @@ void CEnvDescriptorMixer::lerp(
445441
m_fSunShaftsIntensity = fi * A.m_fSunShaftsIntensity + f * B.m_fSunShaftsIntensity;
446442
m_fWaterIntensity = fi * A.m_fWaterIntensity + f * B.m_fWaterIntensity;
447443

448-
#ifdef TREE_WIND_EFFECT
449444
m_fTreeAmplitudeIntensity = fi * A.m_fTreeAmplitudeIntensity + f * B.m_fTreeAmplitudeIntensity;
450-
#endif
451445

452446
// colors
453447
//. sky_color.lerp (A.sky_color,B.sky_color,f).add(Mdf.sky_color).mul(modif_power);

0 commit comments

Comments
 (0)