diff --git a/premake5.lua b/premake5.lua index adc38948..2bb5ed59 100755 --- a/premake5.lua +++ b/premake5.lua @@ -134,10 +134,10 @@ function findlibs() else links { "SDL2" } end - filter { "platforms:win-amd64-gl3" } + filter { "platforms:win-amd64-gl3", "action:vs*" } libdirs { path.join(_OPTIONS["glfwdir64"], "lib-vc2015") } libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x64") } - filter { "platforms:win-x86-gl3" } + filter { "platforms:win-x86-gl3", "action:vs*" } libdirs { path.join(_OPTIONS["glfwdir32"], "lib-vc2015") } libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x86") } filter { "platforms:win*gl3" } @@ -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/skeleton/imgui/ImGuizmo.cpp b/skeleton/imgui/ImGuizmo.cpp index 3a22a262..81c245c9 100644 --- a/skeleton/imgui/ImGuizmo.cpp +++ b/skeleton/imgui/ImGuizmo.cpp @@ -26,7 +26,7 @@ #endif #include "imgui_internal.h" #include "ImGuizmo.h" -#if !defined(_WIN32) +#if !defined(_WIN32) || (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) #define _malloca(x) alloca(x) #define _freea(x) #else 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)))