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): performance / quality slider driving every graphics option
Olcay Seyganfe90b5e5cc33
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 89721f011..e7c61d5c7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1505,7 +1505,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same- The whole options screen is back in the game on Windows. Options on the main menu, Esc and then Options in a match, and Options in the online lobby all open every page, so you can change the resolution, the detail or a camera habit without leaving the game, and the launcher's Options page still sets the same things before it starts. Accept writes only what you changed on the screen. A setting you left alone keeps whatever your settings file says, so a language picked in the launcher, or the light Classic Graphics forces to Classic for as long as it is on, never ends up saved over the choice you made.- Every setting the game reads from the launcher's Options page has a control on the screen now. Shadow Quality and Volumetric Smoke join the shadows on the Effects page, with Smoke Lit By Fire and Explosion Debris Trails under smoke; Lighting, Classic or Reforged, sits over Glow on the Graphics page. Controls gets Edge Scroll In A Window, Drag Out A Formation, Build Without A Worker and the two scroll anchor boxes, Interface gets Health Bar Color, Menu Transition Speed and the two replay camera boxes. The scroll anchor and replay camera boxes are EA's own: they shipped hidden off the edge of the screen with their code still working.-- Cloud shadows have a switch of their own in the launcher, at any detail preset. They used to follow the preset alone: Low took them away, and every other preset kept them on with no way to say no. The preset leaves them alone now, so they stay on until you turn them off, and the change shows the moment the game starts on either renderer.+- Cloud shadows have a switch of their own in the launcher, at any detail preset. They used to follow the preset alone: Low took them away, and every other preset kept them on with no way to say no. Starting the game never touches them now, so they stay as you set them, and the change shows the moment the game starts on either renderer. On the options screen they are a box like the others, which the quality slider and the presets tick and untick with the rest.- Display, graphics, effects, audio, controls, interface and network, behind seven buttons across the top. The original screen was one panel with everything on it at once, and it was already full the day it shipped: the language filter, the keyboard button and four camera checkboxes were parked off the right edge where nobody could reach them, because there was nowhere left to put them. The four checkboxes have a page each now.- Every setting sits with the ones that do the same kind of job. Display is the screen and its brightness. Graphics is what the picture costs and how sharp it is, with the glow and the lighting in a group of their own instead of mixed in with the anti-aliasing. Effects is what stands in the world: all seven shadow boxes together, cloud shadows included, then the scenery, then smoke. Controls splits the camera, the orders, building placement and the mouse into four groups, and Interface holds the command bar size, the income readout, the health bars, the colours, the order lines and the language. In Classic the screen leaves out the few boxes Classic ignores anyway, from smooth motion to the HUD size and the order lines, and closes the gaps they leave, so a box on that screen always does something.- Classic Graphics, on the Graphics page, puts the game back the way it looked in 2003 in one click: its own textures and ground in place of the upscaled ones, the old hard shadows, the round dark patch under every tree where Reforged lays the tree's own outline on the ground, and no glow or sharpening over the picture. Leave it off and you have Reforged. The rest of the options stay yours either way, and the box takes effect the next time the game starts.@@ -1518,8 +1518,9 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same- Supply piles stop shouting their cash over the whole map. A small pile shows its amount only while your cursor is on it or close by, in a smaller font; a big supply dock keeps its label all the time. Classic has the same labels now, with the radar still leaving the piles off.- The Esc menu and the general's promotion screen close the way they open, in both interfaces. Both used to vanish in a single frame, and Classic's Esc menu had lost its opening flash as well. Classic plays 1.04's flash and fade, forwards to open and backwards to close; Reforged fades its pages out over a little more than a tenth of a second, as fast as they fade in.- Every graphics setting is on the Graphics and Effects pages. Shadows, clouds, ground lighting, soft water edges, trees, extra animations, heat haze, texture resolution and the particle limit used to hide in a popup that only opened if you picked Custom from the detail box on another page, so choosing High never showed you what High turns on. Pick a preset now and its settings change in front of you; touch any one of them and the box reads Custom. Texture filtering and the number of anisotropic samples, which needed a text editor, sit there too.-- Every page is sorted into titled groups by what the settings do, and the groups sit in the same three columns on every tab. On Graphics the detail preset heads the first column with the texture and particle sliders under it, the picture settings take the second and the terrain the third. The framed boxes the original drew inside each page are gone. They were sized for headings that no longer exist, which is why no two pages started their first setting at the same height.-- The detail box has Ultra above High, and a preset now sets everything it is responsible for. Picking High used to leave antialiasing and texture filtering wherever they happened to be; High now brings 4x antialiasing and 8 anisotropic samples with it, and Low turns both down for the machines that need it. Ultra is High with the particle limit at the top of its slider, 5,000 against High's 3,000, detail that is never dropped when the frame rate dips, 8x antialiasing, 16 anisotropic samples, thick smoke and every new shadow and effect switched on. Glow stays yours whichever you pick: the artwork was painted without it.+- One slider sets the whole picture. Performance / Quality sits under the detail preset: drag it left for the fastest picture and right for the best looking, and every box, list and slider on Graphics and Effects moves with it while you drag, the settings that cost the least frame time switching on first and the dearest last. The order is measured, one setting at a time, in a 900 unit four-army fight at 1920x1080 on a GeForce RTX 2060 with everything else at its best: cast shadows are the dearest at 2.5 of the card's 5 milliseconds a frame, the particle limit next at 1.6, thick smoke 0.75 and warm light 0.35, and twenty-two of the thirty-three settings cost nothing the measurement could see, so sixteen of them are on by the third step. The shadows that ride on the cast ones wait for them. Low, Medium, High and Ultra are four points along it. Pick a preset and the slider jumps to its point; stop the slider between two and the preset box reads Custom, as it does when you change a box by hand afterwards, which leaves the slider where it was. Beside it the readout names the preset or says how far along you are, and the screen remembers the spot. Nothing applies until you press Accept. Boxes you cannot change keep their value: in a match the slider is greyed out with the presets, under the old renderer the three looks only the new one draws stay as they were, and with Classic Graphics on the slider leaves the lighting and the smoke shadows Classic switches off. A settings file that names a preset beside boxes that say otherwise opens as Custom.+- Every page is sorted into titled groups by what the settings do, and the groups sit in the same three columns on every tab. On Graphics the detail preset heads the first column with the quality and texture sliders under it, the picture settings take the second and the terrain the third; the particle limit heads the particles on Effects. The framed boxes the original drew inside each page are gone. They were sized for headings that no longer exist, which is why no two pages started their first setting at the same height.+- The detail box has Ultra above High, and a preset sets every graphics setting on Graphics and Effects, because it is a point on the quality slider. Two stay out: trees, which every preset keeps as it always did because the battle itself reads them as a map loads, and the outline of units behind buildings, which is there to read the battlefield. Picking High used to leave antialiasing and texture filtering wherever they happened to be; High now brings 4x antialiasing and 16 anisotropic samples with it, and Low turns both down for the machines that need it. Medium already has everything that costs nothing to draw: 16 anisotropic samples, the flat shadows, Modern water, the volumetric hazard clouds, team glow and water foam, with 1,500 particles and no cast shadows. High adds the cast shadows and every shadow that rides on them, 4x antialiasing and 3,000 particles. Ultra puts the particle limit at the top of its slider, 5,000, never drops detail when the frame rate dips, and adds 8x antialiasing, the sharpest sun shadows, thick smoke and warm light. Low is the bare game for an old machine: no shadows, half-size textures, no glow and 500 particles. From Medium up the glow sits on Medium. A preset brings its whole column from the first launch, so a new install and a settings file from before the slider start with every box their preset shows; a setting the file itself names keeps its value.- A new Windows PC starts on High. The first launch picks a preset by looking the graphics card up in a list that ends at the GeForce4 and the Radeon 9700, so any card from the last twenty years came back as unknown, the game took it for a 1999 TNT2 and set Low. A card the list does not know now counts as meeting every preset, which Macs and Linux already did, and the processor and memory decide the rest.- Effects is a page of its own, with seven settings that used to be command line switches or were fixed in the game's data: shadows for infantry, for missiles and bombs, for scenery and for smoke clouds, thicker smoke in two strengths, particles that land on the ground instead of falling through it, and swaying trees split away from extra animations, so the scaffolding can stay while the forest holds still. The shadows take effect on the next map, smoke and particles the next time the game starts.- Every slider shows its value beside it: brightness, the three volumes, scroll speed, texture resolution, particles and anisotropic samples. Every label now starts on the same edge as the box under it; the original drew each one a few pixels to the right.diff --git a/GeneralsMD/Code/Data/German/Generals.str b/GeneralsMD/Code/Data/German/Generals.strindex c07fd2ca7..7903bf89a 100644--- a/GeneralsMD/Code/Data/German/Generals.str+++ b/GeneralsMD/Code/Data/German/Generals.str@@ -14133,6 +14133,14 @@ GUI:OptionsTabEffects"Effekte"END+GUI:GraphicsQuality+"Leistung / Qualität"+END++TOOLTIP:GraphicsQuality+"Links das schnellste Bild, rechts das schönste. Beim Ziehen werden die Felder auf dieser Seite und unter Effekte gesetzt, die günstigen zuerst, und die vier Vorgaben sind Punkte darauf. Änderst du danach ein Feld, steht die Vorgabe auf Benutzerdefiniert. Gilt, sobald du Annehmen drückst; manche Einstellungen warten auf die nächste Karte oder den nächsten Start."+END+GUI:DetailNote0"Alle Optionen an, die meisten Partikel und dichter Rauch, und die Details sinken auch im großen Gefecht nie. Die Auswahl füllt nur die Felder aus; Annehmen wendet sie an."END@@ -14150,7 +14158,7 @@ GUI:DetailNote3ENDGUI:DetailNote4-"Deine eigene Mischung der Felder auf dieser Seite und unter Effekte. Annehmen behält sie bei."+"Deine eigene Mischung der Felder auf dieser Seite und unter Effekte, oder ein Punkt auf dem Regler zwischen zwei Vorgaben. Annehmen behält sie bei."ENDGUI:TextureFilterdiff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex db7d6b54d..6ba1f4ab5 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -158,6 +158,14 @@ GUI:Detail"Detail Preset"END+GUI:GraphicsQuality+"Performance / Quality"+END++TOOLTIP:GraphicsQuality+"Left is the fastest picture, right the best looking. Dragging it sets the boxes on this page and on Effects, the cheap ones first, and the four presets are points along it. Change a box afterwards and the preset reads Custom. Applies when you press Accept; some settings wait for the next map or the next launch."+END+GUI:DetailNote0"Every box on, the most particles and thick smoke, and detail never drops in a big fight. Picking it only fills in the boxes; Accept applies it."END@@ -175,7 +183,7 @@ GUI:DetailNote3ENDGUI:DetailNote4-"Your own mix of the boxes on this page and on Effects. Accept keeps it as it is."+"Your own mix of the boxes on this page and on Effects, or a point on the slider between two presets. Accept keeps it as it is."ENDGUI:Shadows3Ddiff --git a/GeneralsMD/Code/Data/Russian/Generals.str b/GeneralsMD/Code/Data/Russian/Generals.strindex 50675eadd..79e8aacbb 100644--- a/GeneralsMD/Code/Data/Russian/Generals.str+++ b/GeneralsMD/Code/Data/Russian/Generals.str@@ -15789,6 +15789,14 @@ GUI:Ultra"Ультра"END+GUI:GraphicsQuality+"Производительность / Качество"+END++TOOLTIP:GraphicsQuality+"Слева самая быстрая картинка, справа самая красивая. Ползунок расставляет галочки на этой странице и на вкладке «Эффекты», сначала дешёвые, а четыре шаблона стоят на нём точками. Измените галочку потом, и шаблон станет «Особый». Применяется кнопкой «Принять»; некоторые настройки ждут следующей карты или следующего запуска."+END+GUI:DetailNote0"Все галочки включены, максимум частиц и густой дым, детализация не падает даже в крупном бою. Выбор лишь расставляет галочки; применяется кнопкой «Принять»."END@@ -15806,7 +15814,7 @@ GUI:DetailNote3ENDGUI:DetailNote4-"Ваш набор галочек на этой странице и на вкладке «Эффекты». «Принять» оставит всё как есть."+"Ваш набор галочек на этой странице и на вкладке «Эффекты» или точка ползунка между двумя шаблонами. «Принять» оставит всё как есть."ENDGUI:TextureFilterdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 4b7dadda9..43fbda144 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -973,6 +973,14 @@ GUI:Detail"Hazır Ayar"END+GUI:GraphicsQuality+"Performans / Kalite"+END++TOOLTIP:GraphicsQuality+"Sol en hızlı görüntü, sağ en güzeli. Sürgüyü çekince bu sayfadaki ve Efektler sayfasındaki kutular ayarlanır, ucuz olanlar önce açılır; dört hazır ayar sürgünün üstündeki noktalardır. Sonra bir kutuyu değiştirirseniz hazır ayar Özel olur. Kabul Et'e basınca uygulanır; bazı ayarlar bir sonraki haritayı ya da oyunun bir sonraki açılışını bekler."+END+GUI:Faction"Ordu"END@@ -14766,7 +14774,7 @@ GUI:DetailNote3ENDGUI:DetailNote4-"Bu sayfadaki ve Efektler sayfasındaki kutuları kendiniz seçtiniz. Kabul Et'e basınca olduğu gibi kaydedilir."+"Bu sayfadaki ve Efektler sayfasındaki kutuları kendiniz seçtiniz ya da sürgü iki hazır ayarın arasında duruyor. Kabul Et'e basınca olduğu gibi kaydedilir."ENDGUI:TextureFilterdiff --git a/GeneralsMD/Code/Data/Ukrainian/Generals.str b/GeneralsMD/Code/Data/Ukrainian/Generals.strindex 1c9518219..8161e862a 100644--- a/GeneralsMD/Code/Data/Ukrainian/Generals.str+++ b/GeneralsMD/Code/Data/Ukrainian/Generals.str@@ -15789,6 +15789,14 @@ GUI:Ultra"Ультра"END+GUI:GraphicsQuality+"Продуктивність / Якість"+END++TOOLTIP:GraphicsQuality+"Ліворуч найшвидше зображення, праворуч найгарніше. Повзунок виставляє пункти на цій сторінці та в Ефектах, спершу дешеві, а чотири набори стоять на ньому точками. Змініть пункт потім, і набір стане «Власні». Застосовується кнопкою Прийняти; деякі налаштування чекають наступної мапи або наступного запуску."+END+GUI:DetailNote0"Усе ввімкнено, найбільше часток і густий дим, а деталізація ніколи не падає у великій битві. Вибір лише заповнює пункти; застосовує Прийняти."END@@ -15806,7 +15814,7 @@ GUI:DetailNote3ENDGUI:DetailNote4-"Ваш власний набір пунктів на цій сторінці та в Ефектах. Прийняти залишає його як є."+"Ваш власний набір пунктів на цій сторінці та в Ефектах або точка повзунка між двома наборами. Прийняти залишає його як є."ENDGUI:TextureFilterdiff --git a/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd b/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wndindex b7d88f7c9..10fa936e5 100644--- a/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd+++ b/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd@@ -3223,18 +3223,22 @@ WINDOWCHILDWINDOWWINDOWTYPE = STATICTEXT;- SCREENRECT = UPPERLEFT: 34 238, BOTTOMRIGHT: 258 318, CREATIONRESOLUTION: 800 600;- NAME = "OptionsMenu.wnd:DetailNote";+ SCREENRECT = UPPERLEFT: 34 238, BOTTOMRIGHT: 258 262, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:LabelGraphicsQuality";+ TOOLTIPTEXT = "TOOLTIP:GraphicsQuality";STATUS = ENABLED;STYLE = STATICTEXT+MOUSETRACK;SYSTEMCALLBACK = "[None]";INPUTCALLBACK = "[None]";TOOLTIPCALLBACK = "[None]";DRAWCALLBACK = "[None]";- FONT = NAME: "Arial", SIZE: 10, BOLD: 0;- HEADERTEMPLATE = "LabelRegular";+ FONT = NAME: "Arial", SIZE: 14, BOLD: 0;+ HEADERTEMPLATE = "MinorTitle";TOOLTIPDELAY = -1;- TEXTCOLOR = ENABLED: 164 170 190 255, ENABLEDBORDER: 0 0 0 255, DISABLED: 164 170 190 255, DISABLEDBORDER: 0 0 0 255, HILITE: 164 170 190 255, HILITEBORDER: 0 0 0 255;+ TEXT = "GUI:GraphicsQuality";+ 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,@@ -3267,55 +3271,8 @@ WINDOWCHILDWINDOWWINDOWTYPE = STATICTEXT;- SCREENRECT = UPPERLEFT: 34 322, BOTTOMRIGHT: 258 346, CREATIONRESOLUTION: 800 600;- NAME = "OptionsMenu.wnd:LabelTextureResolution";- 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:TextureResolution";- 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: 255 4 0 0, BORDERCOLOR: 255 132 130 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,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;- DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 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;- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 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,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;- STATICTEXTDATA = CENTERED: 0;- END- CHILD- WINDOW- WINDOWTYPE = STATICTEXT;- SCREENRECT = UPPERLEFT: 178 346, BOTTOMRIGHT: 258 370, CREATIONRESOLUTION: 800 600;- NAME = "OptionsMenu.wnd:ValueTextureResolution";+ SCREENRECT = UPPERLEFT: 178 262, BOTTOMRIGHT: 258 286, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:ValueGraphicsQuality";STATUS = ENABLED;STYLE = STATICTEXT+MOUSETRACK;SYSTEMCALLBACK = "[None]";@@ -3360,8 +3317,8 @@ WINDOWCHILDWINDOWWINDOWTYPE = HORZSLIDER;- SCREENRECT = UPPERLEFT: 40 346, BOTTOMRIGHT: 176 370, CREATIONRESOLUTION: 800 600;- NAME = "OptionsMenu.wnd:LowResSlider";+ SCREENRECT = UPPERLEFT: 40 262, BOTTOMRIGHT: 176 286, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:SliderGraphicsQuality";STATUS = ENABLED+IMAGE+TABSTOP;STYLE = HORZSLIDER+MOUSETRACK;SYSTEMCALLBACK = "[None]";@@ -3370,11 +3327,11 @@ WINDOWDRAWCALLBACK = "[None]";FONT = NAME: "Times New Roman", SIZE: 14, BOLD: 0;HEADERTEMPLATE = "[None]";- TOOLTIPTEXT = "TOOLTIP:LowResSlider";+ TOOLTIPTEXT = "TOOLTIP:GraphicsQuality";TOOLTIPDELAY = -1;- TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,- DISABLED: 62 64 92 255, DISABLEDBORDER: 31 32 47 255,- HILITE: 186 255 12 255, HILITEBORDER: 0 2 0 255;+ 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: 255 255 255 255, BORDERCOLOR: 255 255 255 255,IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,@@ -3402,8 +3359,7 @@ WINDOWIMAGE: 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;- SLIDERDATA = MINVALUE: 0,- MAXVALUE: 2;+ SLIDERDATA = MINVALUE: 0, MAXVALUE: 10;SLIDERTHUMBENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 128 128 255, BORDERCOLOR: 255 0 0 255,IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,@@ -3433,10 +3389,54 @@ WINDOWIMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;ENDCHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 34 294, BOTTOMRIGHT: 258 374, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:DetailNote";+ STATUS = ENABLED;+ STYLE = STATICTEXT+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "LabelRegular";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 164 170 190 255, ENABLEDBORDER: 0 0 0 255, DISABLED: 164 170 190 255, DISABLEDBORDER: 0 0 0 255, HILITE: 164 170 190 255, HILITEBORDER: 0 0 0 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+ CHILDWINDOWWINDOWTYPE = STATICTEXT;SCREENRECT = UPPERLEFT: 34 378, BOTTOMRIGHT: 258 402, CREATIONRESOLUTION: 800 600;- NAME = "OptionsMenu.wnd:LabelParticleCap";+ NAME = "OptionsMenu.wnd:LabelTextureResolution";STATUS = ENABLED;STYLE = STATICTEXT+MOUSETRACK;SYSTEMCALLBACK = "[None]";@@ -3446,7 +3446,7 @@ WINDOWFONT = NAME: "Arial", SIZE: 14, BOLD: 0;HEADERTEMPLATE = "MinorTitle";TOOLTIPDELAY = -1;- TEXT = "GUI:ParticleLimit";+ TEXT = "GUI:TextureResolution";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;@@ -3483,7 +3483,7 @@ WINDOWWINDOWWINDOWTYPE = STATICTEXT;SCREENRECT = UPPERLEFT: 178 402, BOTTOMRIGHT: 258 426, CREATIONRESOLUTION: 800 600;- NAME = "OptionsMenu.wnd:ValueParticleCap";+ NAME = "OptionsMenu.wnd:ValueTextureResolution";STATUS = ENABLED;STYLE = STATICTEXT+MOUSETRACK;SYSTEMCALLBACK = "[None]";@@ -3529,7 +3529,7 @@ WINDOWWINDOWWINDOWTYPE = HORZSLIDER;SCREENRECT = UPPERLEFT: 40 402, BOTTOMRIGHT: 176 426, CREATIONRESOLUTION: 800 600;- NAME = "OptionsMenu.wnd:ParticleCapSlider";+ NAME = "OptionsMenu.wnd:LowResSlider";STATUS = ENABLED+IMAGE+TABSTOP;STYLE = HORZSLIDER+MOUSETRACK;SYSTEMCALLBACK = "[None]";@@ -3538,11 +3538,11 @@ WINDOWDRAWCALLBACK = "[None]";FONT = NAME: "Times New Roman", SIZE: 14, BOLD: 0;HEADERTEMPLATE = "[None]";- TOOLTIPTEXT = "TOOLTIP:ParticleCapSlider";+ TOOLTIPTEXT = "TOOLTIP:LowResSlider";TOOLTIPDELAY = -1;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;+ DISABLED: 62 64 92 255, DISABLEDBORDER: 31 32 47 255,+ HILITE: 186 255 12 255, HILITEBORDER: 0 2 0 255;ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 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,@@ -3570,8 +3570,8 @@ WINDOWIMAGE: 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;- SLIDERDATA = MINVALUE: 100,- MAXVALUE: 5000;+ SLIDERDATA = MINVALUE: 0,+ MAXVALUE: 2;SLIDERTHUMBENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 128 128 255, BORDERCOLOR: 255 0 0 255,IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,@@ -7046,6 +7046,174 @@ WINDOWWINDOWWINDOWTYPE = STATICTEXT;SCREENRECT = UPPERLEFT: 530 182, BOTTOMRIGHT: 754 206, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:LabelParticleCap";+ 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:ParticleLimit";+ 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: 255 4 0 0, BORDERCOLOR: 255 132 130 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 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;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ STATICTEXTDATA = CENTERED: 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 674 206, BOTTOMRIGHT: 754 230, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:ValueParticleCap";+ STATUS = ENABLED;+ STYLE = STATICTEXT+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 14, BOLD: 0;+ HEADERTEMPLATE = "MinorTitle";+ TOOLTIPDELAY = -1;+ 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 = HORZSLIDER;+ SCREENRECT = UPPERLEFT: 536 206, BOTTOMRIGHT: 672 230, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:ParticleCapSlider";+ STATUS = ENABLED+IMAGE+TABSTOP;+ STYLE = HORZSLIDER+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Times New Roman", SIZE: 14, BOLD: 0;+ HEADERTEMPLATE = "[None]";+ TOOLTIPTEXT = "TOOLTIP:ParticleCapSlider";+ TOOLTIPDELAY = -1;+ 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: 255 0 0 255, BORDERCOLOR: 255 128 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;+ DISABLEDDRAWDATA = IMAGE: hilightedbox, COLOR: 128 128 128 255, BORDERCOLOR: 64 64 64 255,+ IMAGE: dehilightedbox, 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: linebox, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: arrow, 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;+ SLIDERDATA = MINVALUE: 100,+ MAXVALUE: 5000;+ SLIDERTHUMBENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 128 128 255, BORDERCOLOR: 255 0 0 255,+ IMAGE: NoImage, COLOR: 128 128 128 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;+ SLIDERTHUMBDISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 128 128 128 255,+ IMAGE: NoImage, COLOR: 0 0 0 255, BORDERCOLOR: 64 64 64 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;+ SLIDERTHUMBHILITEDRAWDATA = IMAGE: arrow, COLOR: 0 255 0 255, BORDERCOLOR: 128 255 128 255,+ IMAGE: arrow, COLOR: 0 0 255 255, BORDERCOLOR: 128 128 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;+ END+ CHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 530 238, BOTTOMRIGHT: 754 262, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:LabelSmoke";TOOLTIPTEXT = "TOOLTIP:Smoke";STATUS = ENABLED;@@ -7093,7 +7261,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = COMBOBOX;- SCREENRECT = UPPERLEFT: 536 206, BOTTOMRIGHT: 760 230, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 536 262, BOTTOMRIGHT: 760 286, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:ComboBoxSmoke";TOOLTIPTEXT = "TOOLTIP:Smoke";STATUS = ENABLED+IMAGE;@@ -7333,7 +7501,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = CHECKBOX;- SCREENRECT = UPPERLEFT: 536 238, BOTTOMRIGHT: 760 262, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 536 294, BOTTOMRIGHT: 760 318, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:CheckParticleBounce";STATUS = ENABLED+IMAGE+BORDER;STYLE = CHECKBOX+MOUSETRACK;@@ -7380,7 +7548,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = CHECKBOX;- SCREENRECT = UPPERLEFT: 536 266, BOTTOMRIGHT: 760 290, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 536 322, BOTTOMRIGHT: 760 346, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:CheckSmokeFireLighting";STATUS = ENABLED+IMAGE+BORDER;STYLE = CHECKBOX+MOUSETRACK;@@ -7427,7 +7595,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = CHECKBOX;- SCREENRECT = UPPERLEFT: 536 294, BOTTOMRIGHT: 760 318, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 536 350, BOTTOMRIGHT: 760 374, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:CheckDebrisTrails";STATUS = ENABLED+IMAGE+BORDER;STYLE = CHECKBOX+MOUSETRACK;diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h b/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.hindex b3884a84c..6e41b3540 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h@@ -175,7 +175,7 @@ public:void init(void); ///<initialize tables of preset LOD's.void setCurrentTextureReduction(Int val) {m_currentTextureReduction = val;}Int getCurrentTextureReduction(void) {return m_currentTextureReduction;}- Int getStaticGameLODIndex(AsciiString name);+ static Int getStaticGameLODIndex(AsciiString name); ///< static: the options catalog reads a preset's name before the manager existsInt getDynamicGameLODIndex(AsciiString name);inline Bool isParticleSkipped(void);inline Bool isDebrisSkipped(void);@@ -253,9 +253,16 @@ ParticlePriorityType GameLODManager::getMinDynamicParticleSkipPriority(void)return m_minDynamicParticleSkipPriority;}-/** The Ultra level made from whatever GameLOD.ini says High is: every effect on, the particle limit- * at the top of the options slider, and no dropping detail when the frame rate dips. */+/** The Ultra level made from whatever GameLOD.ini says High is, with the biggest Direct3D 11 particle+ * ring. What it shows on the options pages is applyGraphicsQualityStep's, as for every preset. */extern StaticGameLODInfo makeUltraStaticGameLOD( const StaticGameLODInfo &high );+/** The fields applyStaticLODLevel hands on that the options pages have a control for, set to what the+ * Performance / Quality slider shows at this step (TheGraphicsQualityTable in OptionsCatalog.cpp).+ * The fields with no control - tank tracks, the particle ring, the frame limit - keep what they held,+ * and so do the trees, which a preset gives whenever the memory test passed, and the cloud map,+ * which is a catalog option the preset does not apply. */+extern void applyGraphicsQualityStep( StaticGameLODInfo &info, Int step );+extern GameLODManager *TheGameLODManager;#endif _GAME_LOD_H_\ No newline at end of filediff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.hindex d076b8f5b..b42ee3c5d 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h@@ -328,6 +328,7 @@ public:Int m_cloudStyle; // "CloudStyle": 0 = Classic (default), 1 = Volumetric (when supported)Bool 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 itBool m_classicGraphics; // "ClassicGraphics": the game's own art, tile, shadows and picture; read at startupInt m_lightingStyle; // "LightingStyle": LightingStyleType; the map's lights are rebalanced as each map loadsBool m_shadowMap; // "-shadowmap": draw the casters into the sun's depth buffer as welldiff --git a/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.h b/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.hindex a4a73ce33..b6026e4ab 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.h@@ -155,11 +155,50 @@ enum { SHADOW_QUALITY_COUNT = 3 };// What colours a health bar: 0 the health, green through red, 1 the owner's player colour.enum { HEALTH_BAR_COLORS_COUNT = 2 };+//-----------------------------------------------------------------------------+// The Performance / Quality slider on the Graphics page. One row per graphics setting the Graphics+// and Effects pages carry, holding what that setting's control shows at each step of the slider:+// step 0 is the fastest picture, the last step the best looking, and a setting that costs little+// frame time turns up at an earlier step than one that costs much. The four detail presets are+// steps on it (TheGraphicsQualityAnchors), so GameLODManager::init takes the presets' values for the+// GameLOD.ini fields from here too. A new graphics setting is one more row.+//+// Not in it: the resolution, the window, the monitor, VSync, gamma and ClassicGraphics, which are+// the screen and a choice of art rather than a price paid in frame time, the behind-buildings+// marker, which is there to read the battlefield, and trees, which GameLogic reads as a map loads.+// A setting the simulation reads stays out of the slider.+enum { GRAPHICS_QUALITY_STEPS = 11 };++struct GraphicsQualityRow+{+ const char *control; ///< the control's name in OptionsMenu.wnd, without "OptionsMenu.wnd:"+ Real costMs; ///< Direct3D 11 GPU milliseconds a frame the row's last step costs over its first, 0 under the noise+ Int values[ GRAPHICS_QUALITY_STEPS ]; ///< per step: a check box 0 or 1, a combo box its entry, a slider its position+};++extern const GraphicsQualityRow TheGraphicsQualityTable[];+extern const Int TheGraphicsQualityTableCount;++/** The slider's step for each detail preset, indexed by StaticGameLODLevel: Low, Medium, High, Ultra. */+extern const Int TheGraphicsQualityAnchors[];++/** The row for this control, or NULL. */+extern const GraphicsQualityRow *findGraphicsQualityRow( const char *control );+/** Options.ini -> TheWritableGlobalData, for every row. A key that is absent leaves the field at* whatever GlobalData's constructor put there, which is what makes an old Options.ini keep- * working when a row is added. */+ * working when a row is added. A file that names a detail preset and no GraphicsQuality, one+ * written before the slider or by the launcher alone, first gets that preset's column of+ * TheGraphicsQualityTable, so the keys it does carry still win. */extern void loadOptionsFromPreferences( UserPreferences& pref );+/** The first detail preset GameLODManager applies, when Options.ini had no GraphicsQuality: every+ * catalog row its column names goes to that column, except a row Options.ini named or a switch or+ * ClassicGraphics changed after the load. This is how a first run with no Options.ini, whose+ * preset is picked only once the display starts, gets the boxes its preset shows. Custom, and+ * every later call, changes nothing. */+extern void applyGraphicsQualityColumnAtStartup( Int staticGameLODLevel );+/** TheGlobalData -> Options.ini, for every row. The options menu's Accept writes only the rows the* player changed instead, so a value the command line or ClassicGraphics put in GlobalData for one* run does not end up on disk. */diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cppindex aa5598e5d..19b009ba0 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp@@ -37,6 +37,7 @@#include "zhio.h"#include "Common/GameLOD.h"+#include "Common/OptionsCatalog.h"#include "GameClient/TerrainVisual.h"#include "GameClient/GameClient.h"#include "Common/UserPreferences.h"@@ -293,6 +294,11 @@ void GameLODManager::init(void)// Ultra has no block in the shipped GameLOD.ini, so it is worked out from whatever High became.m_staticGameLODInfo[STATIC_GAME_LOD_ULTRA] = makeUltraStaticGameLOD( m_staticGameLODInfo[STATIC_GAME_LOD_HIGH] );+ // A preset is a step on the options menu's quality slider, and what it puts in the controls the+ // menu shows is that step's, not GameLOD.ini's, so the boxes a preset fills in are what it applies.+ for (Int level = STATIC_GAME_LOD_LOW; level < STATIC_GAME_LOD_CUSTOM; ++level)+ applyGraphicsQualityStep( m_staticGameLODInfo[level], TheGraphicsQualityAnchors[level] );+//Get Presets for custom LOD level by pulling them out of initial globaldata (which should//have all settings already applied).refreshCustomStaticLODLevel();@@ -387,12 +393,22 @@ void GameLODManager::init(void)setStaticLODLevel(userSetDetail);}+/** The detail preset whose step on the quality slider is this one or the nearest one below it. */+static StaticGameLODLevel graphicsQualityLevelAtOrBelow(Int step)+{+ Int level = STATIC_GAME_LOD_ULTRA;+ while (TheGraphicsQualityAnchors[level] > step)+ --level;+ return (StaticGameLODLevel)level;+}+void GameLODManager::refreshCustomStaticLODLevel(void){StaticGameLODInfo *lodInfo=&m_staticGameLODInfo[STATIC_GAME_LOD_CUSTOM];lodInfo->m_maxParticleCount=TheGlobalData->m_maxParticleCount;- lodInfo->m_gpuParticleCapacity=TheGlobalData->m_gpuParticleCapacity;+ // the ring has no control on the pages, so a Custom mix takes it from the preset at or below the quality slider's step+ lodInfo->m_gpuParticleCapacity=m_staticGameLODInfo[graphicsQualityLevelAtOrBelow(TheGlobalData->m_graphicsQuality)].m_gpuParticleCapacity;lodInfo->m_useShadowVolumes=TheGlobalData->m_useShadowVolumes;lodInfo->m_useShadowDecals=TheGlobalData->m_useShadowDecals;lodInfo->m_useCloudMap=TheGlobalData->m_useCloudMap;@@ -526,6 +542,10 @@ Bool GameLODManager::setStaticLODLevel(StaticGameLODLevel level)if (level == STATIC_GAME_LOD_UNKNOWN || (level != STATIC_GAME_LOD_CUSTOM && m_currentStaticLOD == level))return FALSE; //level is already applied. Custom levels are always applied since random options could change.+ // the first preset of a run with no quality step saved brings its column's catalog rows with it+ if (m_currentStaticLOD == STATIC_GAME_LOD_UNKNOWN)+ applyGraphicsQualityColumnAtStartup(level);+applyStaticLODLevel(level);m_currentStaticLOD = level;@@ -734,29 +754,34 @@ Int GameLODManager::getLevelTextureReduction(StaticGameLODLevel level)return m_staticGameLODInfo[level].m_textureReduction;}-// The top of the options menu's particle slider, which is as far as a player can drag it by hand.-enum { ULTRA_MAX_PARTICLE_COUNT = 5000 };-StaticGameLODInfo makeUltraStaticGameLOD( const StaticGameLODInfo &high ){StaticGameLODInfo ultra = high;- ultra.m_maxParticleCount = ULTRA_MAX_PARTICLE_COUNT;ultra.m_gpuParticleCapacity = TheGpuParticleCapacities[STATIC_GAME_LOD_ULTRA];- ultra.m_useShadowVolumes = TRUE;- ultra.m_useShadowDecals = TRUE;- ultra.m_useCloudMap = TRUE;- ultra.m_useLightMap = TRUE;- ultra.m_showSoftWaterEdge = TRUE;- ultra.m_useBuildupScaffolds = TRUE;- ultra.m_useTreeSway = TRUE;- ultra.m_useHeatEffects = TRUE;- ultra.m_useTrees = TRUE;- ultra.m_textureReduction = 0;- // dynamic LOD is what drops effects when the frame rate dips, and Ultra is the level that asks it not to- ultra.m_enableDynamicLOD = FALSE;return ultra;}+static Int graphicsQualityValue( const char *control, Int step )+{+ return findGraphicsQualityRow( control )->values[ step ];+}++void applyGraphicsQualityStep( StaticGameLODInfo &info, Int step )+{+ // the texture slider runs low to high, the field counts halvings+ info.m_textureReduction = 2 - graphicsQualityValue( "LowResSlider", step );+ info.m_maxParticleCount = graphicsQualityValue( "ParticleCapSlider", step );+ info.m_useShadowVolumes = graphicsQualityValue( "Check3DShadows", step ) != 0;+ info.m_useShadowDecals = graphicsQualityValue( "Check2DShadows", step ) != 0;+ info.m_useLightMap = graphicsQualityValue( "CheckGroundLighting", step ) != 0;+ info.m_showSoftWaterEdge = graphicsQualityValue( "CheckSmoothWater", step ) != 0;+ info.m_useBuildupScaffolds = graphicsQualityValue( "CheckExtraAnimations", step ) != 0;+ info.m_useTreeSway = graphicsQualityValue( "CheckTreeSway", step ) != 0;+ info.m_useHeatEffects = graphicsQualityValue( "CheckHeatEffects", step ) != 0;+ // the box is "never lower detail", which is dynamic LOD off+ info.m_enableDynamicLOD = graphicsQualityValue( "CheckNoDynamicLOD", step ) == 0;+}+Bool GameLODManager::didMemPass( void ){return m_memPassed;diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cppindex be3d37f30..d699262c8 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp@@ -47,6 +47,7 @@#include "Common/file.h"#include "Common/FileSystem.h"#include "Common/GameAudio.h"+#include "Common/GameLOD.h" // STATIC_GAME_LOD_HIGH, whose step on the quality slider is the slider's default#include "Common/INI.h"#include "Common/Monitors.h"#include "Common/OptionsCatalog.h"@@ -976,6 +977,7 @@ GlobalData::GlobalData()m_cloudStyle = 0; // Classic by default; volumetric hazard clouds are opt-inm_explosionDebrisTrails = TRUE;m_shadowQuality = 1; //medium, the 2048 map the shadows always had+ m_graphicsQuality = TheGraphicsQualityAnchors[ STATIC_GAME_LOD_HIGH ]; //a preset moves it to its own step as the menu opensm_classicGraphics = FALSE;m_lightingStyle = LIGHTING_STYLE_REFORGED;m_shadowMap = TRUE; //the sun's own shadows are what the game draws with nowdiff --git a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cppindex 484f4ba8c..ac56d8af5 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp@@ -27,6 +27,7 @@#include "Common/AudioAffect.h"#include "Common/GameAudio.h"#include "Common/GameEngine.h"+#include "Common/GameLOD.h"#include "Common/GlobalData.h"#include "Common/UserPreferences.h"#include "GameClient/Mouse.h"@@ -139,6 +140,7 @@ OPTION_BOOL_ACCESSORS( m_mapLight )OPTION_BOOL_ACCESSORS( m_teamGlow )OPTION_BOOL_ACCESSORS( m_waterFoam )OPTION_INT_ACCESSORS( m_shadowQuality )+OPTION_INT_ACCESSORS( m_graphicsQuality )//-----------------------------------------------------------------------------static const unsigned TheMsaaSamples[ OPTION_MSAA_LEVEL_COUNT ] = { 0, 2, 4, 8, 16 };@@ -539,9 +541,10 @@ const OptionDef TheOptionCatalog[] =get_m_volumetricSmokeShadows, set_m_volumetricSmokeShadows },// The shadows of passing clouds scrolled over the terrain. It used to belong to the detail- // preset, which turned it off at Low and gave no other way to; now the preset leaves it alone and- // GameData.ini's Yes holds until Options.ini says otherwise. The terrain asks every frame. Its- // control is EA's CheckCloudShadows, which the menu reads by hand with the other detail boxes.+ // preset, which turned it off at Low and gave no other way to; now applying a preset leaves it+ // alone and GameData.ini's Yes holds until Options.ini says otherwise. The terrain asks every+ // frame. Its control is EA's CheckCloudShadows: the quality slider sets it like any other box, and+ // the menu reads it by hand and saves it at every detail level.{ "UseCloudMap", "", "",OPTION_BOOL, APPLY_LIVE, 0, 1,get_m_useCloudMap, set_m_useCloudMap },@@ -603,11 +606,94 @@ const OptionDef TheOptionCatalog[] =OPTION_BOOL, APPLY_RESTART, 0, 1,get_m_particleGroundBounce, set_m_particleGroundBounce },+ // Where the Performance / Quality slider stands. The slider fills in the other controls and each+ // of them saves itself; a detail preset puts it on the preset's step whatever this says. Under+ // Custom, GameLODManager takes the Direct3D 11 particle ring, which has no control, from the+ // preset at or below this step.+ { "GraphicsQuality", OPT_WND( "SliderGraphicsQuality" ), "GUI:GraphicsQuality",+ OPTION_INT, APPLY_LIVE, 0, GRAPHICS_QUALITY_STEPS - 1,+ get_m_graphicsQuality, set_m_graphicsQuality },+{ NULL, NULL, NULL, OPTION_BOOL, APPLY_LIVE, 0, 0, NULL, NULL }};const Int TheOptionCatalogCount = (sizeof( TheOptionCatalog ) / sizeof( TheOptionCatalog[ 0 ] )) - 1;+//-----------------------------------------------------------------------------+// The Performance / Quality slider, described in OptionsCatalog.h.+//+// Rows run from the cheapest setting to the dearest, and a row's values climb from step 0 to step+// 10: the column a row first rises in is where the slider starts paying for it. costMs is the one+// place the price is written down: Direct3D 11 GPU milliseconds a frame saved by turning that one+// setting from its best to its cheapest with everything else at its best, in a 900 unit four-army+// fight at 1920x1080 on a GeForce RTX 2060 (2026-10-25). Anything under the 0.15 ms the baselines+// wandered by is written 0. The detail presets sit on steps 0, 4, 7 and 10, so the column under+// Low, Medium, High or Ultra is that preset.+//+// The free rows all come on by step 3, except those that draw into the sun's shadow map: they come+// on with cast shadows at step 5, since the map is not drawn without them. Never Lower Detail is+// free on a card that holds its frame rate and is what saves one that does not, so it waits for+// Ultra. Multisampling is read by Direct3D 9 alone and cost nothing measurable there at 8x on this+// card, which another card may not repeat, so it rises through the middle. Under Direct3D 9+// MapLight, TeamGlow and WaterFoam are greyed and the slider leaves them; the shadow map, Modern+// water and the volumetric clouds are the other renderers' alone.+//+// Trees have no row: GameLogic reads the setting as a map loads, so it stays with the memory test+// as EA had it and a preset never turns them off. The behind-buildings marker has none either; it+// is there to read the battlefield, not to cost frame time.+//-----------------------------------------------------------------------------+const Int TheGraphicsQualityAnchors[] = { 0, 4, 7, 10 };++const GraphicsQualityRow TheGraphicsQualityTable[] =+{+ // control, cost, step: 0 1 2 3 4 5 6 7 8 9 10+ { "ComboBoxLightingStyle", 0.0f, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckGroundLighting", 0.0f, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckSmoothWater", 0.0f, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckCloudShadows", 0.0f, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckExtraAnimations", 0.0f, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckHeatEffects", 0.0f, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckTreeSway", 0.0f, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "Check2DShadows", 0.0f, { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckProjectileShadows", 0.0f, { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckDebrisTrails", 0.0f, { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckSmokeFireLighting", 0.0f, { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckTeamGlow", 0.0f, { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckWaterFoam", 0.0f, { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "ComboBoxWaterStyle", 0.0f, { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "ComboBoxCloudStyle", 0.0f, { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckParticleBounce", 0.0f, { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 } },+ { "CheckInfantryShadows", 0.0f, { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 } },+ { "CheckVolumetricSmoke", 0.0f, { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 } },+ { "ComboBoxMSAA", 0.0f, { 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3 } },+ { "CheckNoDynamicLOD", 0.0f, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } },+ { "ComboBoxTextureFilter", 0.1f, { 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 } },+ { "ComboBoxBloom", 0.1f, { 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 } },+ { "SliderAnisotropy", 0.1f, { 2, 4, 8, 16, 16, 16, 16, 16, 16, 16, 16 } },+ { "CheckParticleShadows", 0.15f, { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 } },+ { "LowResSlider", 0.2f, { 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } },+ { "CheckPropShadows", 0.2f, { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1 } },+ { "ComboBoxShadowQuality", 0.25f, { 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2 } },+ { "CheckMapLight", 0.35f, { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 } },+ { "ComboBoxSmoke", 0.75f, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 } },+ // measured 5000 against the slider's floor of 100 (1.6 ms) and against 1000 (0.5 ms)+ { "ParticleCapSlider", 1.6f, { 500, 1000, 1500, 1500, 1500, 2000, 2500, 3000, 3500, 4000, 5000 } },+ // the shadow map's whole cost: the scene 4.06 to 2.14 ms and the shadow pass 0.6 to 0+ { "Check3DShadows", 2.5f, { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 } },+};++const Int TheGraphicsQualityTableCount = sizeof( TheGraphicsQualityTable ) / sizeof( TheGraphicsQualityTable[ 0 ] );++//-----------------------------------------------------------------------------+const GraphicsQualityRow *findGraphicsQualityRow( const char *control )+{+ for( Int i = 0; i < TheGraphicsQualityTableCount; ++i )+ if( strcmp( TheGraphicsQualityTable[ i ].control, control ) == 0 )+ return &TheGraphicsQualityTable[ i ];++ return NULL;+}+//-----------------------------------------------------------------------------const OptionDef *findOptionDef( const char *iniKey ){@@ -689,19 +775,97 @@ AsciiString formatOptionValue( const OptionDef& def, Int value )return out;}+//-----------------------------------------------------------------------------+// A detail preset is its column on the quality slider, catalog rows included. An Options.ini with+// no GraphicsQuality never had the slider save its rows, so they start from the preset's column;+// the keys the file does carry and the switches still win, the keys by being read after it and the+// switches by being parsed later.+//-----------------------------------------------------------------------------+enum { OPTION_CATALOG_ROWS = sizeof( TheOptionCatalog ) / sizeof( TheOptionCatalog[ 0 ] ) };++static Bool TheGraphicsQualityColumnWanted = FALSE; ///< the loaded Options.ini held no GraphicsQuality+static Bool TheOptionNamedInFile[ OPTION_CATALOG_ROWS ]; ///< the row's key was in it+static Int TheOptionValueAsLoaded[ OPTION_CATALOG_ROWS ]; ///< what the load left, before any switch++/** The catalog row a quality table row sets, or -1 for a GameLOD field, which the preset sets itself. */+static Int graphicsQualityOptionIndex( const GraphicsQualityRow &row )+{+ AsciiString widget;+ widget.format( OPT_WND( "%s" ), row.control );+ for( Int i = 0; i < TheOptionCatalogCount; ++i )+ {+ if( strcmp( TheOptionCatalog[ i ].widgetName, widget.str() ) == 0 )+ return i;++ // EA's cloud shadow box is read by the menu by hand, so its catalog row names no control+ if( strcmp( row.control, "CheckCloudShadows" ) == 0 && strcmp( TheOptionCatalog[ i ].iniKey, "UseCloudMap" ) == 0 )+ return i;+ }++ return -1;+}++/** Put a quality table value in a catalog row: the table holds a combo box's entry, the catalog its value. */+static void setGraphicsQualityOption( Int option, Int value )+{+ const OptionDef &def = TheOptionCatalog[ option ];+ def.set( def.kind == OPTION_ENUM ? def.lo + value : value );+}+//-----------------------------------------------------------------------------void loadOptionsFromPreferences( UserPreferences& pref ){+ TheGraphicsQualityColumnWanted = pref.find( "GraphicsQuality" ) == pref.end();+ UserPreferences::const_iterator detail = pref.find( "StaticGameLOD" );+ if( TheGraphicsQualityColumnWanted && detail != pref.end() )+ {+ const Int level = GameLODManager::getStaticGameLODIndex( detail->second );+ if( level >= STATIC_GAME_LOD_LOW && level <= STATIC_GAME_LOD_ULTRA )+ {+ for( Int row = 0; row < TheGraphicsQualityTableCount; ++row )+ {+ const Int option = graphicsQualityOptionIndex( TheGraphicsQualityTable[ row ] );+ if( option >= 0 )+ setGraphicsQualityOption( option, TheGraphicsQualityTable[ row ].values[ TheGraphicsQualityAnchors[ level ] ] );+ }+ }+ }+for( Int i = 0; i < TheOptionCatalogCount; ++i ){const OptionDef& def = TheOptionCatalog[ i ];UserPreferences::const_iterator it = pref.find( AsciiString( def.iniKey ) );+ TheOptionNamedInFile[ i ] = it != pref.end();if( it == pref.end() )continue; // no key, so keep whatever GameData.ini's default put in GlobalDatadef.set( parseOptionValue( def, it->second ) );}++ for( Int i = 0; i < TheOptionCatalogCount; ++i )+ TheOptionValueAsLoaded[ i ] = TheOptionCatalog[ i ].get();+}++//-----------------------------------------------------------------------------+void applyGraphicsQualityColumnAtStartup( Int staticGameLODLevel )+{+ if( !TheGraphicsQualityColumnWanted )+ return;++ TheGraphicsQualityColumnWanted = FALSE;+ if( staticGameLODLevel < STATIC_GAME_LOD_LOW || staticGameLODLevel > STATIC_GAME_LOD_ULTRA )+ return;++ for( Int row = 0; row < TheGraphicsQualityTableCount; ++row )+ {+ const Int option = graphicsQualityOptionIndex( TheGraphicsQualityTable[ row ] );+ // the file's own key, or a value a switch or ClassicGraphics put there after the load+ if( option < 0 || TheOptionNamedInFile[ option ] || TheOptionCatalog[ option ].get() != TheOptionValueAsLoaded[ option ] )+ continue;++ setGraphicsQualityOption( option, TheGraphicsQualityTable[ row ].values[ TheGraphicsQualityAnchors[ staticGameLODLevel ] ] );+ }}//-----------------------------------------------------------------------------diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cppindex 1c280fb53..3b9140dfa 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp@@ -1486,6 +1486,16 @@ static void saveOptions( void )(*pref)["SendDelay"] = AsciiString("no");}+ //-------------------------------------------------------------------------------------------------+ // Cloud shadows are no preset's (GameLODManager::applyStaticLODLevel leaves them), and a preset+ // picked here still shows its step's value in the box, so the box is saved whatever the preset.+ TheWritableGlobalData->m_useCloudMap = GadgetCheckBoxIsChecked( checkCloudShadows );+ (*pref)["UseCloudMap"] = TheGlobalData->m_useCloudMap ? AsciiString("yes") : AsciiString("no");++ // no preset has an opinion on the behind-buildings marker, so neither does the detail box+ TheWritableGlobalData->m_enableBehindBuildingMarkers = GadgetCheckBoxIsChecked( checkBuildingOcclusion );+ (*pref)["BuildingOcclusion"] = TheWritableGlobalData->m_enableBehindBuildingMarkers ? AsciiString("yes") : AsciiString("no");+//-------------------------------------------------------------------------------------------------// Custom game detail settings.GadgetComboBoxGetSelectedPos( comboBoxDetail, &index );@@ -1514,9 +1524,6 @@ static void saveOptions( void )TheWritableGlobalData->m_useShadowDecals = GadgetCheckBoxIsChecked( check2DShadows );(*pref)["UseShadowDecals"] = TheWritableGlobalData->m_useShadowDecals ? AsciiString("yes") : AsciiString("no");- TheWritableGlobalData->m_useCloudMap = GadgetCheckBoxIsChecked( checkCloudShadows );- (*pref)["UseCloudMap"] = TheGlobalData->m_useCloudMap ? AsciiString("yes") : AsciiString("no");-TheWritableGlobalData->m_useLightMap = GadgetCheckBoxIsChecked( checkGroundLighting );(*pref)["UseLightMap"] = TheGlobalData->m_useLightMap ? AsciiString("yes") : AsciiString("no");@@ -1540,9 +1547,6 @@ static void saveOptions( void )//TheWritableGlobalData->m_useFpsLimit = !GadgetCheckBoxIsChecked( checkUnlockFps );//(*pref)["FPSLimit"] = TheGlobalData->m_useFpsLimit ? AsciiString("yes") : AsciiString("no");- TheWritableGlobalData->m_enableBehindBuildingMarkers = GadgetCheckBoxIsChecked( checkBuildingOcclusion );- (*pref)["BuildingOcclusion"] = TheWritableGlobalData->m_enableBehindBuildingMarkers ? AsciiString("yes") : AsciiString("no");-TheWritableGlobalData->m_useTrees = GadgetCheckBoxIsChecked( checkProps);(*pref)["ShowTrees"] = TheWritableGlobalData->m_useTrees ? AsciiString("yes") : AsciiString("no");@@ -2093,8 +2097,7 @@ static GameWindow **const TheGraphicsDetailControls[] ={&sliderTextureResolution, &sliderParticleCap,&check3DShadows, &check2DShadows, &checkCloudShadows, &checkGroundLighting, &checkSmoothWater,- &checkProps, &checkExtraAnimations, &checkTreeSway, &checkHeatEffects, &checkBuildingOcclusion,- &checkNoDynamicLod,+ &checkProps, &checkExtraAnimations, &checkTreeSway, &checkHeatEffects, &checkNoDynamicLod,};enum { GRAPHICS_DETAIL_CONTROL_COUNT = sizeof( TheGraphicsDetailControls ) / sizeof( TheGraphicsDetailControls[ 0 ] ) };@@ -2108,67 +2111,94 @@ static Bool isGraphicsDetailControl( const GameWindow *control )}//--------------------------------------------------------------------------------------------------// The rows of TheOptionCatalog a detail preset sets alongside its GameLOD.ini fields. GameLOD.ini is-// older than every one of them, so what each preset puts in them is written here, one column per-// entry of the detail box: Ultra, High, Medium, Low. Glow is left out: the artwork was painted-// without it, and how much of it looks right is taste rather than detail.+// The Performance / Quality slider. TheGraphicsQualityTable (OptionsCatalog.cpp) says what every+// graphics control on the Graphics and Effects pages shows at each of its steps, and the four+// presets in the detail box are four of those steps. Moving the slider fills in the controls and+// puts the detail box on the preset the step is, or on Custom between them; Accept then applies+// whatever the controls show, as it does for a preset or for boxes ticked by hand.//--------------------------------------------------------------------------------------------------struct DetailPresetCatalogRow+static const char *const TheDetailCaptions[ DETAIL ] = { "GUI:Ultra", "GUI:High", "GUI:Medium", "GUI:Low", "GUI:Custom" };++/** The GameLOD level behind a preset entry of the detail box, which lists them Ultra first. */+static StaticGameLODLevel detailLevel( Int index ){- const char *iniKey;- Int values[ CUSTOMDETAIL ];-};+ return (StaticGameLODLevel)( STATIC_GAME_LOD_ULTRA - index );+}-static const DetailPresetCatalogRow TheDetailPresetCatalogRows[] =-{- { "MSAA", { 3, 2, 0, 0 } },- { "TextureFilter", { 2, 2, 1, 0 } },- { "Anisotropy", { 16, 8, 4, 2 } },- { "UseShadowVolumesForSkins", { 1, 1, 0, 0 } },- { "ShadowsForProjectiles", { 1, 1, 1, 0 } },- { "ShadowsForProps", { 1, 1, 1, 0 } },- { "ShadowsForParticles", { 1, 1, 0, 0 } },- { "Smoke", { 1, 0, 0, 0 } },- { "ParticleBounce", { 1, 0, 0, 0 } },-};-enum { DETAIL_PRESET_CATALOG_ROW_COUNT = sizeof( TheDetailPresetCatalogRows ) / sizeof( TheDetailPresetCatalogRows[ 0 ] ) };+/** The detail box's entry for a step of the slider: the preset on that step, otherwise Custom. */+static Int detailIndexAtStep( Int step )+{+ for( Int index = ULTRADETAIL; index < CUSTOMDETAIL; ++index )+ if( TheGraphicsQualityAnchors[ detailLevel( index ) ] == step )+ return index;++ return CUSTOMDETAIL;+}++static GameWindow *graphicsQualitySlider( void )+{+ return findOptionWidget( *findOptionDef( "GraphicsQuality" ) );+}-static GameWindow *detailPresetCatalogWidget( Int row )+static GameWindow *graphicsQualityWidget( const GraphicsQualityRow &row ){- return findOptionWidget( *findOptionDef( TheDetailPresetCatalogRows[ row ].iniKey ) );+ AsciiString name;+ name.format( "OptionsMenu.wnd:%s", row.control );+ return TheWindowManager->winGetWindowFromId( NULL, NAMEKEY( name ) );}-static Bool isDetailPresetCatalogControl( const GameWindow *control )+static Bool isGraphicsQualityControl( const GameWindow *control ){- for( Int row = 0; row < DETAIL_PRESET_CATALOG_ROW_COUNT; ++row )- if( detailPresetCatalogWidget( row ) == control )+ for( Int row = 0; row < TheGraphicsQualityTableCount; ++row )+ if( graphicsQualityWidget( TheGraphicsQualityTable[ row ] ) == control )return TRUE;return FALSE;}-/** Put one value in a catalog row's control, the way fillCatalogWidgets does for the loaded one. */-static void showCatalogValue( const OptionDef &def, Int value )+/** The row's control when the quality slider sets it, otherwise NULL. It leaves a control the player+ * cannot change - greyed in a match or under Direct3D 9, hidden where the device lacks it - and the+ * two ClassicGraphics forces, whose forced value Accept would otherwise save over the player's own. */+static GameWindow *graphicsQualityDrivenWidget( const GraphicsQualityRow &row ){- GameWindow *widget = findOptionWidget( def );- // every catalog control is the fork's, so a stock or modded OptionsMenu.wnd has none of them- if( widget == NULL )- return;+ GameWindow *control = graphicsQualityWidget( row );+ if( control->winIsHidden() || !control->winGetEnabled() )+ return NULL;- switch( def.kind )+ if( TheGlobalData->m_classicGraphics+ && ( strcmp( row.control, "ComboBoxLightingStyle" ) == 0 || strcmp( row.control, "CheckVolumetricSmoke" ) == 0 ) )+ return NULL;++ return control;+}++/** What a row's control shows, in the table's terms: a check box 0 or 1, a combo box its entry, a slider its position. */+static Int graphicsQualityShownValue( GameWindow *control )+{+ if( BitTest( control->winGetStyle(), GWS_CHECK_BOX ) )+ return GadgetCheckBoxIsChecked( control ) ? 1 : 0;++ if( BitTest( control->winGetStyle(), GWS_COMBO_BOX ) ){- case OPTION_BOOL:- GadgetCheckBoxSetChecked( widget, value != 0 );- break;+ Int entry = -1;+ GadgetComboBoxGetSelectedPos( control, &entry );+ return entry;+ }- case OPTION_ENUM:- GadgetComboBoxSetSelectedPos( widget, clampOptionValue( def, value ) - def.lo );- break;+ return GadgetSliderGetPosition( control );+}- case OPTION_INT:- GadgetSliderSetPosition( widget, clampOptionValue( def, value ) );- break;+/** Whether every control the slider sets shows this step's value. */+static Bool graphicsQualityStepShown( Int step )+{+ for( Int row = 0; row < TheGraphicsQualityTableCount; ++row )+ {+ GameWindow *control = graphicsQualityDrivenWidget( TheGraphicsQualityTable[ row ] );+ if( control && graphicsQualityShownValue( control ) != TheGraphicsQualityTable[ row ].values[ step ] )+ return FALSE;}++ return TRUE;}//-------------------------------------------------------------------------------------------------@@ -2181,6 +2211,7 @@ enum SliderReadoutKindREADOUT_PERCENT, ///< a 0..100 position with a percent signREADOUT_TEXTURE, ///< 0..2, low to high texture resolutionREADOUT_ANISOTROPY, ///< samples, where 0 is whatever the card offers+ READOUT_QUALITY, ///< the quality slider: the preset on its step, or how far along it is in percent};struct SliderReadout@@ -2193,6 +2224,7 @@ struct SliderReadoutstatic const SliderReadout TheSliderReadouts[] ={{ "OptionsMenu.wnd:SliderGamma", "OptionsMenu.wnd:ValueGamma", READOUT_NUMBER },+ { "OptionsMenu.wnd:SliderGraphicsQuality", "OptionsMenu.wnd:ValueGraphicsQuality", READOUT_QUALITY },{ "OptionsMenu.wnd:LowResSlider", "OptionsMenu.wnd:ValueTextureResolution", READOUT_TEXTURE },{ "OptionsMenu.wnd:ParticleCapSlider", "OptionsMenu.wnd:ValueParticleCap", READOUT_NUMBER },{ "OptionsMenu.wnd:SliderAnisotropy", "OptionsMenu.wnd:ValueAnisotropy", READOUT_ANISOTROPY },@@ -2240,6 +2272,18 @@ static void updateSliderReadouts( void )text.format( u"%dx", position );break;+ case READOUT_QUALITY:+ {+ // the box's word, not the step's: a box changed by hand leaves the slider on a preset's step+ Int detailIndex = CUSTOMDETAIL;+ GadgetComboBoxGetSelectedPos( comboBoxDetail, &detailIndex );+ if( detailIndex == CUSTOMDETAIL )+ text.format( u"%d%%", position * 100 / ( GRAPHICS_QUALITY_STEPS - 1 ) );+ else+ text = TheGameText->fetch( TheDetailCaptions[ detailIndex ] );+ break;+ }+default:text.format( u"%d", position );break;@@ -2248,45 +2292,50 @@ static void updateSliderReadouts( void )}}-/** Put a preset's values in the Graphics and Effects pages' controls, the catalog rows in- * TheDetailPresetCatalogRows included. Custom leaves them as they are. Trees and texture- * resolution follow the memory test the way applyStaticLODLevel does, so what the pages show is- * what Accept will set. */-static void showDetailPreset( Int index )+static void updateDetailNote( void );++/** Put one step of the quality slider in every control TheGraphicsQualityTable names, and the detail+ * box on the preset that step is, or on Custom between two of them. A control the slider leaves+ * (graphicsQualityDrivenWidget) keeps what it shows, and so Accept leaves its setting alone. */+static void showGraphicsQualityStep( Int step ){- StaticGameLODLevel level;- switch( index )+ ignoreSelected = TRUE;+ for( Int row = 0; row < TheGraphicsQualityTableCount; ++row ){- case ULTRADETAIL: level = STATIC_GAME_LOD_ULTRA; break;- case HIGHDETAIL: level = STATIC_GAME_LOD_HIGH; break;- case MEDIUMDETAIL: level = STATIC_GAME_LOD_MEDIUM; break;- case LOWDETAIL: level = STATIC_GAME_LOD_LOW; break;- default: return;+ GameWindow *control = graphicsQualityDrivenWidget( TheGraphicsQualityTable[ row ] );+ if( control == NULL )+ continue;++ const Int value = TheGraphicsQualityTable[ row ].values[ step ];+ if( BitTest( control->winGetStyle(), GWS_CHECK_BOX ) )+ GadgetCheckBoxSetChecked( control, value != 0 );+ else if( BitTest( control->winGetStyle(), GWS_COMBO_BOX ) )+ GadgetComboBoxSetSelectedPos( control, value );+ else+ GadgetSliderSetPosition( control, value );}+ // trees are no step's: a preset gives them whenever the memory test passed, as applyStaticLODLevel does+ if( detailIndexAtStep( step ) != CUSTOMDETAIL && checkProps->winGetEnabled() )+ GadgetCheckBoxSetChecked( checkProps, TheGameLODManager->didMemPass() );+ GadgetComboBoxSetSelectedPos( comboBoxDetail, detailIndexAtStep( step ) );+ ignoreSelected = FALSE;++ updateSliderReadouts();+ updateDetailNote();+}- const StaticGameLODInfo &preset = TheGameLODManager->m_staticGameLODInfo[ level ];- const Bool memoryPassed = TheGameLODManager->didMemPass();- const Int textureReduction = TheGameLODManager->getLevelTextureReduction( memoryPassed ? level : STATIC_GAME_LOD_LOW );+/** A preset picked in the detail box: the quality slider moves to its step and the controls show+ * that step. Custom leaves both where they are. */+static void showDetailPreset( Int index )+{+ if( index == CUSTOMDETAIL )+ return;+ const Int step = TheGraphicsQualityAnchors[ detailLevel( index ) ];ignoreSelected = TRUE;- GadgetSliderSetPosition( sliderTextureResolution, TEXTURE_RESOLUTION_STEPS - 1 - textureReduction );- GadgetSliderSetPosition( sliderParticleCap, preset.m_maxParticleCount );- GadgetCheckBoxSetChecked( check3DShadows, preset.m_useShadowVolumes );- GadgetCheckBoxSetChecked( check2DShadows, preset.m_useShadowDecals );- GadgetCheckBoxSetChecked( checkCloudShadows, preset.m_useCloudMap );- GadgetCheckBoxSetChecked( checkGroundLighting, preset.m_useLightMap );- GadgetCheckBoxSetChecked( checkSmoothWater, preset.m_showSoftWaterEdge );- GadgetCheckBoxSetChecked( checkProps, memoryPassed );- GadgetCheckBoxSetChecked( checkExtraAnimations, preset.m_useBuildupScaffolds );- GadgetCheckBoxSetChecked( checkHeatEffects, preset.m_useHeatEffects );- GadgetCheckBoxSetChecked( checkNoDynamicLod, !preset.m_enableDynamicLOD );- if( checkTreeSway )- GadgetCheckBoxSetChecked( checkTreeSway, preset.m_useTreeSway );- for( Int row = 0; row < DETAIL_PRESET_CATALOG_ROW_COUNT; ++row )- showCatalogValue( *findOptionDef( TheDetailPresetCatalogRows[ row ].iniKey ), TheDetailPresetCatalogRows[ row ].values[ index ] );+ GadgetSliderSetPosition( graphicsQualitySlider(), step );ignoreSelected = FALSE;-- updateSliderReadouts();+ showGraphicsQualityStep( step );}/** The grey line under the detail box: what the picked preset turns on, and that picking one only@@ -2308,17 +2357,20 @@ static void updateDetailNote( void )GadgetStaticTextSetText( note, TheGameText->fetch( key ) );}-/** A detail control was touched, so what the page shows is nobody's preset any more. */+/** A detail control was touched, so what the page shows is nobody's preset any more. In a match the+ * box is greyed and keeps its preset: what can still change there (glow, the live effects) is the+ * catalog's to save, and Custom would be saved over the preset for it. */static void markDetailCustom( void ){Int index = CUSTOMDETAIL;GadgetComboBoxGetSelectedPos( comboBoxDetail, &index );- if( index == CUSTOMDETAIL )+ if( index == CUSTOMDETAIL || !comboBoxDetail->winGetEnabled() )return;ignoreSelected = TRUE;GadgetComboBoxSetSelectedPos( comboBoxDetail, CUSTOMDETAIL );ignoreSelected = FALSE;+ updateSliderReadouts();updateDetailNote();}//-------------------------------------------------------------------------------------------------@@ -2609,11 +2661,8 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )// set the display detailGadgetComboBoxReset(comboBoxDetail);- GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:Ultra"), color);- GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:High"), color);- GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:Medium"), color);- GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:Low"), color);- GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:Custom"), color);+ for (Int entry = ULTRADETAIL; entry < DETAIL; ++entry)+ GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch(TheDetailCaptions[entry]), color);//Check if level was never set and default to setting most suitable for system.if (TheGameLODManager->getStaticLODLevel() == STATIC_GAME_LOD_UNKNOWN)@@ -2776,8 +2825,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )}fillCatalogWidgets();- updateSliderReadouts();- updateDetailNote();OptionsHotkeysInit();showOptionsPage( 0 );@@ -2811,6 +2858,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )if (comboBoxDetail)comboBoxDetail->winEnable(FALSE);+ graphicsQualitySlider()->winEnable(FALSE);// and what the detail box decides with it: a preset is picked outside a match, where the// shadows and textures it changes can be rebuilt@@ -2839,6 +2887,23 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )findOptionWidget( *findOptionDef( direct3D11Only[ i ] ) )->winEnable( FALSE );}+ // A preset is its own step on the quality slider, whatever step Options.ini kept from a Custom mix,+ // as long as the boxes show that step. An Options.ini from before the slider can hold a preset+ // with boxes ticked by hand beside it, and then the page is the Custom mix it really is. Run after+ // the greying above, which decides what the slider sets; in a match the box keeps its preset.+ Int detailIndex = CUSTOMDETAIL;+ GadgetComboBoxGetSelectedPos( comboBoxDetail, &detailIndex );+ if( detailIndex != CUSTOMDETAIL )+ {+ const Int step = TheGraphicsQualityAnchors[ detailLevel( detailIndex ) ];+ if( !comboBoxDetail->winGetEnabled() || graphicsQualityStepShown( step ) )+ GadgetSliderSetPosition( graphicsQualitySlider(), step );+ else+ GadgetComboBoxSetSelectedPos( comboBoxDetail, CUSTOMDETAIL );+ }+ updateSliderReadouts();+ updateDetailNote();+// borderless owns the resolution; the list is grey while it is pickedupdateResolutionEnabled();@@ -3011,7 +3076,7 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,picked ? menuModes[ index ].width : TheDisplay->getWidth(),picked ? menuModes[ index ].height : TheDisplay->getHeight() );}- else if( isDetailPresetCatalogControl( control ) )+ else if( isGraphicsQualityControl( control ) ){markDetailCustom();}@@ -3039,7 +3104,10 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,break;updateSliderReadouts();- if( isGraphicsDetailControl( (GameWindow *)mData1 ) || isDetailPresetCatalogControl( (GameWindow *)mData1 ) )+ // the quality slider sets the controls rather than being one of them, so it never makes Custom itself+ if( (GameWindow *)mData1 == graphicsQualitySlider() )+ showGraphicsQualityStep( GadgetSliderGetPosition( (GameWindow *)mData1 ) );+ else if( isGraphicsDetailControl( (GameWindow *)mData1 ) || isGraphicsQualityControl( (GameWindow *)mData1 ) )markDetailCustom();break;}@@ -3128,7 +3196,7 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,setDefaults();updateSliderReadouts();}- else if( isGraphicsDetailControl( control ) || isDetailPresetCatalogControl( control ) )+ else if( isGraphicsDetailControl( control ) || isGraphicsQualityControl( control ) ){markDetailCustom();}diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex f33186341..08285ad4b 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -16685,14 +16685,112 @@ TEST(ultra_static_lod_is_high_with_the_ceiling_raised)high.m_maxParticleCount = 3000;high.m_maxTankTrackFadeDelay = 60000;high.m_useHeatEffects = FALSE;- const StaticGameLODInfo ultra = makeUltraStaticGameLOD( high );+ StaticGameLODInfo ultra = makeUltraStaticGameLOD( high );+ CHECK( ultra.m_gpuParticleCapacity > high.m_gpuParticleCapacity );+ // the page's fields are the quality slider's at Ultra's step, as GameLODManager::init sets them+ applyGraphicsQualityStep( ultra, TheGraphicsQualityAnchors[ STATIC_GAME_LOD_ULTRA ] );CHECK_EQ( ultra.m_maxParticleCount, 5000 );CHECK_EQ( (Int)ultra.m_enableDynamicLOD, 0 );CHECK_EQ( (Int)ultra.m_useHeatEffects, 1 );+ CHECK_EQ( ultra.m_textureReduction, 0 );// what Ultra has no opinion about is High'sCHECK_EQ( ultra.m_maxTankTrackFadeDelay, 60000 );}+/* The Performance / Quality slider runs from the fastest picture to the best looking: no setting+ gets cheaper as it moves right, Low is its left end and Ultra its right, and the presets between+ come in the order the detail box names them. */+TEST(graphics_quality_slider_only_ever_turns_settings_up)+{+ CHECK_EQ( TheGraphicsQualityAnchors[ STATIC_GAME_LOD_LOW ], 0 );+ CHECK_EQ( TheGraphicsQualityAnchors[ STATIC_GAME_LOD_ULTRA ], GRAPHICS_QUALITY_STEPS - 1 );+ CHECK( TheGraphicsQualityAnchors[ STATIC_GAME_LOD_LOW ] < TheGraphicsQualityAnchors[ STATIC_GAME_LOD_MEDIUM ] );+ CHECK( TheGraphicsQualityAnchors[ STATIC_GAME_LOD_MEDIUM ] < TheGraphicsQualityAnchors[ STATIC_GAME_LOD_HIGH ] );+ CHECK( TheGraphicsQualityAnchors[ STATIC_GAME_LOD_HIGH ] < TheGraphicsQualityAnchors[ STATIC_GAME_LOD_ULTRA ] );++ for( Int row = 0; row < TheGraphicsQualityTableCount; ++row )+ {+ const GraphicsQualityRow &quality = TheGraphicsQualityTable[ row ];+ CHECK( findGraphicsQualityRow( quality.control ) == &quality );+ for( Int step = 1; step < GRAPHICS_QUALITY_STEPS; ++step )+ CHECK( quality.values[ step ] >= quality.values[ step - 1 ] );+ }++ // the slider's own position is a catalog row with exactly the table's steps+ const OptionDef *slider = findOptionDef( "GraphicsQuality" );+ CHECK( slider != NULL );+ CHECK_EQ( slider->lo, 0 );+ CHECK_EQ( slider->hi, GRAPHICS_QUALITY_STEPS - 1 );++ // and at Low the preset turns everything the page shows down+ StaticGameLODInfo low;+ applyGraphicsQualityStep( low, TheGraphicsQualityAnchors[ STATIC_GAME_LOD_LOW ] );+ CHECK_EQ( (Int)low.m_useShadowVolumes, 0 );+ CHECK_EQ( (Int)low.m_useShadowDecals, 0 );+ CHECK_EQ( (Int)low.m_enableDynamicLOD, 1 );+ CHECK_EQ( low.m_textureReduction, 1 );+}++/* A preset is its column at startup, catalog rows included, while Options.ini has no quality step:+ the file's own keys win over the column, a file the slider has saved is left alone, and with no+ preset named the first preset applied fills only the rows nothing set after the load. */+TEST(a_preset_brings_its_column_until_the_slider_has_saved_a_step)+{+ GlobalData *saved = TheWritableGlobalData;+ TheWritableGlobalData = NEW GlobalData;+ CHECK( !TheGlobalData->m_teamGlow );++ UserPreferences pref;+ pref[ AsciiString( "StaticGameLOD" ) ] = AsciiString( "Ultra" );+ pref[ AsciiString( "MapLight" ) ] = AsciiString( "no" );+ loadOptionsFromPreferences( pref );+ CHECK( TheGlobalData->m_teamGlow );+ CHECK( !TheGlobalData->m_mapLight );+ CHECK_EQ( findOptionDef( "Smoke" )->get(), 1 );++ TheWritableGlobalData->m_teamGlow = FALSE;+ pref[ AsciiString( "GraphicsQuality" ) ] = AsciiString( "4" );+ loadOptionsFromPreferences( pref );+ CHECK( !TheGlobalData->m_teamGlow );+ applyGraphicsQualityColumnAtStartup( STATIC_GAME_LOD_ULTRA );+ CHECK( !TheGlobalData->m_teamGlow );++ UserPreferences none;+ loadOptionsFromPreferences( none );+ CHECK( !TheGlobalData->m_teamGlow );+ TheWritableGlobalData->m_lightingStyle = LIGHTING_STYLE_CLASSIC; // a switch after the load+ applyGraphicsQualityColumnAtStartup( STATIC_GAME_LOD_MEDIUM );+ CHECK( TheGlobalData->m_teamGlow );+ CHECK_EQ( TheGlobalData->m_lightingStyle, (Int)LIGHTING_STYLE_CLASSIC );+ // once only+ TheWritableGlobalData->m_teamGlow = FALSE;+ applyGraphicsQualityColumnAtStartup( STATIC_GAME_LOD_MEDIUM );+ CHECK( !TheGlobalData->m_teamGlow );++ delete TheWritableGlobalData;+ TheWritableGlobalData = saved;+}++/* The particle ring has no control on the options pages, so a Custom mix between two presets takes+ it from the preset at or below the slider's step. */+TEST(custom_detail_takes_the_particle_ring_of_the_preset_below_the_slider)+{+ GlobalData *saved = TheWritableGlobalData;+ GlobalData *scratch = NEW GlobalData;+ TheWritableGlobalData = scratch;++ GameLODManager lod;+ scratch->m_graphicsQuality = TheGraphicsQualityAnchors[ STATIC_GAME_LOD_HIGH ] - 1;+ CHECK( lod.setStaticLODLevel( STATIC_GAME_LOD_CUSTOM ) );+ CHECK_EQ( TheGlobalData->m_gpuParticleCapacity, lod.m_staticGameLODInfo[ STATIC_GAME_LOD_MEDIUM ].m_gpuParticleCapacity );+ scratch->m_graphicsQuality = TheGraphicsQualityAnchors[ STATIC_GAME_LOD_ULTRA ];+ CHECK( lod.setStaticLODLevel( STATIC_GAME_LOD_CUSTOM ) );+ CHECK_EQ( TheGlobalData->m_gpuParticleCapacity, lod.m_staticGameLODInfo[ STATIC_GAME_LOD_ULTRA ].m_gpuParticleCapacity );++ delete scratch; // while it is the current one: ~GlobalData reads TheWritableGlobalData+ TheWritableGlobalData = saved;+}+TEST(effects_page_rows_reach_the_fields_the_command_line_switches_set){GlobalData *saved = TheWritableGlobalData;@@ -19330,8 +19428,10 @@ TEST(gpu_particle_ring_in_force_is_the_switch_else_the_preset)CHECK_EQ( scratch->getEffectiveGpuParticleCapacity(), 1 << 18 );CHECK( lod.setStaticLODLevel( STATIC_GAME_LOD_LOW ) );CHECK_EQ( scratch->getEffectiveGpuParticleCapacity(), 1 << 17 );+ // Custom takes the ring of the preset at or below the quality slider, not the last one applied+ scratch->m_graphicsQuality = TheGraphicsQualityAnchors[ STATIC_GAME_LOD_HIGH ];CHECK( lod.setStaticLODLevel( STATIC_GAME_LOD_CUSTOM ) );- CHECK_EQ( scratch->getEffectiveGpuParticleCapacity(), 1 << 17 );+ CHECK_EQ( scratch->getEffectiveGpuParticleCapacity(), 1 << 19 );scratch->m_gpuParticleCapacityOverride = 4096;CHECK( lod.setStaticLODLevel( STATIC_GAME_LOD_ULTRA ) );diff --git a/GeneralsMD/Code/Tools/optionsmenu_layout.py b/GeneralsMD/Code/Tools/optionsmenu_layout.pyindex f7d3c0ac3..acdf83d8e 100644--- a/GeneralsMD/Code/Tools/optionsmenu_layout.py+++ b/GeneralsMD/Code/Tools/optionsmenu_layout.py@@ -230,6 +230,8 @@ NEW_CONTROLS = [(CHECK, "CheckMapLight", "GUI:MapLight"),(CHECK, "CheckTeamGlow", "GUI:TeamGlow"),(CHECK, "CheckWaterFoam", "GUI:WaterFoam"),+ (LABEL, "LabelGraphicsQuality", "GUI:GraphicsQuality"),+ (SLIDER, "SliderGraphicsQuality", None),]# EA's check boxes that shipped HIDDEN off the panel's right edge with working code behind them in@@ -249,7 +251,7 @@ READOUTS = ["ValueGamma", "ValueTextureResolution", "ValueParticleCap", "ValueAnisotropy","ValueMusicVolume", "ValueSFXVolume", "ValueVoiceVolume", "ValueScrollSpeed","ValueDragTolerance", "ValueAmbientVolume", "ValueZoomSpeed", "ValueMenuTransitionSpeed",- "ValueMasterVolume",+ "ValueMasterVolume", "ValueGraphicsQuality",]# Lines of small grey text under a control that say what its current choice does, written by@@ -274,7 +276,8 @@ NOTE_COLOR = ("ENABLED: 164 170 190 255, ENABLEDBORDER: 0 0 0 255, "# catalog row's own boundsSLIDER_RANGES = [("SliderAnisotropy", 0, 16), ("SliderDragTolerance", 2, 50),("SliderAmbientVolume", 0, 100), ("SliderZoomSpeed", 25, 300),- ("SliderMenuTransitionSpeed", 25, 400), ("SliderMasterVolume", 0, 100)]+ ("SliderMenuTransitionSpeed", 25, 400), ("SliderMasterVolume", 0, 100),+ ("SliderGraphicsQuality", 0, 10)]# EA's captions that do not fit the page: two popup headings written in capitals, and a check box# caption that ran 20 pixels past the panel's right edge once it stood in a 268 pixel column.@@ -334,11 +337,12 @@ GROUP_LAYOUT = [setting("GammaLabel", "SliderGamma", "ValueGamma")])]),("PageGraphics", [+ # the particle limit went to Effects' Particles group to make room for the quality slider("GUI:OptionsGroupDetail", [setting("DetailLabel", "ComboBoxDetail"),+ setting("LabelGraphicsQuality", "SliderGraphicsQuality", "ValueGraphicsQuality"),("note", "DetailNote"),setting("LabelTextureResolution", "LowResSlider", "ValueTextureResolution"),- setting("LabelParticleCap", "ParticleCapSlider", "ValueParticleCap"),("check", "CheckNoDynamicLOD")]),("GUI:OptionsGroupImage", [("check", "CheckClassicGraphics"),@@ -369,6 +373,7 @@ GROUP_LAYOUT = [("check", "CheckTreeSway"),("check", "CheckBehindBuilding")]),("GUI:OptionsGroupParticles", [+ setting("LabelParticleCap", "ParticleCapSlider", "ValueParticleCap"),setting("LabelSmoke", "ComboBoxSmoke"),("check", "CheckParticleBounce"),("check", "CheckSmokeFireLighting"),@@ -810,6 +815,25 @@ def read_catalog():return [match.groupdict() for match in _ROW.finditer(text)]+# a row of TheGraphicsQualityTable: the control, its cost and its value at every step of the slider+_QUALITY_ROW = re.compile(r'\{\s*"(?P<control>\w+)",\s*(?P<cost>-?[\d.]+)f?,\s*\{(?P<values>[^}]*)\}\s*\}')+++def read_quality_table():+ with open(CATALOG, "rb") as fp:+ text = fp.read().decode("latin-1")+ table = text[text.index("TheGraphicsQualityTable[] ="):]+ table = table[:table.index("};")]+ return [(match.group("control"), [int(value) for value in match.group("values").split(",")])+ for match in _QUALITY_ROW.finditer(table)]+++def bound(text):+ """A catalog row's bound as written: a number, or an enum constant less one."""+ text = text.strip()+ return int(text) if text.lstrip("-").isdigit() else enum_count(text.split()[0]) - 1++def read_strings():"""The keys defined in Patch.str. A key is a line of its own, the value is the quoted lineunder it, and '//' is the only comment GameText.cpp's parseStringFile knows."""@@ -890,7 +914,7 @@ def selfcheck():# a slider narrower than its row never reaches the row's ends, and says nothing about itif row["kind"] == "OPTION_INT":- bounds = (int(row["lo"]), int(row["hi"]))+ bounds = (bound(row["lo"]), bound(row["hi"]))if dict((name, (low, high)) for name, low, high in SLIDER_RANGES).get(widget) != bounds:problems.append("%s runs %d to %d and SLIDER_RANGES does not give %s that range"% ((row["ini"],) + bounds + (widget,)))@@ -934,6 +958,20 @@ def selfcheck():for key in ("GUI:%s" % setting_of(name), "TOOLTIP:%s" % setting_of(name)):if key not in keys:problems.append("%s needs %s in Patch.str" % (name, key))+ # every row of the quality slider names a control on Graphics or Effects and has a value for+ # every step; a row one value short still compiles, with a 0 in the last step+ steps = enum_count("GRAPHICS_QUALITY_STEPS")+ quality = read_quality_table()+ if len(quality) < 9:+ problems.append("only %d quality rows parsed, the regex has stopped matching" % len(quality))+ on_pages = set(short(child) for page in ("PageGraphics", "PageEffects")+ for child in layout.find(page).children)+ for control, values in quality:+ if control not in on_pages:+ problems.append("quality row %s is not a control on the Graphics or Effects page" % control)+ if len(values) != steps:+ problems.append("quality row %s has %d values for %d steps" % (control, len(values), steps))+if ADVANCED in controls:problems.append("%s still carries %s; its controls are on the Graphics page"% (os.path.basename(LAYOUT), ADVANCED))