From 5f05f9e06980f1e4b58c63e53c8ef53cdfd162f1 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Tue, 29 Jun 2021 15:55:28 +0100 Subject: [PATCH] Fix compilation with MinGW --- premake5.lua | 2 -- src/CMakeLists.txt | 1 - src/d3d/rwd3d.h | 12 ++++-------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/premake5.lua b/premake5.lua index adc38948..d83187b8 100755 --- a/premake5.lua +++ b/premake5.lua @@ -149,8 +149,6 @@ function findlibs() end filter { "platforms:*d3d9" } links { "gdi32", "d3d9" } - filter { "platforms:*d3d9", "action:vs*" } - links { "Xinput9_1_0" } filter {} end diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5b169011..45f539fe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -188,7 +188,6 @@ elseif(LIBRW_PLATFORM_D3D9) target_link_libraries(librw PRIVATE d3d9 - xinput ) endif() diff --git a/src/d3d/rwd3d.h b/src/d3d/rwd3d.h index 4ce29be1..abc1b09c 100644 --- a/src/d3d/rwd3d.h +++ b/src/d3d/rwd3d.h @@ -1,6 +1,8 @@ #ifdef RW_D3D9 #ifdef WITH_D3D #include +#else +typedef struct IDirect3DDevice9 IDirect3DDevice9; #endif #endif @@ -8,7 +10,7 @@ namespace rw { #ifdef RW_D3D9 -#ifdef _WINDOWS_ +#if defined(_WINDOWS_) || defined(_WINDEF_H) struct EngineOpenParams { HWND window; @@ -19,10 +21,7 @@ struct EngineOpenParams uint32 please_include_windows_h; }; #endif -#else -#ifdef _D3D9_H_ -#error "please don't include d3d9.h for non-d3d9 platforms" -#endif + #endif namespace d3d { @@ -32,10 +31,7 @@ extern bool32 isP8supported; extern Device renderdevice; #ifdef RW_D3D9 -#ifdef _D3D9_H_ extern IDirect3DDevice9 *d3ddevice; -void setD3dMaterial(D3DMATERIAL9 *mat9); -#endif #define COLOR_ARGB(a, r, g, b) ((rw::uint32)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))