Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Core/Libraries/Source/WWVegas/WW3D2/formconv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ D3DFORMAT WW3DFormatToD3DFormatConversionArray[WW3D_FORMAT_COUNT] = {
D3DFMT_UNKNOWN,
D3DFMT_R8G8B8,
D3DFMT_A8R8G8B8,
D3DFMT_X8R8G8B8,
// TheSuperHackers @feature JohnsterID 14/09/2025 D3DFMT_X8R8G8B8 replaced with D3DFMT_A8R8G8B8 in DX9
D3DFMT_A8R8G8B8,
D3DFMT_R5G6B5,
D3DFMT_X1R5G5B5,
D3DFMT_A1R5G5B5,
Expand Down Expand Up @@ -212,7 +213,8 @@ void Init_D3D_To_WW3_Conversion()

D3DFormatToWW3DFormatConversionArray[D3DFMT_R8G8B8]=WW3D_FORMAT_R8G8B8;
D3DFormatToWW3DFormatConversionArray[D3DFMT_A8R8G8B8]=WW3D_FORMAT_A8R8G8B8;
D3DFormatToWW3DFormatConversionArray[D3DFMT_X8R8G8B8]=WW3D_FORMAT_X8R8G8B8;
// TheSuperHackers @feature JohnsterID 14/09/2025 D3DFMT_X8R8G8B8 replaced with D3DFMT_A8R8G8B8 in DX9
// WW3D_FORMAT_X8R8G8B8 now maps to D3DFMT_A8R8G8B8, but reverse mapping prioritizes WW3D_FORMAT_A8R8G8B8
D3DFormatToWW3DFormatConversionArray[D3DFMT_R5G6B5]=WW3D_FORMAT_R5G6B5;
D3DFormatToWW3DFormatConversionArray[D3DFMT_X1R5G5B5]=WW3D_FORMAT_X1R5G5B5;
D3DFormatToWW3DFormatConversionArray[D3DFMT_A1R5G5B5]=WW3D_FORMAT_A1R5G5B5;
Expand Down
3 changes: 2 additions & 1 deletion Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ static void Log_Textures(bool inited,unsigned& total_count, unsigned& total_mem)
case D3DFMT_L8: tex_format="D3DFMT_L8"; break;
case D3DFMT_A8: tex_format="D3DFMT_A8"; break;
case D3DFMT_P8: tex_format="D3DFMT_P8"; break;
case D3DFMT_X8R8G8B8: tex_format="D3DFMT_X8R8G8B8"; break;
// TheSuperHackers @feature JohnsterID 14/09/2025 D3DFMT_X8R8G8B8 replaced with D3DFMT_A8R8G8B8 in DX9
case D3DFMT_A8R8G8B8: tex_format="D3DFMT_A8R8G8B8"; break;
case D3DFMT_X1R5G5B5: tex_format="D3DFMT_X1R5G5B5"; break;
case D3DFMT_R3G3B2: tex_format="D3DFMT_R3G3B2"; break;
case D3DFMT_A8R3G3B2: tex_format="D3DFMT_A8R3G3B2"; break;
Expand Down
3 changes: 2 additions & 1 deletion GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ static void Log_Textures(bool inited,unsigned& total_count, unsigned& total_mem)
case D3DFMT_L8: tex_format="D3DFMT_L8"; break;
case D3DFMT_A8: tex_format="D3DFMT_A8"; break;
case D3DFMT_P8: tex_format="D3DFMT_P8"; break;
case D3DFMT_X8R8G8B8: tex_format="D3DFMT_X8R8G8B8"; break;
// TheSuperHackers @feature JohnsterID 14/09/2025 D3DFMT_X8R8G8B8 replaced with D3DFMT_A8R8G8B8 in DX9
case D3DFMT_A8R8G8B8: tex_format="D3DFMT_A8R8G8B8"; break;
case D3DFMT_X1R5G5B5: tex_format="D3DFMT_X1R5G5B5"; break;
case D3DFMT_R3G3B2: tex_format="D3DFMT_R3G3B2"; break;
case D3DFMT_A8R3G3B2: tex_format="D3DFMT_A8R3G3B2"; break;
Expand Down
31 changes: 16 additions & 15 deletions GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
#ifndef DX8CAPS_H
#define DX8CAPS_H

// TheSuperHackers @feature JohnsterID 14/09/2025 Migrate from DirectX 8 to DirectX 9 API while keeping existing class names
#include "always.h"
#include "ww3dformat.h"
#include <d3d8.h>
#include <d3d9.h>

class DX8Caps
{
Expand Down Expand Up @@ -207,11 +208,11 @@ class DX8Caps
};


DX8Caps(IDirect3D8* direct3d, const D3DCAPS8& caps,WW3DFormat display_format, const D3DADAPTER_IDENTIFIER8& adapter_id);
DX8Caps(IDirect3D8* direct3d, IDirect3DDevice8* D3DDevice,WW3DFormat display_format, const D3DADAPTER_IDENTIFIER8& adapter_id);
DX8Caps(IDirect3D9* direct3d, const D3DCAPS9& caps,WW3DFormat display_format, const D3DADAPTER_IDENTIFIER9& adapter_id);
DX8Caps(IDirect3D9* direct3d, IDirect3DDevice9* D3DDevice,WW3DFormat display_format, const D3DADAPTER_IDENTIFIER9& adapter_id);
static void Shutdown(void);

void Compute_Caps(WW3DFormat display_format, const D3DADAPTER_IDENTIFIER8& adapter_id);
void Compute_Caps(WW3DFormat display_format, const D3DADAPTER_IDENTIFIER9& adapter_id);
bool Support_TnL() const { return SupportTnL; };
bool Support_DXTC() const { return SupportDXTC; }
bool Support_Gamma() const { return supportGamma; }
Expand Down Expand Up @@ -248,7 +249,7 @@ class DX8Caps
bool Support_Render_To_Texture_Format(WW3DFormat format) const { return SupportRenderToTextureFormat[format]; }
bool Support_Depth_Stencil_Format(WW3DZFormat format) const { return SupportDepthStencilFormat[format]; }

D3DCAPS8 const & Get_DX8_Caps() const { return Caps; }
D3DCAPS9 const & Get_DX8_Caps() const { return Caps; }

const StringClass& Get_Log() const { return CapsLog; }
const StringClass& Get_Compact_Log() const { return CompactLog; }
Expand All @@ -272,21 +273,21 @@ class DX8Caps
static DeviceTypeS3 Get_S3_Device(unsigned device_id);
static DeviceTypeIntel Get_Intel_Device(unsigned device_id);

void Init_Caps(IDirect3DDevice8* D3DDevice);
void Check_Texture_Format_Support(WW3DFormat display_format,const D3DCAPS8& caps);
void Check_Render_To_Texture_Support(WW3DFormat display_format,const D3DCAPS8& caps);
void Check_Depth_Stencil_Support(WW3DFormat display_format, const D3DCAPS8& caps);
void Check_Texture_Compression_Support(const D3DCAPS8& caps);
void Check_Bumpmap_Support(const D3DCAPS8& caps);
void Check_Shader_Support(const D3DCAPS8& caps);
void Check_Maximum_Texture_Support(const D3DCAPS8& caps);
void Init_Caps(IDirect3DDevice9* D3DDevice);
void Check_Texture_Format_Support(WW3DFormat display_format,const D3DCAPS9& caps);
void Check_Render_To_Texture_Support(WW3DFormat display_format,const D3DCAPS9& caps);
void Check_Depth_Stencil_Support(WW3DFormat display_format, const D3DCAPS9& caps);
void Check_Texture_Compression_Support(const D3DCAPS9& caps);
void Check_Bumpmap_Support(const D3DCAPS9& caps);
void Check_Shader_Support(const D3DCAPS9& caps);
void Check_Maximum_Texture_Support(const D3DCAPS9& caps);
void Check_Driver_Version_Status();
void Vendor_Specific_Hacks(const D3DADAPTER_IDENTIFIER8& adapter_id);
void Vendor_Specific_Hacks(const D3DADAPTER_IDENTIFIER9& adapter_id);

int MaxDisplayWidth;
int MaxDisplayHeight;

D3DCAPS8 Caps;
D3DCAPS9 Caps;
bool SupportTnL;
bool SupportDXTC;
bool supportGamma;
Expand Down
Loading