Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(clouds): classic is the default cloud style

Richard Louie Orilla731704bc26b1
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
index 9faac30b0..83d26ae0c 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
@@ -320,7 +320,7 @@ public:
Bool m_shadowsForParticles; // "ShadowsForParticles": big alpha-blended particle clouds drop a soft blob on the ground
Bool m_volumetricSmokeShadows; // "VolumetricSmokeShadows": smoke and dust shade the world and themselves through the sun's map (Direct3D 11)
Bool m_smokeFireLighting; // "SmokeFireLighting": smoke takes light from the fire beside it
- Int m_cloudStyle; // "CloudStyle": 0 = Classic, 1 = Volumetric (Linux)
+ Int m_cloudStyle; // "CloudStyle": 0 = Classic (default), 1 = Volumetric (when supported)
Bool m_explosionDebrisTrails; // "DebrisTrails": blasts throw smoke-trailing fragments and burning shrapnel
Int m_shadowQuality; // "ShadowQuality": the sun's depth map at 1024, 2048 or 4096 texels a side (Direct3D 11)
Bool m_classicGraphics; // "ClassicGraphics": the game's own art, tile, shadows and picture; read at startup
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
index a6da87088..a6672787a 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
@@ -971,7 +971,7 @@ GlobalData::GlobalData()
m_shadowsForParticles = TRUE; //on by default: the shipped INI has no entry for it
m_volumetricSmokeShadows = TRUE;
m_smokeFireLighting = TRUE;
- m_cloudStyle = 1; // approved volumetric hazard clouds unless Classic is explicitly selected
+ m_cloudStyle = 0; // Classic by default; volumetric hazard clouds are opt-in
m_explosionDebrisTrails = TRUE;
m_shadowQuality = 1; //medium, the 2048 map the shadows always had
m_classicGraphics = FALSE;
diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cpp
index 7ff3ea5b1..be1ed9356 100644
--- a/GeneralsMD/Code/Tests/test_gameengine.cpp
+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp
@@ -15127,7 +15127,7 @@ TEST(order_lines_are_a_live_check_box_that_starts_on)
TheWritableGlobalData = saved;
}
-TEST(cloud_style_defaults_to_volumetric_and_preserves_an_explicit_classic_choice)
+TEST(cloud_style_defaults_to_classic_and_preserves_an_explicit_volumetric_choice)
{
GlobalData *saved = TheWritableGlobalData;
GlobalData *scratch = NEW GlobalData;
@@ -15136,7 +15136,7 @@ TEST(cloud_style_defaults_to_volumetric_and_preserves_an_explicit_classic_choice
CHECK(cloud != NULL);
if (cloud) {
UserPreferences pref;
- CHECK_EQ(scratch->m_cloudStyle, 1);
+ CHECK_EQ(scratch->m_cloudStyle, 0);
CHECK_EQ(cloud->kind, OPTION_ENUM);
CHECK_EQ(cloud->apply, APPLY_LIVE);
CHECK_EQ(cloud->lo, 0);
@@ -15145,7 +15145,7 @@ TEST(cloud_style_defaults_to_volumetric_and_preserves_an_explicit_classic_choice
// The cloud appearance is independent of the existing smoke-shadow option.
scratch->m_volumetricSmokeShadows = FALSE;
loadOptionsFromPreferences(pref);
- CHECK_EQ(cloud->get(), 1);
+ CHECK_EQ(cloud->get(), 0);
pref["CloudStyle"] = "0";
loadOptionsFromPreferences(pref);
CHECK_EQ(cloud->get(), 0);
@@ -15154,6 +15154,8 @@ TEST(cloud_style_defaults_to_volumetric_and_preserves_an_explicit_classic_choice
pref["CloudStyle"] = "1";
loadOptionsFromPreferences(pref);
CHECK_EQ(cloud->get(), 1);
+ saveOptionsToPreferences(pref);
+ CHECK_STR(pref["CloudStyle"].str(), "1");
CHECK(!scratch->m_volumetricSmokeShadows);
}
delete scratch;