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(w3ddevice): add sdl water reflections and quality controls
Olcay Seyganc6f4f4ca1433
diff --git a/GeneralsMD/Code/BuildFingerprint.manifest b/GeneralsMD/Code/BuildFingerprint.manifestindex 310fc1263..82c8a1cbe 100644--- a/GeneralsMD/Code/BuildFingerprint.manifest+++ b/GeneralsMD/Code/BuildFingerprint.manifest@@ -2303,7 +2303,9 @@ Libraries/Include/Platform/WaterHullVisualLayout.hLibraries/Include/Platform/WaterObstacleIndex.hLibraries/Include/Platform/WaterOpticalContext.hLibraries/Include/Platform/WaterOpticalModel.h+Libraries/Include/Platform/WaterPerformanceSettings.hLibraries/Include/Platform/WaterProjectedMesh.h+Libraries/Include/Platform/WaterScreenReflection.hLibraries/Include/Platform/WaterShoreFoam.hLibraries/Include/Platform/WaterShoreHistory.hLibraries/Include/Platform/WaterShoreOverlay.hdiff --git a/GeneralsMD/Code/Data/French/Generals.str b/GeneralsMD/Code/Data/French/Generals.strindex 2fcd8747a..7eb3ac6b0 100644--- a/GeneralsMD/Code/Data/French/Generals.str+++ b/GeneralsMD/Code/Data/French/Generals.str@@ -18656,3 +18656,95 @@ ENDCONTROLBAR:ToolTipEvacuateAt"Se rend à l'endroit choisi et ordonne à toutes les unités de sortir.\nAlt : débarquer ici"END++GUI:OptionsTabWater+"Eau"+END++GUI:OptionsGroupReflections+"Reflets"+END++GUI:OptionsGroupModernWater+"Eau moderne"+END++GUI:WaterReflectionEnabled+"Reflets de scène"+END++TOOLTIP:WaterReflectionEnabled+"Reflète la scène dans l’eau moderne. Désactivez cette option pour améliorer les performances tout en conservant la couleur du ciel et les éclats du soleil. Le mode de réflexion reste mémorisé. Appliqué quand vous cliquez sur Accepter."+END++GUI:WaterFftResolution+"Détail des vagues"+END++GUI:WaterFftResolution0+"Faible"+END++GUI:WaterFftResolution1+"Élevé"+END++TOOLTIP:WaterFftResolution+"Définit le niveau de détail des vagues de l’eau moderne. Faible améliore les performances ; Élevé affiche plus de détails. Appliqué quand vous cliquez sur Accepter."+END++GUI:WaterRefractionQuality+"Réfraction"+END++GUI:WaterRefractionQuality0+"Complète"+END++GUI:WaterRefractionQuality1+"Simple"+END++GUI:WaterRefractionQuality2+"Désactivée"+END++TOOLTIP:WaterRefractionQuality+"Pour l’eau moderne. La réfraction complète déforme la vue sous la surface. La réfraction simple garde une eau claire sans déformation. Désactivée, l’eau est opaque et teintée pour améliorer les performances. Appliqué quand vous cliquez sur Accepter."+END++GUI:WaterReflectionDetail+"Détail des reflets"+END++GUI:WaterReflectionDetail0+"Faible"+END++GUI:WaterReflectionDetail1+"Élevé"+END++TOOLTIP:WaterReflectionDetail+"Contrôle le détail des reflets de scène sur l’eau moderne. Faible améliore les performances. Élevé offre des reflets plus nets. La résolution SSR reste inchangée. Appliqué quand vous cliquez sur Accepter."+END++GUI:WaterReflection+"Mode de réflexion"+END++GUI:WaterReflection0+"Classique"+END++GUI:WaterReflection1+"SSR"+END++GUI:WaterReflection2+"Hybride"+END++TOOLTIP:WaterReflection+"Pour l’eau moderne lorsque les reflets de scène sont activés. Classique utilise les reflets d’origine. SSR reflète le contenu visible à l’écran. Hybride combine les deux et est le mode par défaut. Appliqué quand vous cliquez sur Accepter."+ENDdiff --git a/GeneralsMD/Code/Data/German/Generals.str b/GeneralsMD/Code/Data/German/Generals.strindex c54a5b713..fdedbbc27 100644--- a/GeneralsMD/Code/Data/German/Generals.str+++ b/GeneralsMD/Code/Data/German/Generals.str@@ -15492,3 +15492,95 @@ ENDSIDE:Turkiye"Türkiye (Experimentell)"END++GUI:OptionsTabWater+"Wasser"+END++GUI:OptionsGroupReflections+"Reflexionen"+END++GUI:OptionsGroupModernWater+"Modernes Wasser"+END++GUI:WaterReflectionEnabled+"Szenenreflexionen"+END++TOOLTIP:WaterReflectionEnabled+"Spiegelt die Szene im modernen Wasser. Ausschalten verbessert die Leistung, Himmel und Sonnenreflexe bleiben erhalten. Der Reflexionsmodus bleibt gespeichert. Wird nach Klick auf Annehmen angewendet."+END++GUI:WaterFftResolution+"Wellendetails"+END++GUI:WaterFftResolution0+"Niedrig"+END++GUI:WaterFftResolution1+"Hoch"+END++TOOLTIP:WaterFftResolution+"Steuert die feinen Details moderner Wasserwellen. Niedrig verbessert die Leistung; Hoch zeigt mehr Details. Wird nach Klick auf Annehmen angewendet."+END++GUI:WaterRefractionQuality+"Lichtbrechung"+END++GUI:WaterRefractionQuality0+"Voll"+END++GUI:WaterRefractionQuality1+"Einfach"+END++GUI:WaterRefractionQuality2+"Aus"+END++TOOLTIP:WaterRefractionQuality+"Für modernes Wasser. Vollständige Brechung verzerrt den Blick unter der Oberfläche. Einfache Brechung zeigt klares Wasser ohne Verzerrung. Aus macht das Wasser undurchsichtig und getönt, um die Leistung zu verbessern. Wird nach Klick auf Annehmen angewendet."+END++GUI:WaterReflectionDetail+"Reflexionsdetails"+END++GUI:WaterReflectionDetail0+"Niedrig"+END++GUI:WaterReflectionDetail1+"Hoch"+END++TOOLTIP:WaterReflectionDetail+"Steuert die Details der Szenenreflexionen im modernen Wasser. Niedrig verbessert die Leistung. Hoch liefert klarere Reflexionen. Die SSR-Auflösung bleibt unverändert. Wird nach Klick auf Annehmen angewendet."+END++GUI:WaterReflection+"Reflexionsmodus"+END++GUI:WaterReflection0+"Klassisch"+END++GUI:WaterReflection1+"SSR"+END++GUI:WaterReflection2+"Hybrid"+END++TOOLTIP:WaterReflection+"Für modernes Wasser, wenn Szenenreflexionen aktiviert sind. Klassisch nutzt die Originalreflexionen. SSR spiegelt sichtbare Bildschirminhalte. Hybrid kombiniert beides und ist die Standardeinstellung. Wird nach Klick auf Annehmen angewendet."+ENDdiff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 431ec44a7..27682c5e3 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -3666,3 +3666,95 @@ ENDCONTROLBAR:ToolTipEvacuateAt"Go to the chosen spot and order all units to exit\nAlt: unload here"END++GUI:OptionsTabWater+"Water"+END++GUI:OptionsGroupReflections+"Reflections"+END++GUI:OptionsGroupModernWater+"Modern water"+END++GUI:WaterReflectionEnabled+"Scene reflections"+END++TOOLTIP:WaterReflectionEnabled+"Reflects the scene in Modern water. Turn off to improve performance while keeping sky colour and sun highlights. Your reflection mode is remembered. Applied when you Accept."+END++GUI:WaterFftResolution+"Wave detail"+END++GUI:WaterFftResolution0+"Low"+END++GUI:WaterFftResolution1+"High"+END++TOOLTIP:WaterFftResolution+"Controls fine detail in Modern water waves. Low improves performance; High shows more detail. Applied when you Accept."+END++GUI:WaterRefractionQuality+"Refraction"+END++GUI:WaterRefractionQuality0+"Full"+END++GUI:WaterRefractionQuality1+"Simple"+END++GUI:WaterRefractionQuality2+"Off"+END++TOOLTIP:WaterRefractionQuality+"For Modern water. Full distorts the view below the surface. Simple keeps clear water without distortion. Off uses opaque tinted water for better performance. Applied when you Accept."+END++GUI:WaterReflectionDetail+"Reflection detail"+END++GUI:WaterReflectionDetail0+"Low"+END++GUI:WaterReflectionDetail1+"High"+END++TOOLTIP:WaterReflectionDetail+"Controls scene reflection detail in Modern water. Low improves performance. High gives clearer reflections. SSR resolution is unchanged. Applied when you Accept."+END++GUI:WaterReflection+"Reflection mode"+END++GUI:WaterReflection0+"Legacy"+END++GUI:WaterReflection1+"SSR"+END++GUI:WaterReflection2+"Hybrid"+END++TOOLTIP:WaterReflection+"For Modern water when Scene reflections is on. Legacy uses the original reflections. SSR reflects visible screen content. Hybrid combines both and is the default. Applied when you Accept."+ENDdiff --git a/GeneralsMD/Code/Data/Russian/Generals.str b/GeneralsMD/Code/Data/Russian/Generals.strindex 90236a586..af68b59b5 100644--- a/GeneralsMD/Code/Data/Russian/Generals.str+++ b/GeneralsMD/Code/Data/Russian/Generals.str@@ -18536,3 +18536,95 @@ ENDCONTROLBAR:ToolTipEvacuateAt"Отправиться в выбранную точку и приказать всем юнитам выйти\nAlt: высадить здесь"END++GUI:OptionsTabWater+"Вода"+END++GUI:OptionsGroupReflections+"Отражения"+END++GUI:OptionsGroupModernWater+"Современная вода"+END++GUI:WaterReflectionEnabled+"Отражения сцены"+END++TOOLTIP:WaterReflectionEnabled+"Отражает сцену в современной воде. Отключение повышает производительность, сохраняя цвет неба и блики солнца. Режим отражения запоминается. Применяется после нажатия «Принять»."+END++GUI:WaterFftResolution+"Детализация волн"+END++GUI:WaterFftResolution0+"Низкая"+END++GUI:WaterFftResolution1+"Высокая"+END++TOOLTIP:WaterFftResolution+"Задаёт детализацию волн в современной воде. Низкая повышает производительность; высокая показывает больше деталей. Применяется после нажатия «Принять»."+END++GUI:WaterRefractionQuality+"Преломление"+END++GUI:WaterRefractionQuality0+"Полное"+END++GUI:WaterRefractionQuality1+"Простое"+END++GUI:WaterRefractionQuality2+"Выкл."+END++TOOLTIP:WaterRefractionQuality+"Для современной воды. Полное преломление искажает вид под поверхностью. Простое сохраняет чистую воду без искажений. Выкл. делает воду непрозрачной и окрашенной для повышения производительности. Применяется после нажатия «Принять»."+END++GUI:WaterReflectionDetail+"Детали отражений"+END++GUI:WaterReflectionDetail0+"Низкая"+END++GUI:WaterReflectionDetail1+"Высокая"+END++TOOLTIP:WaterReflectionDetail+"Управляет детализацией отражений сцены в современной воде. Низкая настройка повышает производительность. Высокая даёт более чёткие отражения. Разрешение SSR не меняется. Применяется после нажатия «Принять»."+END++GUI:WaterReflection+"Режим отражений"+END++GUI:WaterReflection0+"Классический"+END++GUI:WaterReflection1+"SSR"+END++GUI:WaterReflection2+"Гибридный"+END++TOOLTIP:WaterReflection+"Для современной воды при включённых отражениях сцены. Классический использует исходные отражения. SSR отражает видимое на экране. Гибридный сочетает оба варианта и выбран по умолчанию. Применяется после нажатия «Принять»."+ENDdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex f7808c257..42df6840a 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -18007,3 +18007,95 @@ ENDCONTROLBAR:ToolTipEvacuateAt"Seçtiğiniz yere gidip tüm birliklere çıkma emri verin\nAlt: burada indir"END++GUI:OptionsTabWater+"Su"+END++GUI:OptionsGroupReflections+"Yansımalar"+END++GUI:OptionsGroupModernWater+"Modern Su"+END++GUI:WaterReflectionEnabled+"Sahne Yansıması"+END++TOOLTIP:WaterReflectionEnabled+"Modern suda etraftaki her şey suya yansır. Kapatırsan oyun hızlanır, gökyüzünün rengi ve güneşin parıltısı yine kalır. Seçtiğin yansıma modu unutulmaz. Kabul Et'e basınca uygulanır."+END++GUI:WaterFftResolution+"Dalga Ayrıntısı"+END++GUI:WaterFftResolution0+"Düşük"+END++GUI:WaterFftResolution1+"Yüksek"+END++TOOLTIP:WaterFftResolution+"Modern sudaki dalgaların ince ayrıntısı. Düşük oyunu hızlandırır, Yüksek daha çok ayrıntı gösterir. Kabul Et'e basınca uygulanır."+END++GUI:WaterRefractionQuality+"Kırılma"+END++GUI:WaterRefractionQuality0+"Tam"+END++GUI:WaterRefractionQuality1+"Basit"+END++GUI:WaterRefractionQuality2+"Kapalı"+END++TOOLTIP:WaterRefractionQuality+"Modern su için. Tam'da suyun altı dalgayla kırılıp kayar. Basit'te su yine berrak ama altı kırılmaz. Kapalı'da suyun altı görünmez, su düz bir renk alır ve oyun hızlanır. Kabul Et'e basınca uygulanır."+END++GUI:WaterReflectionDetail+"Yansıma Ayrıntısı"+END++GUI:WaterReflectionDetail0+"Düşük"+END++GUI:WaterReflectionDetail1+"Yüksek"+END++TOOLTIP:WaterReflectionDetail+"Modern sudaki sahne yansımasının ne kadar net olacağı. Düşük oyunu hızlandırır, Yüksek yansımayı netleştirir. SSR bundan etkilenmez. Kabul Et'e basınca uygulanır."+END++GUI:WaterReflection+"Yansıma Modu"+END++GUI:WaterReflection0+"Orijinal"+END++GUI:WaterReflection1+"SSR"+END++GUI:WaterReflection2+"Hibrit"+END++TOOLTIP:WaterReflection+"Sahne Yansıması açıkken Modern su için. Orijinal, oyunun eski yansımasını kullanır. SSR ekranda gördüğün her şeyi yansıtır. Hibrit ikisini birleştirir, varsayılan da bu. Kabul Et'e basınca uygulanır."+ENDdiff --git a/GeneralsMD/Code/Data/Ukrainian/Generals.str b/GeneralsMD/Code/Data/Ukrainian/Generals.strindex dea23fff0..2777a1d85 100644--- a/GeneralsMD/Code/Data/Ukrainian/Generals.str+++ b/GeneralsMD/Code/Data/Ukrainian/Generals.str@@ -18536,3 +18536,95 @@ ENDCONTROLBAR:ToolTipEvacuateAt"Вирушити у вибрану точку й наказати всім підрозділам вийти\nAlt: висадити тут"END++GUI:OptionsTabWater+"Вода"+END++GUI:OptionsGroupReflections+"Відображення"+END++GUI:OptionsGroupModernWater+"Сучасна вода"+END++GUI:WaterReflectionEnabled+"Відображення сцени"+END++TOOLTIP:WaterReflectionEnabled+"Відображає сцену на сучасній воді. Вимкнення підвищує продуктивність, зберігаючи колір неба й відблиски сонця. Режим відображення запам’ятовується. Застосовується після натискання «Прийняти»."+END++GUI:WaterFftResolution+"Деталізація хвиль"+END++GUI:WaterFftResolution0+"Низька"+END++GUI:WaterFftResolution1+"Висока"+END++TOOLTIP:WaterFftResolution+"Визначає деталізацію хвиль сучасної води. Низька підвищує продуктивність; висока показує більше деталей. Застосовується після натискання «Прийняти»."+END++GUI:WaterRefractionQuality+"Заломлення"+END++GUI:WaterRefractionQuality0+"Повне"+END++GUI:WaterRefractionQuality1+"Просте"+END++GUI:WaterRefractionQuality2+"Вимкнено"+END++TOOLTIP:WaterRefractionQuality+"Для сучасної води. Повне заломлення спотворює вигляд під поверхнею. Просте залишає воду прозорою без спотворення. Вимкнено робить воду непрозорою й забарвленою для кращої продуктивності. Застосовується після натискання «Прийняти»."+END++GUI:WaterReflectionDetail+"Деталі відбиття"+END++GUI:WaterReflectionDetail0+"Низька"+END++GUI:WaterReflectionDetail1+"Висока"+END++TOOLTIP:WaterReflectionDetail+"Керує деталізацією відображень сцени на сучасній воді. Низька настройка підвищує продуктивність. Висока забезпечує чіткіші відображення. Роздільність SSR не змінюється. Застосовується після натискання «Прийняти»."+END++GUI:WaterReflection+"Режим відображення"+END++GUI:WaterReflection0+"Класичний"+END++GUI:WaterReflection1+"SSR"+END++GUI:WaterReflection2+"Гібридний"+END++TOOLTIP:WaterReflection+"Для сучасної води з увімкненими відображеннями сцени. Класичний використовує оригінальні відображення. SSR відображає видимий на екрані вміст. Гібридний поєднує обидва варіанти й обраний за замовчуванням. Застосовується після натискання «Прийняти»."+ENDdiff --git a/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd b/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wndindex 2c51d7788..cf5e8a91a 100644--- a/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd+++ b/GeneralsMD/Code/Data/Window/Menus/OptionsMenuClassic.wnd@@ -665,7 +665,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = PUSHBUTTON;- SCREENRECT = UPPERLEFT: 36 108, BOTTOMRIGHT: 123 136, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 36 108, BOTTOMRIGHT: 113 136, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:TabDisplay";STATUS = ENABLED+IMAGE;STYLE = PUSHBUTTON+MOUSETRACK;@@ -709,7 +709,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = PUSHBUTTON;- SCREENRECT = UPPERLEFT: 127 108, BOTTOMRIGHT: 214 136, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 117 108, BOTTOMRIGHT: 194 136, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:TabGraphics";STATUS = ENABLED+IMAGE;STYLE = PUSHBUTTON+MOUSETRACK;@@ -753,7 +753,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = PUSHBUTTON;- SCREENRECT = UPPERLEFT: 218 108, BOTTOMRIGHT: 305 136, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 198 108, BOTTOMRIGHT: 275 136, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:TabEffects";STATUS = ENABLED+IMAGE;STYLE = PUSHBUTTON+MOUSETRACK;@@ -797,7 +797,51 @@ WINDOWCHILDWINDOWWINDOWTYPE = PUSHBUTTON;- SCREENRECT = UPPERLEFT: 309 108, BOTTOMRIGHT: 396 136, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 279 108, BOTTOMRIGHT: 356 136, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:TabWater";+ STATUS = ENABLED+IMAGE;+ STYLE = PUSHBUTTON+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Generals", SIZE: 15, BOLD: 0;+ HEADERTEMPLATE = "MainButton";+ TOOLTIPDELAY = -1;+ TEXT = "GUI:OptionsTabWater";+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255, DISABLED: 186 255 12 255, DISABLEDBORDER: 0 2 0 255, HILITE: 186 255 12 255, HILITEBORDER: 0 2 0 255;+ ENABLEDDRAWDATA = IMAGE: Buttons-Left, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Middle, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Right, 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: Buttons-Disabled-Left, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Disabled-Middle, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Disabled-Right, 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: Buttons-HiLite-Left, COLOR: 209 253 4 255, BORDERCOLOR: 59 60 52 255,+ IMAGE: Buttons-Pushed-Left, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Pushed-Middle, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Pushed-Right, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-HiLite-Middle, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-HiLite-Right, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = PUSHBUTTON;+ SCREENRECT = UPPERLEFT: 360 108, BOTTOMRIGHT: 437 136, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:TabAudio";STATUS = ENABLED+IMAGE;STYLE = PUSHBUTTON+MOUSETRACK;@@ -841,7 +885,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = PUSHBUTTON;- SCREENRECT = UPPERLEFT: 400 108, BOTTOMRIGHT: 487 136, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 441 108, BOTTOMRIGHT: 518 136, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:TabControls";STATUS = ENABLED+IMAGE;STYLE = PUSHBUTTON+MOUSETRACK;@@ -885,7 +929,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = PUSHBUTTON;- SCREENRECT = UPPERLEFT: 491 108, BOTTOMRIGHT: 578 136, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 522 108, BOTTOMRIGHT: 599 136, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:TabInterface";STATUS = ENABLED+IMAGE;STYLE = PUSHBUTTON+MOUSETRACK;@@ -929,7 +973,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = PUSHBUTTON;- SCREENRECT = UPPERLEFT: 582 108, BOTTOMRIGHT: 669 136, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 603 108, BOTTOMRIGHT: 680 136, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:TabNetwork";STATUS = ENABLED+IMAGE;STYLE = PUSHBUTTON+MOUSETRACK;@@ -973,7 +1017,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = PUSHBUTTON;- SCREENRECT = UPPERLEFT: 673 108, BOTTOMRIGHT: 764 136, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 684 108, BOTTOMRIGHT: 764 136, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:TabHotkeys";STATUS = ENABLED+IMAGE;STYLE = PUSHBUTTON+MOUSETRACK;@@ -8400,6 +8444,1341 @@ WINDOWENDALLCHILDRENENDCHILD+ WINDOW+ WINDOWTYPE = USER;+ SCREENRECT = UPPERLEFT: 36 142, BOTTOMRIGHT: 764 462, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:PageWater";+ STATUS = ENABLED+NOFOCUS+SEE_THRU;+ STYLE = USER;+ SYSTEMCALLBACK = "PassMessagesToParentSystem";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Times New Roman", SIZE: 14, BOLD: 0;+ HEADERTEMPLATE = "[NONE]";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 255 255 255 255,+ DISABLED: 255 255 255 255, DISABLEDBORDER: 255 255 255 255,+ HILITE: 255 255 255 255, HILITEBORDER: 255 255 255 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 255, BORDERCOLOR: 47 55 168 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: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 254 254 254 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: 128 128 255 255, BORDERCOLOR: 254 254 254 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;+ CHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 34 150, BOTTOMRIGHT: 258 174, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:GroupHeadingWater0";+ STATUS = ENABLED;+ STYLE = STATICTEXT+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Generals", SIZE: 15, BOLD: 0;+ HEADERTEMPLATE = "MainButton";+ TOOLTIPDELAY = -1;+ TEXT = "GUI:OptionsGroupModernWater";+ TEXTCOLOR = ENABLED: 186 255 12 255, ENABLEDBORDER: 0 2 0 255, DISABLED: 186 255 12 255, DISABLEDBORDER: 0 2 0 255, HILITE: 186 255 12 255, HILITEBORDER: 0 2 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+ CHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 34 182, BOTTOMRIGHT: 258 206, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:LabelWaterFftResolution";+ TOOLTIPTEXT = "TOOLTIP:WaterFftResolution";+ 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:WaterFftResolution";+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 0, BORDERCOLOR: 0 0 0 0,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ STATICTEXTDATA = CENTERED: 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = COMBOBOX;+ SCREENRECT = UPPERLEFT: 40 206, BOTTOMRIGHT: 264 230, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:ComboBoxWaterFftResolution";+ TOOLTIPTEXT = "TOOLTIP:WaterFftResolution";+ STATUS = ENABLED+IMAGE;+ STYLE = MOUSETRACK+COMBOBOX;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "ComboBoxEntry";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDATA = ISEDITABLE: 0,+ MAXCHARS: 16,+ MAXDISPLAY: 5,+ ASCIIONLY: 0,+ LETTERSANDNUMBERS: 0;+ COMBOBOXDROPDOWNBUTTONENABLEDDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONDISABLEDDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONHILITEDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXENABLEDDRAWDATA = IMAGE: TextEntryEnabledLeftEnd, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: TextEntryEnabledRightEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryEnabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryEnabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXDISABLEDDRAWDATA = IMAGE: TextEntryDisabledLeftEnd, COLOR: 128 128 128 255, BORDERCOLOR: 0 0 0 255,+ IMAGE: TextEntryDisabledRightEnd, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryDisabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryDisabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXHILITEDRAWDATA = IMAGE: TextEntryHiliteLeftEnd, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRightEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryHiliteSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXENABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteItemLeftEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: ListBoxHiliteItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXDISABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXHILITEDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 168 255 12 0, BORDERCOLOR: 47 55 168 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 0, BORDERCOLOR: 148 112 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITESLIDERDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 0, BORDERCOLOR: 49 55 168 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBENABLEDDRAWDATA = IMAGE: ScrollBarThumbEnabled, COLOR: 255 4 0 0, BORDERCOLOR: 255 243 28 255,+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBDISABLEDDRAWDATA = IMAGE: ScrollBarThumbDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBHILITEDRAWDATA = IMAGE: ScrollBarThumbHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 34 238, BOTTOMRIGHT: 258 262, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:LabelWaterRefractionQuality";+ TOOLTIPTEXT = "TOOLTIP:WaterRefractionQuality";+ 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:WaterRefractionQuality";+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 0, BORDERCOLOR: 0 0 0 0,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ STATICTEXTDATA = CENTERED: 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = COMBOBOX;+ SCREENRECT = UPPERLEFT: 40 262, BOTTOMRIGHT: 264 286, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:ComboBoxWaterRefractionQuality";+ TOOLTIPTEXT = "TOOLTIP:WaterRefractionQuality";+ STATUS = ENABLED+IMAGE;+ STYLE = MOUSETRACK+COMBOBOX;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "ComboBoxEntry";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDATA = ISEDITABLE: 0,+ MAXCHARS: 16,+ MAXDISPLAY: 5,+ ASCIIONLY: 0,+ LETTERSANDNUMBERS: 0;+ COMBOBOXDROPDOWNBUTTONENABLEDDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONDISABLEDDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONHILITEDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXENABLEDDRAWDATA = IMAGE: TextEntryEnabledLeftEnd, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: TextEntryEnabledRightEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryEnabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryEnabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXDISABLEDDRAWDATA = IMAGE: TextEntryDisabledLeftEnd, COLOR: 128 128 128 255, BORDERCOLOR: 0 0 0 255,+ IMAGE: TextEntryDisabledRightEnd, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryDisabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryDisabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXHILITEDRAWDATA = IMAGE: TextEntryHiliteLeftEnd, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRightEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryHiliteSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXENABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteItemLeftEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: ListBoxHiliteItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXDISABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXHILITEDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 168 255 12 0, BORDERCOLOR: 47 55 168 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 0, BORDERCOLOR: 148 112 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITESLIDERDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 0, BORDERCOLOR: 49 55 168 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBENABLEDDRAWDATA = IMAGE: ScrollBarThumbEnabled, COLOR: 255 4 0 0, BORDERCOLOR: 255 243 28 255,+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBDISABLEDDRAWDATA = IMAGE: ScrollBarThumbDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBHILITEDRAWDATA = IMAGE: ScrollBarThumbHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 282 150, BOTTOMRIGHT: 506 174, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:GroupHeadingWater1";+ STATUS = ENABLED;+ STYLE = STATICTEXT+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Generals", SIZE: 15, BOLD: 0;+ HEADERTEMPLATE = "MainButton";+ TOOLTIPDELAY = -1;+ TEXT = "GUI:OptionsGroupReflections";+ TEXTCOLOR = ENABLED: 186 255 12 255, ENABLEDBORDER: 0 2 0 255, DISABLED: 186 255 12 255, DISABLEDBORDER: 0 2 0 255, HILITE: 186 255 12 255, HILITEBORDER: 0 2 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+ CHILD+ WINDOW+ WINDOWTYPE = CHECKBOX;+ SCREENRECT = UPPERLEFT: 288 182, BOTTOMRIGHT: 512 206, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:CheckWaterReflectionEnabled";+ STATUS = ENABLED+IMAGE+BORDER;+ STYLE = CHECKBOX+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 14, BOLD: 0;+ HEADERTEMPLATE = "MinorTitle";+ TOOLTIPTEXT = "TOOLTIP:WaterReflectionEnabled";+ TOOLTIPDELAY = -1;+ TEXT = "GUI:WaterReflectionEnabled";+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 186 255 12 255, HILITEBORDER: 0 0 0 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: Active-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,+ IMAGE: Active-Checked, COLOR: 0 0 255 255, BORDERCOLOR: 128 128 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: Disabled-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 192 192 192 255,+ IMAGE: Disabled-Checked, COLOR: 64 64 64 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 128 255 128 255,+ IMAGE: Active-HiLighted, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,+ IMAGE: Active-Checked, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 282 210, BOTTOMRIGHT: 506 234, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:LabelWaterReflection";+ TOOLTIPTEXT = "TOOLTIP:WaterReflection";+ 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:WaterReflection";+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 0, BORDERCOLOR: 0 0 0 0,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ STATICTEXTDATA = CENTERED: 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = COMBOBOX;+ SCREENRECT = UPPERLEFT: 288 234, BOTTOMRIGHT: 512 258, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:ComboBoxWaterReflection";+ TOOLTIPTEXT = "TOOLTIP:WaterReflection";+ STATUS = ENABLED+IMAGE;+ STYLE = MOUSETRACK+COMBOBOX;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "ComboBoxEntry";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDATA = ISEDITABLE: 0,+ MAXCHARS: 16,+ MAXDISPLAY: 5,+ ASCIIONLY: 0,+ LETTERSANDNUMBERS: 0;+ COMBOBOXDROPDOWNBUTTONENABLEDDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONDISABLEDDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONHILITEDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXENABLEDDRAWDATA = IMAGE: TextEntryEnabledLeftEnd, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: TextEntryEnabledRightEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryEnabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryEnabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXDISABLEDDRAWDATA = IMAGE: TextEntryDisabledLeftEnd, COLOR: 128 128 128 255, BORDERCOLOR: 0 0 0 255,+ IMAGE: TextEntryDisabledRightEnd, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryDisabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryDisabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXHILITEDRAWDATA = IMAGE: TextEntryHiliteLeftEnd, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRightEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryHiliteSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXENABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteItemLeftEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: ListBoxHiliteItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXDISABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXHILITEDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 168 255 12 0, BORDERCOLOR: 47 55 168 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 0, BORDERCOLOR: 148 112 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITESLIDERDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 0, BORDERCOLOR: 49 55 168 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBENABLEDDRAWDATA = IMAGE: ScrollBarThumbEnabled, COLOR: 255 4 0 0, BORDERCOLOR: 255 243 28 255,+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBDISABLEDDRAWDATA = IMAGE: ScrollBarThumbDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBHILITEDRAWDATA = IMAGE: ScrollBarThumbHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 282 266, BOTTOMRIGHT: 506 290, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:LabelWaterReflectionDetail";+ TOOLTIPTEXT = "TOOLTIP:WaterReflectionDetail";+ 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:WaterReflectionDetail";+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 0, BORDERCOLOR: 0 0 0 0,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;+ STATICTEXTDATA = CENTERED: 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = COMBOBOX;+ SCREENRECT = UPPERLEFT: 288 290, BOTTOMRIGHT: 512 314, CREATIONRESOLUTION: 800 600;+ NAME = "OptionsMenu.wnd:ComboBoxWaterReflectionDetail";+ TOOLTIPTEXT = "TOOLTIP:WaterReflectionDetail";+ STATUS = ENABLED+IMAGE;+ STYLE = MOUSETRACK+COMBOBOX;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "ComboBoxEntry";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDATA = ISEDITABLE: 0,+ MAXCHARS: 16,+ MAXDISPLAY: 5,+ ASCIIONLY: 0,+ LETTERSANDNUMBERS: 0;+ COMBOBOXDROPDOWNBUTTONENABLEDDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONDISABLEDDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 128 128 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXDROPDOWNBUTTONHILITEDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXENABLEDDRAWDATA = IMAGE: TextEntryEnabledLeftEnd, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: TextEntryEnabledRightEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryEnabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryEnabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXDISABLEDDRAWDATA = IMAGE: TextEntryDisabledLeftEnd, COLOR: 128 128 128 255, BORDERCOLOR: 0 0 0 255,+ IMAGE: TextEntryDisabledRightEnd, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: TextEntryDisabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryDisabledSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXEDITBOXHILITEDRAWDATA = IMAGE: TextEntryHiliteLeftEnd, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRightEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: TextEntryHiliteRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: TextEntryHiliteSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXENABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteItemLeftEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: ListBoxHiliteItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXDISABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ COMBOBOXLISTBOXHILITEDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITEDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXENABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 168 255 12 0, BORDERCOLOR: 47 55 168 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXDISABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 0, BORDERCOLOR: 148 112 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ LISTBOXHILITESLIDERDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 0, BORDERCOLOR: 49 55 168 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBENABLEDDRAWDATA = IMAGE: ScrollBarThumbEnabled, COLOR: 255 4 0 0, BORDERCOLOR: 255 243 28 255,+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBDISABLEDDRAWDATA = IMAGE: ScrollBarThumbDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ SLIDERTHUMBHILITEDRAWDATA = IMAGE: ScrollBarThumbHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ END+ ENDALLCHILDREN+ END+ CHILDWINDOWWINDOWTYPE = USER;SCREENRECT = UPPERLEFT: 36 142, BOTTOMRIGHT: 764 462, CREATIONRESOLUTION: 800 600;diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.hindex 46afbadc4..ae13d7e8e 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h@@ -221,6 +221,11 @@ public:Bool m_smoothMotion; // R1: on a display faster than the logic, models drawn between their last two logic states (W3DSmoothMotion.h); -nosmoothmotion turns it offBool m_smoothMotionAnyDisplay; // -smoothmotion: the same whatever the display's refresh rateInt m_waterStyle; // "WaterStyle": 0 = Classic, 1 = Modern (SDL); applied between render frames+ Int m_waterReflection; // "WaterReflection": 0 = Legacy, 1 = SSR, 2 = Hybrid; SDL Modern water+ Bool m_waterReflectionEnabled; // scene reflections; remembers the selected mode+ Int m_waterFftResolution; // 0 = Low (128), 1 = High (256)+ Int m_waterRefractionQuality; // 0 = Full, 1 = Simple, 2 = Off+ Int m_waterReflectionDetail; // 0 = Low, 1 = High planar resolutionInt 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)diff --git a/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.h b/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.hindex 4ad04c88e..896b85484 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/OptionsCatalog.h@@ -145,6 +145,18 @@ enum { SMOKE_LEVEL_COUNT = 3 };// Classic is the original surface; Modern is the SDL wave and optical surface.enum { WATER_STYLE_COUNT = 2 };++// SDL Modern water reflection modes.+enum { WATER_REFLECTION_COUNT = 3 };++// SDL Modern water performance choices. Stored indices are independent of reflection mode.+enum { WATER_FFT_RESOLUTION_COUNT = 2 }; // Low (128), High (256)+enum { WATER_REFRACTION_QUALITY_COUNT = 3 }; // Full, Simple, Off+enum { WATER_REFLECTION_DETAIL_COUNT = 2 }; // Low/High planar resolution; SSR unchanged++/** SDL Modern water controls which must retain their preference when the device is unsupported. */+extern Bool isModernWaterOption( const OptionDef& def );+// Classic is the original hazard effect; Volumetric is the Linux toxin/radiation cloud.enum { CLOUD_STYLE_COUNT = 2 };diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h b/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.hindex 1c2b7a9b5..b7d766c85 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h@@ -518,6 +518,10 @@ public:// inline UnsignedByte getFullyObscuredByShroudWithCheatSpy(void) {return (UnsignedByte)m_drawableFullyObscuredByShroud | 128;}//8 looks like a zero in most fontsBool getDrawsInMirror() const { if( LogicThread::isInsideWindow() ) return m_lookForDraw.drawsInMirror; return BitTest(m_status, DRAWABLE_STATUS_DRAWS_IN_MIRROR) || isKindOf(KINDOF_CAN_CAST_REFLECTIONS); }+ Bool isNoSaveForDraw() const {+ if( LogicThread::isInsideWindow() ) return m_lookForDraw.noSave;+ return testDrawableStatus( DRAWABLE_STATUS_NO_SAVE );+ }/** LOGIC-THREAD.md phase 3, step 3b. How the drawable looks, as the render reads it: hidden, stealth,* opacity, tint, the mirror and dynamic light flags. The tick writes these fields beside the render@@ -529,6 +533,7 @@ public:Bool hidden;Bool fullyObscured;Bool drawsInMirror;+ Bool noSave;Bool receivesDynamicLights;Bool hasTintColor;Bool hasSelectionColor;diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cppindex 5e58f0742..971503c8c 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp@@ -703,6 +703,11 @@ GlobalData::GlobalData()m_smoothMotion = FALSE; //a model stands where the last logic tick left it until the box is tickedm_smoothMotionAnyDisplay = FALSE;m_waterStyle = 0; // classic by default; modern water is an explicit option+ m_waterReflection = 2; // Hybrid once Modern is explicitly selected+ m_waterReflectionEnabled = TRUE;+ m_waterFftResolution = 1;+ m_waterRefractionQuality = 0;+ m_waterReflectionDetail = 1;m_cloudStyle = 0; // Classic by default; volumetric hazard clouds are opt-inm_explosionDebrisTrails = FALSE;m_shadowQuality = 1; //medium, the 2048 map the shadows always haddiff --git a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cppindex f50becae0..6f7d1dc76 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp@@ -121,6 +121,11 @@ OPTION_INT_ACCESSORS( m_msaaLevel )OPTION_BOOL_ACCESSORS( m_vsync )OPTION_INT_ACCESSORS( m_frameRateLimit )OPTION_INT_ACCESSORS( m_waterStyle )+OPTION_INT_ACCESSORS( m_waterReflection )+OPTION_BOOL_ACCESSORS( m_waterReflectionEnabled )+OPTION_INT_ACCESSORS( m_waterFftResolution )+OPTION_INT_ACCESSORS( m_waterRefractionQuality )+OPTION_INT_ACCESSORS( m_waterReflectionDetail )OPTION_INT_ACCESSORS( m_cloudStyle )OPTION_BOOL_ACCESSORS( m_classicGraphics )OPTION_INT_ACCESSORS( m_lightingStyle )@@ -500,6 +505,28 @@ const OptionDef TheOptionCatalog[] =OPTION_ENUM, APPLY_LIVE, 0, WATER_STYLE_COUNT - 1,get_m_waterStyle, set_m_waterStyle },+ // Modern water reads the mode each frame and refreshes its reflection target on a change.+ // Keep this independent of WaterStyle so Classic can retain a choice for a later Modern switch.+ { "WaterReflection", OPT_WND( "ComboBoxWaterReflection" ), "GUI:WaterReflection",+ OPTION_ENUM, APPLY_LIVE, 0, WATER_REFLECTION_COUNT - 1,+ get_m_waterReflection, set_m_waterReflection },++ { "WaterReflectionEnabled", OPT_WND( "CheckWaterReflectionEnabled" ), "GUI:WaterReflectionEnabled",+ OPTION_BOOL, APPLY_LIVE, 0, 1,+ get_m_waterReflectionEnabled, set_m_waterReflectionEnabled },++ { "WaterFftResolution", OPT_WND( "ComboBoxWaterFftResolution" ), "GUI:WaterFftResolution",+ OPTION_ENUM, APPLY_LIVE, 0, WATER_FFT_RESOLUTION_COUNT - 1,+ get_m_waterFftResolution, set_m_waterFftResolution },++ { "WaterRefractionQuality", OPT_WND( "ComboBoxWaterRefractionQuality" ), "GUI:WaterRefractionQuality",+ OPTION_ENUM, APPLY_LIVE, 0, WATER_REFRACTION_QUALITY_COUNT - 1,+ get_m_waterRefractionQuality, set_m_waterRefractionQuality },++ { "WaterReflectionDetail", OPT_WND( "ComboBoxWaterReflectionDetail" ), "GUI:WaterReflectionDetail",+ OPTION_ENUM, APPLY_LIVE, 0, WATER_REFLECTION_DETAIL_COUNT - 1,+ get_m_waterReflectionDetail, set_m_waterReflectionDetail },+// Client appearance only; hazard area, lifetime and damage remain unchanged.{ "CloudStyle", OPT_WND( "ComboBoxCloudStyle" ), "GUI:CloudStyle",OPTION_ENUM, APPLY_LIVE, 0, CLOUD_STYLE_COUNT - 1,@@ -831,6 +858,11 @@ const GraphicsQualityRow TheGraphicsQualityTable[] ={ "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 } },+ // SDL water quality choices. The reflection mode remains the player's chosen look.+ { "CheckWaterReflectionEnabled", 0.0f, { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 } },+ { "ComboBoxWaterRefractionQuality", 0.0f, { 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 } },+ { "ComboBoxWaterFftResolution", 0.0f, { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 } },+ { "ComboBoxWaterReflectionDetail", 0.0f, { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 } },};const Int TheGraphicsQualityTableCount = sizeof( TheGraphicsQualityTable ) / sizeof( TheGraphicsQualityTable[ 0 ] );@@ -855,6 +887,16 @@ const OptionDef *findOptionDef( const char *iniKey )return NULL;}+//-----------------------------------------------------------------------------+Bool isModernWaterOption( const OptionDef& def )+{+ return strcmp( def.iniKey, "WaterReflection" ) == 0+ || strcmp( def.iniKey, "WaterReflectionEnabled" ) == 0+ || strcmp( def.iniKey, "WaterFftResolution" ) == 0+ || strcmp( def.iniKey, "WaterRefractionQuality" ) == 0+ || strcmp( def.iniKey, "WaterReflectionDetail" ) == 0;+}+//-----------------------------------------------------------------------------Int clampOptionValue( const OptionDef& def, Int value ){diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cppindex 20443440a..f1e26da05 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp@@ -551,6 +551,7 @@ void Drawable::takeLookForDraw( void )look.hidden = isDrawableEffectivelyHidden();look.fullyObscured = m_drawableFullyObscuredByShroud;look.drawsInMirror = getDrawsInMirror();+ look.noSave = testDrawableStatus( DRAWABLE_STATUS_NO_SAVE );look.receivesDynamicLights = m_receivesDynamicLights;look.stealthLook = m_stealthLook;look.stealthDrawnLook = m_stealthDrawnLook;@@ -654,6 +655,7 @@ Drawable::Drawable( const ThingTemplate *thingTemplate, DrawableStatus statusBitm_lookForDraw.hidden = FALSE;m_lookForDraw.fullyObscured = FALSE;m_lookForDraw.drawsInMirror = FALSE;+ m_lookForDraw.noSave = BitTest( m_status, DRAWABLE_STATUS_NO_SAVE );m_lookForDraw.receivesDynamicLights = TRUE;m_lookForDraw.hasTintColor = FALSE;m_lookForDraw.hasSelectionColor = FALSE;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cppindex 6fc69f29b..c104f4ddd 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp@@ -64,6 +64,8 @@#include "GameClient/Mouse.h"#include "GameClient/GameText.h"#include "GameClient/Display.h"+#include "GameClient/DisplayStringManager.h"+#include "GameClient/GameFont.h"#include "GameClient/IMEManager.h"#include "GameClient/ShellHooks.h"#include "GameClient/GUICallbacks.h"@@ -76,6 +78,7 @@#include "WWDownload/Registry.h"#include "Platform/HazardCloud.h"#include "Platform/ModernWaterBuild.h"+#include "Platform/WaterScreenReflection.h"//added by saad//used to access a messagebox that does "ok" and "cancel"#include "GameClient/MessageBox.h"@@ -249,13 +252,14 @@ WindowLayout *OptionsLayout = NULL;// this is the two arrays that name them and the one function that decides which one you are// looking at. Shell::optionsLayoutFile names the file, OptionsMenuClassic.wnd.//--------------------------------------------------------------------------------------------------enum { OPTIONS_PAGE_COUNT = 8 };+enum { OPTIONS_PAGE_COUNT = 9, OPTIONS_WATER_PAGE = 3 };static const char *TheOptionsPageNames[ OPTIONS_PAGE_COUNT ] ={"OptionsMenu.wnd:PageDisplay","OptionsMenu.wnd:PageGraphics","OptionsMenu.wnd:PageEffects",+ "OptionsMenu.wnd:PageWater","OptionsMenu.wnd:PageAudio","OptionsMenu.wnd:PageControls","OptionsMenu.wnd:PageInterface",@@ -268,6 +272,7 @@ static const char *TheOptionsTabNames[ OPTIONS_PAGE_COUNT ] ="OptionsMenu.wnd:TabDisplay","OptionsMenu.wnd:TabGraphics","OptionsMenu.wnd:TabEffects",+ "OptionsMenu.wnd:TabWater","OptionsMenu.wnd:TabAudio","OptionsMenu.wnd:TabControls","OptionsMenu.wnd:TabInterface",@@ -280,7 +285,7 @@ static GameWindow * optionsTab[ OPTIONS_PAGE_COUNT ] = { NULL };static NameKeyType optionsTabID[ OPTIONS_PAGE_COUNT ] ={NAMEKEY_INVALID, NAMEKEY_INVALID, NAMEKEY_INVALID, NAMEKEY_INVALID, NAMEKEY_INVALID, NAMEKEY_INVALID,- NAMEKEY_INVALID, NAMEKEY_INVALID+ NAMEKEY_INVALID, NAMEKEY_INVALID, NAMEKEY_INVALID};// The Hotkeys page, OptionsMenuHotkeys.cpp. Its keys are written on Accept like the rest.@@ -297,8 +302,71 @@ void OptionsHotkeysClose( void );* without drawing new artwork: a pressed-looking tab would need a second image per button, and* the buttons are cloned from one that already exists. *///-------------------------------------------------------------------------------------------------+static Bool modernWaterSettingsSupported( void )+{+ return WaterScreenReflection::Supported();+}++// Nine tabs leave less space for translated captions. Fit the actual glyphs,+// keeping the normal font wherever it already fits the button.+static void fitWaterOptionsTabCaption( GameWindow *tab )+{+ if( !TheFontLibrary || !TheDisplayStringManager ) return;+ GameFont *font = tab->winGetFont();+ if( !font ) return;+ Int width, height;+ tab->winGetSize( &width, &height );+ DisplayString *caption = TheDisplayStringManager->newDisplayString();+ if( !caption ) return;+ caption->setText( tab->winGetText() );+ const Int minimum = 8;+ for( ;; )+ {+ caption->setFont( font );+ if( caption->getWidth() <= (width > 8 ? width - 8 : 1) || font->pointSize <= minimum ) break;+ GameFont *smaller = TheFontLibrary->getFont( font->nameString, font->pointSize - 1, font->bold );+ if( !smaller ) break;+ font = smaller;+ }+ tab->winSetFont( font );+ TheDisplayStringManager->freeDisplayString( caption );+}++// Hide the SDL water page elsewhere and give the remaining tabs their original width. Derive+// the bounds from the loaded layout so shell scaling and reopening an existing layout both work.+static void layoutOptionsTabs( void )+{+ if( !optionsTab[0] || !optionsTab[1] || !optionsTab[OPTIONS_PAGE_COUNT - 1] )+ return;+ Int left, top, width, height, secondLeft, secondTop, lastLeft, lastTop, lastWidth, lastHeight;+ optionsTab[0]->winGetPosition( &left, &top );+ optionsTab[0]->winGetSize( &width, &height );+ optionsTab[1]->winGetPosition( &secondLeft, &secondTop );+ optionsTab[OPTIONS_PAGE_COUNT - 1]->winGetPosition( &lastLeft, &lastTop );+ optionsTab[OPTIONS_PAGE_COUNT - 1]->winGetSize( &lastWidth, &lastHeight );+ const Int gap = secondLeft - left - width;+ const Int right = lastLeft + lastWidth;+ const Bool waterSupported = modernWaterSettingsSupported();+ const Int count = OPTIONS_PAGE_COUNT - (waterSupported ? 0 : 1);+ const Int tabWidth = (right - left - (count - 1) * gap) / count;+ Int visible = 0;+ for( Int i = 0; i < OPTIONS_PAGE_COUNT; ++i )+ {+ if( !optionsTab[i] ) continue;+ const Bool hidden = i == OPTIONS_WATER_PAGE && !waterSupported;+ optionsTab[i]->winHide( hidden );+ if( hidden ) continue;+ const Int x = left + visible * (tabWidth + gap);+ optionsTab[i]->winSetPosition( x, top );+ optionsTab[i]->winSetSize( ++visible == count ? right - x : tabWidth, height );+ if( waterSupported ) fitWaterOptionsTabCaption( optionsTab[i] );+ }+}+static void showOptionsPage( Int which ){+ if( which == OPTIONS_WATER_PAGE && !modernWaterSettingsSupported() )+ which = 0;for( Int i = 0; i < OPTIONS_PAGE_COUNT; ++i ){if( optionsPage[ i ] )@@ -1127,6 +1195,9 @@ static void fillCatalogWidgets( void ){const Color entryColor = GameMakeColor( 255, 255, 255, 255 );+ const Bool waterSettingsSupported = modernWaterSettingsSupported();+ layoutOptionsTabs();+for( Int i = 0; i < TheOptionCatalogCount; ++i ){const OptionDef& def = TheOptionCatalog[ i ];@@ -1134,6 +1205,13 @@ static void fillCatalogWidgets( void )if( widget == NULL )continue;+ if (isModernWaterOption(def))+ {+ // Hidden as well as unfilled, so the quality slider leaves them with their page.+ widget->winHide(!waterSettingsSupported);+ if (!waterSettingsSupported) continue;+ }+if (strcmp(def.iniKey, "WaterStyle") == 0){// The Linux renderer and Direct3D 11 draw the Modern water; -d3d9, -headless and macOS do not.@@ -1227,6 +1305,8 @@ static void readCatalogWidgets( OptionPreferences &out )continue;if (strcmp(def.iniKey, "WaterStyle") == 0 && !ModernWater::Supported())continue;+ if (isModernWaterOption(def) && !modernWaterSettingsSupported())+ continue;Int value;switch( def.kind )diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.hindex 0e6d1c470..992d049c0 100644--- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h+++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h@@ -70,6 +70,7 @@ public://-----------------------------------------------------------------------------------------------virtual void draw( void ); ///< Render the in-game user interface+ Bool isWorldSpaceUI( const RenderObjClass *robj, const Drawable *draw ) const; ///< scene models belonging to the cursor and order feedbackvirtual void recordDraw( void ); ///< what draw asks of logic, run at the sync point (LOGIC-THREAD.md phase 3)protected:diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainBackground.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainBackground.hindex 4335eb406..365e7d39e 100644--- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainBackground.h+++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainBackground.h@@ -85,7 +85,7 @@ public:W3DTerrainBackground(void);~W3DTerrainBackground(void);/// Draws the terrain.- void drawVisiblePolys(RenderInfoClass & rinfo, Bool disableTextures);+ void drawVisiblePolys(RenderInfoClass & rinfo, Bool disableTextures, Bool useMirrorCamera = FALSE);void setFlip(WorldHeightMap *htMap); ///< Sets the flip bit for required vertices.void doPartialUpdate(const IRegion2D &partialRange, WorldHeightMap *htMap, Bool doTextures );void doTesselatedUpdate(const IRegion2D &partialRange, WorldHeightMap *htMap, Bool doTextures );diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DTreeBuffer.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DTreeBuffer.hindex cb2dd1b42..2dcb58657 100644--- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DTreeBuffer.h+++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DTreeBuffer.h@@ -64,6 +64,7 @@#include "Common/GameType.h"#include "Common/AsciiString.h"#include "Common/GlobalData.h"+#include "GameLogic/ScriptEngine.h"#include <vector>//-----------------------------------------------------------------------------@@ -310,6 +311,8 @@ private:Real m_curSwayOffset[MAX_SWAY_TYPES];UnsignedInt m_lastSwayFrame; ///< last logic frame the sway was stepped on (drawTrees runs per render frame)UnsignedInt m_lastTreeStepFrame; ///< last logic frame stepTrees moved the toppling and pushed trees on+ BreezeInfo m_breezeForDraw{};+ Bool m_pauseForDraw = FALSE;Real m_curSwayStep[MAX_SWAY_TYPES];Real m_curSwayFactor[MAX_SWAY_TYPES];diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DWater.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DWater.hindex 4c888057b..6a248fe55 100644--- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DWater.h+++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DWater.h@@ -47,6 +47,7 @@#include "GameLogic/WaterGridMotion.h"#include "Platform/RenderTypes.h"#include "Platform/ModernWaterBuild.h"+#include "Platform/WaterScreenReflection.h"#include "Platform/WaterOpticalContext.h"#include "Platform/WaterProjectedMesh.h"#include "Platform/WaterHullVisual.h"@@ -141,6 +142,7 @@ public:void replaceSkyboxTexture(const AsciiString& oldTexName, const AsciiString& newTextName);TextureClass *getSkyTexture(void) const { return m_settings[m_tod].skyTexture; } ///< the time of day's sky, as WaterSet names itBool hasModernVesselFoam(UnsignedInt objectID) const; ///< replacement was submitted for this hull in the current render frame+ Bool isModernFullMirror() const;Bool isModernWaterMirrorForOwner(UnsignedInt objectID) const; ///< owner's surface foam must not reflect back into the same water planeprotected:@@ -188,6 +190,8 @@ protected:Int m_iBumpFrame; ///<current animation frameReal m_bumpFrameAccum; ///<fractional carry, so the flipbook can run slower than one frame per tickReal m_fBumpScale; ///<scales bump map uv perturbation+ Int m_reflectionTargetRequestSize = 0;+ WaterScreenReflection::Mode m_waterReflectionMode = WaterScreenReflection::Mirror;TextureClass * m_pReflectionTexture; ///<render target for reflectionReal m_reflectionLevel; ///<height of the water plane the reflection texture was rendered forVector2 m_reflectionAreaMin; ///<lower left of the screen area the reflection texture covers, -1 to 1@@ -269,6 +273,7 @@ protected:std::vector<WaterPolygonForDraw> m_waterPolygonsForDraw;void takeWaterPolygonsForDraw(void);void takeMotionReadsForRender(void);+ void synchronizeWaterReflection(void);#endifWaterObstacleIndex::Grid m_modernObstacleIndex;std::vector<WaterObstacleIndex::Influence> m_modernObstacleInfluences;@@ -365,6 +370,8 @@ protected:void renderSkyBody(Matrix3D *mat); ///<draw the sky body (sun, moon, etc.)void renderWaterMesh(void); ///<draw the water surface mesh (deformed 3d mesh).RenderResult initBumpMap(LPDIRECT3DTEXTURE9 *pTex, TextureClass *pBumpSource); ///<copies data into bump-map format.+ Int mapReflectionTargetSize() const;+ void ensureMapReflectionTarget(void);void renderMirror(CameraClass *cam, Real level); ///< Draw reflected scene into texturevoid drawReflection(Int triangleCount, Int vertexCount); ///< Lay the reflection over the water just drawnvoid drawSea(RenderInfoClass & rinfo); ///< Draw the surface of the waterdiff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DWaterTracks.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DWaterTracks.hindex 8b405bfcb..fdb36b8aa 100644--- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DWaterTracks.h+++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DWaterTracks.h@@ -63,11 +63,9 @@ public:protected:void waveForDraw(Vector2 &waveTailOrigin,Vector2 &waveFrontOrigin,Real &waveAlpha,Real &widthFrac);-#if defined(__linux__)Vector2 m_drawnWaveTail,m_drawnWaveFront;Real m_drawnWaveAlpha=0,m_drawnWaveWidth=0,m_drawnWaterHeight=0;Bool m_drawnHasWater=FALSE,m_drawnWaveReady=FALSE;-#endifTextureClass *m_stageZeroTexture; ///<primary textureSphereClass m_boundingSphere; ///<bounding sphere of WaterTracksAABoxClass m_boundingBox; ///<bounding box of WaterTracks@@ -130,9 +128,7 @@ public:void flush (RenderInfoClass & rinfo); ///<draw all tracks that were requested for rendering.void update(void); ///<update the state of all edges (fade alpha, remove old, etc.)-#if defined(__linux__)void takeReadsForRender(void);-#endifvoid init(void); ///< pre-allocate track objectsvoid shutdown( void ); ///< release all pre-allocated track objects, called by destructordiff --git a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9.cpp b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9.cppindex 16a16a0ff..70256f7bf 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9.cpp@@ -1018,3 +1018,8 @@ RenderResult PosixDevice9::SetPixelShaderConstantF(unsigned int start, const flomemcpy(PixelShaderConstants[start], data, count * sizeof(PixelShaderConstants[0]));return D3D_OK;}++bool PosixWaterGpuAvailable(IDirect3DDevice9 *device)+{+ return device && static_cast<PosixDevice9 *>(device)->Get_Gpu();+}diff --git a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9.h b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9.hindex 47b62c586..f51a522c7 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9.h+++ b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9.h@@ -511,3 +511,6 @@ protected:};#endif // POSIXDEVICE9_H++// SDL water features require a live native GPU device.+bool PosixWaterGpuAvailable(IDirect3DDevice9 *device);diff --git a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9Draw.cpp b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9Draw.cppindex 10d0e1e92..9a6ef7ad8 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9Draw.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/PosixDevice9Draw.cpp@@ -36,6 +36,7 @@#include "ffshader.h"#include "ffvertex.h"#include "Platform/WaterFftSampling.h"+#include "Platform/WaterPerformanceSettings.h"#include "Platform/WaterFoamHistory.h"#include <SDL3/SDL.h>@@ -546,6 +547,11 @@ void PosixDevice9::Build_Water_Constants(const SdlPixelConstants &pixel_constantwater.WorldFromClip[8 + column] = z_row;}}+ // Project SSR through the inverse of the exact matrix used for depth reconstruction.+ if (!water_inverse(water.WorldFromClip, water.ClipFromWorld)) {+ memset(water.ClipFromWorld, 0, sizeof(water.ClipFromWorld));+ for (unsigned i = 0; i < 4; ++i) water.ClipFromWorld[i * 5] = 1.0f;+ }water.Viewport[0] = (float)Viewport.X + 0.5f;water.Viewport[1] = (float)Viewport.Y + 0.5f;water.Viewport[2] = (float)Viewport.Width;@@ -970,7 +976,9 @@ RenderResult PosixDevice9::Gpu_Draw(const DrawCall &call)const bool fft_requested = !SunActive && pixel_engine == ENGINE_SHADER_WATER_TRAPEZOID&& vertex_engine == ENGINE_SHADER_NONE && !vertex.LightingEnabled&& PixelShaderConstants[6][2] > 0.5f && PixelShaderConstants[6][3] > 0.5f;- bool fft_water = fft_requested && Gpu->Prepare_Ocean(PixelShaderConstants[1][0]*WaterFftSampling::TimeScale);+ bool fft_water = fft_requested && Gpu->Prepare_Ocean(PixelShaderConstants[1][0]*WaterFftSampling::TimeScale,+ WaterPerformanceSettings::Applied().requestedFftResolution);+ if (fft_water) WaterPerformanceSettings::Applied().activeFftResolution = Gpu->Ocean_Configuration().resolution;const SdlProgram *fft_vertex = fft_water ? &Programs->Water_Vertex_Program(vertex) : NULL;if (fft_vertex && fft_vertex->Shader == NULL) fft_water = false;const SdlProgram &vertex_program = vertex_engine != ENGINE_SHADER_NONE@@ -1115,8 +1123,12 @@ RenderResult PosixDevice9::Gpu_Draw(const DrawCall &call)const bool stage_indices = call.Indexed && (fan || is_dynamic(index_buffer));const unsigned int index_size = (call.Indexed && index_buffer->format() == D3DFMT_INDEX32) ? 4 : 2;const bool water_draw = pixel_engine == ENGINE_SHADER_WATER_TRAPEZOID || pixel_engine == ENGINE_SHADER_WATER_RIVER;- SDL_GPUTexture *water_background = water_draw ? Gpu->Water_Background(target) : NULL;- SDL_GPUTexture *water_depth = water_draw ? Gpu->Scene_Depth(target) : NULL;+ const auto &water_settings = WaterPerformanceSettings::Applied();+ const bool ssr_colour = water_settings.sceneReflections && PixelShaderConstants[95][3] > .5f;+ const bool water_colour = WaterPerformanceSettings::SceneColourRequired(water_settings.refraction, ssr_colour);+ if (water_draw) Gpu->Prepare_Water_Snapshot(target, water_colour, true);+ SDL_GPUTexture *water_background = water_draw && water_colour ? Gpu->Water_Background(target) : NULL;+ SDL_GPUTexture *water_depth = water_draw ? Gpu->Water_Depth(target) : NULL;bool water_history = water_draw && Water_Foam_History_Available();draw.VertexSamplerCount = vertex_program.SamplerSlots;for (unsigned int slot = 0; slot < draw.VertexSamplerCount && slot < 3; ++slot) {diff --git a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlConstants.h b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlConstants.hindex b78da7375..470758b4d 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlConstants.h+++ b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlConstants.h@@ -100,8 +100,9 @@ struct SdlWaterPixelConstants#define MODERN_WATER_CPP_UNIFORM(name) float name[4];MODERN_WATER_MATERIAL_UNIFORMS(MODERN_WATER_CPP_UNIFORM)#undef MODERN_WATER_CPP_UNIFORM+ float ClipFromWorld[16]; // inverse of depth-range-adjusted WorldFromClip for SSR};-static_assert(sizeof(SdlWaterPixelConstants) == WaterHullVisualLayout::VertexCommonRegisters * 16, "water uniform packing");+static_assert(sizeof(SdlWaterPixelConstants) == (WaterHullVisualLayout::VertexCommonRegisters + 4) * 16, "water uniform packing");static_assert(offsetof(SdlWaterPixelConstants,MaterialColor)==184*16&& offsetof(SdlWaterPixelConstants,MaterialParameters)==185*16,"water material tail packing");@@ -111,7 +112,7 @@ struct SdlWaterVisualPixelConstantsSdlWaterPixelConstants Water;float VisualHullMeta[WaterHullVisualLayout::MaxHulls][4];};-static_assert(sizeof(SdlWaterVisualPixelConstants)==WaterHullVisualLayout::FragmentCommonRegisters*16,+static_assert(sizeof(SdlWaterVisualPixelConstants)==(WaterHullVisualLayout::FragmentCommonRegisters + 4)*16,"fragment hull metadata packing");// A generator adding a block must have an explicit recording/binding path. The mesh packetdiff --git a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlGpuFrame.cpp b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlGpuFrame.cppindex ff47a0bd8..8e5f3df33 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlGpuFrame.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlGpuFrame.cpp@@ -22,6 +22,7 @@#include "SdlGpuDepthFormat.h"#include "sdl3shadercompile.h"#include "Platform/WaterFftSpectrum.h"+#include "Platform/WaterPerformanceSettings.h"#include <SDL3/SDL.h>@@ -296,6 +297,7 @@ void SdlGpuFrame::Release_Targets()// window dimensions: resizing scene targets keeps both its seed and paused frame unchanged.struct SdlGpuFrame::OceanResources{+ WaterFftSpectrum::Configuration Configuration = WaterFftSpectrum::ForResolution(WaterFftSpectrum::Resolution);SDL_GPUTexture *Initial[3]={}, *Ping[2][6]={}, *Maps[6]={}, *Butterfly=NULL;SDL_GPUShader *Vertex=NULL, *Pixels[4]={};SDL_GPUGraphicsPipeline *Pipelines[4]={};@@ -318,7 +320,7 @@ struct SdlGpuFrame::OceanResourcesSDL_GPUTextureSamplerBinding bindings[7]={};for(unsigned i=0;i<count;++i) {bindings[i].texture=source[i];bindings[i].sampler=Point;}SDL_BindGPUFragmentSamplers(pass,0,bindings,count);- const unsigned side=which==3?WaterFftSpectrum::Resolution>>unsigned(parameters[2]):WaterFftSpectrum::Resolution;+ const unsigned side=which==3?Configuration.resolution>>unsigned(parameters[2]):Configuration.resolution;const SDL_GPUViewport viewport={0,0,float(side),float(side),0,1};SDL_SetGPUViewport(pass,&viewport);SDL_PushGPUFragmentUniformData(commands,0,parameters,8*sizeof(float));@@ -365,13 +367,16 @@ bool SdlGpuFrame::Fail_Ocean(const char *reason)OceanFailed=true;Release_Ocean();return false;}-bool SdlGpuFrame::Create_Ocean()+bool SdlGpuFrame::Create_Ocean(WaterFftSpectrum::Configuration configuration){using namespace WaterFftSpectrum;+ if (FailNextOceanRebuild) { FailNextOceanRebuild = false; return Fail_Ocean("injected rebuild failure"); }+ const unsigned Resolution = configuration.resolution, Phases = configuration.phases;const SDL_GPUTextureUsageFlags usage=SDL_GPU_TEXTUREUSAGE_COLOR_TARGET|SDL_GPU_TEXTUREUSAGE_SAMPLER;if(!SDL_GPUTextureSupportsFormat(GpuDevice,SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT,SDL_GPU_TEXTURETYPE_2D,usage))return Fail_Ocean("RGBA32F colour-target/sampler usage unsupported");Ocean=new OceanResources;+ Ocean->Configuration = configuration;SDL_GPUTextureCreateInfo texture={};texture.type=SDL_GPU_TEXTURETYPE_2D;texture.format=SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT;texture.usage=usage;texture.width=texture.height=Resolution;texture.layer_count_or_depth=texture.num_levels=1;@@ -395,7 +400,7 @@ bool SdlGpuFrame::Create_Ocean()std::vector<unsigned char> spirv;std::string error;if(!SDL3_Compile_HLSL_To_SPIRV(VertexHlsl(),true,spirv,error) ||!(Ocean->Vertex=SDL3_Create_Shader(GpuDevice,spirv,true,error))) return Fail_Ocean(error.c_str());- const std::string pixels[4]={SpectrumHlsl(),ButterflyHlsl(),PostHlsl(),Ocean_Mip_Hlsl()};+ const std::string pixels[4]={SpectrumHlsl(),ButterflyHlsl(configuration),PostHlsl(),Ocean_Mip_Hlsl()};SDL_GPUColorTargetDescription targets[6]={};for(auto &target:targets) target.format=texture.format;for(unsigned i=0;i<4;++i) {@@ -408,7 +413,7 @@ bool SdlGpuFrame::Create_Ocean()Ocean->Pipelines[i]=SDL_CreateGPUGraphicsPipeline(GpuDevice,&pipeline);if(!Ocean->Pipelines[i]) return Fail_Ocean(SDL_GetError());}- const std::vector<float> initial=InitialSpectrum(),butterfly=Butterfly();+ const std::vector<float> initial=InitialSpectrum(configuration),butterfly=Butterfly(configuration);const Uint32 fieldBytes=Resolution*Resolution*4*sizeof(float),butterflyBytes=Phases*Resolution*4*sizeof(float);SDL_GPUTransferBufferCreateInfo transferInfo={};transferInfo.usage=SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD;transferInfo.size=fieldBytes*3+butterflyBytes;@@ -436,17 +441,47 @@ bool SdlGpuFrame::Create_Ocean()return true;}-bool SdlGpuFrame::Prepare_Ocean(float time)+bool SdlGpuFrame::Prepare_Ocean(float time, unsigned resolution){- if(!std::isfinite(time) || OceanFailed) return false;- if(OceanReady && time==OceanTime) return true;- // Do not mutate a field referenced by draws still sitting in the CPU batch. Ordering submissions- // is sufficient; waiting or reading the texture back would unnecessarily serialize every frame.- if((!Commands.empty() || !Uploads.empty()) && !Flush()) return Fail_Ocean("could not submit preceding draws");- if(!Ocean && !Create_Ocean()) return false;+ if (!std::isfinite(time)) return false;+ const auto requested = WaterFftSpectrum::ForResolution(resolution);+ if (OceanRequestedResolution != requested.resolution) {+ OceanFailedResolution = 0;+ OceanRequestedResolution = requested.resolution;+ }+ const bool boundary = OceanPrepareFrame != WaterFrame;+ OceanPrepareFrame = WaterFrame;+ const bool rebuild = !Ocean || (boundary && Ocean->Configuration.resolution != requested.resolution+ && OceanFailedResolution != requested.resolution);+ if (OceanFailed && !Ocean && OceanFailedResolution == requested.resolution) return false;+ if (!rebuild && OceanReady && time == OceanTime) return true;+ // Submit older readers before replacing resources. Keep a working field on allocation failure.+ if ((!Commands.empty() || !Uploads.empty()) && !Flush()) return false;+ OceanResources *previous = rebuild ? Ocean : NULL;+ const bool previousReady = OceanReady;+ const float previousTime = OceanTime;+ if (rebuild) { Ocean = NULL; OceanReady = false; OceanFailed = false; }+ auto failure = [&](const char *reason) {+ Fail_Ocean(reason);+ OceanFailedResolution = requested.resolution;+ if (previous) {+ Ocean = previous; OceanReady = previousReady; OceanTime = previousTime; OceanFailed = false;+ return OceanReady;+ }+ return false;+ };+ if (rebuild && !Create_Ocean(requested)) {+ OceanFailedResolution = requested.resolution;+ if (previous) {+ Ocean = previous; OceanReady = previousReady; OceanTime = previousTime; OceanFailed = false;+ return OceanReady;+ }+ return false;+ }+ const unsigned Resolution = Ocean->Configuration.resolution, Phases = Ocean->Configuration.phases;const Uint64 started=SDL_GetTicksNS();SDL_GPUCommandBuffer *commands=SDL_AcquireGPUCommandBuffer(GpuDevice);- if(!commands) return Fail_Ocean(SDL_GetError());+ if(!commands) return failure(SDL_GetError());using namespace WaterFftSpectrum;float parameters[8]={float(Resolution),time,0,0,Sizes[0],Sizes[1],Sizes[2],0};bool ok=Ocean->Pass(commands,0,Ocean->Ping[0],Ocean->Initial,3,parameters);@@ -470,13 +505,22 @@ bool SdlGpuFrame::Prepare_Ocean(float time)}SDL_EndGPUCopyPass(copy);}- if(!ok) {SDL_CancelGPUCommandBuffer(commands);return Fail_Ocean("could not record independent FFT passes");}+ if(!ok) {SDL_CancelGPUCommandBuffer(commands);return failure("could not record independent FFT passes");}ok=SerializeSubmits?Submit(commands):Submit_Flush(commands);FlushMs+=double(SDL_GetTicksNS()-started)/1.0e6;++Flushes;++FlushesTotal;- if(!ok) return Fail_Ocean(SDL_GetError());+ if(!ok) return failure(SDL_GetError());+ if (previous) {+ OceanResources *replacement = Ocean; Ocean = previous; Release_Ocean(); Ocean = replacement;+ }+ if (rebuild) OceanFailedResolution = 0;OceanTime=time;OceanReady=true;++OceanUpdates;return true;}+WaterFftSpectrum::Configuration SdlGpuFrame::Ocean_Configuration() const+{+ return Ocean ? Ocean->Configuration : WaterFftSpectrum::ForResolution(WaterFftSpectrum::Resolution);+}+SDL_GPUTexture *SdlGpuFrame::Ocean_Map(unsigned int index) const{return OceanReady && Ocean && index<6?Ocean->Maps[index]:NULL;@@ -492,7 +536,7 @@ void SdlGpuFrame::Invalidate_Water_Snapshots(SDL_GPUTexture *colour, SDL_GPUTextfor (size_t i = 0; i < WaterSnapshots.size(); ++i) {WaterSnapshot &snapshot = WaterSnapshots[i];if ((colour && snapshot.Source.Colour == colour) || (depth && snapshot.Source.Depth == depth)) {- snapshot.Ready = false;+ snapshot.ColourReady = snapshot.DepthReady = snapshot.Frozen = false;}}}@@ -500,10 +544,10 @@ void SdlGpuFrame::Invalidate_Water_Snapshots(SDL_GPUTexture *colour, SDL_GPUTextvoid SdlGpuFrame::Refresh_Water_Snapshots(){++WaterFrame;- for (size_t i = 0; i < WaterSnapshots.size(); ++i) WaterSnapshots[i].Ready = false;+ for (size_t i = 0; i < WaterSnapshots.size(); ++i) WaterSnapshots[i].ColourReady = WaterSnapshots[i].DepthReady = WaterSnapshots[i].Frozen = false;}-SdlGpuFrame::WaterSnapshot *SdlGpuFrame::Water_Snapshot(const SdlTarget &source)+SdlGpuFrame::WaterSnapshot *SdlGpuFrame::Water_Snapshot(const SdlTarget &source, bool colour, bool depth){if (source.Width == 0 || source.Height == 0 || !source.Colour) return NULL;WaterSnapshot *snapshot = NULL;@@ -518,20 +562,6 @@ SdlGpuFrame::WaterSnapshot *SdlGpuFrame::Water_Snapshot(const SdlTarget &source)if (!snapshot) {WaterSnapshot fresh = {};fresh.Source = source;- SDL_GPUTextureCreateInfo info;- SDL_zero(info);- info.type = SDL_GPU_TEXTURETYPE_2D;- info.format = BACK_BUFFER_FORMAT;- info.usage = SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | SDL_GPU_TEXTUREUSAGE_SAMPLER;- info.width = source.Width; info.height = source.Height;- info.layer_count_or_depth = 1; info.num_levels = 1;- info.sample_count = SDL_GPU_SAMPLECOUNT_1;- fresh.Colour = SDL_CreateGPUTexture(GpuDevice, &info);- if (!fresh.Colour) return NULL;- if (source.Depth && DepthSampleable && Create_Scene_Depth_Pipeline()) {- info.format = SDL_GPU_TEXTUREFORMAT_R32_FLOAT;- fresh.Depth = SDL_CreateGPUTexture(GpuDevice, &info);- }if (WaterSnapshots.size() == 8) {// The cache is bounded even when effects continually allocate intermediate targets. Recorded// draws can keep using the retired textures until this batch has been submitted.@@ -548,41 +578,62 @@ SdlGpuFrame::WaterSnapshot *SdlGpuFrame::Water_Snapshot(const SdlTarget &source)snapshot = &WaterSnapshots.back();}}- if (!snapshot->Ready) {- const int32_t rectangle[4] = { 0, 0, (int32_t)source.Width, (int32_t)source.Height };- Record_Blit(source.Colour, rectangle, snapshot->Colour, rectangle, false);- if (snapshot->Depth) {- Command command = {};- command.IsDepthSnapshot = true;- command.BlitSource = source.Depth;- command.BlitDestination = snapshot->Depth;- memcpy(command.Rect, rectangle, sizeof(rectangle));- Commands.push_back(command);+ // A demand declaration freezes both channels at one pre-water point. Missing channels+ // cannot be filled later from a source that may already contain water.+ if (!snapshot->Frozen) {+ SDL_GPUTextureCreateInfo info={};info.type=SDL_GPU_TEXTURETYPE_2D;+ info.format=BACK_BUFFER_FORMAT;info.usage=SDL_GPU_TEXTUREUSAGE_COLOR_TARGET|SDL_GPU_TEXTUREUSAGE_SAMPLER;+ info.width=source.Width;info.height=source.Height;info.layer_count_or_depth=info.num_levels=1;+ if(colour && !snapshot->Colour) snapshot->Colour=SDL_CreateGPUTexture(GpuDevice,&info);+ if(depth && !snapshot->Depth && source.Depth && DepthSampleable && Create_Scene_Depth_Pipeline()) {+ info.format=SDL_GPU_TEXTUREFORMAT_R32_FLOAT;snapshot->Depth=SDL_CreateGPUTexture(GpuDevice,&info);+ }+ {+ const int32_t rectangle[4]={0,0,(int32_t)source.Width,(int32_t)source.Height};+ if(colour && snapshot->Colour) {+ Record_Blit(source.Colour,rectangle,snapshot->Colour,rectangle,false);+ snapshot->ColourReady=true;++WaterColourCaptures;+ }+ if(depth && snapshot->Depth) {+ Command command={};command.IsDepthSnapshot=true;command.BlitSource=source.Depth;+ command.BlitDestination=snapshot->Depth;memcpy(command.Rect,rectangle,sizeof(rectangle));+ Commands.push_back(command);snapshot->DepthReady=true;++WaterDepthCaptures;+ }+ snapshot->CaptureSerial=++WaterCaptureSerial;snapshot->Frozen=true;}- snapshot->CaptureSerial = ++WaterCaptureSerial;- snapshot->Ready = true;}snapshot->UsedFrame = WaterFrame;return snapshot;}+void SdlGpuFrame::Prepare_Water_Snapshot(const SdlTarget &source, bool colour, bool depth)+{+ Water_Snapshot(source,colour,depth);+}+SDL_GPUTexture *SdlGpuFrame::Water_Background(const SdlTarget &source){- WaterSnapshot *snapshot = Water_Snapshot(source);- return snapshot ? snapshot->Colour : NULL;+ WaterSnapshot *snapshot = Water_Snapshot(source,true,true);+ return snapshot && snapshot->ColourReady ? snapshot->Colour : NULL;+}++SDL_GPUTexture *SdlGpuFrame::Water_Depth(const SdlTarget &source)+{+ WaterSnapshot *snapshot = Water_Snapshot(source,true,true);+ return snapshot && snapshot->DepthReady ? snapshot->Depth : NULL;}SDL_GPUTexture *SdlGpuFrame::Scene_Depth(const SdlTarget &source){- WaterSnapshot *snapshot = Water_Snapshot(source);- return snapshot ? snapshot->Depth : NULL;+ Prepare_Water_Snapshot(source,WaterPerformanceSettings::Applied().sceneColourRequired,true);+ return Water_Depth(source);}SDL_GPUTexture *SdlGpuFrame::Ready_Scene_Depth(const SdlTarget &source, uint64_t &serial) const{serial = 0;for (const WaterSnapshot &snapshot : WaterSnapshots) {- if (snapshot.Ready && snapshot.Depth && snapshot.Source.Colour == source.Colour+ if (snapshot.DepthReady && snapshot.Depth && snapshot.Source.Colour == source.Colour&& snapshot.Source.Depth == source.Depth && snapshot.Source.Width == source.Width&& snapshot.Source.Height == source.Height) {serial = snapshot.CaptureSerial;diff --git a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlGpuFrame.h b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlGpuFrame.hindex 162fc1b24..884abe57e 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlGpuFrame.h+++ b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlGpuFrame.h@@ -36,6 +36,7 @@#define SDLGPUFRAME_H#include "Platform/RenderTypes.h"+#include "Platform/WaterFftSpectrum.h"#include <stdint.h>#include <string>@@ -244,7 +245,13 @@ public:SDL_GPUTexture * Ready_Scene_Depth(const SdlTarget &source, uint64_t &serial) const;/// Lazy, GPU-only Phillips spectrum/IFFT. Previous draws finish recording before maps change;/// repeated paused times reuse the same field. Failure leaves the analytic water fallback usable.- bool Prepare_Ocean(float time);+ bool Prepare_Ocean(float time, unsigned resolution = WaterFftSpectrum::Resolution);+ WaterFftSpectrum::Configuration Ocean_Configuration() const;+ void Fail_Next_Ocean_Rebuild_For_Test() { FailNextOceanRebuild = true; }+ uint64_t Water_Colour_Captures() const { return WaterColourCaptures; }+ uint64_t Water_Depth_Captures() const { return WaterDepthCaptures; }+ void Prepare_Water_Snapshot(const SdlTarget &source, bool colour, bool depth);+ SDL_GPUTexture *Water_Depth(const SdlTarget &source);SDL_GPUTexture * Ocean_Map(unsigned int index) const;SDL_GPUSampler * Ocean_Sampler() const;uint64_t Ocean_Updates() const { return OceanUpdates; }@@ -325,13 +332,14 @@ private:{SdlTarget Source;SDL_GPUTexture *Colour, *Depth;- bool Ready;+ bool ColourReady, DepthReady, Frozen;uint64_t UsedFrame;uint64_t CaptureSerial;};std::vector<WaterSnapshot> WaterSnapshots; // at most eight; replaced resources retire with their batchuint64_t WaterFrame = 0;uint64_t WaterCaptureSerial = 0;+ uint64_t WaterColourCaptures = 0, WaterDepthCaptures = 0;bool DepthSampleable = false;SDL_GPUShader *SceneDepthVertex = NULL, *SceneDepthPixel = NULL;SDL_GPUGraphicsPipeline *SceneDepthPipeline = NULL;@@ -341,11 +349,14 @@ private:bool OceanFailed = false, OceanReady = false;float OceanTime = 0;uint64_t OceanUpdates = 0;- bool Create_Ocean();+ uint64_t OceanPrepareFrame = UINT64_MAX;+ unsigned OceanFailedResolution = 0, OceanRequestedResolution = 0;+ bool FailNextOceanRebuild = false;+ bool Create_Ocean(WaterFftSpectrum::Configuration configuration);void Release_Ocean();bool Fail_Ocean(const char *reason);- WaterSnapshot *Water_Snapshot(const SdlTarget &source);+ WaterSnapshot *Water_Snapshot(const SdlTarget &source, bool colour, bool depth);void Invalidate_Water_Snapshots(SDL_GPUTexture *colour, SDL_GPUTexture *depth);void Refresh_Water_Snapshots();// The one depth-to-R32F resolve: the scene snapshots (water, hazard clouds) and the sun'sdiff --git a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlProgramCache.cpp b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlProgramCache.cppindex ecb6dd583..e414c150c 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlProgramCache.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/PosixDevice/Render/SdlProgramCache.cpp@@ -26,6 +26,7 @@#include "ffvertex.h"#include "sdl3target.h"#include "Platform/WaterFftSampling.h"+#include "Platform/WaterPerformanceSettings.h"#include "Platform/WaterShoreOverlay.h"#include <SDL3/SDL.h>@@ -237,7 +238,7 @@ const SdlProgram &SdlProgramCache::Water_Vertex_Program(const VertexPipelineDescstd::string hlsl;const bool generated = !description.LightingEnabled&& VertexShader_Generate(description, VERTEX_SHADER_TARGET_D3D11, hlsl)- && WaterFftSampling::WrapVertex(hlsl) && SDL3_Shader_Retarget(hlsl, true);+ && WaterFftSampling::WrapVertex(hlsl,true) && SDL3_Shader_Retarget(hlsl, true);const SdlProgram &made = Make(VertexPrograms, key, generated, hlsl, true);WaterVertexByBytes.Add(&description, sizeof(description), &VertexPrograms[key]);return made;@@ -267,16 +268,29 @@ const SdlProgram &SdlProgramCache::Engine_Vertex_Program(int program)const SdlProgram &SdlProgramCache::Engine_Pixel_Program(int program, const PixelPipelineDescription &pipeline){// The program and the pipeline description, side by side, as the lookup's bytes.- struct { int Program; PixelPipelineDescription Pipeline; } lookup;+ struct {+ int Program;+ PixelPipelineDescription Pipeline;+ unsigned Resolution, Refraction, Reflections;+ } lookup;memset(&lookup, 0, sizeof(lookup));lookup.Program = program;+ const bool water = program == ENGINE_SHADER_WATER_TRAPEZOID || program == ENGINE_SHADER_WATER_RIVER;+ if (water) {+ const auto &settings = WaterPerformanceSettings::Applied();+ lookup.Resolution = settings.activeFftResolution;+ lookup.Refraction = unsigned(settings.refraction);+ lookup.Reflections = settings.sceneReflections ? 1 : 0;+ }memcpy(&lookup.Pipeline, &pipeline, sizeof(pipeline)); // padding and all, as the caller built itif (SdlProgram *found = EnginePixelByBytes.Find(&lookup, sizeof(lookup))) {++found->Uses;return *found;}const EngineShaderProgram engine = (EngineShaderProgram)program;- const std::string key = std::string("engine:") + EngineShader_Name(engine) + CombinerShader_Pipeline_Key(pipeline);+ const std::string key = std::string("engine:") + EngineShader_Name(engine) + CombinerShader_Pipeline_Key(pipeline)+ + (water ? ":water:" + std::to_string(lookup.Resolution) + ":" + std::to_string(lookup.Refraction)+ + ":" + std::to_string(lookup.Reflections) : std::string());std::map<std::string, SdlProgram>::iterator existing = PixelPrograms.find(key);if (existing != PixelPrograms.end()) {++existing->second.Uses;diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cppindex 17905a3f3..be8aea666 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/FlatHeightMap.cpp@@ -464,6 +464,7 @@ DECLARE_PERF_TIMER(Terrain_Render_Flat)void FlatHeightMapRenderObjClass::Render(RenderInfoClass & rinfo){USE_PERF_TIMER(Terrain_Render_Flat)+ const Bool modernFullMirror = TheWaterRenderObj && TheWaterRenderObj->isModernFullMirror();Int devicePasses;W3DShaderManager::ShaderTypes st;@@ -500,7 +501,11 @@ void FlatHeightMapRenderObjClass::Render(RenderInfoClass & rinfo)DX8Wrapper::Set_Material(m_vertexMaterialClass);- DX8Wrapper::Set_Shader(m_shaderClass);+ // The mirror camera looks up at the banks; both sides belong in Modern's coloured mirror.+ ShaderClass terrainShader(m_shaderClass);+ if (modernFullMirror)+ terrainShader.Set_Cull_Mode(ShaderClass::CULL_MODE_DISABLE);+ DX8Wrapper::Set_Shader(terrainShader);if (TheGlobalData->m_timeOfDay == TIME_OF_DAY_NIGHT) {doCloud = false;@@ -531,9 +536,9 @@ void FlatHeightMapRenderObjClass::Render(RenderInfoClass & rinfo)if (m_disableTextures)devicePasses=1; //force to 1 lighting-only pass- // A water mirror leaves the ground out: the reflection darkens water wherever anything stands in- // the mirror, and the banks would lay a dark band along every shore.- if (ShaderClass::Is_Backface_Culling_Inverted())+ // Classic's mirror darkens water wherever anything stands in it, so reflected banks would+ // lay a dark band along every shore. Modern uses the ground's colour instead.+ if (ShaderClass::Is_Backface_Culling_Inverted() && !modernFullMirror)devicePasses=0;//Specify all textures that this shader may need.@@ -559,7 +564,10 @@ void FlatHeightMapRenderObjClass::Render(RenderInfoClass & rinfo)for (pass=0; pass<devicePasses; pass++) {Bool disableTex = m_disableTextures;if (m_disableTextures ) {- DX8Wrapper::Set_Shader(ShaderClass::_PresetOpaque2DShader);+ ShaderClass shader=ShaderClass::_PresetOpaque2DShader;+ if (modernFullMirror)+ shader.Set_Cull_Mode(ShaderClass::CULL_MODE_DISABLE);+ DX8Wrapper::Set_Shader(shader);DX8Wrapper::Set_Texture(0,NULL);} else {W3DShaderManager::setShader(st, pass);@@ -572,8 +580,10 @@ void FlatHeightMapRenderObjClass::Render(RenderInfoClass & rinfo)if (pass>0) {disableTex = TRUE; // doing cloud/noise}- if (!tile->isCulled()) {- tile->drawVisiblePolys(rinfo, disableTex);+ // Do not updateCenter for the mirror: it changes the main view's texture/LOD state.+ // The tile tests the reflected frustum without changing that cached visibility.+ if (modernFullMirror || !tile->isCulled()) {+ tile->drawVisiblePolys(rinfo, disableTex, modernFullMirror);if (i*CELLS_PER_TILE<xCoordMin) {xCoordMin = i*CELLS_PER_TILE;}@@ -640,9 +650,11 @@ void FlatHeightMapRenderObjClass::Render(RenderInfoClass & rinfo)ShaderClass::Invalidate();DX8Wrapper::Apply_Render_State_Changes();- m_waypointBuffer->drawWaypoints(rinfo);+ if (!modernFullMirror)+ m_waypointBuffer->drawWaypoints(rinfo);- m_bibBuffer->renderBibs();+ if (!modernFullMirror)+ m_bibBuffer->renderBibs();#endif// We do some custom blending, so tell the shader class to reset everything.DX8Wrapper::Set_Texture(0,NULL);diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HazardCloudUnsupported.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HazardCloudUnsupported.cppindex cf563cf31..7cbb32389 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HazardCloudUnsupported.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HazardCloudUnsupported.cpp@@ -5,6 +5,7 @@#include "Platform/HazardCloud.h"#include "Platform/HazardCloudShared.h"#include "Platform/ModernWaterBuild.h"+#include "Platform/WaterScreenReflection.h"namespace HazardCloud {@@ -26,3 +27,7 @@ bool Supported() { return false; }std::unique_ptr<Renderer> CreateRenderer() { return nullptr; }} // namespace HazardCloudShared++namespace WaterScreenReflection {+bool Supported() { return false; }+}diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cppindex 1d188152f..2d82f1d7f 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp@@ -1766,6 +1766,8 @@ DECLARE_PERF_TIMER(Terrain_Render)void HeightMapRenderObjClass::Render(RenderInfoClass & rinfo){USE_PERF_TIMER(Terrain_Render)+ const Bool modernFullMirror = TheWaterRenderObj && TheWaterRenderObj->isModernFullMirror();+ const Bool drawGround = !ShaderClass::Is_Backface_Culling_Inverted() || modernFullMirror;Int i,j,devicePasses;W3DShaderManager::ShaderTypes st;@@ -1858,7 +1860,12 @@ void HeightMapRenderObjClass::Render(RenderInfoClass & rinfo)else{DX8Wrapper::Set_Material(m_vertexMaterialClass);- DX8Wrapper::Set_Shader(m_shaderClass);+ // The reflected camera is below the banks. Draw both sides of the ground in Modern's+ // coloured mirror; the water plane still clips away everything below the surface.+ ShaderClass terrainShader(m_shaderClass);+ if (modernFullMirror)+ terrainShader.Set_Cull_Mode(ShaderClass::CULL_MODE_DISABLE);+ DX8Wrapper::Set_Shader(terrainShader);if (TheGlobalData->m_timeOfDay == TIME_OF_DAY_NIGHT) {doCloud = false;@@ -1867,8 +1874,8 @@ void HeightMapRenderObjClass::Render(RenderInfoClass & rinfo)st=W3DShaderManager::ST_TERRAIN_BASE; //set default shader//set correct shader based on current settings- if (!ShaderClass::Is_Backface_Culling_Inverted())- { //not reflection pass+ if (drawGround)+ { //the main view and Modern mirror use the normal lit terrainif (TheGlobalData->m_useLightMap && doCloud){ st=W3DShaderManager::ST_TERRAIN_BASE_NOISE12;}@@ -1905,13 +1912,16 @@ void HeightMapRenderObjClass::Render(RenderInfoClass & rinfo)}Int pass;- for (pass=0; pass<devicePasses && !ShaderClass::Is_Backface_Culling_Inverted(); pass++) { //a water mirror leaves the ground out, see the shorelines below+ for (pass=0; pass<devicePasses && drawGround; pass++) { //Classic water leaves the ground out, see the shorelines below#ifdef TIMING_TESTS#endifif (!doMultiPassWireFrame) //multi-pass wireframe doesn't use regular shaders.{if (m_disableTextures ) {- DX8Wrapper::Set_Shader(ShaderClass::_PresetOpaque2DShader);+ ShaderClass shader=ShaderClass::_PresetOpaque2DShader;+ if (modernFullMirror)+ shader.Set_Cull_Mode(ShaderClass::CULL_MODE_DISABLE);+ DX8Wrapper::Set_Shader(shader);DX8Wrapper::Set_Texture(0,NULL);} else {W3DShaderManager::setShader(st, pass);@@ -1960,14 +1970,17 @@ void HeightMapRenderObjClass::Render(RenderInfoClass & rinfo)if (pass) //shader was applied at least once?W3DShaderManager::resetShader(st);- // A water mirror leaves the ground out, and everything drawn onto it. The reflection darkens- // water wherever anything stands in the mirror, and the banks would lay a dark band along- // every shore; the ground was also most of what the mirror drew.+ // Classic water leaves the ground out: its mirror darkens the water wherever anything+ // stands in it, so the banks would lay a dark band along every shore. Modern needs the+ // coloured ground, including its third blend layer, but not the feather painted over water.if (!ShaderClass::Is_Backface_Culling_Inverted()){//Draw feathered shorelinesrenderShoreLines(&rinfo.Camera);+ }+ if (drawGround)+ {//Do additional pass over any tiles that have 3 textures blended together.if (TheGlobalData->m_use3WayTerrainBlends)renderExtraBlendTiles();@@ -2031,11 +2044,17 @@ void HeightMapRenderObjClass::Render(RenderInfoClass & rinfo)if (TheTerrainTracksRenderObjClassSystem)TheTerrainTracksRenderObjClassSystem->flush();- // The water a reflection lands on is shrouded already, and shrouding the ground inside the- // mirror as well would draw the whole terrain a second time for no visible difference.- if (m_shroud && rinfo.Additional_Pass_Count() && !ShaderClass::Is_Backface_Culling_Inverted())+ // Modern reflects the ground's own shroud too. Classic leaves that ground out and the+ // water it lands on is already shrouded, so there is no second terrain pass there.+ if (m_shroud && rinfo.Additional_Pass_Count() && drawGround){rinfo.Peek_Additional_Pass(0)->Install_Materials();+ // The shroud installs its own culling state. Keep it on the same faces as the base.+ if (modernFullMirror)+ {+ DX8Wrapper::Apply_Render_State_Changes();+ DX8Wrapper::Set_DX8_Render_State(D3DRS_CULLMODE,D3DCULL_NONE);+ }renderTerrainPass(&rinfo.Camera);rinfo.Peek_Additional_Pass(0)->UnInstall_Materials();}@@ -2046,15 +2065,16 @@ void HeightMapRenderObjClass::Render(RenderInfoClass & rinfo)elsem_bridgeBuffer->drawBridges(&rinfo.Camera, m_disableTextures, m_stageTwoTexture);- if ( m_waypointBuffer )+ if ( m_waypointBuffer && !modernFullMirror )m_waypointBuffer->drawWaypoints(rinfo);- m_bibBuffer->renderBibs();+ if (!modernFullMirror)+ m_bibBuffer->renderBibs();// the build grid goes down with the ground it describes: drawn here it is depth tested against// the terrain and covered by everything drawn after it, so it reads as paint on the map rather// than as a wireframe floating over the scene- if( TheInGameUI )+ if( TheInGameUI && !modernFullMirror ){TheInGameUI->drawBuildGrid();@@ -2293,7 +2313,8 @@ void HeightMapRenderObjClass::renderExtraBlendTiles(void)if (vertexCount){//Check if we couldn't fit all blend tiles into vertex buffer so we can enlarge it for next frame.- if (vertexCount == (maxBlendTiles*4))+ // Only the main view grows it; the mirror reuses this frame's terrain buffers.+ if (vertexCount == (maxBlendTiles*4) && (!TheWaterRenderObj || !TheWaterRenderObj->isModernFullMirror()))maxBlendTiles += 16; //enlarge by 16 to reduce trashing.ShaderClass::Invalidate(); //invalidate to force shader to reset since we directly changed states@@ -2304,6 +2325,8 @@ void HeightMapRenderObjClass::renderExtraBlendTiles(void)REF_PTR_RELEASE(vmat);ShaderClass shader=ShaderClass::_PresetOpaqueShader;shader.Set_Depth_Mask(ShaderClass::DEPTH_WRITE_DISABLE); //disable writes to z+ if (TheWaterRenderObj && TheWaterRenderObj->isModernFullMirror())+ shader.Set_Cull_Mode(ShaderClass::CULL_MODE_DISABLE);DX8Wrapper::Set_Shader(shader);if (TheGlobalData->m_use3WayTerrainBlends == 2)diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cppindex 8ef1c2437..ab0a06644 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp@@ -1363,6 +1363,25 @@ void W3DInGameUI::drawGuardMarkers( void )} // end drawGuardMarkers+//-------------------------------------------------------------------------------------------------+/** Models which share the world scene with units, but describe the player's orders and cursor. */+//-------------------------------------------------------------------------------------------------+Bool W3DInGameUI::isWorldSpaceUI( const RenderObjClass *robj, const Drawable *draw ) const+{+ // These live in the world scene so the ground can cover them, but are feedback for the player.+ // A row of placement previews owns more than the single drawable under the cursor.+ if( robj == m_buildingPlacementAnchor || robj == m_buildingPlacementArrow )+ return TRUE;+ for( Int i = 0; i < MAX_MOVE_HINTS; i++ )+ if( robj == m_moveHintRenderObj[ i ] )+ return TRUE;+ if( draw && m_placeIcon )+ for( Int i = 0; i < TheGlobalData->m_maxLineBuildObjects; i++ )+ if( draw == m_placeIcon[ i ] )+ return TRUE;+ return FALSE;+}+//-------------------------------------------------------------------------------------------------/** Each live move ring aligned on logic's terrain, at the sync point: the ground and water heights* are logic's, and drawMoveHints runs inside the overlap window. */diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cppindex 197788208..31b4c66d1 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp@@ -54,6 +54,8 @@#include "GameClient/View.h"#include "W3DDevice/GameClient/HeightMap.h"#include "W3DDevice/GameClient/W3DScene.h"+#include "W3DDevice/GameClient/W3DWater.h"+#include "W3DDevice/GameClient/W3DInGameUI.h"#include "W3DDevice/GameClient/W3DDynamicLight.h"#include "W3DDevice/GameClient/W3DParticleSys.h"#include "W3DDevice/GameClient/FireLights.h"@@ -553,6 +555,7 @@ void RTS3DScene::Visibility_Check(CameraClass * camera)if (ShaderClass::Is_Backface_Culling_Inverted()){ //we are rendering reflections///@todo: Have better flag to detect reflection pass+ const Bool modernFullMirror = TheWaterRenderObj && TheWaterRenderObj->isModernFullMirror();// Loop over all top-level RenderObjects in this scene. If the bounding sphere is not in front// of all the frustum planes, it is invisible.@@ -566,6 +569,16 @@ void RTS3DScene::Visibility_Check(CameraClass * camera)if (drawInfo)draw=drawInfo->m_drawable;+ // The Modern mirror admits ordinary scene models, but the cursor and order feedback+ // are still UI even when their models live in the world scene.+ if (modernFullMirror && (robj == TheWaterRenderObj ||+ (draw && draw->isNoSaveForDraw()) ||+ (TheInGameUI && ((W3DInGameUI *)TheInGameUI)->isWorldSpaceUI(robj, draw))))+ {+ robj->Set_Visible(false);+ continue;+ }+if( draw ){// The flags are last frame's. Customized_Render leaves an occluder, and any drawable@@ -578,7 +591,7 @@ void RTS3DScene::Visibility_Check(CameraClass * camera)// The same test the main pass hides a drawable by, or a unit under the fog of war,// or a building standing in for its own ghost, shows up in the water and nowhere else.Bool hidden = robj->Is_Hidden() || draw->isDrawableEffectivelyHidden() || draw->getFullyObscuredByShroud();- robj->Set_Visible(!hidden && draw->getDrawsInMirror() && (!camera->Cull_Sphere(robj->Get_Bounding_Sphere()) || posedPartsInView(robj, camera)));+ robj->Set_Visible(!hidden && (modernFullMirror || draw->getDrawsInMirror()) && (!camera->Cull_Sphere(robj->Get_Bounding_Sphere()) || posedPartsInView(robj, camera)));}}else@@ -812,7 +825,10 @@ void RTS3DScene::renderOneObject(RenderInfoClass &rinfo, RenderObjClass *robj, Iif (robj->Class_ID() == RenderObjClass::CLASSID_IMAGE3D )- { robj->Render(rinfo); //notify decals system that this track is visible+ {+ if (TheWaterRenderObj && TheWaterRenderObj->isModernFullMirror())+ return; //ground decals belong to the main view, not the coloured mirror+ robj->Render(rinfo); //notify decals system that this track is visiblereturn; //decals are not lit by this system yet so skip rest of lighting}@@ -887,7 +903,8 @@ void RTS3DScene::renderOneObject(RenderInfoClass &rinfo, RenderObjClass *robj, Iif ( rinfo.drawEffect != DRAW_EFFECT_OUTAGE && rinfo.drawEffect != DRAW_EFFECT_EMP )tintColor = draw->getTintColor();- selectionColor = draw->getSelectionColor();+ if (!TheWaterRenderObj || !TheWaterRenderObj->isModernFullMirror())+ selectionColor = draw->getSelectionColor();if ( tintColor || selectionColor ){@@ -1080,8 +1097,9 @@ static Real sceneElapsedMS( const Int64 &from, const Int64 &to )/**Draw everything that was submitted from this scene*/void RTS3DScene::Flush(RenderInfoClass & rinfo){+ const Bool modernFullMirror = TheWaterRenderObj && TheWaterRenderObj->isModernFullMirror();//don't draw shadows in this mode because they interfere with destination alpha or are invisible (wireframe)- if (m_customPassMode == SCENE_PASS_DEFAULT && Get_Extra_Pass_Polygon_Mode() == EXTRA_PASS_DISABLE)+ if (m_customPassMode == SCENE_PASS_DEFAULT && Get_Extra_Pass_Polygon_Mode() == EXTRA_PASS_DISABLE && !modernFullMirror)DoShadows(rinfo, false); //draw all non-stencil shadows (decals) since they fall under other objects.TheDX8MeshRenderer.Flush(); //draw all non-translucent objects.@@ -1100,7 +1118,7 @@ void RTS3DScene::Flush(RenderInfoClass & rinfo)DoTrees(rinfo);//don't draw shadows in this mode because they interfere with destination alpha- if (m_customPassMode == SCENE_PASS_DEFAULT && Get_Extra_Pass_Polygon_Mode() == EXTRA_PASS_DISABLE)+ if (m_customPassMode == SCENE_PASS_DEFAULT && Get_Extra_Pass_Polygon_Mode() == EXTRA_PASS_DISABLE && !modernFullMirror)DoShadows(rinfo, true); //draw all stencil shadows// The Ambient Occlusion option goes on under the water and every translucent draw, none of which@@ -1498,6 +1516,7 @@ void RTS3DScene::Customized_Render( RenderInfoClass &rinfo )// If we are doing water mirror, we draw with backface culling inverted. In this case,// we only want to call On_Frame_Update if we aren't drawing water, as otherwise// we get 2 frame updates per frame, and it screws up the particle emitters.+ // The Modern mirror also reuses the terrain textures, visibility and LOD from that update.it.Peek_Obj()->On_Frame_Update();}}@@ -2318,6 +2337,7 @@ void RTS3DScene::Visibility_Check(CameraClass * camera)if (ShaderClass::Is_Backface_Culling_Inverted()){ //we are rendering reflections///@todo: Have better flag to detect reflection pass+ const Bool modernFullMirror = TheWaterRenderObj && TheWaterRenderObj->isModernFullMirror();// Loop over all top-level RenderObjects in this scene. If the bounding sphere is not in front// of all the frustum planes, it is invisible.@@ -2330,12 +2350,23 @@ void RTS3DScene::Visibility_Check(CameraClass * camera)if (drawInfo)draw=drawInfo->m_drawable;+ // The Modern mirror admits ordinary scene models, but the cursor and order feedback+ // are still UI even when their models live in the world scene.+ if (modernFullMirror && (robj == TheWaterRenderObj ||+ (draw && draw->isNoSaveForDraw()) ||+ (TheInGameUI && ((W3DInGameUI *)TheInGameUI)->isWorldSpaceUI(robj, draw))))+ {+ robj->Set_Visible(false);+ continue;+ }+if( draw ){if (robj->Is_Force_Visible()) {robj->Set_Visible(true);} else {- robj->Set_Visible(draw->getDrawsInMirror() && !camera->Cull_Sphere(robj->Get_Bounding_Sphere()));+ Bool hidden = modernFullMirror && (robj->Is_Hidden() || draw->isDrawableEffectivelyHidden() || draw->getFullyObscuredByShroud());+ robj->Set_Visible(!hidden && (modernFullMirror || draw->getDrawsInMirror()) && !camera->Cull_Sphere(robj->Get_Bounding_Sphere()));}}elsediff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cppindex a4165ea24..5f51de3bc 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainBackground.cpp@@ -47,6 +47,8 @@// Includes//-----------------------------------------------------------------------------#include "W3DDevice/GameClient/W3DTerrainBackground.h"+#include "WW3D2/rinfo.h"+#include "WW3D2/camera.h"#include <stdio.h>#include <string.h>@@ -760,13 +762,13 @@ void W3DTerrainBackground::updateTexture(void)// W3DTerrainBackground::renderTerrain//=============================================================================//=============================================================================-void W3DTerrainBackground::drawVisiblePolys(RenderInfoClass & rinfo, Bool disableTextures)+void W3DTerrainBackground::drawVisiblePolys(RenderInfoClass & rinfo, Bool disableTextures, Bool useMirrorCamera){#if 1if (m_curNumTerrainIndices == 0) {return;}- if (m_cullStatus==CULL_STATUS_INVISIBLE) {+ if (useMirrorCamera ? rinfo.Camera.Cull_Box(m_bounds) : m_cullStatus==CULL_STATUS_INVISIBLE) {return;}// Setup the vertex buffer, shader & texture.@@ -786,7 +788,7 @@ void W3DTerrainBackground::drawVisiblePolys(RenderInfoClass & rinfo, Bool disablif (m_curNumTerrainIndices == 0) {return;}- if (m_cullStatus==CULL_STATUS_INVISIBLE) {+ if (useMirrorCamera ? rinfo.Camera.Cull_Box(m_bounds) : m_cullStatus==CULL_STATUS_INVISIBLE) {return;}// Setup the vertex buffer, shader & texture.diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cppindex 1aa6208b9..472c4086c 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp@@ -59,6 +59,7 @@ enum#include "Platform/SunShadow.h"#include "W3DDevice/GameClient/SunShadowCasterCull.h"#include "W3DDevice/GameClient/W3DTreeBuffer.h"+#include "W3DDevice/GameClient/W3DWater.h"#include <stdio.h>#include <string.h>@@ -2223,6 +2224,8 @@ void W3DTreeBuffer::stepTrees( void )if (TheGameLogic && TheGameLogic->isGamePaused()) {pause = true;}+ m_breezeForDraw = weatherBreezeInfo();+ m_pauseForDraw = pause;const UnsignedInt now = TheGameClient ? TheGameClient->getFrame() : 0;if (pause || now == m_lastTreeStepFrame) {return;@@ -2288,11 +2291,8 @@ void W3DTreeBuffer::drawTrees(CameraClass * camera, RefRenderObjListIterator *pD// if breeze changes, always process the full update, even if not visible,// so that things offscreen won't 'pop' when first viewed- const BreezeInfo& info = weatherBreezeInfo();- Bool pause = TheScriptEngine->isTimeFrozenScript() || TheScriptEngine->isTimeFrozenDebug();- if (TheGameLogic && TheGameLogic->isGamePaused()) {- pause = true;- }+ const BreezeInfo& info = m_breezeForDraw;+ Bool pause = m_pauseForDraw;Int i;if (!pause) {if (info.m_breezeVersion != m_curSwayVersion)@@ -2356,7 +2356,7 @@ void W3DTreeBuffer::drawTrees(CameraClass * camera, RefRenderObjListIterator *pD// Shadows are wanted under either option: the loop used to be gated on m_useShadowDecals alone,// so with volume shadows picked trees were the one thing in the scene standing on nothing.- Bool drawShadows = !sunCamera && !mapped && (TheGlobalData->m_useShadowDecals || TheGlobalData->m_useShadowVolumes);+ Bool drawShadows = !sunCamera && !mapped && (!TheWaterRenderObj || !TheWaterRenderObj->isModernFullMirror()) && (TheGlobalData->m_useShadowDecals || TheGlobalData->m_useShadowVolumes);Bool silhouetteShadows = drawShadows && treeSilhouetteShadows(m_dwTreeVertexShader);// Draw tree shadows.diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cppindex c2d9853ef..e89685777 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp@@ -206,8 +206,8 @@ void W3DWaypointBuffer::drawWaypoints(RenderInfoClass &rinfo)RenderInfoClass localRinfo(rinfo.Camera);localRinfo.light_environment=&lightEnv;- // not in the water's mirror pass: the ground is left out of the reflection, and a PASS_ALWAYS- // order line would lie on top of the water+ // Not in the water's mirror pass: these are orders drawn for the player, even where Modern+ // reflects the ground, and a PASS_ALWAYS order line would lie on top of the water.const Bool mirror = ShaderClass::Is_Backface_Culling_Inverted();for( std::vector<WaypointDraw>::const_iterator it = m_draws.begin(); it != m_draws.end(); ++it ){diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cppindex 2c2a6b092..8ed945ae3 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp@@ -36,6 +36,7 @@#include "stdio.h"#include "Lib/Clock.h"#include "Platform/WaterSurfaceModel.h"+#include "Platform/WaterPerformanceSettings.h"#include "Platform/ModernWaterMaterial.h"#include "Platform/WaterShoreOverlay.h"#include "Platform/WaterFoamWindow.h"@@ -62,6 +63,9 @@#include "camera.h"#include "scene.h"#include "dx8wrapper.h"+#ifndef _WIN32+extern bool PosixWaterGpuAvailable(IDirect3DDevice9 *device);+#endif#include "light.h"#include "d3dx9math.h"#include "d3d8shadertranslate.h"@@ -498,6 +502,13 @@ Bool WaterRenderObjClass::hasModernVesselFoam(UnsignedInt objectID) const#endif}+Bool WaterRenderObjClass::isModernFullMirror() const+{+ // Only a supported backend publishes Hybrid at the render sync point.+ return m_renderingMirror && m_useModernWater+ && m_waterType == WATER_TYPE_0_TRANSLUCENT && m_waterReflectionMode == WaterScreenReflection::Hybrid;+}+#if ZH_MODERN_WATERvoid WaterRenderObjClass::takeWaterPolygonsForDraw(void){@@ -528,15 +539,14 @@ void WaterRenderObjClass::takeReadsForRender(void)// Logic owns the water tables and object values; model transforms stay on the render side// so the hull slice follows the same interpolated pose as the displayed vessel.synchronizeWaterStyle();+ synchronizeWaterReflection();takeWaterPolygonsForDraw();takeMotionReadsForRender();m_modernObjectsForDraw.clear();m_modernObstacles.clear();m_modernObstacleObjectIDs.clear();m_modernReadsReady=m_useModernWater && TheGameLogic && TheTerrainLogic &&TheTerrainRenderObject && TheTerrainRenderObject->getMap();-#if defined(__linux__)- // Windows' wave tracks still update in their own flush, as they always have.- if (m_waterTrackSystem) m_waterTrackSystem->takeReadsForRender();-#endif+ // SDL tracks use this sync point on every host; Direct3D retains its own flush boundary.+ if (WaterScreenReflection::Supported() && m_waterTrackSystem) m_waterTrackSystem->takeReadsForRender();if (!m_modernReadsReady) return;for (const Object *object=TheGameLogic->getFirstObject();object;object=object->getNextObject()) {@@ -937,13 +947,24 @@ bool Supported()#if defined(_WIN32)return Direct3D11_Is_Active() && Direct3D11_Present_Is_Enabled();#else- return ZH_MODERN_WATER;+ return PosixWaterGpuAvailable(DX8Wrapper::_Get_D3D_Device());#endif}} // namespace ModernWater#if ZH_MODERN_WATER+namespace WaterScreenReflection {+bool Supported()+{+#ifdef _WIN32+ return false;+#else+ return PosixWaterGpuAvailable(DX8Wrapper::_Get_D3D_Device());+#endif+}+}+/** The Modern style is asked for and a device draws it. Classic graphics is the 2003 picture, so itkeeps EA's water whatever WaterStyle says, as it keeps the old clouds and drops the foam. Thequality slider and its presets leave WaterStyle alone: Modern is the player's own pick. */@@ -1103,12 +1124,47 @@ void WaterRenderObjClass::synchronizeWaterStyle(void)#endif}+Int WaterRenderObjClass::mapReflectionTargetSize() const+{+ if (m_useModernWater && WaterScreenReflection::Supported())+ return WaterScreenReflection::MirrorSize(m_waterReflectionMode,+ WaterPerformanceSettings::Applied().reflectionDetail);+ return WaterScreenReflection::LegacyMirrorSize;+}++void WaterRenderObjClass::ensureMapReflectionTarget(void)+{+ if (m_waterType!=WATER_TYPE_0_TRANSLUCENT)+ return;+ if (m_useModernWater && WaterScreenReflection::Supported() && !WaterScreenReflection::UsesMirror(m_waterReflectionMode))+ return;+ const Int size=mapReflectionTargetSize();+ if (m_reflectionTargetRequestSize==size)+ return;+ m_reflectionTargetRequestSize=size;++ // Keep the old target alive until its replacement exists. A low-memory device keeps+ // that usable reflection; initial Hybrid allocation can fall back to the original size.+ Int fallbackSize=WaterScreenReflection::LegacyMirrorSize;+ if(m_useModernWater && WaterScreenReflection::Supported()) fallbackSize=WaterScreenReflection::MirrorSize(WaterScreenReflection::Mirror,+ WaterPerformanceSettings::Applied().reflectionDetail);+ TextureClass *replacement=DX8Wrapper::Create_Render_Target(size,size);+ if (!replacement && !m_pReflectionTexture && size!=fallbackSize)+ replacement=DX8Wrapper::Create_Render_Target(fallbackSize,fallbackSize);+ if (!replacement)+ return;+ REF_PTR_RELEASE(m_pReflectionTexture);+ m_pReflectionTexture=replacement;+ m_reflectionReused=TRUE; // a newly allocated target must be rendered even at a stationary camera+}+void WaterRenderObjClass::setupModernWaterShader(Bool river, Bool heightCorrection, Bool waveCage){#if ZH_MODERN_WATERif (!m_useModernWater) return;updateModernWaterTextures();- const Bool reflection = m_pReflectionTexture && !m_renderingMirror &&+ const Bool reflection = (!WaterScreenReflection::Supported() || WaterScreenReflection::UsesMirror(m_waterReflectionMode))+ && m_pReflectionTexture && !m_renderingMirror &&m_reflectionAreaMax.X > m_reflectionAreaMin.X && m_reflectionAreaMax.Y > m_reflectionAreaMin.Y;TextureClass *mirror = reflection ? m_pReflectionTexture : m_whiteTexture;if (!mirror->Is_Initialized()) mirror->Init();@@ -1138,6 +1194,8 @@ void WaterRenderObjClass::setupModernWaterShader(Bool river, Bool heightCorrectisetModernWaterConstants(6, optics, 1);D3DXVECTOR4 materialColor, materialParameters;getModernWaterMaterial(&materialColor.x, &materialParameters.x);+ if (WaterScreenReflection::Supported())+ materialParameters.w = WaterScreenReflection::Traces(m_waterReflectionMode) ? 1.0f : 0.0f;setModernWaterConstants(ModernWaterMaterial::RegisterColor, materialColor, 1);setModernWaterConstants(ModernWaterMaterial::RegisterParameters, materialParameters, 1);const RGBColor &ambient = TheGlobalData->m_terrainAmbient[0];@@ -1966,6 +2024,7 @@ void WaterRenderObjClass::ReleaseResources(void)REF_PTR_RELEASE(m_indexBuffer);REF_PTR_RELEASE(m_pReflectionTexture);+ m_reflectionTargetRequestSize = 0;SAFE_RELEASE(m_vertexBufferD3D);SAFE_RELEASE(m_indexBufferD3D);releaseWaterTwins();@@ -2084,7 +2143,10 @@ void WaterRenderObjClass::ReAcquireResources(void)}if (m_waterType == WATER_TYPE_0_TRANSLUCENT)+ {+ m_reflectionTargetRequestSize = WATER_REFLECTION_SIZE;m_pReflectionTexture = DX8Wrapper::Create_Render_Target (WATER_REFLECTION_SIZE, WATER_REFLECTION_SIZE);+ }if (m_waterTrackSystem)m_waterTrackSystem->ReAcquireResources();@@ -2633,6 +2695,37 @@ void WaterRenderObjClass::loadSetting( Setting *setting, TimeOfDay timeOfDay )}+void WaterRenderObjClass::synchronizeWaterReflection(void)+{+ if (!WaterScreenReflection::Supported()) return;+ // Accept updates the preferences; only this boundary publishes them to the SDL+ // renderer. It also runs while the options menu has paused simulation.+ if (TheGlobalData)+ WaterPerformanceSettings::Apply(TheGlobalData->m_waterReflectionEnabled,+ TheGlobalData->m_waterFftResolution, TheGlobalData->m_waterRefractionQuality,+ TheGlobalData->m_waterReflectionDetail);+ const WaterScreenReflection::Mode mode = WaterScreenReflection::Resolve(+ TheGlobalData ? TheGlobalData->m_waterReflection : 2,+ WaterPerformanceSettings::Applied().sceneReflections);+ WaterPerformanceSettings::Applied().sceneColourRequired = WaterPerformanceSettings::SceneColourRequired(+ WaterPerformanceSettings::Applied().refraction, WaterScreenReflection::Traces(mode));+ if (mode != m_waterReflectionMode)+ {+ // The mirror may have sat unused while the scene moved. Refresh it on the first+ // frame back, even when the camera is still where the old reflection was drawn.+ if (m_useModernWater && WaterScreenReflection::UsesMirror(mode))+ m_reflectionReused = TRUE;+ m_waterReflectionMode = mode;+ }+ if (m_useModernWater && mode==WaterScreenReflection::SkyOnly && m_waterType==WATER_TYPE_0_TRANSLUCENT)+ {+ REF_PTR_RELEASE(m_pReflectionTexture);+ m_reflectionTargetRequestSize=0;+ m_reflectionAreaMin.Set(0.0f,0.0f);+ m_reflectionAreaMax.Set(0.0f,0.0f);+ }+}+//-------------------------------------------------------------------------------------------------/** Our water may use effects that require run-time rendered textures. These* textures need to be updated before we start rendering to the main screen@@ -2642,6 +2735,9 @@ void WaterRenderObjClass::updateRenderTargetTextures(CameraClass *cam){// This render boundary also runs while the game/options menu is paused.synchronizeWaterStyle();+#if ZH_MODERN_WATER+ synchronizeWaterReflection();+#endifif (!cam || !TheTerrainRenderObject || !TheTerrainRenderObject->getMap())return;@@ -2652,8 +2748,12 @@ void WaterRenderObjClass::updateRenderTargetTextures(CameraClass *cam)renderMirror(cam, m_level); //generate texture containing reflected scene}- if (m_waterType != WATER_TYPE_0_TRANSLUCENT || !m_pReflectionTexture)- return;+ if (m_waterType != WATER_TYPE_0_TRANSLUCENT) return;+ if (WaterScreenReflection::Supported()) {+ if (m_useModernWater && !WaterScreenReflection::UsesMirror(m_waterReflectionMode)) return;+ ensureMapReflectionTarget();+ }+ if (!m_pReflectionTexture) return;// A camera that has not moved looks at the same water from the same place, so a reflection one// frame old lines up with it exactly and only what moved in it is a frame late. Such a framediff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cppindex 0396ef330..b2c46bd97 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp@@ -65,6 +65,7 @@#include "assetmgr.h"#include "WW3D2/dx8wrapper.h"#include "Platform/RenderTypes.h"+#include "Platform/WaterScreenReflection.h"#if defined(__linux__)#include "Platform/WaterShoreOverlay.h"#endif@@ -443,9 +444,8 @@ void WaterTracksObj::waveForDraw(Vector2 &waveTailOrigin,Vector2 &waveFrontOrigiInt WaterTracksObj::render(DX8VertexBufferClass *vertexBuffer, Int batchStart){-#if defined(__linux__)- if (!m_drawnWaveReady) return batchStart;-#endif+ const Bool snapshot = WaterScreenReflection::Supported();+ if (snapshot && !m_drawnWaveReady) return batchStart;VertexFormatXYZDUV1 *vb;Vector2 waveTailOrigin,waveFrontOrigin;Real waterHeight;@@ -489,21 +489,17 @@ Int WaterTracksObj::render(DX8VertexBufferClass *vertexBuffer, Int batchStart)if (mirror)vb = (VertexFormatXYZDUV1 *)mirror;-#if defined(__linux__)- waveTailOrigin=m_drawnWaveTail;waveFrontOrigin=m_drawnWaveFront;- waveAlpha=m_drawnWaveAlpha;widthFrac=m_drawnWaveWidth;- waterHeight=m_drawnWaterHeight;-#else- waveForDraw(waveTailOrigin,waveFrontOrigin,waveAlpha,widthFrac);-#endif+ if (snapshot) {+ waveTailOrigin=m_drawnWaveTail;waveFrontOrigin=m_drawnWaveFront;+ waveAlpha=m_drawnWaveAlpha;widthFrac=m_drawnWaveWidth;+ waterHeight=m_drawnWaterHeight;+ } else {+ waveForDraw(waveTailOrigin,waveFrontOrigin,waveAlpha,widthFrac);+ }//First insert tail of wave:Vector2 testPoint(waveTailOrigin);-#if defined(__linux__)- const Bool hasWaterLevel=m_drawnHasWater;-#else- TheTerrainLogic->isUnderwater(testPoint.X,testPoint.Y,&waterHeight);-#endif+ if (!snapshot) TheTerrainLogic->isUnderwater(testPoint.X,testPoint.Y,&waterHeight);vb->x= testPoint.X;vb->y= testPoint.Y;vb->z=waterHeight+1.5f;@@ -560,7 +556,7 @@ Int WaterTracksObj::render(DX8VertexBufferClass *vertexBuffer, Int batchStart)const Vector2 corners[4]={waveTailOrigin,waveTailOrigin+m_perpDir*m_waveFinalWidth*widthFrac,waveFrontOrigin+m_perpDir*m_waveFinalWidth*widthFrac,waveFrontOrigin};for(Int i=0;i<4;++i){shoreTrack.xy[i*2]=corners[i].X;shoreTrack.xy[i*2+1]=corners[i].Y;}- PosixWaterShoreTrack(DX8Wrapper::_Get_D3D_Device(),m_authoredSource && hasWaterLevel &&+ PosixWaterShoreTrack(DX8Wrapper::_Get_D3D_Device(),m_authoredSource && m_drawnHasWater &&!TheGlobalData->m_isWorldBuilder && !TheGlobalData->m_usingWaterTrackEditor?&shoreTrack:NULL);#endifDX8Wrapper::Draw_Strip(0,idxCount-2,0,m_x*m_y); //there are always n-2 primitives for n index strip.@@ -966,7 +962,6 @@ void WaterTracksRenderSystem::update()static void TestWaterUpdate(void); // static, as its definition isvoid setFPMode( void );-#if defined(__linux__)void WaterTracksRenderSystem::takeReadsForRender(void){if (!TheGlobalData->m_showSoftWaterEdge || TheWaterTransparency->m_transparentWaterDepth==0) return;@@ -980,7 +975,6 @@ void WaterTracksRenderSystem::takeReadsForRender(void)mod->m_drawnWaveReady=TRUE;}}-#endif//=============================================================================// WaterTracksRenderSystem::flush@@ -998,12 +992,11 @@ Try improving the fit to vertical surfaces like cliffs.if (!TheGlobalData->m_showSoftWaterEdge || TheWaterTransparency->m_transparentWaterDepth ==0 )return;-#if !defined(__linux__)- if (TheGlobalData->m_usingWaterTrackEditor)- TestWaterUpdate();-- update(); //update positions of all the tracks-#endif+ if (!WaterScreenReflection::Supported()) {+ if (TheGlobalData->m_usingWaterTrackEditor)+ TestWaterUpdate();+ update(); // Direct3D tracks retain their original flush boundary.+ }rinfo.Camera.Apply();diff --git a/GeneralsMD/Code/Libraries/Include/Platform/ModernWaterBuild.h b/GeneralsMD/Code/Libraries/Include/Platform/ModernWaterBuild.hindex 532edaf23..994fc333a 100644--- a/GeneralsMD/Code/Libraries/Include/Platform/ModernWaterBuild.h+++ b/GeneralsMD/Code/Libraries/Include/Platform/ModernWaterBuild.h@@ -1,9 +1,9 @@-// Where the Modern water is compiled in: the SDL GPU device on Linux and the Direct3D 11 backend on-// Windows. macOS, -d3d9 and -headless stay on the Classic water.+// Modern water is compiled for SDL GPU and Direct3D 11. Runtime capability queries+// decide which features the current device supports.// Distributed under the repository's GPL-3.0 terms; see LICENSE.md.#pragma once-#if defined(__linux__) || defined(_WIN32)+#if defined(__unix__) || defined(__APPLE__) || defined(_WIN32)#define ZH_MODERN_WATER 1#else#define ZH_MODERN_WATER 0diff --git a/GeneralsMD/Code/Libraries/Include/Platform/WaterFftFiltering.h b/GeneralsMD/Code/Libraries/Include/Platform/WaterFftFiltering.hindex 5605a21cb..49330daf3 100644--- a/GeneralsMD/Code/Libraries/Include/Platform/WaterFftFiltering.h+++ b/GeneralsMD/Code/Libraries/Include/Platform/WaterFftFiltering.h@@ -11,8 +11,9 @@ using VarianceTable=std::array<std::array<double,WaterFftSpectrum::Cascades>,Lev// A mip is a box average of 2^level base texels. Integrate the energy removed from the// two height-slope channels, using this exact deterministic spectrum, not an unrelated// roughness constant. Independent forward/backward modes have additive expected power.-inline VarianceTable UnresolvedSlopeVariance(const std::vector<float>& initial) {+inline VarianceTable UnresolvedSlopeVariance(const std::vector<float>& initial, WaterFftSpectrum::Configuration configuration=WaterFftSpectrum::ForResolution(WaterFftSpectrum::Resolution)) {using namespace WaterFftSpectrum;+ const unsigned Resolution=configuration.resolution;VarianceTable result={};if(initial.size()!=Resolution*Resolution*Cascades*4) return result;for(unsigned c=0;c<Cascades;++c) for(unsigned y=0;y<Resolution;++y) for(unsigned x=0;x<Resolution;++x) {@@ -22,7 +23,7 @@ inline VarianceTable UnresolvedSlopeVariance(const std::vector<float>& initial)const double ax=Pi*(int(x)-int(Resolution/2))/Resolution,ay=Pi*(int(y)-int(Resolution/2))/Resolution;const double kx=2*ax*Resolution/Sizes[c],ky=2*ay*Resolution/Sizes[c];const double energy=power*(kx*kx+ky*ky);- for(unsigned l=1;l<Levels;++l) {+ for(unsigned l=1;l<configuration.levels;++l) {const unsigned width=1u<<l;const double fx=ax==0?1:std::sin(width*ax)/(width*std::sin(ax));const double fy=ay==0?1:std::sin(width*ay)/(width*std::sin(ay));@@ -31,18 +32,22 @@ inline VarianceTable UnresolvedSlopeVariance(const std::vector<float>& initial)}return result;}-inline const VarianceTable &SpectrumVariance() {- static const VarianceTable table=UnresolvedSlopeVariance(WaterFftSpectrum::InitialSpectrum());- return table;+inline const VarianceTable &SpectrumVariance(WaterFftSpectrum::Configuration configuration=WaterFftSpectrum::ForResolution(WaterFftSpectrum::Resolution)) {+ if(configuration.resolution==128) {+ static const VarianceTable low=UnresolvedSlopeVariance(WaterFftSpectrum::InitialSpectrum(WaterFftSpectrum::ForResolution(128)),WaterFftSpectrum::ForResolution(128));+ return low;+ }+ static const VarianceTable high=UnresolvedSlopeVariance(WaterFftSpectrum::InitialSpectrum());+ return high;}-inline std::string Source() {- std::string source="static const float3 fftLostSlopeVariance[9]={\n";- const auto &table=SpectrumVariance();- for(unsigned l=0;l<Levels;++l) {- char row[192];std::snprintf(row,sizeof(row),"float3(%.9g,%.9g,%.9g)%s\n",table[l][0],table[l][1],table[l][2],l+1<Levels?",":"");+inline std::string Source(WaterFftSpectrum::Configuration configuration=WaterFftSpectrum::ForResolution(WaterFftSpectrum::Resolution)) {+ std::string source="static const float3 fftLostSlopeVariance["+std::to_string(configuration.levels)+"]={\n";+ const auto &table=SpectrumVariance(configuration);+ for(unsigned l=0;l<configuration.levels;++l) {+ char row[192];std::snprintf(row,sizeof(row),"float3(%.9g,%.9g,%.9g)%s\n",table[l][0],table[l][1],table[l][2],l+1<configuration.levels?",":"");source+=row;}- return source+R"HLSL(};+ source+=R"HLSL(};float3 fftShadingLod(float footprint) {float3 texels=max(footprint,0.0)*256.0/(float3(450.0,103.0,13.0)*fftWorldScale);return clamp(log2(max(texels,float3(1,1,1))),0.0,8.0);@@ -56,5 +61,12 @@ float fftShadingVariance(float3 lod) {return result;})HLSL";+ auto replace=[&](const std::string &from,const std::string &to) {+ for(size_t at=source.find(from);at!=std::string::npos;at=source.find(from,at+to.size())) source.replace(at,from.size(),to);+ };+ replace("*256.0/","*"+std::to_string(configuration.resolution)+".0/");+ replace(",0.0,8.0)",",0.0,"+std::to_string(configuration.phases)+".0)");+ replace("level,7)","level,"+std::to_string(configuration.phases-1)+")");+ return source;}}diff --git a/GeneralsMD/Code/Libraries/Include/Platform/WaterFftSampling.h b/GeneralsMD/Code/Libraries/Include/Platform/WaterFftSampling.hindex 8aea914cf..fbafa7f62 100644--- a/GeneralsMD/Code/Libraries/Include/Platform/WaterFftSampling.h+++ b/GeneralsMD/Code/Libraries/Include/Platform/WaterFftSampling.h@@ -17,7 +17,7 @@ constexpr float WorldScale=WaterFftSpectrum::WorldScale;constexpr float TimeScale=0.4f;// Both stages consume the same immutable draw snapshot. Slot zero remains the generated// fixed vertex block; the vessel field is water-only slot one on the vertex stage.-inline std::string UniformSource(const char *name,unsigned slot,bool visual_hull=false) {+inline std::string UniformSource(const char *name,unsigned slot,bool visual_hull=false,bool sdl=false) {std::string source=std::string("cbuffer ")+name+" : register(b"+std::to_string(slot)+R"HLSL(){float4 TextureFactor;@@ -44,6 +44,7 @@ inline std::string UniformSource(const char *name,unsigned slot,bool visual_hull#define MODERN_WATER_HLSL_UNIFORM(name) " float4 " #name ";\n"source+=MODERN_WATER_MATERIAL_UNIFORMS(MODERN_WATER_HLSL_UNIFORM);#undef MODERN_WATER_HLSL_UNIFORM+ if(sdl) source+=" row_major float4x4 ClipFromWorld;\n";if(visual_hull) source+=" float4 VisualHullMeta[8];\n";source+="};\n";if(visual_hull) source+=R"HLSL(@@ -134,14 +135,14 @@ float3 fftVertexDisplacement(float2 p) {return fftVertexDisplacement(p,WaterPara}// Add a water-only wrapper to the generated fixed vertex program. It retains the engine's// original projection, shroud coordinate generation and fog after moving the actual vertex.-inline bool WrapVertex(std::string &hlsl)+inline bool WrapVertex(std::string &hlsl,bool sdl=false){const std::string entry="Output main(Input input)";const size_t at=hlsl.find(entry);if(at==std::string::npos || hlsl.find("float3 Normal")==std::string::npos|| hlsl.find("float2 TexCoord1")==std::string::npos) return false;hlsl.replace(at,entry.size(),"Output waterFixedVertex(Input input)");- hlsl+=UniformSource("WaterVertexParameters",1);+ hlsl+=UniformSource("WaterVertexParameters",1,false,sdl);hlsl+=VertexSource();hlsl+=WaterWaveCageShader::Source(true);hlsl+=R"HLSL(@@ -183,9 +184,9 @@ Output main(Input input))HLSL";return true;}-inline std::string PixelSource()+inline std::string PixelSource(WaterFftSpectrum::Configuration configuration=WaterFftSpectrum::ForResolution(WaterFftSpectrum::Resolution)){- std::string source=CommonSource()+WaterBowLift::Source()+WaterVesselWaves::Source()+WaterFftFiltering::Source()+R"HLSL(+ std::string source=CommonSource()+WaterBowLift::Source()+WaterVesselWaves::Source()+WaterFftFiltering::Source(configuration)+R"HLSL(struct FftSurface {float3 bow;float3 displacement;diff --git a/GeneralsMD/Code/Libraries/Include/Platform/WaterFftSpectrum.h b/GeneralsMD/Code/Libraries/Include/Platform/WaterFftSpectrum.hindex cc277467c..ad13f6ded 100644--- a/GeneralsMD/Code/Libraries/Include/Platform/WaterFftSpectrum.h+++ b/GeneralsMD/Code/Libraries/Include/Platform/WaterFftSpectrum.h@@ -10,6 +10,12 @@namespace WaterFftSpectrum {constexpr unsigned Resolution=256, Phases=8, Cascades=3, Maps=6;+struct Configuration { unsigned resolution, phases, levels; };+// Only validated tiers are accepted; unrecognised values preserve the shared default.+constexpr Configuration ForResolution(unsigned resolution) {+ return resolution==128 ? Configuration{128,7,8} : Configuration{256,8,9};+}+constexpr float Sizes[Cascades]={450.0f,103.0f,13.0f};// Sampling and spectrum construction share one reference-to-world conversion.constexpr float WorldScale=20.0f;@@ -46,8 +52,8 @@ inline float Random(uint32_t &state) {t=(t^(t>>15))*(t|1u);t^=t+(t^(t>>7))*(t|61u);return float(double(t^(t>>14))/4294967296.0);}-inline std::vector<float> InitialSpectrum() {- const unsigned n=Resolution,texels=n*n;+inline std::vector<float> InitialSpectrum(Configuration configuration=ForResolution(Resolution)) {+ const unsigned n=configuration.resolution,texels=n*n;std::vector<float> noise(texels*2),result(texels*Cascades*4);uint32_t seed=0;for(float &v:noise) v=Random(seed);@@ -91,9 +97,10 @@ inline std::vector<float> InitialSpectrum() {}return result;}-inline std::vector<float> Butterfly() {+inline std::vector<float> Butterfly(Configuration configuration=ForResolution(Resolution)) {+ const unsigned Resolution=configuration.resolution,Phases=configuration.phases;std::vector<float> result(Resolution*Phases*4);- auto reverse=[](unsigned v) { unsigned r=0;for(unsigned j=0;j<Phases;++j) { r=(r<<1)|(v&1);v>>=1; }return r; };+ auto reverse=[Phases](unsigned v) { unsigned r=0;for(unsigned j=0;j<Phases;++j) { r=(r<<1)|(v&1);v>>=1; }return r; };for(unsigned phase=0;phase<Phases;++phase) for(unsigned i=0;i<Resolution;++i) {const unsigned span=1u<<phase,base=i%(span*2)<span?i:i-span;const double angle=2*Pi*(i*(Resolution>>(phase+1)))/Resolution;@@ -145,7 +152,7 @@ Result main(float4 position:SV_Position) {)HLSL";return source;}-inline std::string ButterflyHlsl() {+inline std::string ButterflyHlsl(Configuration configuration = ForResolution(Resolution)) {std::string source=Resources(7);source+=R"HLSL(float4 butterfly(float4 a,float4 b,float2 w) {@@ -159,6 +166,9 @@ Result main(float4 position:SV_Position) {a/=Parameters.x;b/=Parameters.x;Result result;)HLSL";for(unsigned i=0;i<Maps;++i) {const std::string s=std::to_string(i);source+="result.v"+s+"=butterfly(T"+s+".SampleLevel(S"+s+",a,0),T"+s+".SampleLevel(S"+s+",b,0),entry.xy);\n";}+ const std::string divisor="/8.0,";+ const size_t at=source.find(divisor);+ if(at!=std::string::npos) source.replace(at,divisor.size(),"/"+std::to_string(configuration.phases)+".0,");return source+"return result; }\n";}inline std::string PostHlsl() {diff --git a/GeneralsMD/Code/Libraries/Include/Platform/WaterPerformanceSettings.h b/GeneralsMD/Code/Libraries/Include/Platform/WaterPerformanceSettings.hnew file mode 100644index 000000000..a55a3df8a--- /dev/null+++ b/GeneralsMD/Code/Libraries/Include/Platform/WaterPerformanceSettings.h@@ -0,0 +1,33 @@+// Distributed under the repository's GPL-3.0 terms; see LICENSE.md.+#pragma once++// Render-side SDL water preferences. Updated at the water render boundary, except+// activeFftResolution, which a water FFT draw publishes before choosing its pixel program.+// Shared shader callers retain the original defaults.+namespace WaterPerformanceSettings {+enum Refraction { Full = 0, Simple = 1, Off = 2 };+struct Configuration {+ bool sceneReflections = true;+ unsigned requestedFftResolution = 256;+ unsigned activeFftResolution = 256; // the successfully allocated ocean, including fallback+ Refraction refraction = Full;+ bool sceneColourRequired = true; // SceneColourRequired() for the effective reflection mode+ int reflectionDetail = 1; // scene reflection detail; 0 Low, 1 High+};+inline Configuration &Applied() {+ static Configuration configuration;+ return configuration;+}+// Water samples scene colour for refraction and for screen-space reflection (c95.w=1).+// Planar reflections read their own capture.+inline bool SceneColourRequired(Refraction refraction, bool screenSpaceReflection) {+ return refraction != Off || screenSpaceReflection;+}+inline void Apply(bool reflections, int waveDetail, int refraction, int reflectionDetail = 1) {+ Configuration &configuration = Applied();+ configuration.sceneReflections = reflections;+ configuration.requestedFftResolution = waveDetail == 0 ? 128 : 256;+ configuration.refraction = refraction == Simple ? Simple : refraction == Off ? Off : Full;+ configuration.reflectionDetail = reflectionDetail == 0 ? 0 : 1;+}+}diff --git a/GeneralsMD/Code/Libraries/Include/Platform/WaterScreenReflection.h b/GeneralsMD/Code/Libraries/Include/Platform/WaterScreenReflection.hnew file mode 100644index 000000000..620efe7ae--- /dev/null+++ b/GeneralsMD/Code/Libraries/Include/Platform/WaterScreenReflection.h@@ -0,0 +1,155 @@+// Screen-space and planar reflections for SDL Modern water. Render-only.+// Distributed under the repository's GPL-3.0 terms; see LICENSE.md.+#pragma once++namespace WaterScreenReflection {++bool Supported(); // Queries the current backend; false before a GPU device exists.+enum Mode { Mirror, ScreenSpace, Hybrid, SkyOnly };+constexpr unsigned LegacyMirrorSize = 512;+constexpr unsigned HybridMirrorSize = 1024;+inline unsigned MirrorSize(Mode mode, int detail = 1) {+ const unsigned high = mode == Hybrid ? HybridMirrorSize : LegacyMirrorSize;+ return detail == 0 ? high / 2 : high;+}+inline Mode Resolve(int setting, bool enabled = true)+{+ if (!enabled) return SkyOnly;+ switch (setting) {+ case 0: return Mirror;+ case 1: return ScreenSpace;+ default: return Hybrid;+ }+}+inline bool Traces(Mode mode) { return mode == ScreenSpace || mode == Hybrid; }+inline bool UsesMirror(Mode mode) { return mode == Mirror || mode == Hybrid; }++// Needs the water shader's WorldFromClip, ClipFromWorld, Viewport, CameraPosition, SceneParameters and MaterialParameters, the+// scene colour (Texture5) and depth (Texture6) snapshots, and waterScenePixel/scenePosition.+inline const char *ShaderSource() { return R"HLSL(+float2 waterSsrPixel(float4 clip)+{+ float2 ndc=clip.xy/clip.w;+ return Viewport.xy+(ndc*float2(0.5,-0.5)+0.5)*Viewport.zw;+}+float waterSsrDepth(float2 pixel)+{+ // A depth discontinuity must not become a phantom intermediate surface.+ return Texture6.Load(int3(int2(floor(waterScenePixel(pixel))),0)).r;+}+struct WaterSsrSample+{+ float3 colour; // display-space scene colour at the hit+ float confidence; // 0 for a miss+ float travel; // world ray distance / WaterSsrDistance+ float refused; // 1 when no trace was attempted+ float distance; // world ray distance; 0 for a miss+ float3 position; // accepted scene surface, for reflection correspondence+};+static const int WaterSsrSteps=32;+static const int WaterSsrRefinements=7; // Stops earlier once the bracket is subpixel.+static const float WaterSsrDistance=700.0; // world units; a map cell is 10+// How far behind a depth sample a ray may pass and still hit it: a few world units, plus two+// pixels of the ray's own depth travel. A fixed allowance as wide as a building also accepts+// every ray passing behind a thin lintel or pillar, which fills the open water between them.+static const float WaterSsrThickness=3.0;+// The share of the wave normal the trace follows. The mirror only nudges its lookup by the+// normal; a fully rippled ray scatters a reflection into speckle over a long trace.+static const float WaterSsrNormalWeight=0.3;+// A downward reflected ray meets the water itself, and the snapshot holds no water. Rays leaving+// the screen, or passing behind everything, fall back to the caller's reflection.+WaterSsrSample waterScreenReflection(float3 world, float3 view, float3 normal, float roughness, float2 pixel)+{+ float3 ray=reflect(-view, normalize(lerp(float3(0,0,1), normal, WaterSsrNormalWeight)));+ WaterSsrSample result;+ result.colour=float3(0,0,0); result.confidence=0.0; result.travel=1.0; result.refused=1.0;+ result.distance=0.0; result.position=world;+ [branch] if (!(MaterialParameters.w>0.5 && MaterialParameters.w<1.5 && SceneParameters.x>0.5 && SceneParameters.w>0.5) || ray.z<0.02)+ return result;+ // Uploaded once per draw, including the same viewport depth mapping as WorldFromClip.+ float4 c0=mul(float4(world,1),ClipFromWorld);+ float4 c1=mul(float4(world+ray*WaterSsrDistance,1),ClipFromWorld);+ [branch] if (!(c0.w>0.0)) return result;+ // Keep the segment in front of the camera.+ float nearW=c0.w*0.05;+ if (c1.w<nearW) c1=lerp(c0,c1,(c0.w-nearW)/max(c0.w-c1.w,1e-5));+ float2 p0=waterSsrPixel(c0), p1=waterSsrPixel(c1);+ float z0=c0.z/c0.w, z1=c1.z/c1.w;+ // Device depth is affine in screen space along a projected line, so it interpolates with the pixel.+ float2 lo=waterScenePixel(float2(-1e9,-1e9)), hi=waterScenePixel(float2(1e9,1e9));+ float2 d=p1-p0;+ float2 exitT=float2(d.x>0.0?(hi.x-p0.x)/d.x:(d.x<0.0?(lo.x-p0.x)/d.x:1.0),+ d.y>0.0?(hi.y-p0.y)/d.y:(d.y<0.0?(lo.y-p0.y)/d.y:1.0));+ float span=saturate(min(exitT.x,exitT.y));+ p1=lerp(p0,p1,span); z1=lerp(z0,z1,span);+ float rayPixels=length(p1-p0);+ [branch] if (rayPixels<2.0) return result;+ result.refused=0.0;+ // The water origin passed the opaque depth test, so the first segment starts in front.+ bool previousFront=true;+ float previous=0.0, found=-1.0, hitQuality=0.0;+ // Keep a fixed screen-space phase: deterministic zero-phase stepping produced coherent+ // missing bands on thin geometry without a history resolve. This retains the existing+ // spatial stipple limitation, but never changes the phase with frame number.+ float jitter=frac(52.9829189*frac(dot(pixel,float2(0.06711056,0.00583715))));+ [loop] for (int i=1; i<=WaterSsrSteps && found<0.0; ++i) {+ // Denser near contact. Include the segment endpoint as the final sample.+ float t=i==WaterSsrSteps?1.0:pow((float(i)-1.0+jitter)/float(WaterSsrSteps),1.6);+ float2 at=waterScenePixel(floor(lerp(p0,p1,t))+0.5);+ float rayDepth=lerp(z0,z1,t);+ if (rayDepth<0.0 || rayDepth>1.0) break;+ float sceneDepth=waterSsrDepth(at);+ bool behindNow=sceneDepth<0.999999 && rayDepth>sceneDepth;+ [branch] if (behindNow) {+ float a=previous, b=t;+ // Only refine a real front-to-behind bracket. After a rejected occluder, later+ // behind samples still need a slab test: they can meet a different valid surface.+ if (previousFront) {+ [loop] for (int r=0; r<WaterSsrRefinements && (b-a)*rayPixels>0.5; ++r) {+ float m=(a+b)*0.5;+ float md=waterSsrDepth(lerp(p0,p1,m));+ if (md<0.999999 && lerp(z0,z1,m)>md) b=m; else a=m;+ }+ }+ float2 hp=waterScenePixel(floor(lerp(p0,p1,b))+0.5);+ float hd=waterSsrDepth(hp);+ float3 sceneHit=scenePosition(hp,hd);+ float3 rayHit=scenePosition(hp,lerp(z0,z1,b));+ float behind=length(rayHit-CameraPosition.xyz)-length(sceneHit-CameraPosition.xyz);+ float before=max(b-1.0/rayPixels,0.0);+ // Use the same pixel for both reconstructions: only depth travel widens the slab.+ float3 rayBefore=scenePosition(hp,lerp(z0,z1,before));+ float pixelTravel=abs(length(rayHit-CameraPosition.xyz)-length(rayBefore-CameraPosition.xyz));+ float tolerance=min(WaterSsrThickness+2.0*pixelTravel,6.0);+ // Under-water scene (the bed the refraction sees) cannot be met by an upward ray.+ if (hd<0.999999 && behind>=0.0 && behind<=tolerance && sceneHit.z>world.z-1.0) {+ found=b;+ result.position=sceneHit;+ hitQuality=1.0-smoothstep(0.8*tolerance,tolerance,behind);+ }+ }+ previous=t;+ previousFront=!behindNow;+ }+ [branch] if (found<0.0) return result;+ float2 hit=lerp(p0,p1,found);+ float2 radius=float2(1.0,1.0)+saturate(roughness)*6.0;+ float3 colour=Texture5.SampleLevel(Sampler5,waterScenePixel(hit)*SceneParameters.yz,0).rgb*0.4;+ colour+=Texture5.SampleLevel(Sampler5,waterScenePixel(hit+float2(radius.x,0))*SceneParameters.yz,0).rgb*0.15;+ colour+=Texture5.SampleLevel(Sampler5,waterScenePixel(hit-float2(radius.x,0))*SceneParameters.yz,0).rgb*0.15;+ colour+=Texture5.SampleLevel(Sampler5,waterScenePixel(hit+float2(0,radius.y))*SceneParameters.yz,0).rgb*0.15;+ colour+=Texture5.SampleLevel(Sampler5,waterScenePixel(hit-float2(0,radius.y))*SceneParameters.yz,0).rgb*0.15;+ float2 border=min(hit-lo,hi-hit);+ float filterSupport=max(radius.x,radius.y)+1.0;+ result.colour=colour;+ // Projected t is not a world-distance fraction, especially after clipping the ray.+ float3 hitWorld=scenePosition(hit,lerp(z0,z1,found));+ result.distance=length(hitWorld-world);+ result.travel=saturate(result.distance/WaterSsrDistance);+ result.confidence=hitQuality*smoothstep(filterSupport,filterSupport+12.0,min(border.x,border.y))+ *(1.0-smoothstep(0.75,1.0,result.travel));+ return result;+}+)HLSL"; }++}diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/engineshader.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/engineshader.cppindex f05bfb79a..177ee9d39 100644--- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/engineshader.cpp+++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/engineshader.cpp@@ -21,6 +21,8 @@#include "ffvertex.h"#include "sdl3target.h"#include "Platform/WaterSurfaceModel.h"+#include "Platform/WaterPerformanceSettings.h"+#include "Platform/WaterScreenReflection.h"#include "Platform/WaterOpticalModel.h"#include "Platform/ModernWaterMaterial.h"#include "Platform/WaterHullModel.h"@@ -651,15 +653,20 @@ static bool write_engine_pixel_program(EngineShaderProgram program,// SDL map water has a dedicated, explicitly packed uniform block (SdlWaterPixelConstants).// Runtime-generated normal detail, terrain depth, refraction and the coloured planar reflection// are composed before the existing shore/shroud alpha blend. No additional assets are required.-static void write_modern_water(std::string &hlsl, bool river)+static void write_modern_water(std::string &hlsl, bool river, bool sdl = false){+ const auto quality = sdl ? WaterPerformanceSettings::Applied() : WaterPerformanceSettings::Configuration();hlsl.clear();+ if (sdl) {+ hlsl += std::string("#define WATER_SCENE_REFLECTIONS ") + (quality.sceneReflections ? "1\n" : "0\n");+ hlsl += "#define WATER_REFRACTION_QUALITY " + std::to_string(int(quality.refraction)) + "\n";+ }for (unsigned stage = 0; stage < 15u; ++stage) {char line[128];snprintf(line, sizeof(line), "Texture2D Texture%u : register(t%u);\nSamplerState Sampler%u : register(s%u);\n", stage, stage, stage, stage);hlsl += line;}- hlsl += WaterFftSampling::UniformSource("CombinerConstants",0,true);+ hlsl += WaterFftSampling::UniformSource("CombinerConstants",0,true,sdl);hlsl += R"HLSL(struct Input{float4 Position : SV_Position;@@ -880,13 +887,35 @@ WaterRefractionSample waterRefractedScene(float2 originalPixel, float2 offset,return result;})HLSL";+ if (sdl) {+ hlsl += WaterScreenReflection::ShaderSource();+ hlsl += R"HLSL(+float4 waterMirrorTexel(int2 pixel, int2 size)+{+ float3 colour=Texture1.Load(int3(clamp(pixel,int2(0,0),size-1),0)).rgb;+ // Legacy terrain cannot supply coverage alpha. Resolve the black-clear convention+ // BEFORE filtering, so a partially covered texel does not become an opaque black rim.+ float coverage=saturate(max(max(colour.r,colour.g),colour.b)*64.0);+ return float4(colour*coverage,coverage);+}+float4 waterMirrorFiltered(float2 uv, int2 size)+{+ float2 p=saturate(uv)*float2(size)-0.5, f=frac(p);+ int2 base=int2(floor(p));+ float4 c00=waterMirrorTexel(base,size), c10=waterMirrorTexel(base+int2(1,0),size);+ float4 c01=waterMirrorTexel(base+int2(0,1),size), c11=waterMirrorTexel(base+int2(1,1),size);+ // Preserve the existing display-space texture filtering, but carry coverage with it.+ return lerp(lerp(c00,c10,f.x),lerp(c01,c11,f.x),f.y);+}+)HLSL";+ }hlsl += WaterSurfaceModel::ShaderSource();hlsl += WaterSurfaceModel::OceanShaderSource();hlsl += WaterOpticalModel::GetHlslSource();hlsl += ModernWaterMaterial::OpticalSource();hlsl += ModernWaterMaterial::BubbleSource();hlsl += WaterHullModel::GetHlslSource();- hlsl += WaterFftSampling::PixelSource();+ hlsl += WaterFftSampling::PixelSource(WaterFftSpectrum::ForResolution(quality.activeFftResolution));hlsl += WaterWaveCageShader::Source(false);char oceanBound[96];snprintf(oceanBound, sizeof(oceanBound), "static const float oceanDisplacementBound = %.9g;\n",@@ -1213,7 +1242,60 @@ float4 main(Input input) : SV_Targetfloat2 reflectionUV = (screenUV - reflectionOffset) / reflectionScale;float2 distortion = pixelOffset(resolvedNormal.xy * 8.0, dx, dy) / max(Viewport.zw, float2(1, 1)) / reflectionScale;float2 blur = roughness * 0.008 / reflectionScale;- float4 mirror = Texture1.Sample(Sampler1, saturate(reflectionUV + distortion)) * 0.5;+)HLSL";+ if (sdl) hlsl += R"HLSL( float4 mirror=0.0, filteredMirror=0.0;+ float2 mirrorFilterSupport=abs(blur);+ bool filteredPlanar=WATER_SCENE_REFLECTIONS && MaterialParameters.w>0.5 && WaterParameters.z>0.5;+#if WATER_SCENE_REFLECTIONS+ [branch] if (filteredPlanar) {+ uint mirrorWidth,mirrorHeight;+ Texture1.GetDimensions(mirrorWidth,mirrorHeight);+ int2 mirrorSize=max(int2(mirrorWidth,mirrorHeight),int2(1,1));+ filteredMirror=waterMirrorFiltered(reflectionUV+distortion,mirrorSize)*0.5;+ filteredMirror+=waterMirrorFiltered(reflectionUV+distortion+blur,mirrorSize)*0.25;+ filteredMirror+=waterMirrorFiltered(reflectionUV+distortion-blur,mirrorSize)*0.25;+ mirrorFilterSupport+=1.0/float2(mirrorSize);+ } else if (WaterParameters.z>0.5) {+ // Keep the original reconstruction in Legacy.+ mirror=Texture1.Sample(Sampler1,saturate(reflectionUV+distortion))*0.5;+ mirror+=Texture1.Sample(Sampler1,saturate(reflectionUV+distortion+blur))*0.25;+ mirror+=Texture1.Sample(Sampler1,saturate(reflectionUV+distortion-blur))*0.25;+ }+#endif+ float2 border = min(reflectionUV, 1.0 - reflectionUV);+ // Legacy terrain passes preserve destination alpha for shore blending, including in the+ // mirror. Its transparent-black clear gives RGB coverage even when geometry cannot write A.+ float mirrorCoverage = filteredPlanar ? 1.0 : saturate(max(max(mirror.r, mirror.g), mirror.b) * 64.0);+ if (filteredPlanar)+ border=min(reflectionUV+distortion,1.0-reflectionUV-distortion)-mirrorFilterSupport;+ float coverage = saturate(min(border.x, border.y) * 30.0) * mirrorCoverage * WaterParameters.z;+ coverage *= 1.0 - smoothstep(0.5, 2.0, abs(baseLevel - WaterParameters.w));+ float3 skyRadiance=waterLinear(sky);+ if(offshore>0.0) skyRadiance=lerp(skyRadiance,oceanEnvironment(reflectedRay,light,daylight,environmentRoughness),offshore);+ float3 reflection;+ [branch] if (filteredPlanar) {+ // Remove coverage before decoding, then restore it in linear light. Decoding once+ // keeps the old interior colour filtering and avoids twelve gamma conversions.+ float3 planarRadiance=waterLinear(saturate(filteredMirror.rgb/max(filteredMirror.a,1e-6)))+ *filteredMirror.a;+ reflection=skyRadiance*(1.0-coverage*filteredMirror.a)+coverage*planarRadiance;+ } else reflection=lerp(skyRadiance,waterLinear(mirror.rgb),coverage);+ // MaterialParameters.w selects the traced reflection; hybrid also retains planar visibility.+ WaterSsrSample ssr = (WaterSsrSample)0;+#if WATER_SCENE_REFLECTIONS+ ssr = waterScreenReflection(world, view, environmentNormal, environmentRoughness, input.Position.xy);+#endif+ // A main-camera hit cannot certify a surface hidden from that camera (a bridge underside,+ // for example). Retain the planar contribution in hybrid until geometric correspondence+ // is available. Trust includes empty sky, so it is independent of the RGB coverage heuristic.+ float2 tracedMirrorUV=reflectionUV+distortion;+ float2 tracedMirrorBorder=min(tracedMirrorUV,1.0-tracedMirrorUV)-mirrorFilterSupport;+ float mirrorTrust=saturate(min(tracedMirrorBorder.x,tracedMirrorBorder.y)*30.0)*WaterParameters.z;+ mirrorTrust*=1.0-smoothstep(0.5,2.0,abs(baseLevel-WaterParameters.w));+ float ssrWeight=ssr.confidence*lerp(1.0,0.35,saturate(mirrorTrust));+ reflection = lerp(reflection, waterLinear(ssr.colour), ssrWeight);+)HLSL";+ else hlsl += R"HLSL( float4 mirror = Texture1.Sample(Sampler1, saturate(reflectionUV + distortion)) * 0.5;mirror += Texture1.Sample(Sampler1, saturate(reflectionUV + distortion + blur)) * 0.25;mirror += Texture1.Sample(Sampler1, saturate(reflectionUV + distortion - blur)) * 0.25;float2 border = min(reflectionUV, 1.0 - reflectionUV);@@ -1225,14 +1307,34 @@ float4 main(Input input) : SV_Targetfloat3 skyRadiance=waterLinear(sky);if(offshore>0.0) skyRadiance=lerp(skyRadiance,oceanEnvironment(reflectedRay,light,daylight,environmentRoughness),offshore);float3 reflection = lerp(skyRadiance, waterLinear(mirror.rgb), coverage);- // Refraction uses the actual optical depth and shared colour/depth viewport bounds.- float2 refractionPixels = waterRefractionPixels(opticalDepth, view, normal, dx, dy);+)HLSL";+ hlsl += R"HLSL( // Refraction uses the actual optical depth and shared colour/depth viewport bounds.+)HLSL";+ if (sdl) hlsl += R"HLSL( float2 refractionPixels = 0.0;+ WaterRefractionSample refractedScene = (WaterRefractionSample)0;+ refractedScene.bottom = bottom;+#if WATER_REFRACTION_QUALITY == 0+ refractionPixels = waterRefractionPixels(opticalDepth, view, normal, dx, dy);+ refractedScene = waterRefractedScene(input.Position.xy, refractionPixels,+ world, opticalWorld, view, baseLevel, bottom);+#elif WATER_REFRACTION_QUALITY == 1+ // Undistorted transmission reads the original scene exactly once. Depth remains+ // independent for submerged objects, intersections and foam.+ refractedScene.pixel = waterScenePixel(floor(input.Position.xy)+0.5);+ [branch] if (SceneParameters.x>0.5)+ refractedScene.colour = Texture5.Load(int3(int2(floor(refractedScene.pixel)),0)).rgb;+#endif+)HLSL";+ else hlsl += R"HLSL( float2 refractionPixels = waterRefractionPixels(opticalDepth, view, normal, dx, dy);WaterRefractionSample refractedScene = waterRefractedScene(input.Position.xy, refractionPixels,world, opticalWorld, view, baseLevel, bottom);- bottom = refractedScene.bottom;+)HLSL";+ hlsl += R"HLSL( bottom = refractedScene.bottom;float bedDepth = max(opticalWorld.z-bottom.z, 0.0);float3 scene = waterLinear(refractedScene.colour);- // Material detail is fixed to the *actual* submerged scene position. Keep object materials,+)HLSL";+ if (sdl) hlsl += "#if WATER_REFRACTION_QUALITY != 2\n";+ hlsl += R"HLSL( // Material detail is fixed to the *actual* submerged scene position. Keep object materials,// steep cliff faces, map tint, and visibility; only exposed bed terrain receives this detail.float bedHeight = terrainHeight(bottom.xy);float2 bedSlope = float2(terrainHeight(bottom.xy+float2(5,0))-terrainHeight(bottom.xy-float2(5,0)),@@ -1270,7 +1372,13 @@ float4 main(Input input) : SV_Target// in enclosed pools. Actual scene ray length still governs submerged objects and refraction.float3 transmission = WaterOpticalTransmission(length(bottom-opticalWorld), WaterParameters.y,offshore, OpticalParameters.x, OpticalParameters.y);- // Preserve the current face-light signal, but apply it only to water's in-scattered source.+)HLSL";+ if (sdl) hlsl += R"HLSL(#else+ float3 transmission = 0.0;+ float caustic = 1.0;+#endif+)HLSL";+ hlsl += R"HLSL( // Preserve the current face-light signal, but apply it only to water's in-scattered source.// Transmitted terrain/object colour must not receive a second surface-light multiplier.float3 swellNormal=normalize(float3(-oceanSwell.yz*attenuation-correctionSlope,1));swellNormal=normalize(lerp(swellNormal,normal,fftWeight));@@ -1453,9 +1561,17 @@ float4 main(Input input) : SV_TargetoceanEnvironment(reflectedRay,light,daylight,foamRoughness),offshore);float foamLevelCoverage=WaterParameters.z*(1.0-smoothstep(0.5,2.0,abs(baseLevel-WaterParameters.w)));- float3 foamReflection=waterFoamPlanarReflection(foamSky,reflectionUV,distortion,+)HLSL";+ if (sdl) hlsl += R"HLSL( float3 foamReflection=foamSky;+#if WATER_SCENE_REFLECTIONS+ foamReflection=waterFoamPlanarReflection(foamSky,reflectionUV,distortion,reflectionScale,foamRoughness,foamLevelCoverage);- vesselRadiance=waterFoamRoughMaterial(vesselDiffuse,foamReflection,+#endif+)HLSL";+ else hlsl += R"HLSL( float3 foamReflection=waterFoamPlanarReflection(foamSky,reflectionUV,distortion,+ reflectionScale,foamRoughness,foamLevelCoverage);+)HLSL";+ hlsl += R"HLSL( vesselRadiance=waterFoamRoughMaterial(vesselDiffuse,foamReflection,environmentFresnel,oceanViewCosine,foamRoughness);// Share the filtered incident reflection; exchange Fresnel only once.if(shoreMaterialWeight>0.0)@@ -1475,10 +1591,10 @@ float4 main(Input input) : SV_Target)HLSL";if (river) {hlsl += " float4 edge = Texture3.Sample(Sampler3, float2(2.0*input.TexCoord0.x, input.TexCoord0.y));\n";- hlsl += " current = float4(saturate(surface) * input.Diffuse.a, edge.a * saturate(depth * 2.0) * lerp(base.a, step(0.001, base.a), SceneParameters.x));\n";+ hlsl += " current = float4(saturate(surface) * input.Diffuse.a, edge.a * saturate(depth * 2.0) * lerp(base.a, step(0.001, base.a), " + std::string(sdl ? "WATER_REFRACTION_QUALITY == 2 ? 1.0 : SceneParameters.x" : "SceneParameters.x") + "));\n";} else {hlsl += " float4 edge = Texture3.Sample(Sampler3, input.TexCoord3);\n";- hlsl += " current = float4(saturate(surface) * edge.rgb, saturate(depth * 2.0) * lerp(input.Diffuse.a * base.a, step(0.001, input.Diffuse.a * base.a), SceneParameters.x));\n";+ hlsl += " current = float4(saturate(surface) * edge.rgb, saturate(depth * 2.0) * lerp(input.Diffuse.a * base.a, step(0.001, input.Diffuse.a * base.a), " + std::string(sdl ? "WATER_REFRACTION_QUALITY == 2 ? 1.0 : SceneParameters.x" : "SceneParameters.x") + "));\n";}}@@ -1493,14 +1609,12 @@ bool EngineShader_Pixel_Program(EngineShaderProgram program,}const bool modern_water = EngineShader_Is_Modern_Water(program);if (target == COMBINER_SHADER_TARGET_SDL3_GPU) {-#if defined(__linux__)if (modern_water) {- write_modern_water(hlsl, program == ENGINE_SHADER_WATER_RIVER);+ write_modern_water(hlsl, program == ENGINE_SHADER_WATER_RIVER, true);if (!CombinerShader_Append_Pixel_Pipeline(pipeline, hlsl)) return false;hlsl += " return current;\n}\n";return SDL3_Shader_Retarget(hlsl, false);}-#endif // __linux__return write_engine_pixel_program(program, pipeline, hlsl, EngineShader_Paints_Ground(program))&& SDL3_Shader_Retarget(hlsl, false);}diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex 06d851fc5..b3d0fda19 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -132,6 +132,7 @@ static int GetSystemMetrics( int which )}#endif#include "Common/OptionsCatalog.h"+#include "Platform/WaterScreenReflection.h"#include "Common/SubsystemInterface.h"#include "GameClient/GameText.h"#include "Common/GameLOD.h"@@ -19173,6 +19174,262 @@ TEST(water_style_defaults_to_classic_and_preserves_an_explicit_modern_choice)TheWritableGlobalData=saved;}+TEST(water_reflections_default_to_hybrid_and_persist_each_mode)+{+ const OptionDef *reflection = findOptionDef("WaterReflection");+ CHECK(reflection != NULL);+ if (!reflection)+ return;+ CHECK_EQ(reflection->kind, OPTION_ENUM);+ CHECK_EQ(reflection->apply, APPLY_LIVE);+ CHECK_EQ(reflection->lo, 0);+ CHECK_EQ(reflection->hi, 2);+ CHECK_STR(reflection->widgetName, "OptionsMenu.wnd:ComboBoxWaterReflection");+ CHECK_STR(reflection->labelKey, "GUI:WaterReflection");++ GlobalData *saved = TheWritableGlobalData;+ GlobalData *scratch = NEW GlobalData;+ TheWritableGlobalData = scratch;++ UserPreferences pref;+ CHECK_EQ(scratch->m_waterReflection, 2);+ // Existing preference files have no key; retain Hybrid until the player chooses a mode.+ loadOptionsFromPreferences(pref);+ CHECK_EQ(reflection->get(), 2);++ // The choice remains available with Classic water, ready for a later switch to Modern.+ scratch->m_waterStyle = 0;+ static const char *const modes[] = { "0", "1", "2" };+ for (Int mode = 0; mode < WATER_REFLECTION_COUNT; ++mode) {+ pref["WaterReflection"] = modes[mode];+ loadOptionsFromPreferences(pref);+ CHECK_EQ(reflection->get(), mode);+ saveOptionsToPreferences(pref);+ CHECK_STR(pref["WaterReflection"].str(), modes[mode]);+ reflection->set((mode + 1) % WATER_REFLECTION_COUNT);+ loadOptionsFromPreferences(pref);+ CHECK_EQ(scratch->m_waterReflection, mode);+ CHECK_EQ(scratch->m_waterStyle, 0);+ }++ // Hand-edited out-of-range values must still resolve to a mode shown in the menu.+ pref["WaterReflection"] = "-1";+ loadOptionsFromPreferences(pref);+ CHECK_EQ(reflection->get(), 0);+ pref["WaterReflection"] = "3";+ loadOptionsFromPreferences(pref);+ CHECK_EQ(reflection->get(), 2);+ pref["WaterReflection"] = "99";+ loadOptionsFromPreferences(pref);+ CHECK_EQ(reflection->get(), 2);++ delete scratch;+ TheWritableGlobalData = saved;+}++TEST(modern_water_performance_defaults_preserve_existing_appearance)+{+ GlobalData *saved = TheWritableGlobalData;+ GlobalData *scratch = NEW GlobalData;+ TheWritableGlobalData = scratch;++ CHECK(scratch->m_waterReflectionEnabled);+ CHECK_EQ(scratch->m_waterFftResolution, 1);+ CHECK_EQ(scratch->m_waterRefractionQuality, 0);+ CHECK_EQ(scratch->m_waterReflectionDetail, 1);+ UserPreferences missing;+ loadOptionsFromPreferences(missing);+ CHECK(scratch->m_waterReflectionEnabled);+ CHECK_EQ(scratch->m_waterFftResolution, 1);+ CHECK_EQ(scratch->m_waterRefractionQuality, 0);+ CHECK_EQ(scratch->m_waterReflectionDetail, 1);+ CHECK_EQ(scratch->m_waterReflection, 2); // existing Hybrid value is unchanged++ delete scratch;+ TheWritableGlobalData = saved;+}++TEST(modern_water_performance_choices_round_trip_without_device_or_modern_style)+{+ // This engine-only test has no active SDL GPU device. Preferences must still load and save+ // without one, and remain ready when Modern water becomes available again.+ CHECK(!WaterScreenReflection::Supported());+ GlobalData *saved = TheWritableGlobalData;+ GlobalData *scratch = NEW GlobalData;+ TheWritableGlobalData = scratch;+ scratch->m_waterStyle = 0;+ scratch->m_waterReflection = 2;++ const char *const keys[] = { "WaterReflectionEnabled", "WaterFftResolution", "WaterRefractionQuality", "WaterReflectionDetail" };+ const char *const widgets[] = { "OptionsMenu.wnd:CheckWaterReflectionEnabled",+ "OptionsMenu.wnd:ComboBoxWaterFftResolution", "OptionsMenu.wnd:ComboBoxWaterRefractionQuality",+ "OptionsMenu.wnd:ComboBoxWaterReflectionDetail" };+ const Int maxValues[] = { 1, WATER_FFT_RESOLUTION_COUNT - 1, WATER_REFRACTION_QUALITY_COUNT - 1, WATER_REFLECTION_DETAIL_COUNT - 1 };+ for (Int i = 0; i < (Int)(sizeof(keys) / sizeof(keys[0])); ++i) {+ const OptionDef *def = findOptionDef(keys[i]);+ CHECK(def != NULL);+ if (!def) continue;+ CHECK_EQ(def->kind, i == 0 ? OPTION_BOOL : OPTION_ENUM);+ CHECK_EQ(def->apply, APPLY_LIVE);+ CHECK_EQ(def->lo, 0);+ CHECK_EQ(def->hi, maxValues[i]);+ CHECK_STR(def->widgetName, widgets[i]);+ CHECK(isModernWaterOption(*def));+ for (Int value = 0; value <= maxValues[i]; ++value) {+ UserPreferences pref;+ def->set(value);+ saveOptionsToPreferences(pref);+ CHECK_STR(pref[keys[i]].str(), formatOptionValue(*def, value).str());+ def->set((value + 1) % (maxValues[i] + 1));+ loadOptionsFromPreferences(pref);+ CHECK_EQ(def->get(), value);+ CHECK_EQ(scratch->m_waterStyle, 0);+ CHECK_EQ(scratch->m_waterReflection, 2);+ }+ }+ // The same classification protects every hidden water performance widget from writeback.+ CHECK(isModernWaterOption(*findOptionDef("WaterReflection")));+ CHECK(!isModernWaterOption(*findOptionDef("WaterStyle")));+ CHECK(!isModernWaterOption(*findOptionDef("CloudStyle")));++ delete scratch;+ TheWritableGlobalData = saved;+}++TEST(modern_water_performance_invalid_values_are_bounded_and_console_input_is_strict)+{+ GlobalData *saved = TheWritableGlobalData;+ GlobalData *scratch = NEW GlobalData;+ TheWritableGlobalData = scratch;+ const char *const keys[] = { "WaterFftResolution", "WaterRefractionQuality", "WaterReflectionDetail" };+ for (Int i = 0; i < (Int)(sizeof(keys) / sizeof(keys[0])); ++i) {+ const OptionDef *def = findOptionDef(keys[i]);+ CHECK(def != NULL);+ if (!def) continue;+ UserPreferences pref;+ pref[keys[i]] = "-100";+ loadOptionsFromPreferences(pref);+ CHECK_EQ(def->get(), def->lo);+ pref[keys[i]] = "99";+ loadOptionsFromPreferences(pref);+ CHECK_EQ(def->get(), def->hi);+ saveOptionsToPreferences(pref);+ CHECK_STR(pref[keys[i]].str(), formatOptionValue(*def, def->hi).str());+ pref[keys[i]] = "invalid";+ loadOptionsFromPreferences(pref);+ CHECK_EQ(def->get(), 0); // same legacy invalid-number handling as the other catalog enums+ Int value = 47;+ CHECK(!parseOptionText(*def, "99", &value));+ CHECK_EQ(value, 47);+ CHECK(!parseOptionText(*def, "invalid", &value));+ CHECK_EQ(value, 47);+ CHECK(!parseOptionText(*def, "1.5", &value));+ CHECK_EQ(value, 47);+ }+ const OptionDef *reflection = findOptionDef("WaterReflectionEnabled");+ CHECK(reflection != NULL);+ if (reflection) {+ UserPreferences pref;+ pref["WaterReflectionEnabled"] = "true";+ loadOptionsFromPreferences(pref);+ CHECK_EQ(reflection->get(), 1);+ pref["WaterReflectionEnabled"] = "invalid";+ loadOptionsFromPreferences(pref);+ CHECK_EQ(reflection->get(), 0);+ Int value = 47;+ CHECK(!parseOptionText(*reflection, "invalid", &value));+ CHECK_EQ(value, 47);+ }++ delete scratch;+ TheWritableGlobalData = saved;+}+++TEST(modern_water_reflection_detail_is_retained_while_scene_reflections_are_off)+{+ const OptionDef *detail = findOptionDef("WaterReflectionDetail");+ CHECK(detail != NULL);+ if (!detail) return;+ CHECK_STR(detail->labelKey, "GUI:WaterReflectionDetail");+ CHECK(findGraphicsQualityRow("ComboBoxWaterReflectionDetail") != NULL);++ GlobalData *saved = TheWritableGlobalData;+ GlobalData *scratch = NEW GlobalData;+ TheWritableGlobalData = scratch;+ scratch->m_waterStyle = 0;+ scratch->m_waterReflectionEnabled = FALSE;+ scratch->m_waterReflection = 2;+ detail->set(0);+ UserPreferences preferences;+ saveOptionsToPreferences(preferences);+ CHECK_STR(preferences["WaterReflectionDetail"].str(), "0");+ detail->set(1);+ loadOptionsFromPreferences(preferences);+ CHECK_EQ(scratch->m_waterReflectionDetail, 0);+ CHECK_EQ(scratch->m_waterStyle, 0);+ CHECK(!scratch->m_waterReflectionEnabled);+ CHECK_EQ(scratch->m_waterReflection, 2);+ UserPreferences missing;+ loadOptionsFromPreferences(missing);+ CHECK_EQ(scratch->m_waterReflectionDetail, 0); // absent keys do not overwrite an existing choice++ delete scratch;+ TheWritableGlobalData = saved;+}++TEST(modern_water_quality_slider_high_is_the_sdl_default_and_low_is_modern_low)+{+ const GraphicsQualityRow *reflections = findGraphicsQualityRow("CheckWaterReflectionEnabled");+ const GraphicsQualityRow *refraction = findGraphicsQualityRow("ComboBoxWaterRefractionQuality");+ const GraphicsQualityRow *waves = findGraphicsQualityRow("ComboBoxWaterFftResolution");+ const GraphicsQualityRow *detail = findGraphicsQualityRow("ComboBoxWaterReflectionDetail");+ CHECK(reflections && refraction && waves && detail);+ if (!reflections || !refraction || !waves || !detail) return;+ // The reflection mode is a look chosen independently of quality.+ CHECK(findGraphicsQualityRow("ComboBoxWaterReflection") == NULL);++ GlobalData *saved = TheWritableGlobalData;+ GlobalData *scratch = NEW GlobalData;+ TheWritableGlobalData = scratch;++ const Int high = TheGraphicsQualityAnchors[STATIC_GAME_LOD_HIGH];+ CHECK_EQ(reflections->values[high], scratch->m_waterReflectionEnabled ? 1 : 0);+ CHECK_EQ(refraction->values[high], scratch->m_waterRefractionQuality);+ CHECK_EQ(waves->values[high], scratch->m_waterFftResolution);+ CHECK_EQ(detail->values[high], scratch->m_waterReflectionDetail);++ const Int low = TheGraphicsQualityAnchors[STATIC_GAME_LOD_LOW];+ CHECK_EQ(reflections->values[low], 0);+ CHECK_EQ(refraction->values[low], 2);+ CHECK_EQ(waves->values[low], 0);+ CHECK_EQ(detail->values[low], 0);++ // Upstream loads explicit preferences only; a preset name/slider position does not replace+ // absent water keys. The menu writes the selected preset's water rows as explicit keys.+ UserPreferences pref;+ pref["StaticGameLOD"] = "Low";+ pref["GraphicsQuality"] = "0";+ pref["WaterFftResolution"] = "1";+ loadOptionsFromPreferences(pref);+ CHECK(scratch->m_waterReflectionEnabled);+ CHECK_EQ(scratch->m_waterRefractionQuality, 0);+ CHECK_EQ(scratch->m_waterReflectionDetail, 1);+ CHECK_EQ(scratch->m_waterFftResolution, 1);+ pref["WaterReflectionEnabled"] = "no";+ pref["WaterRefractionQuality"] = "2";+ pref["WaterReflectionDetail"] = "0";+ loadOptionsFromPreferences(pref);+ CHECK(!scratch->m_waterReflectionEnabled);+ CHECK_EQ(scratch->m_waterRefractionQuality, 2);+ CHECK_EQ(scratch->m_waterReflectionDetail, 0);+ CHECK_EQ(scratch->m_waterFftResolution, 1);+ CHECK_EQ(scratch->m_waterReflection, 2); // the mode is left as it was++ delete scratch;+ TheWritableGlobalData = saved;+}+TEST(cloud_style_defaults_to_classic_and_preserves_an_explicit_volumetric_choice){GlobalData *saved = TheWritableGlobalData;@@ -19703,7 +19960,9 @@ TEST(graphics_quality_slider_only_ever_turns_settings_up)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 ] );+ CHECK( strcmp( quality.control, "ComboBoxWaterRefractionQuality" ) == 0+ ? quality.values[ step ] <= quality.values[ step - 1 ]+ : quality.values[ step ] >= quality.values[ step - 1 ] );}// Modern water is opt-in: a preset gave it to the sea of the main menu's shell map at 11 to 45 ms a passCHECK( findGraphicsQualityRow( "ComboBoxWaterStyle" ) == NULL );diff --git a/GeneralsMD/Code/Tests/test_posix_draw_resolve.cpp b/GeneralsMD/Code/Tests/test_posix_draw_resolve.cppindex f174510de..7463f794a 100644--- a/GeneralsMD/Code/Tests/test_posix_draw_resolve.cpp+++ b/GeneralsMD/Code/Tests/test_posix_draw_resolve.cpp@@ -304,6 +304,13 @@ static void check_constants(PosixDevice9 *device)inverse = inverse && fabs(identity - (r == c ? 1.0 : 0.0)) < 0.0001;}CHECK(inverse);+ // The uploaded forward projection replaces the per-pixel inverse in SSR. Verify it against+ // the independently calculated view/projection, not a second call to the inverse helper.+ for (int r = 0; r < 4; ++r) for (int c = 0; c < 4; ++c) {+ double forward = 0;+ for (int j = 0; j < 4; ++j) forward += view[r][j] * projection[j][c];+ CHECK(near_value(water.ClipFromWorld[r * 4 + c], forward));+ }CHECK(near_value(water.CameraPosition[0], -20) && near_value(water.CameraPosition[1], 10)&& near_value(water.CameraPosition[2], -30));CHECK(memcmp(&water.Combiner, &pixel, sizeof(pixel)) == 0);@@ -329,7 +336,7 @@ static void check_constants(PosixDevice9 *device)CHECK(memcmp(water.HullData,hull_registers[1],sizeof(water.HullData))==0);// The optional foam contour is a distinct tail, never a replacement for the mean hull used// by displacement. Exercise every register, including the twelfth vertex of hull eight.- CHECK(sizeof(water)==186*16 && offsetof(SdlWaterPixelConstants,ContactHullData)==100*16);+ CHECK(sizeof(water)==190*16 && offsetof(SdlWaterPixelConstants,ContactHullData)==100*16);float contact_registers[80][4]={};for(int r=0;r<80;++r)for(int c=0;c<4;++c)contact_registers[r][c]=-float(r*4+c)-0.75f;CHECK(device->SetPixelShaderConstantF(96,&contact_registers[0][0],80)==D3D_OK);@@ -368,7 +375,7 @@ static void check_constants(PosixDevice9 *device)// 186-register native vertex prefix or copying the reserved engine-register gap into metadata.using namespace WaterHullVisualLayout;CHECK(PosixDevice9::PIXEL_SHADER_CONSTANT_COUNT==896);- CHECK(sizeof(SdlWaterVisualPixelConstants)==194*16 && offsetof(SdlWaterVisualPixelConstants,VisualHullMeta)==186*16);+ CHECK(sizeof(SdlWaterVisualPixelConstants)==198*16 && offsetof(SdlWaterVisualPixelConstants,VisualHullMeta)==190*16);CHECK(VertexCommonRegisters==186 && FragmentCommonRegisters==194);CHECK(BlockOffset(0)==0 && BlockOffset(1)==256 && BlockOffset(2)==512);CHECK(BlockRegisters(0)==256 && BlockRegisters(1)==256 && BlockRegisters(2)==192);diff --git a/GeneralsMD/Code/Tests/test_sdl_gpu_frame.cpp b/GeneralsMD/Code/Tests/test_sdl_gpu_frame.cppindex 6ee13ecd2..984fb0cab 100644--- a/GeneralsMD/Code/Tests/test_sdl_gpu_frame.cpp+++ b/GeneralsMD/Code/Tests/test_sdl_gpu_frame.cpp@@ -44,6 +44,7 @@#include <limits>#include "Platform/WaterFftSpectrum.h"#include "Platform/WaterFftSampling.h"+#include "Platform/WaterPerformanceSettings.h"#include "Platform/WaterFoamShading.h"#include "Platform/WaterFoamEnvironment.h"#include "Platform/WaterShoreFoam.h"@@ -410,6 +411,26 @@ static void check_scene_depth(SdlGpuFrame *frame)object.Draw(scene, 0.05f);CHECK(frame->Read_Back(frame->Scene_Depth(scene), scene.Width, scene.Height, colour));CHECK(colour == sampled);+ // A declared depth-only water boundary must skip colour allocation/copy, retain+ // the frozen original depth after later draws, and reject a late colour request.+ frame->Set_Target(intermediate);frame->Clear_Back_Buffer(true,true,true,0xFF204060,.75f,0);+ const auto coloursBefore=frame->Water_Colour_Captures(),depthsBefore=frame->Water_Depth_Captures();+ const auto savedSettings=WaterPerformanceSettings::Applied();+ WaterPerformanceSettings::Applied().sceneColourRequired=false;+ CHECK(frame->Scene_Depth(intermediate)!=NULL);+ WaterPerformanceSettings::Applied()=savedSettings;+ CHECK(frame->Water_Colour_Captures()==coloursBefore && frame->Water_Depth_Captures()==depthsBefore+1);+ CHECK(frame->Water_Background(intermediate)==NULL);+ object.Draw(intermediate,.12f);CHECK(frame->Flush());+ CHECK(frame->Water_Depth(intermediate)==intermediate_depth);+ CHECK(frame->Read_Back(intermediate_depth,23,17,colour));+ CHECK(fabs(depth_at(colour,23,11,8)-.75f)<.00001f);+ CHECK(frame->Water_Colour_Captures()==coloursBefore && frame->Water_Background(intermediate)==NULL);+ frame->Clear_Back_Buffer(true,true,true,0xFF102030,.6f,0);+ frame->Prepare_Water_Snapshot(intermediate,true,false);+ CHECK(frame->Water_Colour_Captures()==coloursBefore+1 && frame->Water_Depth_Captures()==depthsBefore+1);+ CHECK(frame->Water_Depth(intermediate)==NULL && frame->Ready_Scene_Depth(intermediate,readySerial)==NULL && readySerial==0);+ CHECK(frame->Water_Background(intermediate)!=NULL);// Depth-only clear invalidates the pair, then release source handles with a capture still queued.frame->Set_Target(intermediate);frame->Clear_Back_Buffer(false, true, false, 0, 0.7f, 0);@@ -2101,7 +2122,7 @@ float4 main(float4 position:SV_Position):SV_Target0 {static std::vector<float> read_ocean(SdlGpuFrame *frame,unsigned mip=0){SDL_GPUTexture *textures[6];for(unsigned i=0;i<6;++i) textures[i]=frame->Ocean_Map(i);- return read_float_targets(frame,textures,6,WaterFftSpectrum::Resolution>>mip,WaterFftSpectrum::Resolution>>mip,mip);+ return read_float_targets(frame,textures,6,frame->Ocean_Configuration().resolution>>mip,frame->Ocean_Configuration().resolution>>mip,mip);}using OceanMipReference=std::array<std::vector<double>,WaterFftSpectrum::Phases+1>;@@ -2206,7 +2227,7 @@ static void check_gpu_water_vertex_uniform_order(SdlGpuFrame *frame)const unsigned contactRegister=offsetof(SdlWaterPixelConstants,ContactHullData)/16;const unsigned lastContactRegister=contactRegister+79;const unsigned fillRegister=offsetof(SdlWaterPixelConstants,FoamFillLights)/16;- CHECK(contactRegister==100 && fillRegister==180 && sizeof(SdlWaterPixelConstants)==186*16);+ CHECK(contactRegister==100 && fillRegister==180 && sizeof(SdlWaterPixelConstants)==190*16);std::string block="cbuffer WaterBlock : register(b1,space1) { float4 Water[";block+=std::to_string(sizeof(SdlWaterPixelConstants)/16)+"]; };\n";const std::string output="struct Output { float4 Position:SV_Position; [[vk::location(0)]] float4 Value:TEXCOORD0; };\n";@@ -2326,11 +2347,11 @@ static void check_gpu_water_visual_uniform_order(SdlGpuFrame *frame)const unsigned width=PacketRegisters+MaxHulls,rows=8;const char *output="struct Output { float4 Position:SV_Position; [[vk::location(0)]] float4 Value:TEXCOORD0; };\n";const char *position="Output o;o.Position=float4(id==1?3.0:-1.0,id==2?3.0:-1.0,0,1);";- std::string vs=std::string(output)+WaterFftSampling::UniformSource("WaterVertex",1)++ std::string vs=std::string(output)+WaterFftSampling::UniformSource("WaterVertex",1,false,true)+"cbuffer FixedBlock:register(b0){float4 Fixed;};\n"+"Output main(uint id:SV_VertexID){"+position+"o.Value=float4(WaterParameters.x,ContactHullData[79].w,FoamFillLights[3].z,1)+Fixed;return o;}\n";- std::string ps=WaterFftSampling::UniformSource("WaterFragment",0,true)+R"HLSL(+ std::string ps=WaterFftSampling::UniformSource("WaterFragment",0,true,true)+R"HLSL(float4 main(float4 position:SV_Position,[[vk::location(0)]] float4 value:TEXCOORD0):SV_Target0 {int x=(int)position.x;if(x<704) {@@ -2444,7 +2465,7 @@ float4 main(float4 position:SV_Position,[[vk::location(0)]] float4 value:TEXCOORif(waterRows[row] && state && (x==256 || x==512))armedBoundary+=std::abs(actual-(expected-1024))>100;}CHECK(matched && armedLatest>0 && armedBoundary>0);- printf("sdl_gpu_frame_selfcheck: visual hull transport: all704 packet float4s +8 metadata, PS slots0..3, 186-register VS alias and 194-register PS common, queued A/B/zero, non-water, clear, new batch, resize; max error %.9g, armed %u/%u\n",maxError,armedLatest,armedBoundary);+ printf("sdl_gpu_frame_selfcheck: visual hull transport: all704 packet float4s +8 metadata, PS slots0..3, 190-register VS alias and 198-register PS common, queued A/B/zero, non-water, clear, new batch, resize; max error %.9g, armed %u/%u\n",maxError,armedLatest,armedBoundary);}static void check_gpu_water_visual_query(SdlGpuFrame *frame)@@ -2454,7 +2475,7 @@ static void check_gpu_water_visual_query(SdlGpuFrame *frame)using namespace WaterHullVisualLayout;const unsigned width=MaxHulls*3,rows=27;const char *vs="float4 main(uint id:SV_VertexID):SV_Position{return float4(id==1?3.0:-1.0,id==2?3.0:-1.0,0,1);}";- std::string ps=WaterFftSampling::UniformSource("WaterQuery",0,true)+WaterHullVisual::Source()+R"HLSL(+ std::string ps=WaterFftSampling::UniformSource("WaterQuery",0,true,true)+WaterHullVisual::Source()+R"HLSL(float4 main(float4 position:SV_Position):SV_Target0 {int column=(int)position.x,hull=column/3;float scale=1.0+0.25*hull;@@ -2661,7 +2682,7 @@ float2 oceanMeshHullEffects(float3 world,float level,float time,float offshore,if(current.empty()||previous.empty())return;const unsigned samplesX=25,samplesY=7,width=samplesX*2;const char *vs="float4 main(uint id:SV_VertexID):SV_Position{return float4(id==1?3.0:-1.0,id==2?3.0:-1.0,0,1);}";- std::string ps=WaterFftSampling::UniformSource("WaterEffects",0,true)+WaterFftSampling::CommonSource()++ std::string ps=WaterFftSampling::UniformSource("WaterEffects",0,true,true)+WaterFftSampling::CommonSource()+production.substr(noiseBegin,noiseEnd-noiseBegin)+WaterHullContactFoam::Source()+contact+WaterHullVisual::Source()+sharedContact+previous+current+R"HLSL(float4 main(float4 pixel:SV_Position):SV_Target0 {@@ -2810,7 +2831,7 @@ static void check_gpu_foam_history_upload(SdlGpuFrame *frame)// catches binding truncation; changing a used image before submitting catches upload hazards.const unsigned width=8,tileHeight=4,rows=tileHeight*4;const char *vs="float4 main(uint id:SV_VertexID):SV_Position {return float4(id==1?3.0:-1.0,id==2?3.0:-1.0,0,1);}";- std::string ps=WaterFftSampling::UniformSource("WaterBlock",0)+R"HLSL(+ std::string ps=WaterFftSampling::UniformSource("WaterBlock",0,false,true)+R"HLSL(Texture2D History:register(t14);SamplerState HistorySampler:register(s14);float4 main(float4 pixel:SV_Position):SV_Target0 {float2 uv=float2(pixel.x/8.0,frac(pixel.y/4.0));@@ -2911,7 +2932,7 @@ static void check_gpu_foam_history_tiles(SdlGpuFrame *frame)add(.5f,-1.f/32);add(.5f,33.f/32);add(.5f,.5f,8);add(.5f,.5f,7,12);const unsigned count=unsigned(queries.size()),bands=9,rows=count*bands;const char *vs="float4 main(uint id:SV_VertexID):SV_Position{return float4(id==1?3.0:-1.0,id==2?3.0:-1.0,0,1);}";- std::string ps=WaterFftSampling::UniformSource("WaterBlock",0)++ std::string ps=WaterFftSampling::UniformSource("WaterBlock",0,false,true)+"Texture2D<float4> Legacy:register(t13);Texture2D<float4> Texture14:register(t14);SamplerState Sampler14:register(s14);\n""cbuffer TileQueries:register(b1){float4 Queries["+std::to_string(count)+"];};\n"+WaterFoamShading::HistorySamplingSource()+WaterShoreFoam::HistorySource()+@@ -3087,7 +3108,7 @@ static void check_gpu_foam_history_sampling(SdlGpuFrame *frame)const size_t changed=oldHistory.find(replacement);CHECK(changed!=std::string::npos);if(changed==std::string::npos)return;oldHistory.erase(changed,replacement.size());oldHistory.replace(oldHistory.find("waterFoamHistory("),strlen("waterFoamHistory("),"frozenHistory(");- std::string ps=WaterFftSampling::UniformSource("WaterBlock",0)++ std::string ps=WaterFftSampling::UniformSource("WaterBlock",0,false,true)+"Texture2D Texture14:register(t14);SamplerState Sampler14:register(s14);\n"+"cbuffer QueryBlock:register(b1){float4 Queries["+std::to_string(rows)+"];};\n"+production.substr(noiseStart,noiseEnd-noiseStart)+WaterFoamShading::HistorySamplingSource()+WaterFoamShading::Source()+oldHistory+@@ -4165,6 +4186,14 @@ Result main(float4 pixel:SV_Position) {#endif // __linux__#if defined(__linux__)+static std::string water_scene_reflection_define(const std::string &production)+{+ const size_t begin=production.find("#define WATER_SCENE_REFLECTIONS ");+ const size_t end=production.find('\n',begin);+ CHECK(begin!=std::string::npos && end!=std::string::npos);+ return begin!=std::string::npos && end!=std::string::npos?production.substr(begin,end-begin+1):std::string();+}+static void check_gpu_foam_material(SdlGpuFrame *frame){// Execute the actual material helpers and the emitted production integration block. A@@ -4224,7 +4253,7 @@ static void check_gpu_foam_material(SdlGpuFrame *frame)integrationStart=production.find("float3 vesselRadiance=vesselDiffuse;"),integrationEnd=production.find("float4 current;",integrationStart);CHECK(lightingStart!=std::string::npos && lightingEnd>lightingStart && integrationStart!=std::string::npos && integrationEnd>integrationStart);if(lightingStart==std::string::npos || lightingEnd<=lightingStart || integrationStart==std::string::npos || integrationEnd<=integrationStart)return;- std::string ps="Texture2D Texture1:register(t1);SamplerState Sampler1:register(s1);\n"+ std::string ps=water_scene_reflection_define(production)+"Texture2D Texture1:register(t1);SamplerState Sampler1:register(s1);\n""struct Query{float4 uv;float4 mapping;float4 sky;float4 diffuse;float4 incident;float4 clear;float4 crest;float4 material;};\n""cbuffer QueriesBlock:register(b0){Query Queries["+std::to_string(rows)+"];};\n"+production.substr(lightingStart,lightingEnd-lightingStart)+WaterFoamShading::MaterialSource()+@@ -4401,7 +4430,7 @@ static void check_gpu_coastal_material(SdlGpuFrame *frame)if(lightStart==std::string::npos || lightEnd<=lightStart || start==std::string::npos || end<=start)return;const std::string lighting=WaterFoamShading::Source();const size_t lightingEnd=lighting.find("// Cubic bilinear value noise");CHECK(lightingEnd!=std::string::npos);if(lightingEnd==std::string::npos)return;- std::string ps="Texture2D Texture1:register(t1);SamplerState Sampler1:register(s1);\n"+ std::string ps=water_scene_reflection_define(production)+"Texture2D Texture1:register(t1);SamplerState Sampler1:register(s1);\n""struct Query{float4 normal;float4 light;float4 ambient;float4 sun;float4 fillDirection1;float4 fillColour1;""float4 fillDirection2;float4 fillColour2;float4 clear;float4 foam;float4 material;float4 sky;float4 edge;float4 fog;};\n""cbuffer QueriesBlock:register(b0){Query Queries["+std::to_string(rows)+"];};\n"+@@ -4571,7 +4600,7 @@ static void check_gpu_vessel_hull_damping(SdlGpuFrame *frame)add(23,10,7,.95f,.8f,-.004f,.001f,-.003f,.004f);add(80,23,7,.7f,.4f,.003f,-.002f,.004f,.006f); // inside the rotated hullconst unsigned rows=unsigned(fixtures.size()),columns=3;- std::string common=WaterFftSampling::UniformSource("WaterBlock",0)+WaterVesselWaves::Source()++ std::string common=WaterFftSampling::UniformSource("WaterBlock",0,false,true)+WaterVesselWaves::Source()+"cbuffer FixtureBlock:register(b1) {float4 Point;float4 FreeDamping;float4 Offshore;};\n";std::string vs=common+R"HLSL(struct Output {float4 Position:SV_Position;[[vk::location(0)]] float3 Value:TEXCOORD0;};@@ -4679,7 +4708,7 @@ static void check_gpu_water_wave_cage(SdlGpuFrame *frame)} r;r.device=frame->Device();VertexPipelineDescription vd={};vd.FVF=FF_FVF_XYZ|FF_FVF_NORMAL|FF_FVF_DIFFUSE|FF_FVF_TEX2;vd.StageCount=4;vd.Stages[0].TextureCoordinateIndex=0;vd.Stages[1].TextureCoordinateIndex=1;- std::string vs;CHECK(VertexShader_Generate(vd,VERTEX_SHADER_TARGET_D3D11,vs));CHECK(WaterFftSampling::WrapVertex(vs));+ std::string vs;CHECK(VertexShader_Generate(vd,VERTEX_SHADER_TARGET_D3D11,vs));CHECK(WaterFftSampling::WrapVertex(vs,true));CHECK(SDL3_Shader_Retarget(vs,true));const std::string entry="Output main(Input input)";const size_t at=vs.find(entry);CHECK(at!=std::string::npos);if(at==std::string::npos)return;vs.replace(at,entry.size(),"Output cageWaterVertex(Input input)");@@ -4702,7 +4731,7 @@ CageProbe main(uint id:SV_VertexID) {const size_t fixtureAt=vs.find("cbuffer Fixture:register(b2)");CHECK(fixtureAt!=std::string::npos);if(fixtureAt==std::string::npos)return;vs.replace(fixtureAt,strlen("cbuffer Fixture:register(b2)"),"cbuffer Fixture:register(b2,space1)");std::string pixelFixture=fixture;pixelFixture.replace(pixelFixture.find("register(b2)"),strlen("register(b2)"),"register(b1)");- std::string ps=WaterFftSampling::UniformSource("WaterBlock",0)+pixelFixture+R"HLSL(+ std::string ps=WaterFftSampling::UniformSource("WaterBlock",0,false,true)+pixelFixture+R"HLSL(Texture2D Texture2:register(t2);SamplerState Sampler2:register(s2);)HLSL"+WaterFftSampling::CommonSource()+WaterWaveCageShader::Source(false)+R"HLSL(struct CageProbe {float4 Position:SV_Position;float4 Displacement:TEXCOORD0;};@@ -4849,7 +4878,7 @@ static void check_gpu_water_hull_normal(SdlGpuFrame *frame)if(!observe_water_normal(ps)) return;VertexPipelineDescription vd={};vd.FVF=FF_FVF_XYZ|FF_FVF_NORMAL|FF_FVF_DIFFUSE|FF_FVF_TEX2;vd.StageCount=4;vd.Stages[0].TextureCoordinateIndex=0;vd.Stages[1].TextureCoordinateIndex=1;- std::string vs;CHECK(VertexShader_Generate(vd,VERTEX_SHADER_TARGET_D3D11,vs));CHECK(WaterFftSampling::WrapVertex(vs));+ std::string vs;CHECK(VertexShader_Generate(vd,VERTEX_SHADER_TARGET_D3D11,vs));CHECK(WaterFftSampling::WrapVertex(vs,true));CHECK(SDL3_Shader_Retarget(vs,true));const std::string entry="Output main(Input input)";const size_t at=vs.find(entry);CHECK(at!=std::string::npos);if(at==std::string::npos)return;vs.replace(at,entry.size(),"Output hullFixtureWaterVertex(Input input)");@@ -5114,7 +5143,7 @@ static void check_gpu_water_bow_refinement(SdlGpuFrame *frame)} r;r.device=frame->Device();VertexPipelineDescription vd={};vd.FVF=FF_FVF_XYZ|FF_FVF_NORMAL|FF_FVF_DIFFUSE|FF_FVF_TEX2;vd.StageCount=4;vd.Stages[0].TextureCoordinateIndex=0;vd.Stages[1].TextureCoordinateIndex=1;- std::string vs;CHECK(VertexShader_Generate(vd,VERTEX_SHADER_TARGET_D3D11,vs));CHECK(WaterFftSampling::WrapVertex(vs));+ std::string vs;CHECK(VertexShader_Generate(vd,VERTEX_SHADER_TARGET_D3D11,vs));CHECK(WaterFftSampling::WrapVertex(vs,true));// Retarget the actual Input entry before replacing it with the procedural fixture.CHECK(SDL3_Shader_Retarget(vs,true));const std::string entry="Output main(Input input)";const size_t at=vs.find(entry);CHECK(at!=std::string::npos);if(at==std::string::npos)return;@@ -5346,7 +5375,7 @@ static void check_gpu_fft_vessel_composition(SdlGpuFrame *frame)};CHECK(frame->Flush());if(!upload()) return;const std::string basicVS="float4 main(uint id:SV_VertexID):SV_Position {return float4(id==1?3.0:-1.0,id==2?3.0:-1.0,0,1);}";- std::string sampleVS=WaterFftSampling::UniformSource("WaterBlock",0)+WaterFftSampling::VertexSource()+R"HLSL(+ std::string sampleVS=WaterFftSampling::UniformSource("WaterBlock",0,false,true)+WaterFftSampling::VertexSource()+R"HLSL(cbuffer PointBlock:register(b1) {float4 PointData;};struct Output {float4 Position:SV_Position;[[vk::location(0)]] float4 Value:TEXCOORD0;[[vk::location(1)]] nointerpolation float4 Registered:TEXCOORD1;};Output main(uint id:SV_VertexID) {Output o;o.Position=float4(id==1?3.0:-1.0,id==2?3.0:-1.0,0,1);@@ -5354,7 +5383,7 @@ o.Value=float4(fftVertexDisplacement(PointData.xy,PointData.z),1);o.Registered=float4(fftVertexDisplacement(PointData.xy,PointData.z,.559713426),1);return o;})HLSL";std::string samplePS="float4 main(float4 pixel:SV_Position,[[vk::location(0)]] float4 value:TEXCOORD0,[[vk::location(1)]] nointerpolation float4 registered:TEXCOORD1):SV_Target0 {return pixel.x>=30.0?registered:value;}";- std::string surfacePS=WaterFftSampling::UniformSource("WaterBlock",0);+ std::string surfacePS=WaterFftSampling::UniformSource("WaterBlock",0,false,true);for(unsigned i=0;i<6;++i) surfacePS+="Texture2D Texture"+std::to_string(8+i)+":register(t"+std::to_string(i)+");SamplerState Sampler"+std::to_string(8+i)+":register(s"+std::to_string(i)+");\n";surfacePS+="cbuffer PointBlock:register(b1) {float4 Points["+std::to_string(rows)+"];};\n";surfacePS+=WaterFftSampling::PixelSource();@@ -5958,9 +5987,9 @@ if(col==44) {// Direct O(N^2) Fourier sum at a few points: deliberately independent of GPU butterfly ordering,// bit reversal, .5-per-phase normalization and checkerboard postprocessing. Complex-pair packing// also verifies all four channels, not just a visually plausible height map.-static void direct_ocean(const std::vector<float>& initial,unsigned cascade,double px,double py,double time,double out[8])+static void direct_ocean(const std::vector<float>& initial,unsigned cascade,double px,double py,double time,double out[8],unsigned n=WaterFftSpectrum::Resolution){- using C=std::complex<double>;const unsigned n=WaterFftSpectrum::Resolution;+ using C=std::complex<double>;C sums[4]={},unpacked[8]={};const C imaginary(0,1);for(unsigned y=0;y<n;++y) for(unsigned x=0;x<n;++x) {const double kx=2*WaterFftSpectrum::Pi*(int(x)-int(n/2))/WaterFftSpectrum::Sizes[cascade];@@ -5987,7 +6016,7 @@ static void direct_ocean(const std::vector<float>& initial,unsigned cascade,doub}}-static void check_fft_spectral_reality(const std::vector<float>& initial)+static void check_fft_spectral_reality(const std::vector<float>& initial,unsigned Resolution=WaterFftSpectrum::Resolution){using namespace WaterFftSpectrum;using C=std::complex<double>;auto height=[&](const std::vector<float>& data,unsigned cascade,unsigned x,unsigned y,double time) {@@ -6139,6 +6168,162 @@ float2 uv=float2(0,0);output.Value=float4(A.SampleLevel(SA,uv,2.375).y,B.SampleL}// B, G, R and A of pixel (x, y) in the gamma test's picture: no two pixels alike, no channel alike.+static void check_gpu_fft_quality_switch(SdlGpuFrame *frame)+{+ using namespace WaterFftSpectrum;+ CHECK(frame->Present(NULL));CHECK(frame->Prepare_Ocean(2.25f,256));+ const auto high=read_ocean(frame);SDL_GPUTexture *old=frame->Ocean_Map(0);+ SDL_GPUTextureCreateInfo info={};info.type=SDL_GPU_TEXTURETYPE_2D;+ info.format=SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT;+ info.usage=SDL_GPU_TEXTUREUSAGE_COLOR_TARGET|SDL_GPU_TEXTUREUSAGE_SAMPLER;+ info.width=info.height=256;info.layer_count_or_depth=info.num_levels=1;+ SDL_GPUTexture *reader=SDL_CreateGPUTexture(frame->Device(),&info);CHECK(reader);+ CHECK(frame->Present(NULL));+ const int32_t rect[4]={0,0,256,256};frame->Record_Blit(old,rect,reader,rect,false);+ CHECK(frame->Prepare_Ocean(2.25f,128));+ CHECK(frame->Ocean_Configuration().resolution==128 && frame->Ocean_Configuration().levels==8);+ CHECK(frame->Ocean_Map(0)!=old);+ const auto preserved=read_float_targets(frame,&reader,1,256,256);+ CHECK(preserved.size()==256*256*4 && std::equal(preserved.begin(),preserved.end(),high.begin()));+ SDL_ReleaseGPUTexture(frame->Device(),reader);+ const auto low=read_ocean(frame),initial=InitialSpectrum(ForResolution(128));+ CHECK(low.size()==6*128*128*4);check_fft_spectral_reality(initial,128);+ double maximum=0;+ for(unsigned c=0;c<3;++c) for(auto xy:{std::array<unsigned,2>{0,0},{17,53},{64,64},{127,7}}) {+ double expected[8];direct_ocean(initial,c,xy[0],xy[1],2.25,expected,128);+ for(unsigned channel=0;channel<8;++channel) {+ const double actual=low[((c*2+channel/4)*128*128+xy[1]*128+xy[0])*4+channel%4];+ const double error=std::abs(actual-expected[channel]);maximum=(std::max)(maximum,error);+ CHECK(std::isfinite(actual) && error<.001+std::abs(expected[channel])*.0001);+ }+ }+ for(unsigned level=1;level<8;++level) {+ const auto mip=read_ocean(frame,level);const unsigned side=128>>level,block=1u<<level;+ for(unsigned map=0;map<6;++map) for(unsigned channel=0;channel<4;++channel) {+ double sum=0;for(unsigned y=0;y<block;++y) for(unsigned x=0;x<block;++x) sum+=low[(map*128*128+y*128+x)*4+channel];+ CHECK(std::abs(mip[map*side*side*4+channel]-sum/(block*block))<.00001);+ }+ }+ const auto updates=frame->Ocean_Updates();CHECK(frame->Prepare_Ocean(2.25f,256));+ CHECK(frame->Ocean_Configuration().resolution==128 && frame->Ocean_Updates()==updates);+ CHECK(frame->Present(NULL));CHECK(frame->Prepare_Ocean(2.25f,256));+ CHECK(frame->Ocean_Configuration().resolution==256 && frame->Ocean_Updates()==updates+1);+ CHECK(read_ocean(frame)==high);+ CHECK(frame->Present(NULL));CHECK(frame->Prepare_Ocean(2.25f,128));+ CHECK(read_ocean(frame)==low);+ const auto beforeFailure=frame->Ocean_Updates();SDL_GPUTexture *lowTexture=frame->Ocean_Map(0);+ CHECK(frame->Present(NULL));frame->Fail_Next_Ocean_Rebuild_For_Test();+ CHECK(frame->Prepare_Ocean(2.25f,256));+ CHECK(frame->Ocean_Configuration().resolution==128 && frame->Ocean_Map(0)==lowTexture);+ CHECK(frame->Ocean_Updates()==beforeFailure && read_ocean(frame)==low);+ // A failed request is latched to avoid retrying allocation every frame; toggling+ // away and back explicitly retries it, preserving paused simulation time.+ CHECK(frame->Present(NULL));CHECK(frame->Prepare_Ocean(2.25f,256));+ CHECK(frame->Ocean_Configuration().resolution==128 && frame->Ocean_Updates()==beforeFailure);+ CHECK(frame->Prepare_Ocean(2.25f,128));+ CHECK(frame->Present(NULL));CHECK(frame->Prepare_Ocean(2.25f,256));+ CHECK(frame->Ocean_Configuration().resolution==256 && read_ocean(frame)==high);+ printf("sdl_gpu_frame_selfcheck: FFT128 direct Fourier max %.9g; all mip extents, queued old reader, same-time boundary switches and deterministic restoration checked\n",maximum);+}++static void check_gpu_water_opaque_alpha(SdlGpuFrame *frame)+{+ // Execute each generated program's actual final coverage block, then actual+ // source-alpha blending. Fractional authored and arriving vertex alpha must+ // not leak the destination through opaque refraction; shore coverage remains.+ struct Restore { WaterPerformanceSettings::Configuration saved=WaterPerformanceSettings::Applied();+ ~Restore(){WaterPerformanceSettings::Applied()=saved;} } restore;+ const unsigned width=12,height=1;+ const float fixtures[width][8]={+ {.35f,.4f,1,1, 0,0,0,0},{.35f,.4f,1,1, 1,0,0,0},+ {.35f,.4f,.25f,1, 0,0,0,0},{.35f,.4f,.25f,1, 1,0,0,0},+ {.35f,.4f,1,.125f, 0,0,0,0},{.35f,.4f,1,.125f, 1,0,0,0},+ {0,.4f,1,1, 0,0,0,0},{0,.4f,1,1, 1,0,0,0},+ {.35f,0,1,1, 0,0,0,0},{.35f,0,1,1, 1,0,0,0},+ {.0005f,.4f,1,1, 0,0,0,0},{.0005f,.4f,1,1, 1,0,0,0}};+ struct Resources {+ SDL_GPUDevice *device;SDL_GPUShader *vertex=NULL,*pixel=NULL;+ SDL_GPUGraphicsPipeline *pipelines[2]={};SDL_GPUTexture *base=NULL,*edge=NULL,*targets[2]={};SDL_GPUSampler *sampler=NULL;+ void resetProgram(){for(auto *&p:pipelines)if(p){SDL_ReleaseGPUGraphicsPipeline(device,p);p=NULL;}+ if(pixel){SDL_ReleaseGPUShader(device,pixel);pixel=NULL;}}+ ~Resources(){resetProgram();if(vertex)SDL_ReleaseGPUShader(device,vertex);if(sampler)SDL_ReleaseGPUSampler(device,sampler);+ if(base)SDL_ReleaseGPUTexture(device,base);if(edge)SDL_ReleaseGPUTexture(device,edge);+ for(auto *t:targets)if(t)SDL_ReleaseGPUTexture(device,t);}+ } r;r.device=frame->Device();+ SDL_GPUTextureCreateInfo texture={};texture.type=SDL_GPU_TEXTURETYPE_2D;texture.format=SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT;+ texture.usage=SDL_GPU_TEXTUREUSAGE_COLOR_TARGET|SDL_GPU_TEXTUREUSAGE_SAMPLER;+ texture.width=width;texture.height=height;texture.layer_count_or_depth=texture.num_levels=1;+ r.base=SDL_CreateGPUTexture(r.device,&texture);r.edge=SDL_CreateGPUTexture(r.device,&texture);+ for(auto *&target:r.targets)target=SDL_CreateGPUTexture(r.device,&texture);+ SDL_GPUSamplerCreateInfo sampler={};sampler.min_filter=sampler.mag_filter=SDL_GPU_FILTER_NEAREST;+ sampler.address_mode_u=sampler.address_mode_v=SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE;+ r.sampler=SDL_CreateGPUSampler(r.device,&sampler);CHECK(r.base&&r.edge&&r.targets[0]&&r.targets[1]&&r.sampler);+ if(!r.base||!r.edge||!r.targets[0]||!r.targets[1]||!r.sampler)return;+ for(unsigned field=0;field<2;++field){uint32_t offset=0;float *data=(float*)frame->Upload_Space(width*16,offset);+ for(unsigned x=0;x<width;++x){data[x*4]=data[x*4+1]=data[x*4+2]=1;data[x*4+3]=fixtures[x][field?2:0];}+ frame->Queue_Texture_Upload(field?r.edge:r.base,0,width,1,offset);}+ CHECK(frame->Flush());+ const char *vs="float4 main(uint id:SV_VertexID):SV_Position{return float4(id==1?3.0:-1.0,id==2?3.0:-1.0,0,1);}";+ std::string error;std::vector<unsigned char> spirv;CHECK(SDL3_Compile_HLSL_To_SPIRV(vs,true,spirv,error));+ r.vertex=SDL3_Create_Shader(r.device,spirv,true,error);CHECK(r.vertex);if(!r.vertex)return;+ unsigned renders=0,armed=0;double maximum=0;+ for(auto program:{ENGINE_SHADER_WATER_TRAPEZOID,ENGINE_SHADER_WATER_RIVER})for(auto quality:{WaterPerformanceSettings::Full,WaterPerformanceSettings::Off}) {+ r.resetProgram();auto &settings=WaterPerformanceSettings::Applied();settings.refraction=quality;settings.sceneReflections=false;+ PixelPipelineDescription pipeline={};std::string production;+ CHECK(EngineShader_Pixel_Program(program,pipeline,production,COMBINER_SHADER_TARGET_SDL3_GPU));+ const auto start=production.find(" float4 current;");+ const auto end=production.find('\n',production.find(" current = float4",start))+1;+ const auto define=production.find("#define WATER_REFRACTION_QUALITY "),defineEnd=production.find('\n',define);+ CHECK(start!=std::string::npos&&end>start&&define!=std::string::npos&&defineEnd!=std::string::npos);+ if(start==std::string::npos||end<=start||define==std::string::npos||defineEnd==std::string::npos)return;+ std::string ps=production.substr(define,defineEnd-define+1)++ "Texture2D Texture0:register(t0,space2);SamplerState Sampler0:register(s0,space2);"+ "Texture2D Texture3:register(t3,space2);SamplerState Sampler3:register(s3,space2);"+ "cbuffer Queries:register(b0,space3){float4 F[24];};"+ "struct Input{float4 Diffuse;float2 TexCoord0;float2 TexCoord3;};"+ "float4 main(float4 pixel:SV_Position):SV_Target0{uint x=(uint)pixel.x;float4 a=F[x*2];"+ "Input input;input.Diffuse=float4(1,1,1,a.y);input.TexCoord3=float2((x+.5)/12.0,.5);"+ "input.TexCoord0=float2(input.TexCoord3.x*.5,.5);"+ "float4 base=Texture0.Sample(Sampler0,input.TexCoord3);float4 SceneParameters=F[x*2+1];"+ "float depth=a.w;float3 surface=float3(.2,.4,.6);"++ production.substr(start,end-start)+"return current;}";+ bool compiled=SDL3_Compile_HLSL_To_SPIRV(ps,false,spirv,error);CHECK(compiled);+ if(!compiled){printf("opaque alpha fixture: %s\n",error.c_str());return;}+ r.pixel=SDL3_Create_Shader(r.device,spirv,false,error);CHECK(r.pixel);if(!r.pixel)return;+ for(unsigned blend=0;blend<2;++blend){SDL_GPUColorTargetDescription colour={};colour.format=texture.format;+ colour.blend_state.enable_blend=blend;+ colour.blend_state.src_color_blendfactor=SDL_GPU_BLENDFACTOR_SRC_ALPHA;colour.blend_state.dst_color_blendfactor=SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA;+ colour.blend_state.color_blend_op=colour.blend_state.alpha_blend_op=SDL_GPU_BLENDOP_ADD;+ colour.blend_state.src_alpha_blendfactor=SDL_GPU_BLENDFACTOR_ONE;colour.blend_state.dst_alpha_blendfactor=SDL_GPU_BLENDFACTOR_ZERO;+ SDL_GPUGraphicsPipelineCreateInfo info={};info.vertex_shader=r.vertex;info.fragment_shader=r.pixel;+ info.primitive_type=SDL_GPU_PRIMITIVETYPE_TRIANGLELIST;info.target_info.color_target_descriptions=&colour;info.target_info.num_color_targets=1;+ r.pipelines[blend]=SDL_CreateGPUGraphicsPipeline(r.device,&info);CHECK(r.pipelines[blend]);if(!r.pipelines[blend])return;+ SDL_GPUCommandBuffer *commands=SDL_AcquireGPUCommandBuffer(r.device);CHECK(commands);if(!commands)return;+ SDL_GPUColorTargetInfo target={};target.texture=r.targets[blend];target.load_op=SDL_GPU_LOADOP_CLEAR;target.store_op=SDL_GPU_STOREOP_STORE;+ target.clear_color={.9f,.1f,.3f,1};SDL_GPURenderPass *pass=SDL_BeginGPURenderPass(commands,&target,1,NULL);CHECK(pass);if(!pass)return;+ SDL_BindGPUGraphicsPipeline(pass,r.pipelines[blend]);SDL_GPUTextureSamplerBinding bindings[4]={};+ for(unsigned i=0;i<4;++i){bindings[i].texture=i==3?r.edge:r.base;bindings[i].sampler=r.sampler;}+ SDL_BindGPUFragmentSamplers(pass,0,bindings,4);SDL_PushGPUFragmentUniformData(commands,0,fixtures,sizeof(fixtures));+ SDL_DrawGPUPrimitives(pass,3,1,0,0);SDL_EndGPURenderPass(pass);CHECK(SDL_SubmitGPUCommandBuffer(commands));++renders;+ }+ const auto actual=read_float_targets(frame,r.targets,2,width,1);CHECK(actual.size()==width*4*2);if(actual.size()!=width*8)return;+ const bool river=program==ENGINE_SHADER_WATER_RIVER;+ for(unsigned x=0;x<width;++x){const auto &f=fixtures[x];const double authored=f[0]*(river?1:f[1]);+ const double fullCoverage=(river?f[2]:1)*std::clamp(2.0*double(f[3]),0.0,1.0);+ const double expected=fullCoverage*((quality==WaterPerformanceSettings::Off||f[4]>0)?(authored>=.001?1:0):authored);+ for(unsigned blend=0;blend<2;++blend)for(unsigned c=0;c<4;++c){const float raw[3]={.2f,.4f,.6f},background[3]={.9f,.1f,.3f};+ const double source=c==3?expected:raw[c]*(river?f[1]:1);+ const double value=c==3||!blend?source:source*expected+background[c]*(1-expected);+ const double difference=std::abs(actual[(blend*width+x)*4+c]-value);maximum=(std::max)(maximum,difference);CHECK(difference<.000003);+ }+ if(quality==WaterPerformanceSettings::Off&&!(x&1))for(unsigned blend=0;blend<2;++blend)for(unsigned c=0;c<4;++c)+ CHECK(actual[(blend*width+x)*4+c]==actual[(blend*width+x+1)*4+c]);+ armed+=quality==WaterPerformanceSettings::Off&&f[4]==0&&authored>0&&authored<1&&fullCoverage>0;+ }+ }+ CHECK(armed>=6);printf("sdl_gpu_frame_selfcheck: opaque refraction final alpha: both production programs, %u renders, fractional base/vertex alpha, absent/present colour, zero masks, shoreline fades and actual blending; max error %.9g, %u armed old-alpha controls\n",renders,maximum,armed);+}+static void pattern(unsigned int x, unsigned int y, uint8_t out[4]){out[0] = (uint8_t)(x * 4);@@ -6832,6 +7017,8 @@ int main()check_colour_only_target(frame);check_scene_depth_snapshot(frame);check_gpu_fft_ocean(frame);+ check_gpu_fft_quality_switch(frame);+ check_gpu_water_opaque_alpha(frame);check_gpu_water_vertex_uniform_order(frame);check_gpu_modern_water_material(frame);check_gpu_water_visual_uniform_order(frame);diff --git a/GeneralsMD/Code/Tests/test_sdl_program_cache.cpp b/GeneralsMD/Code/Tests/test_sdl_program_cache.cppindex ecbb32594..3f0e5c515 100644--- a/GeneralsMD/Code/Tests/test_sdl_program_cache.cpp+++ b/GeneralsMD/Code/Tests/test_sdl_program_cache.cpp@@ -36,6 +36,7 @@#include "ffvertex.h"#include "engineshader.h"#include "Platform/EngineShaderName.h"+#include "Platform/WaterPerformanceSettings.h"#include <SDL3/SDL.h>@@ -202,6 +203,25 @@ int main()CHECK(refused_again.Shader == NULL && cache.Programs_Refused() == refused_before + 1);check_live_water_style_programs(device,cache);+ const auto savedWater=WaterPerformanceSettings::Applied();+ const SdlProgram *tiers[12]={};unsigned tier=0;PixelPipelineDescription waterPipeline={};+ for(unsigned resolution:{128u,256u}) for(unsigned refraction=0;refraction<3;++refraction) for(bool reflections:{false,true}) {+ auto &settings=WaterPerformanceSettings::Applied();settings.activeFftResolution=resolution;+ settings.refraction=WaterPerformanceSettings::Refraction(refraction);settings.sceneReflections=reflections;+ tiers[tier]=&cache.Engine_Pixel_Program(ENGINE_SHADER_WATER_TRAPEZOID,waterPipeline);+ CHECK(tiers[tier]->Shader!=NULL);+ for(unsigned prior=0;prior<tier;++prior) CHECK(tiers[prior]!=tiers[tier]);+ CHECK(&cache.Engine_Pixel_Program(ENGINE_SHADER_WATER_TRAPEZOID,waterPipeline)==tiers[tier]);++tier;+ }+ const auto builtTiers=cache.Programs_Built();tier=0;+ for(unsigned resolution:{128u,256u}) for(unsigned refraction=0;refraction<3;++refraction) for(bool reflections:{false,true}) {+ auto &settings=WaterPerformanceSettings::Applied();settings.activeFftResolution=resolution;+ settings.refraction=WaterPerformanceSettings::Refraction(refraction);settings.sceneReflections=reflections;+ CHECK(&cache.Engine_Pixel_Program(ENGINE_SHADER_WATER_TRAPEZOID,waterPipeline)==tiers[tier++]);+ }+ CHECK(cache.Programs_Built()==builtTiers);WaterPerformanceSettings::Applied()=savedWater;+ printf("sdl_program_cache_selfcheck: all 12 water quality variants cached and reused\n");+printf("sdl_program_cache_selfcheck: %s, %u programs built in %.0f ms, %u refused\n",SDL_GetGPUDeviceDriver(frame->Device()), cache.Programs_Built(), cache.Milliseconds_Compiling(),diff --git a/GeneralsMD/Code/Tests/test_shader_sdl.cpp b/GeneralsMD/Code/Tests/test_shader_sdl.cppindex 58d0ec476..6257dcba8 100644--- a/GeneralsMD/Code/Tests/test_shader_sdl.cpp+++ b/GeneralsMD/Code/Tests/test_shader_sdl.cpp@@ -74,6 +74,8 @@#include "Platform/WaterHullVisual.h"#include "Platform/WaterSurfaceModel.h"#include "Platform/WaterFftSampling.h"+#include "Platform/WaterScreenReflection.h"+#include "Platform/WaterPerformanceSettings.h"#include "Platform/WaterFoamEnvironment.h"#include "sdl3target.h"#include <limits>@@ -343,7 +345,7 @@ TEST(fft_water_vertex_and_pixel_compile_with_separate_texture_bindings)CHECK_EQ(samplers,0u);CHECK_EQ(buffers,1u);}}- CHECK(WaterFftSampling::WrapVertex(vertex));+ CHECK(WaterFftSampling::WrapVertex(vertex,true));CHECK(SDL3_Shader_Retarget(vertex,true));const size_t swap=vertex.find("input.Diffuse = input.Diffuse.bgra");CHECK(swap!=std::string::npos);@@ -403,7 +405,8 @@ const WaterUniformMember WaterUniformMembers[] = {WATER_UNIFORM_MEMBER(ContactHullData),WATER_UNIFORM_MEMBER(FoamFillLights),WATER_UNIFORM_MEMBER(MaterialColor),- WATER_UNIFORM_MEMBER(MaterialParameters)+ WATER_UNIFORM_MEMBER(MaterialParameters),+ WATER_UNIFORM_MEMBER(ClipFromWorld)};#undef WATER_COMBINER_MEMBER#undef WATER_UNIFORM_MEMBER@@ -499,7 +502,7 @@ TEST(modern_water_compiled_uniform_layout_matches_every_cpu_upload_field)}std::string vertex;const bool generated = VertexShader_Generate(description, VERTEX_SHADER_TARGET_D3D11, vertex)- && WaterFftSampling::WrapVertex(vertex) && SDL3_Shader_Retarget(vertex, true);+ && WaterFftSampling::WrapVertex(vertex,true) && SDL3_Shader_Retarget(vertex, true);CHECK(generated);if (generated) checkCompiledWaterUniformLayout(vertex, true, "WaterVertexParameters", false);}@@ -1403,3 +1406,121 @@ TEST(shared_cloud_programs_compile_validate_and_translate)CHECK_EQ(uniforms, program.first == HazardCloud::vertexShader() ? 0u : 1u);}}++TEST(fft_low_tier_preserves_energy_reality_and_filtering)+{+ using namespace WaterFftSpectrum;+ const auto configuration=ForResolution(128);+ CHECK(configuration.resolution==128 && configuration.phases==7 && configuration.levels==8);+ CHECK(ForResolution(0).resolution==256);+ const auto initial=InitialSpectrum(configuration),butterfly=Butterfly(configuration);+ CHECK(initial==InitialSpectrum(configuration));+ CHECK(initial.size()==128*128*3*4 && butterfly.size()==128*7*4);+ const auto &variance=WaterFftFiltering::SpectrumVariance(configuration);+ for(unsigned c=0;c<Cascades;++c) {+ double energy=0,slope=0;const unsigned n=configuration.resolution;+ for(unsigned y=0;y<n;++y) for(unsigned x=0;x<n;++x) {+ const float *h=&initial[((c*n+y)*n+x)*4];+ const float *opposite=&initial[((c*n+(n-y)%n)*n+(n-x)%n)*4];+ CHECK(h[0]==opposite[2] && h[1]==-opposite[3]);+ CHECK(h[2]==opposite[0] && h[3]==-opposite[1]);+ double power=0;for(unsigned i=0;i<4;++i) {CHECK(std::isfinite(h[i]));power+=double(h[i])*h[i];}+ if(x==0 || y==0 || (x==n/2 && y==n/2)) CHECK(power==0);+ const double kx=2*Pi*(int(x)-int(n/2))/Sizes[c],ky=2*Pi*(int(y)-int(n/2))/Sizes[c];+ energy+=power;slope+=power*(kx*kx+ky*ky);+ }+ CHECK(std::abs(std::sqrt(energy)*WorldScale-HeightRms[c])<HeightRms[c]*2e-7);+ CHECK(std::abs(variance[7][c]-slope)<1e-10*(1+slope));+ CHECK(variance[0][c]==0 && variance[8][c]==0);+ }+ CHECK(ButterflyHlsl(configuration).find("/7.0,")!=std::string::npos);+ const std::string filtering=WaterFftFiltering::Source(configuration);+ CHECK(filtering.find("fftLostSlopeVariance[8]")!=std::string::npos);+ CHECK(filtering.find("*128.0/")!=std::string::npos);+ CHECK(filtering.find("level,6)")!=std::string::npos);+}++TEST(water_performance_tiers_compile_both_materials_and_preserve_shared_defaults)+{+ struct Restore { WaterPerformanceSettings::Configuration saved=WaterPerformanceSettings::Applied();+ ~Restore() {WaterPerformanceSettings::Applied()=saved;} } restore;+ PixelPipelineDescription pipeline={};+ std::string d3dBaseline;+ CHECK(EngineShader_Pixel_Program(ENGINE_SHADER_WATER_TRAPEZOID,pipeline,d3dBaseline,COMBINER_SHADER_TARGET_D3D11));+ for(unsigned resolution:{128u,256u}) for(unsigned refraction=0;refraction<3;++refraction) for(bool reflections:{false,true}) {+ auto &settings=WaterPerformanceSettings::Applied();settings.activeFftResolution=resolution;+ settings.refraction=WaterPerformanceSettings::Refraction(refraction);settings.sceneReflections=reflections;+ for(auto program:{ENGINE_SHADER_WATER_TRAPEZOID,ENGINE_SHADER_WATER_RIVER}) {+ std::string source,error;std::vector<unsigned char> spirv;+ CHECK(EngineShader_Pixel_Program(program,pipeline,source,COMBINER_SHADER_TARGET_SDL3_GPU));+ const bool compiled=SDL3_Compile_HLSL_To_SPIRV(source,false,spirv,error);+ if(!compiled) printf("water tier %u/%u/%u program%d: %s\n",resolution,refraction,reflections,program,error.c_str());+ CHECK(compiled);+ if (compiled) {+ std::string msl, why; unsigned samplers = 0, buffers = 0;+ SDL3_Shader_Slots(spirv, false, samplers, buffers);+ CHECK(SDL3_Translate_SPIRV_To_MSL(spirv, false, msl, error));+ // Load-only textures need no sampler in Metal's entry point. Every+ // surviving binding still uses the slot recorded by the SDL draw.+ for (int slot : msl_indices(msl, "texture")) CHECK(slot >= 0 && unsigned(slot) < samplers);+ for (int slot : msl_indices(msl, "sampler")) CHECK(slot >= 0 && unsigned(slot) < samplers);+ }+ if(compiled && !reflections && refraction==WaterPerformanceSettings::Off) {+ spvc_context context=NULL;CHECK(spvc_context_create(&context)==SPVC_SUCCESS);+ if(context) {+ std::vector<SpvId> words(spirv.size()/sizeof(SpvId));memcpy(words.data(),spirv.data(),spirv.size());+ spvc_parsed_ir ir=NULL;spvc_compiler compiler=NULL;spvc_resources resources=NULL;spvc_set active=NULL;+ bool reflected=spvc_context_parse_spirv(context,words.data(),words.size(),&ir)==SPVC_SUCCESS+ && spvc_context_create_compiler(context,SPVC_BACKEND_NONE,ir,SPVC_CAPTURE_MODE_TAKE_OWNERSHIP,&compiler)==SPVC_SUCCESS+ && spvc_compiler_get_active_interface_variables(compiler,&active)==SPVC_SUCCESS+ && spvc_compiler_create_shader_resources_for_active_variables(compiler,&resources,active)==SPVC_SUCCESS;+ const spvc_reflected_resource *images=NULL;size_t count=0;+ reflected=reflected && spvc_resources_get_resource_list_for_type(resources,SPVC_RESOURCE_TYPE_SEPARATE_IMAGE,&images,&count)==SPVC_SUCCESS;+ CHECK(reflected);bool depth=false;+ if(reflected) for(size_t i=0;i<count;++i) {+ const std::string name=images[i].name;+ CHECK(name!="Texture1" && name!="Texture5" && name!="Texture7");+ depth|=name=="Texture6";+ }+ CHECK(depth);spvc_context_destroy(context);+ }+ }+ }+ std::string d3d;+ CHECK(EngineShader_Pixel_Program(ENGINE_SHADER_WATER_TRAPEZOID,pipeline,d3d,COMBINER_SHADER_TARGET_D3D11));+ CHECK(d3d==d3dBaseline);+ }+}++TEST(screen_reflection_modes_are_bounded_and_selected_per_draw)+{+ using namespace WaterScreenReflection;+ CHECK(Resolve(0) == Mirror && Resolve(1) == ScreenSpace && Resolve(2) == Hybrid);+ CHECK(Resolve(-1) == Hybrid && Resolve(99) == Hybrid);+ for (int setting = 0; setting < 3; ++setting) CHECK(Resolve(setting, false) == SkyOnly);+ CHECK(UsesMirror(Mirror) && UsesMirror(Hybrid) && !UsesMirror(ScreenSpace) && !UsesMirror(SkyOnly));+ CHECK(Traces(ScreenSpace) && Traces(Hybrid) && !Traces(Mirror) && !Traces(SkyOnly));+ for (auto program : {ENGINE_SHADER_WATER_TRAPEZOID, ENGINE_SHADER_WATER_RIVER}) {+ PixelPipelineDescription pipeline = {}; std::string source;+ CHECK(EngineShader_Pixel_Program(program, pipeline, source, COMBINER_SHADER_TARGET_SDL3_GPU));+ CHECK(source.find("waterScreenReflection(world, view, environmentNormal") != std::string::npos);+ CHECK(source.find("MaterialParameters.w>0.5") != std::string::npos);+ CHECK(source.find("waterMirrorFiltered(reflectionUV+distortion") != std::string::npos);+ }+ CHECK(MirrorSize(Mirror) == 512 && MirrorSize(Hybrid) == 1024);+ CHECK(MirrorSize(Mirror, 0) == 256 && MirrorSize(Hybrid, 0) == 512);+}++TEST(direct3d11_modern_water_source_matches_the_upstream_baseline)+{+ // FNV-1a of the complete generated v3.8.0 source, captured independently from e3e1a898.+ const uint64_t expected[] = {2644328293701272477ull, 15503000995417316327ull};+ unsigned index = 0;+ for (auto program : {ENGINE_SHADER_WATER_TRAPEZOID, ENGINE_SHADER_WATER_RIVER}) {+ PixelPipelineDescription pipeline = {}; std::string source;+ CHECK(EngineShader_Pixel_Program(program, pipeline, source, COMBINER_SHADER_TARGET_D3D11));+ uint64_t hash = 14695981039346656037ull;+ for (unsigned char value : source) { hash ^= value; hash *= 1099511628211ull; }+ CHECK(hash == expected[index++]);+ }+}diff --git a/GeneralsMD/Code/Tests/test_water_grid.cpp b/GeneralsMD/Code/Tests/test_water_grid.cppindex c843d7987..b87e09231 100644--- a/GeneralsMD/Code/Tests/test_water_grid.cpp+++ b/GeneralsMD/Code/Tests/test_water_grid.cpp@@ -170,6 +170,7 @@ TEST(water_grid_unstepped_is_not_the_golden)}#include "Platform/WaterSurfaceModel.h"+#include "Platform/WaterPerformanceSettings.h"#include "Platform/WaterProjectedMesh.h"#include "Platform/WaterBowRefinement.h"#include "WaterBowShoulderTest.h"@@ -4782,6 +4783,14 @@ TEST(water_bow_shoulder_large_hull_scale_cap_support_and_small_boat_identity)#include "GameClient/Water.h"#include "GameLogic/PolygonTrigger.h"#include "../GameEngineDevice/Source/PosixDevice/Render/PosixDevice9.h"+#include "../GameEngineDevice/Source/PosixDevice/Render/SdlGpuFrame.h"+#include "../GameEngineDevice/Source/PosixDevice/Render/SdlResourceMirror.h"+#include "dx8wrapper.h"+#include "ww3d.h"+#include "wwmath.h"+#include "formconv.h"+#include "texture.h"+#include <SDL3/SDL.h>#include "../Libraries/Source/WWVegas/WW3D2/engineshader.h"namespace {@@ -4789,6 +4798,13 @@ struct WaterShaderNameProbe : PosixDevice9 { using PosixDevice9::Engine_Name_Of;class LiveWaterStyleProbe : public WaterRenderObjClass{public:+ void setMirrorState(bool modern, WaterType type, bool rendering) {+ m_useModernWater=modern; m_waterType=type; m_renderingMirror=rendering;+ }+ void setReflectionMode(WaterScreenReflection::Mode mode) { m_waterReflectionMode=mode; }+ TextureClass *ensureReflectionTarget() { ensureMapReflectionTarget(); return m_pReflectionTexture; }+ void clearReflectionRefresh() { m_reflectionReused=FALSE; }+ bool reflectionNeedsRefresh() const { return m_reflectionReused; }bool usesModernWater() const { return m_useModernWater; }const std::vector<WaterOpticalContext::Polygon> &opticalPolygonsForDraw() {refreshModernWaterOpticalPolygons();@@ -4828,6 +4844,133 @@ public:};}+TEST(water_full_mirror_admits_only_hybrid_modern_map_water)+{+ boot();+ WaterTransparencySetting *saved=(WaterTransparencySetting*)TheWaterTransparency.getNonOverloadedPointer();+ TheWaterTransparency=newInstance(WaterTransparencySetting);+ {+ LiveWaterStyleProbe water;+ const WaterRenderObjClass &query=water;+ CHECK(!query.isModernFullMirror());+ // Every style/type/pass/mode combination uses the real render-policy query.+ // Original reflections and Modern sea water retain the old selective mirror.+ for(bool modern:{false,true})+ for(int type=0;type<WaterRenderObjClass::WATER_TYPE_MAX;++type)+ for(bool rendering:{false,true}) {+ water.setMirrorState(modern,(WaterRenderObjClass::WaterType)type,rendering);+ for (WaterScreenReflection::Mode mode : {+ WaterScreenReflection::Mirror, WaterScreenReflection::ScreenSpace,+ WaterScreenReflection::Hybrid, WaterScreenReflection::SkyOnly}) {+ water.setReflectionMode(mode);+ CHECK_EQ(bool(query.isModernFullMirror()),+ modern && rendering && type==WaterRenderObjClass::WATER_TYPE_0_TRANSLUCENT+ && mode==WaterScreenReflection::Hybrid);+ }+ }+ water.setReflectionMode(WaterScreenReflection::Hybrid);+ water.setMirrorState(true,WaterRenderObjClass::WATER_TYPE_0_TRANSLUCENT,false);+ CHECK(!query.isModernFullMirror()); // the main view never borrows the broader mirror rules+ }+ TheWaterTransparency=saved;+}++TEST(water_hybrid_target_resize_preserves_queued_reflections_and_refreshes_new_targets)+{+ struct RestoreQuality { WaterPerformanceSettings::Configuration saved=WaterPerformanceSettings::Applied();+ ~RestoreQuality() { WaterPerformanceSettings::Applied()=saved; } } restoreQuality;+ boot();+ const bool video=SDL_InitSubSystem(SDL_INIT_VIDEO);+ if (!video) {+ std::printf("SKIP: reflection allocation test needs SDL video: %s\n",SDL_GetError());+ return;+ }+ const char *oldFrames=SDL_GetHint("ZH_OFFSCREEN_FRAMES"), *oldHz=SDL_GetHint("ZH_OFFSCREEN_HZ");+ const bool hadFrames=oldFrames!=NULL, hadHz=oldHz!=NULL;+ const std::string savedFrames=oldFrames?oldFrames:"", savedHz=oldHz?oldHz:"";+ SDL_SetHint("ZH_OFFSCREEN_FRAMES","1");+ SDL_SetHint("ZH_OFFSCREEN_HZ","0");+ WWMath::Init();+ // WW3D::Init normally initializes this before DX8Wrapper. This minimal harness+ // needs the same mapping so render-target caps recognize the display format.+ Init_D3D_To_WW3_Conversion();+ const bool initialized=DX8Wrapper::Init(NULL);+ const bool ready=initialized &&+ WW3D::Set_Render_Device(0,64,64,32,1,false,false,false)==WW3D_ERROR_OK;+ auto *device=ready?static_cast<PosixDevice9 *>(DX8Wrapper::_Get_D3D_Device()):NULL;+ if (device && device->Get_Gpu()) {+ std::printf("reflection target lifecycle: GPU readback across High/Low and Legacy/Hybrid targets\n");+ WaterTransparencySetting *savedTransparency=+ (WaterTransparencySetting*)TheWaterTransparency.getNonOverloadedPointer();+ TheWaterTransparency=newInstance(WaterTransparencySetting);+ {+ LiveWaterStyleProbe water;+ water.setMirrorState(true,WaterRenderObjClass::WATER_TYPE_0_TRANSLUCENT,false);+ IDirect3DSurface9 *back=NULL;+ CHECK(device->GetBackBuffer(0,0,D3DBACKBUFFER_TYPE_MONO,&back)==D3D_OK);+ const unsigned sizes[]={512,1024,512,256,512,1024};+ const WaterScreenReflection::Mode modes[]={WaterScreenReflection::Mirror,WaterScreenReflection::Hybrid,+ WaterScreenReflection::Hybrid,WaterScreenReflection::Mirror,WaterScreenReflection::Mirror,WaterScreenReflection::Hybrid};+ const int details[]={1,1,0,0,1,1};+ const RenderUInt32 colours[]={0xffff0000u,0xff00ff00u,0xff0000ffu,0xffffff00u,0xff00ffffu,0xffff00ffu};+ const unsigned steps=sizeof(sizes)/sizeof(sizes[0]);+ IDirect3DBaseTexture9 *previous=NULL; // borrowed from the bound sampler+ for (unsigned step=0;back && step<steps;++step) {+ WaterPerformanceSettings::Applied().reflectionDetail=details[step];+ water.setReflectionMode(modes[step]);+ water.clearReflectionRefresh();+ TextureClass *target=water.ensureReflectionTarget();+ CHECK(target && water.reflectionNeedsRefresh());+ if (!target) break;+ D3DSURFACE_DESC desc={};+ CHECK(target->Peek_D3D_Texture()->GetLevelDesc(0,&desc)==D3D_OK);+ CHECK_EQ(desc.Width,sizes[step]);CHECK_EQ(desc.Height,sizes[step]);+ // Replacing WaterRenderObjClass's owner must not release an old texture still+ // held by the sampler; queued GPU work will outlive both CPU owners below.+ if (previous) {+ IDirect3DBaseTexture9 *bound=NULL;+ CHECK(device->GetTexture(1,&bound)==D3D_OK && bound==previous);+ if (bound) bound->Release();+ }+ water.clearReflectionRefresh();+ CHECK(water.ensureReflectionTarget()==target && !water.reflectionNeedsRefresh());+ DX8Wrapper::Set_DX8_Texture(1,target->Peek_D3D_Texture());+ DX8Wrapper::Flush_Deferred_D3D9_State();+ previous=target->Peek_D3D_Texture();+ DX8Wrapper::Set_Render_Target_With_Z(target);+ D3DVIEWPORT9 viewport={0,0,sizes[step],sizes[step],0.0f,1.0f};+ CHECK(device->SetViewport(&viewport)==D3D_OK);+ CHECK(device->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,colours[step],1.0f,0)==D3D_OK);+ IDirect3DSurface9 *surface=target->Get_D3D_Surface_Level();+ const RenderRect stripe={int(step*64/steps),0,int((step+1)*64/steps),64};+ CHECK(surface && device->StretchRect(surface,NULL,back,&stripe,D3DTEXF_POINT)==D3D_OK);+ if (surface) surface->Release();+ DX8Wrapper::Set_Render_Target((IDirect3DSurface9 *)NULL);+ }+ // Retire old GPU copies before submitting the clears/blits which still use them.+ // Coloured stripes prove queued references survive every mode/detail replacement.+ DX8Wrapper::Set_DX8_Texture(1,NULL);+ DX8Wrapper::Flush_Deferred_D3D9_State();+ device->Get_Mirrors()->Collect_Dead();+ std::vector<uint8_t> pixels;+ CHECK(device->Get_Gpu()->Read_Back(device->Get_Gpu()->Back_Buffer(),64,64,pixels));+ if (pixels.size()==64*64*4) for (unsigned step=0;step<steps;++step) {+ const size_t at=(32*64+(step*2+1)*64/(steps*2))*4;+ CHECK_EQ(unsigned(pixels[at]),colours[step]&255u);+ CHECK_EQ(unsigned(pixels[at+1]),(colours[step]>>8)&255u);+ CHECK_EQ(unsigned(pixels[at+2]),(colours[step]>>16)&255u);+ } else CHECK(false);+ if (back) back->Release();+ }+ TheWaterTransparency=savedTransparency;+ } else std::printf("SKIP: reflection allocation test needs an offscreen GPU renderer: %s\n",SDL_GetError());+ if (initialized) DX8Wrapper::Shutdown();+ WWMath::Shutdown();+ if (hadFrames) SDL_SetHint("ZH_OFFSCREEN_FRAMES",savedFrames.c_str()); else SDL_ResetHint("ZH_OFFSCREEN_FRAMES");+ if (hadHz) SDL_SetHint("ZH_OFFSCREEN_HZ",savedHz.c_str()); else SDL_ResetHint("ZH_OFFSCREEN_HZ");+ SDL_QuitSubSystem(SDL_INIT_VIDEO);+}+TEST(water_polygon_draw_snapshot_survives_live_height_geometry_and_lifetime_changes){boot();@@ -4921,3 +5064,18 @@ TEST(water_style_changes_at_render_boundary_without_advancing_paused_time_or_reldelete scratch;TheWritableGlobalData=saved;}#endif++TEST(water_quality_keeps_scene_depth_independent_of_colour_demand)+{+ using namespace WaterPerformanceSettings;+ const auto saved = Applied();+ Apply(false, 0, Off, 0);+ CHECK(!Applied().sceneReflections && Applied().requestedFftResolution == 128);+ CHECK(Applied().refraction == Off && Applied().reflectionDetail == 0);+ CHECK(!SceneColourRequired(Off, false));+ CHECK(SceneColourRequired(Off, true));+ CHECK(SceneColourRequired(Simple, false) && SceneColourRequired(Full, false));+ Apply(true, 1, Full, 1);+ CHECK(Applied().sceneReflections && Applied().requestedFftResolution == 256);+ Applied() = saved;+}diff --git a/GeneralsMD/Code/Tools/optionsmenu_layout.py b/GeneralsMD/Code/Tools/optionsmenu_layout.pyindex d23e2a465..958677002 100644--- a/GeneralsMD/Code/Tools/optionsmenu_layout.py+++ b/GeneralsMD/Code/Tools/optionsmenu_layout.py@@ -1,12 +1,12 @@#!/usr/bin/env python3-"""Rebuild OptionsMenu.wnd as eight tabbed pages on one grid.+"""Rebuild OptionsMenu.wnd as tabbed pages on one grid.EA's options screen is one 800x600 panel with everything on it at once, and it was already fullwhen it shipped: the language filter, the keyboard button and the four camera checkboxes are allstill in the file, parked off the right edge with HIDDEN set, because there was nowhere left to putthem. Seventeen settings later there is no version of "find room" that works.-So the screen becomes eight pages behind eight buttons: Display, Graphics, Effects, Audio, Controls,+So the screen becomes nine pages behind nine buttons: Display, Graphics, Effects, Water, Audio, Controls,Interface, Network and Hotkeys, the last two lists rather than settings (build_hotkeys_page). Every graphics setting is on Graphics or Effects, including the ones EA hid ina popup that only opened when Custom was picked from a combo box on another page. Each page is a listof titled groups, sorted by what a setting does, flowed into three columns on one grid, so a heading,@@ -48,8 +48,9 @@ from wndlayout import clone# and the version line all start and stop. The frame is as tall as the tallest group column needs -# Effects' Shadows column and Graphics' Quality column both end 312 pixels below their heading, on the# page's last pixel - plus the title, the tabs and the buttons, and it is centred on the 600 line: 58-# above it, 58 below. A column that runs past the page is refused when the layout is built. Eight tabs-# still fit the inner width at 87 pixels each.+# above it, 58 below. A column that runs past the page is refused when the layout is built. Nine tabs+# share the inner width. OptionsMenu.cpp hides the SDL Water tab where unsupported and restores+# the original eight-tab widths.PANEL = (20, 58, 760, 484) # left, top, width, heightINNER_LEFT, INNER_WIDTH = 36, 728TITLE = (INNER_LEFT, 64, 400, 32)@@ -63,6 +64,7 @@ TABS = [("PageDisplay", "TabDisplay", "GUI:OptionsTabDisplay"),("PageGraphics", "TabGraphics", "GUI:OptionsTabGraphics"),("PageEffects", "TabEffects", "GUI:OptionsTabEffects"),+ ("PageWater", "TabWater", "GUI:OptionsTabWater"),("PageAudio", "TabAudio", "GUI:OptionsTabAudio"),("PageControls", "TabControls", "GUI:OptionsTabControls"),("PageInterface", "TabInterface", "GUI:OptionsTabInterface"),@@ -172,6 +174,15 @@ NEW_CONTROLS = [(COMBO, "ComboBoxWaterStyle", None),(LABEL, "LabelCloudStyle", "GUI:CloudStyle"),(COMBO, "ComboBoxCloudStyle", None),+ (LABEL, "LabelWaterReflection", "GUI:WaterReflection"),+ (COMBO, "ComboBoxWaterReflection", None),+ (LABEL, "LabelWaterReflectionDetail", "GUI:WaterReflectionDetail"),+ (COMBO, "ComboBoxWaterReflectionDetail", None),+ (CHECK, "CheckWaterReflectionEnabled", "GUI:WaterReflectionEnabled"),+ (LABEL, "LabelWaterFftResolution", "GUI:WaterFftResolution"),+ (COMBO, "ComboBoxWaterFftResolution", None),+ (LABEL, "LabelWaterRefractionQuality", "GUI:WaterRefractionQuality"),+ (COMBO, "ComboBoxWaterRefractionQuality", None),(LABEL, "LabelMSAA", "GUI:MSAA"),(COMBO, "ComboBoxMSAA", None),(LABEL, "LabelBloom", "GUI:Bloom"),@@ -413,6 +424,15 @@ GROUP_LAYOUT = [("check", "CheckWeather"),("check", "CheckWaterSplashes")])]),+ ("PageWater", [+ ("GUI:OptionsGroupModernWater", [+ setting("LabelWaterFftResolution", "ComboBoxWaterFftResolution"),+ setting("LabelWaterRefractionQuality", "ComboBoxWaterRefractionQuality")]),+ ("GUI:OptionsGroupReflections", [+ ("check", "CheckWaterReflectionEnabled"),+ setting("LabelWaterReflection", "ComboBoxWaterReflection"),+ setting("LabelWaterReflectionDetail", "ComboBoxWaterReflectionDetail")])]),+("PageAudio", [("GUI:OptionsGroupVolume", [setting("LabelMasterVolume", "SliderMasterVolume", "ValueMasterVolume"),@@ -705,7 +725,60 @@ def build_hotkeys_page(page, templates):page.children.append(button)+def update_water_page(layout):+ """Regenerate Water and the tab strip in an existing tabbed master."""+ old = layout.find("OptionsMenuParentOld")+ templates = dict((name, layout.find(name)) for name in (CHECK, LABEL, COMBO, "ButtonDefaults"))+ templates["VideoParent"] = layout.find("PageGraphics")+ page = make_page(templates["VideoParent"], "PageWater")+ groups = dict(GROUP_LAYOUT)["PageWater"]+ names = set(name for _heading, items in groups for item in items+ for name in (item[1:3] if item[0] == "setting" else item[1:2]))+ controls = dict((name, make_control(templates[template], name, text, 0, 0, 1, 1))+ for template, name, text in NEW_CONTROLS if name in names)+ groups = dict(GROUP_LAYOUT)["PageWater"]+ index = 0+ for column, stack in enumerate(flow(groups)):+ left = COLUMNS[column]+ heading_top = HEADING_TOP+ for heading_key, items in stack:+ name = "GroupHeadingWater%d" % index+ index += 1+ heading = make_heading(templates, name, heading_key)+ heading.place(left - TEXT_NUDGE, heading_top, COLUMN_WIDTH, ROW_HEIGHT)+ page.children.append(heading)+ top = heading_top + HEADING_PITCH+ for item in items:+ names = [(item[1], top, CHECK)] if item[0] == "check" else [+ (item[1], top, LABEL), (item[2], top + ROW_HEIGHT, COMBO)]+ for name, y, template in names:+ control = controls.pop(name)+ control.place(left - TEXT_NUDGE if template == LABEL else left,+ y, COLUMN_WIDTH, ROW_HEIGHT)+ restyle(control, templates[template])+ if template == LABEL:+ control.put_prop("STATICTEXTDATA", "CENTERED: 0")+ page.children.append(control)+ top += item_height(item)+ if top > PAGE[1] + PAGE[3]:+ raise ValueError("Water controls extend beyond the page")+ heading_top = top + GROUP_GAP+ if controls:+ raise KeyError("unplaced Water controls: %s" % ", ".join(sorted(controls)))+ tab_names = set(tab for _page, tab, _text in TABS)+ old.children = [child for child in old.children+ if short(child) not in tab_names and short(child) != "PageWater"]+ pages = [detach(old, name) for name, _tab, _text in TABS if name != "PageWater"]+ for index, (_page, name, text) in enumerate(TABS):+ old.children.append(make_tab(templates["ButtonDefaults"], name, text, index))+ for name, _tab, _text in TABS:+ old.children.append(page if name == "PageWater" else pages.pop(0))+ return layout++def build(layout):+ if layout.find("PageDisplay"):+ return update_water_page(layout)old = layout.find("OptionsMenuParentOld")templates = dict((name, layout.find(name))for name in (CHECK, LABEL, COMBO, SLIDER, "VideoParent", "ButtonDefaults",@@ -999,18 +1072,17 @@ 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, Effects or Display, where the full- # columns pushed Collapsing Buildings, and has a value for every step; a row one value short still- # compiles, with a 0 in the last step+ # every row of the quality slider names a control on Graphics, Effects, Display or the SDL Water page+ # and has a value for every step; a row one value short still compiles, with a 0 in the last stepsteps = 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", "PageDisplay")+ on_pages = set(short(child) for page in ("PageGraphics", "PageEffects", "PageDisplay", "PageWater")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, Effects or Display page" % control)+ problems.append("quality row %s is not a control on the Graphics, Effects, Display or Water page" % control)if len(values) != steps:problems.append("quality row %s has %d values for %d steps" % (control, len(values), steps))@@ -1019,16 +1091,44 @@ def selfcheck():% (os.path.basename(LAYOUT), ADVANCED))problems.extend(overlaps(layout))- # Hazard appearance is a Graphics setting, independent of particle thickness.+ # Hazard cloud style belongs directly beneath water, independent of the+ # separate particle thickness and smoke-shadow controls on Effects.graphics = layout.find("PageGraphics")+ water = layout.find("ComboBoxWaterStyle")cloud_label = layout.find("LabelCloudStyle")cloud = layout.find("ComboBoxCloudStyle")- if graphics and cloud_label and cloud:+ if graphics and water and cloud_label and cloud:if cloud not in graphics.children or cloud_label not in graphics.children:problems.append("CloudStyle must be on the Graphics page")+ if cloud.rect[0] != water.rect[0] or cloud.rect[1] != water.rect[1] + SETTING_PITCH:+ problems.append("CloudStyle must be directly below WaterStyle in the same column")if cloud_label.rect[1] != cloud.rect[1] - ROW_HEIGHT:problems.append("CloudStyle label must sit above its combo box")+ # Modern water performance controls have their own page: Effects has no room for them.+ # Its bounds and the tab widths are checked independently of the generic overlap checks.+ water_page = layout.find("PageWater")+ water_controls = ["LabelWaterFftResolution", "ComboBoxWaterFftResolution",+ "LabelWaterRefractionQuality", "ComboBoxWaterRefractionQuality",+ "CheckWaterReflectionEnabled", "LabelWaterReflection", "ComboBoxWaterReflection",+ "LabelWaterReflectionDetail", "ComboBoxWaterReflectionDetail"]+ for name in water_controls:+ control = layout.find(name)+ if not water_page or not control or control not in water_page.children:+ problems.append("%s must be on the Water page" % name)+ elif (control.rect[0] < PAGE[0] - TEXT_NUDGE or control.rect[1] < PAGE[1]+ or control.rect[2] > PAGE[0] + PAGE[2] or control.rect[3] > PAGE[1] + PAGE[3]):+ problems.append("%s extends beyond the Water page" % name)+ for stem in ("WaterFftResolution", "WaterRefractionQuality", "WaterReflection", "WaterReflectionDetail"):+ label, combo = layout.find("Label" + stem), layout.find("ComboBox" + stem)+ if label and combo and (label.rect[0] != combo.rect[0] - TEXT_NUDGE+ or label.rect[1] != combo.rect[1] - ROW_HEIGHT):+ problems.append("%s label must sit above its combo box" % stem)+ for _page, tab, _text in TABS:+ control = layout.find(tab)+ if not control or control.rect[0] < INNER_LEFT or control.rect[2] > INNER_LEFT + INNER_WIDTH:+ problems.append("%s extends beyond the tab strip" % tab)+for problem in problems:print("optionsmenu: %s" % problem)if problems:@@ -1048,7 +1148,10 @@ def main(argv):return 2layout = wndlayout.load(argv[1])- wndlayout.save(build(layout), argv[2])+ # Validate before opening the output, including when the tracked master is also the input.+ result = build(layout).text().replace("\r\n", "\n").encode("latin-1")+ with open(argv[2], "wb") as output:+ output.write(result)print("%s: %d windows" % (argv[2], sum(1 for _ in layout.root.walk())))return 0