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(gameclient): Smoke simulation setting, Off, Low or High, live
Olcay Seyganb1e461e9346e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c7d0effc2..2221ba77a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -102,6 +102,11 @@ found and fixed, EA's own, not port damage.**- A fresh install's first Scud Storm landing, Particle Cannon, nuke and general's air strikes no longer catch a picture for 110 to 130 milliseconds each, whichever cloud style is on. The explosion and lit-smoke shaders those strikes draw with come with the game now, where each one used to be built the first time its blast showed up; a superweapon battle on Twilight Flame from a fresh install now builds nothing at all.- A blast the game has no shader for yet, a mod's or a combination nobody recorded, no longer stops the picture while one is built. The shader is built beside the game, and the blast's pieces that need it appear when it is ready, about a sixth of a second later at worst; before, the whole frame waited 110 to 130 milliseconds for each one. With a shader file missing twenty-two of them, a superweapon battle drew on with no pause and the longest any blast waited was 153 milliseconds. The interface, the fog of war and anything drawn into a picture of its own still get their shaders at once, on the match's first frame.+## Smoke simulation++- Options > Effects has a Smoke Simulation box. On Low or High a tank's cook-off, a shell's dirt fountain and a nuclear mushroom are a moving body of air rather than flat sprites: the smoke rolls, rises with the heat, settles as dust and parts round the buildings in its way. Off is the default, and Off draws exactly the picture the game drew before. The box works mid-match, the next frame after you press Accept, on the default renderer; the Direct3D 9 renderer and the Classic graphics setting hide it.+- It costs the graphics card. Three armies and three superweapons on Twilight Flame at 1920x1080, on an RTX 2060: 5.0 ms of GPU time a frame with it Off, 5.8 to 6.6 on Low and 7.7 to 7.9 on High. Low runs half as many blasts at once with a lighter solver, so a weak card should leave it Off or take Low.+## A rank ladder for every army- Three chevrons are now a whole army's ladder. An American unit climbs 28 promotions from E-1 Private to General of the Army, a Chinese one 19 from Private to General, a GLA one 20 from Recruit to Supreme Liberator. Every unit starts unranked with a bare health bar and no bonus; from the first promotion on, each grade wears its own insignia beside the health bar and floats it up over the unit's head the moment it is earned. Hover the portrait for the rank's name and how far the next one is: "Next rank 340/420 XP".diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 39d50d789..6dec444ce 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -553,6 +553,26 @@ TOOLTIP:Smoke"How long smoke hangs in the air and how dense it looks. 175 of the game's 1088 effects are smoke. Very Thick cost 0.7 ms a frame over a burning column when it was measured. Takes effect the next time the game starts."END+GUI:VolumeSmoke+"Smoke simulation"+END++GUI:VolumeSmoke0+"Off"+END++GUI:VolumeSmoke1+"Low"+END++GUI:VolumeSmoke2+"High"+END++TOOLTIP:VolumeSmoke+"Smoke and dust as a moving body of air instead of flat sprites: it rolls, rises with the heat and parts round buildings. It costs graphics card time, so leave it Off on a weak card. Low costs about half as much as High. Applies the moment you Accept, mid-match too."+END+GUI:ParticleBounce"Particles Hit The Ground"ENDdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex d96193742..84c812347 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -15045,6 +15045,26 @@ TOOLTIP:Smoke"Dumanın havada ne kadar asılı kaldığı ve ne kadar yoğun göründüğü. Oyundaki 1088 efektin 175'i duman. Çok Kalın, ölçüldüğünde yanan bir kolonun üstünde kare başına 0,7 ms tuttu. Oyun bir sonraki açılışında etkinleşir."END+GUI:VolumeSmoke+"Duman Simülasyonu"+END++GUI:VolumeSmoke0+"Kapalı"+END++GUI:VolumeSmoke1+"Düşük"+END++GUI:VolumeSmoke2+"Yüksek"+END++TOOLTIP:VolumeSmoke+"Duman ve toz düz resimler yerine hareket eden bir hava kütlesi olur: yuvarlanır, sıcakla yükselir, binaların etrafından dolaşır. Ekran kartına yük bindirir, zayıf kartta Kapalı bırak. Düşük, Yüksek'in yaklaşık yarısı kadar yük getirir. Kabul Et'e bastığın an uygulanır, maç ortasında da."+END+GUI:ParticleBounce"Parçacıklar Yere Çarpar"ENDdiff --git a/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd b/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wndindex 22cf0a08f..43ca9cfd4 100644--- a/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd+++ b/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd@@ -7499,9 +7499,297 @@ WINDOWIMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;ENDCHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 530 294, BOTTOMRIGHT: 754 318, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:LabelVolumeSmoke";+ TOOLTIPTEXT = "TOOLTIP:VolumeSmoke";+ STATUS = ENABLED;+ STYLE = STATICTEXT+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 14, BOLD: 0;+ HEADERTEMPLATE = "MinorTitle";+ TOOLTIPDELAY = -1;+ TEXT = "GUI:VolumeSmoke";+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 0, BORDERCOLOR: 0 0 0 0,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ STATICTEXTDATA = CENTERED: 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = COMBOBOX;+ SCREENRECT = UPPERLEFT: 536 318, BOTTOMRIGHT: 760 342, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:ComboBoxVolumeSmoke";+ TOOLTIPTEXT = "TOOLTIP:VolumeSmoke";+ STATUS = ENABLED+IMAGE;+ STYLE = MOUSETRACK+COMBOBOX;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "ComboBoxEntry";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: NoImage, COLOR: 47 55 168 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,+ 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: NoImage, COLOR: 192 192 192 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, 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;+ COMBOBOXDATA = ISEDITABLE: 0,+ MAXCHARS: 16,+ MAXDISPLAY: 5,+ ASCIIONLY: 0,+ LETTERSANDNUMBERS: 0;+ COMBOBOXDROPDOWNBUTTONENABLEDDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONDISABLEDDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONHILITEDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXENABLEDDRAWDATA = IMAGE: TextEntryEnabledLeftEnd, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: TextEntryEnabledRightEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryEnabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryEnabledSmallRepeatingCenter, 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;+ COMBOBOXEDITBOXDISABLEDDRAWDATA = IMAGE: TextEntryDisabledLeftEnd, COLOR: 128 128 128 255, BORDERCOLOR: 0 0 0 255,+ IMAGE: TextEntryDisabledRightEnd, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryDisabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryDisabledSmallRepeatingCenter, 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;+ COMBOBOXEDITBOXHILITEDRAWDATA = IMAGE: TextEntryHiliteLeftEnd, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRightEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryHiliteSmallRepeatingCenter, 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;+ COMBOBOXLISTBOXENABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteItemLeftEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: ListBoxHiliteItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemSmallRepeatingCenter, 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;+ COMBOBOXLISTBOXDISABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: NoImage, COLOR: 192 192 192 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXHILITEDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, 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;+ LISTBOXENABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderUpButtonHiliteSelected, 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 168 255 12 0, BORDERCOLOR: 47 55 168 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 0, BORDERCOLOR: 148 112 0 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITESLIDERDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 0, BORDERCOLOR: 49 55 168 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBENABLEDDRAWDATA = IMAGE: ScrollBarThumbEnabled, COLOR: 255 4 0 0, BORDERCOLOR: 255 243 28 255,+ IMAGE: ScrollBarThumbHiliteSelected, 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBDISABLEDDRAWDATA = IMAGE: ScrollBarThumbDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBHILITEDRAWDATA = IMAGE: ScrollBarThumbHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ END+ CHILDWINDOWWINDOWTYPE = CHECKBOX;- SCREENRECT = UPPERLEFT: 536 294, BOTTOMRIGHT: 760 318, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 536 350, BOTTOMRIGHT: 760 374, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:CheckParticleBounce";STATUS = ENABLED+IMAGE+BORDER;STYLE = CHECKBOX+MOUSETRACK;@@ -7548,7 +7836,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = CHECKBOX;- SCREENRECT = UPPERLEFT: 536 322, BOTTOMRIGHT: 760 346, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 536 378, BOTTOMRIGHT: 760 402, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:CheckSmokeFireLighting";STATUS = ENABLED+IMAGE+BORDER;STYLE = CHECKBOX+MOUSETRACK;@@ -7595,7 +7883,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = CHECKBOX;- SCREENRECT = UPPERLEFT: 536 350, BOTTOMRIGHT: 760 374, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 536 406, BOTTOMRIGHT: 760 430, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:CheckDebrisTrails";STATUS = ENABLED+IMAGE+BORDER;STYLE = CHECKBOX+MOUSETRACK;diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.hindex 21c531b42..c95a68763 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h@@ -377,6 +377,7 @@ public:Bool m_smoothMotionAnyDisplay; // -smoothmotion: the same whatever the display's refresh rateInt m_waterStyle; // "WaterStyle": 0 = Classic, 1 = Modern (SDL); applied between render framesInt m_cloudStyle; // "CloudStyle": 0 = Classic (default), 1 = Volumetric (when supported)+ Int m_volumeSmoke; // "VolumeSmoke": smoke as a simulated volume, 0 Off (default), 1 Low, 2 High (Direct3D 11); -volsmoke for one runBool m_explosionDebrisTrails; // "DebrisTrails": blasts throw smoke-trailing fragments and burning shrapnelInt m_shadowQuality; // "ShadowQuality": the sun's depth map at 1024, 2048 or 4096 texels a side (Direct3D 11)Int m_graphicsQuality; // "GraphicsQuality": where the options menu's Performance / Quality slider stands; Custom takes the particle ring from the preset at or below itdiff --git a/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.h b/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.hindex b6026e4ab..38604abf6 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.h@@ -147,6 +147,8 @@ enum { SMOKE_LEVEL_COUNT = 3 };enum { WATER_STYLE_COUNT = 2 };// Classic is the original hazard effect; Volumetric is the Linux toxin/radiation cloud.enum { CLOUD_STYLE_COUNT = 2 };+// Volume smoke: Off, Low and High (DX11VolumeSmoke.cpp sizes its grids by it).+enum { VOLUME_SMOKE_COUNT = 3 };// Shadow quality is the size of the sun's depth map, low, medium and high: 1024, 2048 and 4096// texels a side (W3DVolumetricShadow.cpp, renderShadowMap). Medium is the size the map always had.diff --git a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cppindex 9f2eb33e0..0eea107d4 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/CommandLine.cpp@@ -1111,6 +1111,24 @@ Int parseNoSmokeFireLight(char *args[], int)return 1;}+/* -volsmoke [off|low|high]: the VolumeSmoke option for one run; bare, High. */+Int parseVolumeSmoke(char *args[], int num)+{+ if (!TheWritableGlobalData) return 1;+ TheWritableGlobalData->m_volumeSmoke = 2;+ if (num > 1)+ {+ static const char *const levels[] = { "off", "low", "high" };+ for (Int level = 0; level < 3; ++level)+ if (strcasecmp(args[1], levels[level]) == 0)+ {+ TheWritableGlobalData->m_volumeSmoke = level;+ return 2;+ }+ }+ return 1;+}+/* -lighting <classic|reforged>: the LightingStyle option for one run, the before and after of anypicture of it. */Int parseLightingStyle(char *args[], int num)@@ -2901,6 +2919,7 @@ static CommandLineParam params[] ={ "-smoothmotion", parseSmoothMotion },{ "-nosmokefirelight", parseNoSmokeFireLight },{ "-lighting", parseLightingStyle },+ { "-volsmoke", parseVolumeSmoke },{ "-quickstart", parseQuickStart },/* In every build: EA kept them to Debug and Internal, so a Release run could not skip the logo or themovies. */diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cppindex 81c281a18..18af39608 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp@@ -1043,6 +1043,7 @@ GlobalData::GlobalData()m_smoothMotionAnyDisplay = FALSE;m_waterStyle = 0; // classic by default; modern water is an explicit optionm_cloudStyle = 0; // Classic by default; volumetric hazard clouds are opt-in+ m_volumeSmoke = 0; // off by default: the volumes cost GPU time a low-end card does not havem_explosionDebrisTrails = TRUE;m_shadowQuality = 1; //medium, the 2048 map the shadows always hadm_graphicsQuality = TheGraphicsQualityAnchors[ STATIC_GAME_LOD_HIGH ]; //a preset moves it to its own step as the menu opensdiff --git a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cppindex 32bca53a8..d444eb8df 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp@@ -120,6 +120,7 @@ OPTION_INT_ACCESSORS( m_msaaLevel )OPTION_BOOL_ACCESSORS( m_vsync )OPTION_INT_ACCESSORS( m_waterStyle )OPTION_INT_ACCESSORS( m_cloudStyle )+OPTION_INT_ACCESSORS( m_volumeSmoke )OPTION_BOOL_ACCESSORS( m_classicGraphics )OPTION_INT_ACCESSORS( m_lightingStyle )OPTION_INT_ACCESSORS( m_healthBarMode )@@ -468,6 +469,15 @@ const OptionDef TheOptionCatalog[] =OPTION_ENUM, APPLY_LIVE, 0, CLOUD_STYLE_COUNT - 1,get_m_cloudStyle, set_m_cloudStyle },+ // Smoke and dust as a simulated volume on Direct3D 11, Off, Low or High. The volumes read it+ // every frame, so a change shows on the next one, mid-match too; -volsmoke picks it for one run.+ // Off by default and kept out of the quality slider, as Modern water is: an opt-in that costs+ // GPU time the slider's presets should not spend for a player who never asked. On Options >+ // Effects; the menu hides it where Direct3D 11 does not present.+ { "VolumeSmoke", OPT_WND( "ComboBoxVolumeSmoke" ), "GUI:VolumeSmoke",+ OPTION_ENUM, APPLY_LIVE, 0, VOLUME_SMOKE_COUNT - 1,+ get_m_volumeSmoke, set_m_volumeSmoke },+// Classic or Reforged. Classic is the picture the game shipped with: its own textures, EA's// ground tile, no normal maps, the stencil shadows and no post effects. The upscaled archives// are mounted before GlobalData exists, so Win32BIGFileSystem reads this key out of Options.inidiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cppindex 254c92654..9c4549098 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp@@ -1153,6 +1153,16 @@ static void fillCatalogWidgets( void )if (label) label->winHide(!supported);if (!supported) continue;}+ if (strcmp(def.iniKey, "VolumeSmoke") == 0)+ {+ // the smoke volumes need what the hazard clouds need: Direct3D 11 presenting at level 11+ const Bool supported = HazardCloud::Supported();+ widget->winHide(!supported);+ GameWindow *label = TheWindowManager->winGetWindowFromId(+ NULL, NAMEKEY("OptionsMenu.wnd:LabelVolumeSmoke"));+ if (label) label->winHide(!supported);+ if (!supported) continue;+ }const Int value = clampOptionValue( def, def.get() );@@ -1200,7 +1210,7 @@ static void readCatalogWidgets( OptionPreferences &out )continue;// A hidden, unfilled combo must not overwrite the player's opt-in.- if (strcmp(def.iniKey, "CloudStyle") == 0 && !HazardCloud::Supported())+ if ((strcmp(def.iniKey, "CloudStyle") == 0 || strcmp(def.iniKey, "VolumeSmoke") == 0) && !HazardCloud::Supported())continue;if (strcmp(def.iniKey, "WaterStyle") == 0 && !ModernWater::Supported())continue;diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/VolumeSmoke.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/VolumeSmoke.hindex 1ec31286f..020afd118 100644--- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/VolumeSmoke.h+++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/VolumeSmoke.h@@ -1,4 +1,4 @@-// Explosion smoke as a simulated volume, behind -volsmoke, on the Direct3D 11 frame only+// Explosion smoke as a simulated volume, behind the VolumeSmoke setting, on the Direct3D 11 frame only// (DX11VolumeSmoke.cpp). Client side: it reads particle systems and draws, and nothing in the// logic reads it back. Distributed under the repository's GPL-3.0 terms; see LICENSE.md.#pragma once@@ -11,7 +11,7 @@ namespace VolumeSmoke {// True for a system whose billboards are not drawn: a volume draws its smoke, or its volume went// to a newer blast and its smoke is dropped. The first time a death's smoke system is asked// about it is given a volume, the oldest one's if none is free, so none of them ever draws-// billboards. False whenever -volsmoke is off or the device cannot take the volumes.+// billboards. False whenever the setting is Off or the device cannot take the volumes.bool Takes(ParticleSystem *system);// Takes without claiming anything and without touching the device: for the GPU overflow path,@@ -19,7 +19,7 @@ bool Takes(ParticleSystem *system);bool Hides(ParticleSystem *system);// Steps every volume once per logic frame that passed and draws them into the scene, from-// doParticles between two of the backend's draws. Nothing with -volsmoke off.+// doParticles between two of the backend's draws. Nothing with the setting Off.void Render(const HazardCloud::Camera &camera);// The particle manager's reset (a match ending, a load): every volume goes, and the systems leftdiff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/DX11VolumeSmoke.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/DX11VolumeSmoke.cppindex c56950e30..233dfd701 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/DX11VolumeSmoke.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/DX11VolumeSmoke.cpp@@ -1,4 +1,5 @@-// Explosion smoke as a fluid, behind -volsmoke, on the Direct3D 11 frame only. Distributed under+// Explosion smoke as a fluid, behind the VolumeSmoke setting (Off, Low, High; -volsmoke for one+// run), on the Direct3D 11 frame only. Distributed under// the repository's GPL-3.0 terms; see LICENSE.md.//// Three kinds of blast, each told from the particle systems its FX spawns and each played from a@@ -31,13 +32,12 @@// timeline, and a billowy noise eroding the surface so the cap reads as cauliflower.//// Nothing here is read by the logic or draws a random number: every variation is an integer hash.-// The D3D9 and SDL3 paths, -headless and every run without the switch keep the billboards, and-// with the switch off Takes, Hides and Render return before touching anything. With it on, every+// The D3D9 and SDL3 paths, -headless and every run with the setting Off keep the billboards, and+// with it Off Takes, Hides and Render return before touching anything. With it on, every// system of a blast this takes draws no billboards, its GPU overflow particles included; the tank// and the shell keep their additive fire and flash cards, the nuclear blast has none.#include "Common/GlobalData.h"#include "Common/Debug.h"-#include "Common/EarlyCommandLine.h"#include "Common/LogicThread.h"#include "GameClient/ParticleSys.h"#include "GameLogic/GameLogic.h"@@ -65,16 +65,25 @@namespace {-// Two atlases: the small one for tanks and shells, the big one for nuclear blasts.+// Two atlases: the small one for tanks and shells, the big one for nuclear blasts. The slab+// counts are the setting's (Quality below); a change of setting builds the atlases again.struct TierShape { unsigned gx, gy, gz, slabs, first; };-const TierShape TierShapes[2] = { { 48, 48, 40, 24, 0 }, { 96, 96, 80, 2, 24 } };-const unsigned MaxVolumes = 26; // both tiers' slabs, the small tier's first+TierShape TierShapes[2] = { { 48, 48, 40, 24, 0 }, { 96, 96, 80, 2, 24 } };+const unsigned MaxVolumes = 26; // both tiers' slabs at High, the small tier's firstconst unsigned MaxSlabs = 24; // the constant arrays' length, the same in both tiersconst unsigned MaxPuffs = 24;const unsigned MaxStreaks = 16;-const unsigned JacobiSweeps = 14; // even, so the pressure ends where it startedconst unsigned NoiseSide = 32;+// The VolumeSmoke setting, Low and High (Off draws nothing). Low keeps High's grids, since every+// timeline constant is written in cells, and halves what a frame pays instead: half as many+// volumes at once, 8 pressure sweeps for 14, a march step half as long again.+// ponytail: a coarser Low grid needs the timelines' cell constants scaled with it; do that if+// Low still costs too much on a weak card.+struct Quality { unsigned slabs[2]; unsigned sweeps; float stepCells; };+const Quality Qualities[3] = { { { 0, 0 }, 0, 0.0f }, { { 12, 1 }, 8, 0.9f }, { { 24, 2 }, 14, 0.6f } }; // sweeps even, so the pressure ends where it started+int level = 0; // the setting the atlases were last made for+// The world, in game units (a tank is about 30, 7 m: a unit is about 0.23 m).const float Gravity = 42.0f; // units/s^2const float DustSettle = 4.0f; // units/s@@ -88,7 +97,6 @@ const float VelocityHalfLife = 3.0f;const float HeatHalfLife = 1.8f;const float DustHalfLife = 6.0f;const float Extinction = 0.16f; // per world unit at density 1-const float StepCells = 0.6f; // march step with up to three volumes on screenconst DXGI_FORMAT VelocityFormat = DXGI_FORMAT_R16G16B16A16_FLOAT; // xyz cells/s, w heatconst DXGI_FORMAT DensityFormat = DXGI_FORMAT_R16G16_FLOAT; // soot, dust@@ -172,12 +180,24 @@ struct DrawConstants {// What every program starts with, after the tier's GX, GY, GZ and SLABS: the fade that keeps smoke// off the box's walls, round about the column's axis so no square corner shows.+// The air's box (AIR) holds four density channels: soot, dust, and each times its brightness, so a+// cell's grey advects with its soot. A blast's holds two and takes its colours from the timeline.const char *const Grid = R"HLSL(+#ifdef AIR+#define DEN float4+float walls(float3 cell)+{+ float2 inside = min(cell.xy, float2(GX - 1, GY - 1) - cell.xy);+ return smoothstep(0, 4, inside.x) * smoothstep(0, 4, inside.y) * smoothstep(0, 6, GZ - 1 - cell.z);+}+#else+#define DEN float2float walls(float3 cell){float2 across = (cell.xy - float2(GX - 1, GY - 1) * 0.5) / (GX * 0.5 - 1);return (1 - smoothstep(0.6, 1.0, length(across))) * smoothstep(0, 10, GZ - 1 - cell.z);}+#endifuint hash(uint3 v){uint h = v.x * 73856093u ^ v.y * 19349663u ^ v.z * 83492791u;@@ -299,11 +319,19 @@ void main(uint3 id : SV_DispatchThreadID)// The literal is cut in two: MSVC refuses one longer than 16 KB (C2026).const char *const AdvectPass = R"HLSL(Texture3D<float4> Vel : register(t0);-Texture3D<float2> Den : register(t1);+Texture3D<DEN> Den : register(t1);Texture3D<float4> Curl : register(t2);RWTexture3D<float4> VelOut : register(u0);-RWTexture3D<float2> DenOut : register(u1);+RWTexture3D<DEN> DenOut : register(u1);RWTexture3D<float> PresOut : register(u2);+#ifdef AIR+// The particles of every smoke system the air took, as spheres in cells: centre and radius, then+// the soot and the dust they stand for and their brightness. Each 8 by 8 column of cells has its+// list of the spheres that reach it.+StructuredBuffer<float4> Sources : register(t5);+StructuredBuffer<uint2> TileRange : register(t6);+StructuredBuffer<uint> TileIndex : register(t7);+#endiffloat w(int3 c, uint slab) { return Curl.Load(at(c, slab)).w; }[numthreads(8, 8, 8)]void main(uint3 id : SV_DispatchThreadID)@@ -315,14 +343,21 @@ void main(uint3 id : SV_DispatchThreadID)float4 power = Power[slab];float4 shape = Shape[slab];float4 vt = 0;- float2 d = 0;+ DEN d = 0;if (volume.w > 0.5) {PresOut[id] = 0;} else {float3 back = cell - Vel.Load(int4(id, 0)).xyz * dt;vt = Vel.SampleLevel(Linear, uvwOf(back, slab), 0);- d.x = Den.SampleLevel(Linear, uvwOf(back, slab), 0).x;- d.y = Den.SampleLevel(Linear, uvwOf(back + float3(0, 0, Step.z * dt), slab), 0).y; // dust settles+ DEN carried = Den.SampleLevel(Linear, uvwOf(back, slab), 0);+ DEN settled = Den.SampleLevel(Linear, uvwOf(back + float3(0, 0, Step.z * dt), slab), 0); // dust settles+ d.x = carried.x;+ d.y = settled.y;+#ifdef AIR+ d.z = carried.z * Keep.w; // soot thins out in the open air+ d.w = settled.w * Keep.z;+ d.x *= Keep.w;+#endif// Heat lifts, fading out under the ceiling, where a rising cap stops and spreads.float lift = Forces.x * vt.w * saturate((shape.z - cell.z) / max(shape.z * 0.3, 1));vt.z += dt * (lift - Forces.y * d.y); // soot is light; dust and dirt are what weigh@@ -413,6 +448,26 @@ const char *const AdvectPassEnd = R"HLSL(vt.w = max(vt.w, heat.x * k);vt.xyz = lerp(vt.xyz, motion.xyz, saturate(k * heat.z));}+#ifdef AIR+ // The cells under a particle are drawn towards the smoke it stands for at Step.w a second, so+ // the volume follows the particles without being pinned to them: what a wake pushes out of a+ // puff comes back over a fraction of a second, not on the next step.+ {+ uint2 range = TileRange[(c.y / 8) * (GX / 8) + c.x / 8];+ float rate = saturate(Step.w * dt);+ for (uint j = range.x; j < range.x + range.y; ++j) {+ uint index = TileIndex[j];+ float4 where = Sources[index * 2], what = Sources[index * 2 + 1];+ float3 away = cell - where.xyz;+ float r2 = dot(away, away) / (where.w * where.w);+ if (r2 >= 1) continue;+ float k = (1 - r2) * (1 - r2);+ float soot = what.x * k, dust = what.y * k;+ if (soot > d.x) { d.x += (soot - d.x) * rate; d.z += (soot * what.z - d.z) * rate; }+ if (dust > d.y) { d.y += (dust - d.y) * rate; d.w += (dust * what.z - d.w) * rate; }+ }+ }+#endifd = min(d, 4);d *= lerp(0.92, 1, walls(cell)); // smoke that drifts to the walls thins out there// Open sides and top: what reaches them is gone. The ground lets nothing through and keeps@@ -502,7 +557,7 @@ void main(uint3 id : SV_DispatchThreadID)// Sunlight reaching each cell through the soot and dust between it and the sun, with a share that// went through more thinly, for the light scattered more than once.const char *const LightPass = R"HLSL(-Texture3D<float2> Den : register(t0);+Texture3D<DEN> Den : register(t0);RWTexture3D<float> LightOut : register(u0);[numthreads(8, 8, 8)]void main(uint3 id : SV_DispatchThreadID)@@ -512,7 +567,7 @@ void main(uint3 id : SV_DispatchThreadID)[loop] for (int k = 1; k <= 16; ++k) {float3 q = float3(c) + SunToward.xyz * (k * 1.5);if (any(q < float3(-0.5, -0.5, -0.5)) || any(q > float3(GX - 0.5, GY - 0.5, GZ - 0.5))) break;- float2 dd = Den.SampleLevel(Linear, uvwOf(q, slab), 0);+ DEN dd = Den.SampleLevel(Linear, uvwOf(q, slab), 0);tau += dd.x + dd.y;}tau *= 1.5 * SunToward.w * volume.z;@@ -696,15 +751,32 @@ std::unordered_map<const ParticleSystemTemplate *, TemplateKind> templateKinds;unsigned claimedCount = 0, joinedCount = 0, droppedCount = 0;int lastReport = 0;+unsigned tierOf(unsigned slot) { return slot >= TierShapes[1].first ? 1 : 0; }+unsigned slabOf(unsigned slot) { return slot - TierShapes[tierOf(slot)].first; }++void releaseState();++// The setting, read every time: Off, Low or High from the options menu, or -volsmoke for the run.+// A change drops every volume, program and texture, and forgets every system taken, so with Off+// the next frame draws the billboards again, and with a new level the atlases are made again at+// its size the next time a blast asks.bool requested(){- static const bool on = findEarlyCommandLineOption(L"-volsmoke") != NULL;- return on;+ const int want = TheGlobalData ? (std::min)((std::max)(TheGlobalData->m_volumeSmoke, 0), 2) : 0;+ if (want != level) {+ releaseState();+ takenSystems.clear();+ firstSeen.clear();+ lastReport = 0;+ level = want;+ TierShapes[0].slabs = Qualities[level].slabs[0];+ TierShapes[1].slabs = Qualities[level].slabs[1];+ TierShapes[1].first = TierShapes[0].slabs;+ DEBUG_LOG(("VOLSMOKE: setting %s\n", level == 0 ? "Off" : level == 1 ? "Low" : "High"));+ }+ return level > 0;}-unsigned tierOf(unsigned slot) { return slot >= TierShapes[1].first ? 1 : 0; }-unsigned slabOf(unsigned slot) { return slot - TierShapes[tierOf(slot)].first; }-void releaseState(){for (Tier &tier : state.tiers) {@@ -1262,7 +1334,7 @@ void step(ID3D11DeviceContext *context, unsigned t, int now, float dt, float secrun(context, tier, AdvectProgram, { tier.velocity[0].view, tier.density[in].view, tier.curl.view },{ tier.velocity[1].write, tier.density[out].write, tier.pressure[0].write }, slabs);run(context, tier, DivergenceProgram, { tier.velocity[1].view }, { tier.divergence.write }, slabs);- for (unsigned sweep = 0; sweep < JacobiSweeps; ++sweep) {+ for (unsigned sweep = 0; sweep < Qualities[level].sweeps; ++sweep) {const unsigned from = sweep & 1;run(context, tier, JacobiProgram, { tier.pressure[from].view, tier.divergence.view }, { tier.pressure[1 - from].write }, slabs);}@@ -1557,7 +1629,7 @@ void Render(const HazardCloud::Camera &camera)context->PSSetSamplers(0, 2, samplers);context->PSSetConstantBuffers(0, 1, &state.drawConstants);// the budget: past three volumes on screen each one is marched in longer steps- const float stepCells = StepCells * (std::max)(1.0f, shown / 3.0f);+ const float stepCells = Qualities[level].stepCells * (std::max)(1.0f, shown / 3.0f);int boundTier = -1;for (unsigned n = 0; n < shown; ++n) {const unsigned slot = order[n];diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex 6cac123a8..9ae8964a9 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -16480,6 +16480,29 @@ TEST(cloud_style_defaults_to_classic_and_preserves_an_explicit_volumetric_choiceTheWritableGlobalData = saved;}+TEST(volume_smoke_defaults_off_and_applies_live_at_three_levels)+{+ GlobalData *saved = TheWritableGlobalData;+ GlobalData *scratch = NEW GlobalData;+ TheWritableGlobalData = scratch;+ const OptionDef *smoke = findOptionDef("VolumeSmoke");+ CHECK(smoke != NULL);+ if (smoke) {+ CHECK_EQ(scratch->m_volumeSmoke, 0);+ CHECK_EQ(smoke->kind, OPTION_ENUM);+ CHECK_EQ(smoke->apply, APPLY_LIVE);+ CHECK_EQ(smoke->lo, 0);+ CHECK_EQ(smoke->hi, 2);+ CHECK_STR(smoke->widgetName, "OptionsMenu.wnd:ComboBoxVolumeSmoke");+ UserPreferences pref;+ pref["VolumeSmoke"] = "1";+ loadOptionsFromPreferences(pref);+ CHECK_EQ(scratch->m_volumeSmoke, 1);+ }+ delete scratch;+ TheWritableGlobalData = saved;+}+TEST(option_catalog_round_trips_every_key_through_options_ini){/* Every row has to survive the trip out to Options.ini and back, at both ends of its range.diff --git a/GeneralsMD/Code/Tools/optionsmenu_layout.py b/GeneralsMD/Code/Tools/optionsmenu_layout.pyindex 778daaf5f..38a9155cb 100644--- a/GeneralsMD/Code/Tools/optionsmenu_layout.py+++ b/GeneralsMD/Code/Tools/optionsmenu_layout.py@@ -204,6 +204,8 @@ NEW_CONTROLS = [(CHECK, "CheckParticleShadows", "GUI:ParticleShadows"),(LABEL, "LabelSmoke", "GUI:Smoke"),(COMBO, "ComboBoxSmoke", None),+ (LABEL, "LabelVolumeSmoke", "GUI:VolumeSmoke"),+ (COMBO, "ComboBoxVolumeSmoke", None),(CHECK, "CheckParticleBounce", "GUI:ParticleBounce"),(CHECK, "CheckChromaLighting", "GUI:ChromaLighting"),(LABEL, "LabelAmbientVolume", "GUI:AmbientVolume"),@@ -382,6 +384,7 @@ GROUP_LAYOUT = [("GUI:OptionsGroupParticles", [setting("LabelParticleCap", "ParticleCapSlider", "ValueParticleCap"),setting("LabelSmoke", "ComboBoxSmoke"),+ setting("LabelVolumeSmoke", "ComboBoxVolumeSmoke"),("check", "CheckParticleBounce"),("check", "CheckSmokeFireLighting"),("check", "CheckDebrisTrails")])]),