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.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
feat(gameengine): heat haze option, on with the quality slider past High
Olcay Seyganebade6836887
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c4d4f9c5e..ac8a56160 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -38,6 +38,10 @@ found and fixed, EA's own, not port damage.**- What your base is building stands over the radar as pictures again, not lines of text: one row of four, no wider than the radar's box, the next to arrive on the left, together in one steel tray hard against the left edge of the screen, built like the tray that holds the general's powers, each picture in its cell with the coloured edge a power button wears. The seconds left sit in its corner on a dark plate, an x4 marks four of the same thing queued back to back, and a dark sweep comes off the picture as it builds. Past four, a tag sticking up from the tray says how many more are coming. Click one and the camera goes to the building making it; right-click it, or click with Ctrl held, and the newest of it comes off that building's queue, the picture turning red under Ctrl first so you see what you are about to cancel.- Superweapon countdowns in the top right are pictures too, yours first and then everyone else's, each soonest first, six to a row and two rows at most in a tray of their own against the right edge of the screen, a little under the info strip, with a tag hanging below it for the rest. A thick border in its owner's colour runs round all four sides of each one, edged in light under a dark colour and in black under a bright one, so a navy or olive player stands out from the tray as clearly as a yellow one. A dark sweep shows how far the charge has come, and once one is charged its owner's colour rises up over the picture like light off a lamp, brightest at the foot, breathing slowly so a ready superweapon reads at a glance. Clicking one of your own takes the camera to it.+## Air that shimmers over fire++- Heat Haze, under Options, Display, is a new setting, off by default until it has been played. The air above a burning building wavers, a laser's beam bends what lies behind it, and a missile leaves a ripple behind its exhaust, the way hot air does in Command and Conquer 3. Only the ground behind the heat moves: a tank parked in the fire keeps its outline. The Performance / Quality slider turns it on one stop past High, with ambient occlusion, and you can still tick it by hand at any stop. Your opponent's setting is his own, because nothing in the game reads it. Direct3D 11 only, and off under Classic Graphics.+## EA's four ranks are back- The rank ladder is gone, every grade, perk and aura of it. A unit is Regular, Veteran, Elite or Heroic again, on the kills and the bonuses the 2003 game gave them, with EA's chevrons over the health bar and on the portrait. Six kills of its own kind make a Crusader Heroic, where an American one needed 66 on the ladder.diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 27682c5e3..b9887026c 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -1863,6 +1863,14 @@ TOOLTIP:SmoothMotion"On a screen faster than 60 Hz, units are drawn between their last two positions instead of holding each one until the next. A 60 Hz screen shows no change. Only your picture changes: nothing in the game reads it, and other players see their own setting. Applies when you press Accept."END+GUI:HeatHaze+"Heat Haze"+END++TOOLTIP:HeatHaze+"The air shimmers over fires, along laser beams and behind missile exhaust. Direct3D 11 only, and off under Classic Graphics. Applies when you press Accept."+END+GUI:StructureCollapse"Collapsing Buildings"ENDdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 42df6840a..50f4b93d0 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -16277,6 +16277,14 @@ TOOLTIP:SmoothMotion"60 Hz'den hızlı ekranda birimler, her konumu bir sonrakine kadar tutmak yerine son iki konumlarının arasında çizilir. 60 Hz ekranda fark görünmez. Yalnızca sizin görüntünüz değişir: oyundaki hiçbir şey bunu okumaz, diğer oyuncular kendi ayarını görür. Kabul'e basınca geçerli olur."END+GUI:HeatHaze+"Isı Dalgalanması"+END++TOOLTIP:HeatHaze+"Yangınların üstünde, lazer ışınları boyunca ve füze egzozunun arkasında hava dalgalanır. Yalnızca Direct3D 11 ile, Klasik Grafikler açıkken kapalıdır. Kabul Et'e basınca uygulanır."+END+GUI:StructureCollapse"Yıkılan Binalar"ENDdiff --git a/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd b/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wndindex cf5e8a91a..b4674b176 100644--- a/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd+++ b/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd@@ -2696,9 +2696,56 @@ WINDOWIMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;ENDCHILD+ WINDOW+ WINDOWTYPE = CHECKBOX;+ SCREENRECT = UPPERLEFT: 288 294, BOTTOMRIGHT: 512 318, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:CheckHeatHaze";+ STATUS = ENABLED+IMAGE+BORDER;+ STYLE = CHECKBOX+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 14, BOLD: 0;+ HEADERTEMPLATE = "MinorTitle";+ TOOLTIPTEXT = "TOOLTIP:HeatHaze";+ TOOLTIPDELAY = -1;+ TEXT = "GUI:HeatHaze";+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 186 255 12 255, HILITEBORDER: 0 0 0 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: Active-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,+ IMAGE: Active-Checked, COLOR: 0 0 255 255, BORDERCOLOR: 128 128 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: Disabled-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 192 192 192 255,+ IMAGE: Disabled-Checked, COLOR: 64 64 64 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 128 255 128 255,+ IMAGE: Active-HiLighted, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,+ IMAGE: Active-Checked, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ END+ CHILDWINDOWWINDOWTYPE = STATICTEXT;- SCREENRECT = UPPERLEFT: 282 294, BOTTOMRIGHT: 506 318, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 282 322, BOTTOMRIGHT: 506 346, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:LabelFrameRateLimit";TOOLTIPTEXT = "TOOLTIP:FrameRateLimit";STATUS = ENABLED;@@ -2746,7 +2793,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = COMBOBOX;- SCREENRECT = UPPERLEFT: 288 318, BOTTOMRIGHT: 512 342, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 288 346, BOTTOMRIGHT: 512 370, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:ComboBoxFrameRateLimit";TOOLTIPTEXT = "TOOLTIP:FrameRateLimit";STATUS = ENABLED+IMAGE;diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.hindex c7e228f97..da6703d6d 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h@@ -560,7 +560,7 @@ public:Bool m_waterFoam; ///< "WaterFoam": foam, shore band and the sun's shadow on water (Direct3D 11, client only)Bool m_groundMarks; ///< "GroundMarks": craters, stains and longer treads that fade over minutes (Direct3D 11, client only)Bool m_firelight; ///< "Firelight": flames light the ground, walls and units around them (Direct3D 11, client only)- Bool m_heatHaze; ///< "-heathaze": the air over FireLook flames shimmers (Direct3D 11, client only, prototype)+ Bool m_heatHaze; ///< "HeatHaze", "-heathaze": the air over fire, beams and exhausts shimmers (Direct3D 11, client only)Bool m_hemiAmbient; ///< "HemiAmbient": models take the ambient from the sky above and the ground below (Direct3D 11, client only)Bool m_ambientOcclusion; ///< "AmbientOcclusion": corners and the ground under what stands on it darken, half size in world units (Direct3D 11, client only)Bool m_weatherEffects; ///< "Weather": rain, blowing sand or snow by the map's ground, and a wind on trees and smoke (Direct3D 11, client only)diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cppindex 82feef5a5..c94220f99 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp@@ -1095,7 +1095,7 @@ Int parseSmoothMotion(char *args[], int)return 1;}-/* -heathaze: the air over the FireLook flames shimmers on Direct3D 11, a prototype. Client only. */+/* -heathaze: the HeatHaze option on for one run, whatever Options.ini says. Client only. */Int parseHeatHaze(char *args[], int){if (TheWritableGlobalData)diff --git a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cppindex 6f7d1dc76..1efd9853e 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp@@ -159,6 +159,7 @@ OPTION_BOOL_ACCESSORS( m_atmosphere )OPTION_BOOL_ACCESSORS( m_structureCollapse )OPTION_BOOL_ACCESSORS( m_smoothMotion )OPTION_BOOL_ACCESSORS( m_internalHdr )+OPTION_BOOL_ACCESSORS( m_heatHaze )OPTION_INT_ACCESSORS( m_shadowQuality )OPTION_INT_ACCESSORS( m_graphicsQuality )@@ -745,6 +746,14 @@ const OptionDef TheOptionCatalog[] =OPTION_BOOL, APPLY_LIVE, 0, 1,get_m_internalHdr, set_m_internalHdr },+ // The air over fire, along laser beams and behind missile exhaust shimmers, at the strength the+ // HEAT_HAZE_*, HEAT_BEAM_* and HEAT_EXHAUST_* constants in W3DParticleSys.cpp give. The particle draw+ // reads it every frame, and no sim reads it. Off under Classic graphics and -d3d9; -heathaze turns it+ // on for a run. On Options > Display, under Picture: every column of Graphics and Effects is full.+ { "HeatHaze", OPT_WND( "CheckHeatHaze" ), "GUI:HeatHaze",+ OPTION_BOOL, APPLY_LIVE, 0, 1,+ get_m_heatHaze, set_m_heatHaze },+// The size of the sun's depth map. The shadow pass asks for it every frame and the backend makes// the map again when the size changes, so a new level shows on the next frame. On Options >// Effects. Classic graphics and -d3d9 draw no map at all.@@ -847,6 +856,9 @@ const GraphicsQualityRow TheGraphicsQualityTable[] ={ "CheckWaterSplashes", 0.2f, { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 } },{ "CheckAtmosphere", 0.2f, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } },{ "ComboBoxShadowQuality", 0.25f, { 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2 } },+ // from the DX11 GPU frame lines at 1920x1080 with -noFPSLimit, on against off: about 0.1 ms in a+ // normal match (0.08 to 0.13), 0.2 to 0.4 in a fire-heavy one (0.07 to 0.55 at the ends)+ { "CheckHeatHaze", 0.25f, { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 } },{ "CheckAmbientOcclusion", 0.3f, { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 } },{ "CheckMapLight", 0.35f, { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 } },{ "CheckFirelight", 0.4f, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } },diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cppindex 400ac768a..16db50e28 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp@@ -3136,7 +3136,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )// three looks only the Direct3D 11 picture draws; under -d3d9 their boxes keep the saved value, greyedif( !TheGlobalData->m_direct3D11 ){- static const char *const direct3D11Only[] = { "MapLight", "TeamGlow", "WaterFoam", "GroundMarks", "Firelight", "HemiAmbient", "AmbientOcclusion", "InternalHdr", "Weather", "WaterSplashes", "Atmosphere", "StructureCollapse" };+ static const char *const direct3D11Only[] = { "MapLight", "TeamGlow", "WaterFoam", "GroundMarks", "Firelight", "HemiAmbient", "AmbientOcclusion", "InternalHdr", "Weather", "WaterSplashes", "Atmosphere", "StructureCollapse", "HeatHaze" };for( Int i = 0; i < (Int)( sizeof( direct3D11Only ) / sizeof( direct3D11Only[ 0 ] ) ); ++i )findOptionWidget( *findOptionDef( direct3D11Only[ i ] ) )->winEnable( FALSE );}diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex b3d0fda19..5694cf63a 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -19970,7 +19970,7 @@ TEST(graphics_quality_slider_only_ever_turns_settings_up)// the looks of 2026-10-31 rise above High, which stays the picture the Classic box's untick gives,// and every one is on at Ultra and a fork's row, so a Classic page keeps them offstatic const char *const aboveHigh[] = { "CheckInternalHdr", "CheckHemiAmbient", "CheckGroundMarks", "CheckStructureCollapse",- "CheckWaterSplashes", "CheckAtmosphere", "CheckAmbientOcclusion", "CheckFirelight", "CheckWeather" };+ "CheckWaterSplashes", "CheckAtmosphere", "CheckAmbientOcclusion", "CheckFirelight", "CheckWeather", "CheckHeatHaze" };for( Int i = 0; i < (Int)( sizeof( aboveHigh ) / sizeof( aboveHigh[ 0 ] ) ); ++i ){const GraphicsQualityRow *look = findGraphicsQualityRow( aboveHigh[ i ] );@@ -20036,7 +20036,7 @@ TEST(no_options_file_is_the_classic_game_with_every_added_row_off)"ShadowsForProjectiles", "ShadowsForProps", "ShadowsForParticles", "VolumetricSmokeShadows", "SmokeFireLighting","DebrisTrails", "MapLight", "TeamGlow", "WaterFoam", "GroundMarks", "Firelight", "HemiAmbient", "AmbientOcclusion","Weather", "WaterSplashes", "Atmosphere", "StructureCollapse", "SmoothMotion", "InternalHdr", "Smoke", "ParticleBounce",- NULL+ "HeatHaze", NULL};for( Int i = 0; off[ i ] != NULL; ++i )CHECK_EQ( findOptionDef( off[ i ] )->get(), 0 );diff --git a/GeneralsMD/Code/Tools/optionsmenu_layout.py b/GeneralsMD/Code/Tools/optionsmenu_layout.pyindex 958677002..a1d5a06f3 100644--- a/GeneralsMD/Code/Tools/optionsmenu_layout.py+++ b/GeneralsMD/Code/Tools/optionsmenu_layout.py@@ -262,6 +262,7 @@ NEW_CONTROLS = [(CHECK, "CheckAtmosphere", "GUI:Atmosphere"),(CHECK, "CheckStructureCollapse", "GUI:StructureCollapse"),(CHECK, "CheckSmoothMotion", "GUI:SmoothMotion"),+ (CHECK, "CheckHeatHaze", "GUI:HeatHaze"),(LABEL, "LabelGraphicsQuality", "GUI:GraphicsQuality"),(SLIDER, "SliderGraphicsQuality", None),]@@ -370,6 +371,7 @@ GROUP_LAYOUT = [# every column of Graphics and Effects is full("check", "CheckStructureCollapse"),("check", "CheckSmoothMotion"),+ ("check", "CheckHeatHaze"),# the Screen column is full with the monitor and the resolution notesetting("LabelFrameRateLimit", "ComboBoxFrameRateLimit")])]),