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
fix(w3ddevice): place an unknown GPU at the top preset on Windows too
Olcay Seygan6f6e9e809dc7
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ec73dc0d2..b74302460 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1073,6 +1073,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same- Every graphics setting is on the Graphics and Effects pages. Shadows, clouds, ground lighting, soft water edges, trees, extra animations, heat haze, texture resolution and the particle limit used to hide in a popup that only opened if you picked Custom from the detail box on another page, so choosing High never showed you what High turns on. Pick a preset now and its settings change in front of you; touch any one of them and the box reads Custom. Texture filtering and the number of anisotropic samples, which needed a text editor, sit there too.- Every page is sorted into titled groups by what the settings do, and the groups sit in the same three columns on every tab. On Graphics the detail preset heads the first column with the texture and particle sliders under it, the picture settings take the second and the terrain the third. The framed boxes the original drew inside each page are gone. They were sized for headings that no longer exist, which is why no two pages started their first setting at the same height.- The detail box has Ultra above High, and a preset now sets everything it is responsible for. Picking High used to leave antialiasing and texture filtering wherever they happened to be; High now brings 4x antialiasing and 8 anisotropic samples with it, and Low turns both down for the machines that need it. Ultra is High with the particle limit at the top of its slider, 5,000 against High's 3,000, detail that is never dropped when the frame rate dips, 8x antialiasing, 16 anisotropic samples, thick smoke and every new shadow and effect switched on. Glow stays yours whichever you pick: the artwork was painted without it.+- A new Windows PC starts on High. The first launch picks a preset by looking the graphics card up in a list that ends at the GeForce4 and the Radeon 9700, so any card from the last twenty years came back as unknown, the game took it for a 1999 TNT2 and set Low. A card the list does not know now counts as meeting every preset, which Macs and Linux already did, and the processor and memory decide the rest.- Effects is a page of its own, with seven settings that used to be command line switches or were fixed in the game's data: shadows for infantry, for missiles and bombs, for scenery and for smoke clouds, thicker smoke in two strengths, particles that land on the ground instead of falling through it, and swaying trees split away from extra animations, so the scaffolding can stay while the forest holds still. The shadows take effect on the next map, smoke and particles the next time the game starts.- Every slider shows its value beside it: brightness, the three volumes, scroll speed, texture resolution, particles and anisotropic samples. Every label now starts on the same edge as the box under it; the original drew each one a few pixels to the right.- The tab you are on is lit in the same green as the group headings. The original drew it in dark grey on the black panel, which read as a button you could not press rather than the page you were looking at.diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cppindex 9dafae7a6..a67ba71ba 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp@@ -3403,23 +3403,22 @@ RenderResult W3DShaderManager::LoadAndCreateD3DVertexShader(const char* strFilePenum { UNMEASURED_CPU_REPORTED_MHZ = 3049 };#endif-#if !defined(_WIN32)/* The chipset reported for a device getChipset cannot place: the top of the table (R300), which everyLODPreset any GameLODPresets.ini can name (GameLOD.cpp's VideoNames, XX to R300) meets. Decision 2,- extended to the GPU: the POSIX device answers no vendor or device ID the table knows, so getChipset- says DC_UNKNOWN, GameLOD presumed a TNT2, and every shipped preset - LOW included - asks for a GF3- or GF4, so a first launch fell to LOW on any Mac. Only the preset choice sees this value: it is what+ extended to the GPU: getChipset's table ends at the GeForce4 and the Radeon 9700, so any later card+ (and the POSIX device, which has no vendor ID at all) comes back DC_UNKNOWN or placed only by its+ caps, GameLOD presumed a TNT2, and every shipped preset - LOW included - asks for a GF3 or GF4, so a+ first launch fell to LOW on Windows and Mac alike. Only the preset choice sees this value: it is whattestMinimumRequirements hands GameLOD, while the renderer keeps asking getChipset itself. Anoverride (-noshaders, GlobalData's ChipsetType) is not DC_UNKNOWN and is reported as it is.test_render_hooks checks the value against the game's own file. */enum { UNKNOWN_CHIPSET_REPORTED = DC_MAX - 1 };-/* Which chipset the presets see for the one getChipset found (testMinimumRequirements' POSIX branch, a- function of its own so test_render_hooks can table it). Placing a device only by its caps is not- placing it: since A3e the POSIX device claims pixel shader 1.1, so getChipset answers- DC_GENERIC_PIXEL_SHADER_1_1 rather than DC_UNKNOWN, and that is below the GF3 every shipped preset- asks for - every Mac would fall to LOW again. An override (-noshaders, GlobalData's ChipsetType) is- reported as it is. */+/* Which chipset the presets see for the one getChipset found (testMinimumRequirements, a function of its+ own so test_render_hooks can table it). Placing a device only by its caps is not placing it: the+ POSIX device claims pixel shader 1.1 (A3e) and a Windows adapter the table does not name is read off+ whatever caps the D3D9 device admits to, and DC_GENERIC_PIXEL_SHADER_1_1 is below the GF3 every+ shipped preset asks for. An override (-noshaders, GlobalData's ChipsetType) is reported as it is. */ChipsetType chipsetForPresets(ChipsetType detected, Bool overridden){if (overridden)@@ -3429,7 +3428,6 @@ ChipsetType chipsetForPresets(ChipsetType detected, Bool overridden)return (ChipsetType)UNKNOWN_CHIPSET_REPORTED;return detected;}-#endifBool testMinimumRequirements(ChipsetType *videoChipType, CpuType *cpuType, Int *cpuFreq, Int *numRAM, Real *intBenchIndex, Real *floatBenchIndex, Real *memBenchIndex){@@ -3440,13 +3438,9 @@ Bool W3DShaderManager::testMinimumRequirements(ChipsetType *videoChipType, CpuTy{if (videoChipType){- *videoChipType = getChipset();-#if !defined(_WIN32)// Decision 2 for the GPU: a device the chipset table cannot place counts as meeting every preset- // (chipsetForPresets). Windows' D3D9 names its adapter, and keeps the original presumption- // (GameLOD: a TNT2).- *videoChipType = chipsetForPresets(*videoChipType, TheGlobalData != NULL && TheGlobalData->m_chipSetType != DC_UNKNOWN);-#endif+ // (chipsetForPresets), on every platform.+ *videoChipType = chipsetForPresets(getChipset(), TheGlobalData != NULL && TheGlobalData->m_chipSetType != DC_UNKNOWN);}if (cpuType)diff --git a/GeneralsMD/Code/Tools/lod-first-run-check.sh b/GeneralsMD/Code/Tools/lod-first-run-check.shindex 086acaa53..f9f3fdc15 100755--- a/GeneralsMD/Code/Tools/lod-first-run-check.sh+++ b/GeneralsMD/Code/Tools/lod-first-run-check.sh@@ -15,8 +15,9 @@# You should have received a copy of the GNU General Public License# along with this program. If not, see <http://www.gnu.org/licenses/>.#-# Decision 2 for the GPU, run for real: a first launch off Windows chooses the top detail preset the CPU-# and memory rules allow, where before every Mac's chose LOW.+# Decision 2 for the GPU, run for real: a first launch chooses the top detail preset the CPU and memory+# rules allow, where before every Mac's chose LOW, and so did a Windows machine whose card is newer than+# W3DShaderManager::getChipset's table.## Before the rule, the POSIX device answered no vendor or device ID W3DShaderManager::getChipset knows,# so it said DC_UNKNOWN; GameLOD presumed a TNT2, and every LODPreset in the shipped GameLODPresets.ini,@@ -36,7 +37,10 @@# is this rule's doing, and this check can see a Low.## WHAT THIS DOES NOT SEE: a machine with less than 512 MB (every Mac the port supports has more), and-# Windows, where the rule is not compiled and the original presumption stands.+# Windows. The rule is the same code there (chipsetForPresets has no platform guard), but this script+# drives the POSIX executable only. On Windows the CPU half reaches HIGH by its own road: a CPU the+# cpudetect tables cannot name (every Ryzen, most Core) is XX and takes the same benchmark stub, and one+# they misname as a P3 or P4 is matched by its measured MHz, above the lowest HIGH preset's (P3 1400, P4 1500).## RULE 9: the root is a farm, never the install, and the install is listed before and after# (Tools/install-guard.sh).