SnowyMouse / chimera

The update to Halo PC that never was
https://chimera.opencarnage.net
GNU General Public License v3.0
137 stars 26 forks source link

Remove D3DX dependency; Use Direct2D + DirectWrite instead #52

Open BinToss opened 3 years ago

BinToss commented 3 years ago

This would allow Chimera to run without requiring the DirectX June 2010 redistribution. The D3DX library (including LPD3DXFONT) has been retired and is no longer maintained nor included with the rest of Windows' native DirectX packages.

I recommend looking into DirectWrite + Direct2D and/or DirectXTK SpriteFont as a possible alternative. The latter could be used for gamepad button sprites, too.

D3DX can be found... ...in [src/chimera/output/draw_text.cpp] Line 4: #include <d3dx9.h> ...in [src/monolith/monolith.cmake] Line 15, Column 235: .../libzstd.a -l d3dx9

Links: D3DX retirement Text via DirectWrite + Direct2D DirectXTK

Aerocatia commented 3 years ago

The d3d9x dependency has not been removed for TTF text support, but not having it no longer blocks the game from loading. (e28c2343f0ad6233c5d0f8d9a745874866f30df2)

When not having d3d9x the game will simply fall back to bitmap text.

BinToss commented 3 years ago

In the mean time, you can have users install d3d9x with the minimal DXSetup shipped with OpenSauce 4.0 (2015). dxredist.zip

BinToss commented 1 year ago

Arecaidian Fox and I recently tested SPV3 (and OpenSauce by extension) with d3dx9 only present in the game's directory (not "installed" in any way, not present in any system folder, and confirmed via ProcessHacker's Process Modules tab).

Works like a charm. If Chimera is released with d3dx9_43.dll, users won't need to explicitly install it or the DirectX Runtime (June 2010) redist.