Fix compilation with MinGW

This commit is contained in:
Cameron Cawley 2021-06-29 15:55:28 +01:00
parent b164e49dcf
commit 39933ccc21
4 changed files with 11 additions and 16 deletions

View File

@ -134,10 +134,10 @@ function findlibs()
else else
links { "SDL2" } links { "SDL2" }
end end
filter { "platforms:win-amd64-gl3" } filter { "platforms:win-amd64-gl3", "action:vs*" }
libdirs { path.join(_OPTIONS["glfwdir64"], "lib-vc2015") } libdirs { path.join(_OPTIONS["glfwdir64"], "lib-vc2015") }
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x64") } 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["glfwdir32"], "lib-vc2015") }
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x86") } libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x86") }
filter { "platforms:win*gl3" } filter { "platforms:win*gl3" }
@ -149,8 +149,6 @@ function findlibs()
end end
filter { "platforms:*d3d9" } filter { "platforms:*d3d9" }
links { "gdi32", "d3d9" } links { "gdi32", "d3d9" }
filter { "platforms:*d3d9", "action:vs*" }
links { "Xinput9_1_0" }
filter {} filter {}
end end

View File

@ -26,11 +26,13 @@
#endif #endif
#include "imgui_internal.h" #include "imgui_internal.h"
#include "ImGuizmo.h" #include "ImGuizmo.h"
#if !defined(_WIN32)
#if defined(_MSC_VER) || defined(__MINGW32__)
#include <malloc.h>
#endif
#if !defined(_MSC_VER) && !defined(__MINGW64_VERSION_MAJOR)
#define _malloca(x) alloca(x) #define _malloca(x) alloca(x)
#define _freea(x) #define _freea(x)
#else
#include <malloc.h>
#endif #endif
// includes patches for multiview from // includes patches for multiview from

View File

@ -188,7 +188,6 @@ elseif(LIBRW_PLATFORM_D3D9)
target_link_libraries(librw target_link_libraries(librw
PRIVATE PRIVATE
d3d9 d3d9
xinput
) )
endif() endif()

View File

@ -1,6 +1,8 @@
#ifdef RW_D3D9 #ifdef RW_D3D9
#ifdef WITH_D3D #ifdef WITH_D3D
#include <d3d9.h> #include <d3d9.h>
#else
typedef struct IDirect3DDevice9 IDirect3DDevice9;
#endif #endif
#endif #endif
@ -8,7 +10,7 @@ namespace rw {
#ifdef RW_D3D9 #ifdef RW_D3D9
#ifdef _WINDOWS_ #if defined(_WINDOWS_) || defined(_WINDEF_H)
struct EngineOpenParams struct EngineOpenParams
{ {
HWND window; HWND window;
@ -19,10 +21,7 @@ struct EngineOpenParams
uint32 please_include_windows_h; uint32 please_include_windows_h;
}; };
#endif #endif
#else
#ifdef _D3D9_H_
#error "please don't include d3d9.h for non-d3d9 platforms"
#endif
#endif #endif
namespace d3d { namespace d3d {
@ -32,10 +31,7 @@ extern bool32 isP8supported;
extern Device renderdevice; extern Device renderdevice;
#ifdef RW_D3D9 #ifdef RW_D3D9
#ifdef _D3D9_H_
extern IDirect3DDevice9 *d3ddevice; 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))) #define COLOR_ARGB(a, r, g, b) ((rw::uint32)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))