From 49fd48423ea04c0583c67be2acfebdc861f21e56 Mon Sep 17 00:00:00 2001 From: Ilya Orlov Date: Sat, 29 Sep 2018 18:31:26 +0300 Subject: [PATCH] xrRender: portion of fixes linux compile errors, and small refactor --- src/Common/PlatformLinux.inl | 24 +++++++++++++----------- src/Layers/xrRender/r__occlusion.cpp | 2 +- src/Layers/xrRenderGL/glHW.cpp | 2 +- src/Layers/xrRenderGL/glSH_Texture.cpp | 6 +++--- src/Layers/xrRenderPC_GL/CMakeLists.txt | 4 ++++ src/xrEngine/xr_ioc_cmd.h | 18 +++++++++--------- 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/Common/PlatformLinux.inl b/src/Common/PlatformLinux.inl index eaa865bae53..19d5b85de7b 100644 --- a/src/Common/PlatformLinux.inl +++ b/src/Common/PlatformLinux.inl @@ -881,6 +881,17 @@ typedef enum _D3DTRANSFORMSTATETYPE { D3DTS_FORCE_DWORD = 0x7fffffff } D3DTRANSFORMSTATETYPE; +typedef enum _D3DTEXTURETRANSFORMFLAGS { + D3DTTFF_DISABLE = 0, + D3DTTFF_COUNT1 = 1, + D3DTTFF_COUNT2 = 2, + D3DTTFF_COUNT3 = 3, + D3DTTFF_COUNT4 = 4, + D3DTTFF_PROJECTED = 256, + + D3DTTFF_FORCE_DWORD = 0x7fffffff +} D3DTEXTURETRANSFORMFLAGS; + #define D3DTS_WORLD D3DTS_WORLDMATRIX(0) #define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1) #define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2) @@ -908,17 +919,6 @@ typedef enum _D3DTRANSFORMSTATETYPE { #define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0} -typedef enum _D3DTEXTURETRANSFORMFLAGS { - D3DTTFF_DISABLE = 0, - D3DTTFF_COUNT1 = 1, - D3DTTFF_COUNT2 = 2, - D3DTTFF_COUNT3 = 3, - D3DTTFF_COUNT4 = 4, - D3DTTFF_PROJECTED = 256, - - D3DTTFF_FORCE_DWORD = 0x7fffffff -} D3DTEXTURETRANSFORMFLAGS; - #ifndef D3DRECT_DEFINED typedef struct _D3DRECT { LONG x1; @@ -929,5 +929,7 @@ typedef struct _D3DRECT { #define D3DRECT_DEFINED #endif +typedef DWORD FOURCC; + inline BOOL SwitchToThread() { return (0 == pthread_yield()); } diff --git a/src/Layers/xrRender/r__occlusion.cpp b/src/Layers/xrRender/r__occlusion.cpp index 9f31ae7119f..aaadd21180b 100644 --- a/src/Layers/xrRender/r__occlusion.cpp +++ b/src/Layers/xrRender/r__occlusion.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "./r__occlusion.h" +#include "r__occlusion.h" #include "QueryHelper.h" diff --git a/src/Layers/xrRenderGL/glHW.cpp b/src/Layers/xrRenderGL/glHW.cpp index 0181165c11d..f46395ce631 100644 --- a/src/Layers/xrRenderGL/glHW.cpp +++ b/src/Layers/xrRenderGL/glHW.cpp @@ -168,7 +168,7 @@ void CHW::ClearDepthStencilView(GLuint pDepthStencilView, UINT ClearFlags, FLOAT glDepthMask(GL_TRUE); glClearDepthf(Depth); } - if (ClearFlags & D3DCLEAR_STENCIL) + if (ClearFlags & D3D_CLEAR_STENCIL) { glStencilMask(~0); glClearStencil(Stencil); diff --git a/src/Layers/xrRenderGL/glSH_Texture.cpp b/src/Layers/xrRenderGL/glSH_Texture.cpp index b734a4d4139..d07f4ed9871 100644 --- a/src/Layers/xrRenderGL/glSH_Texture.cpp +++ b/src/Layers/xrRenderGL/glSH_Texture.cpp @@ -4,7 +4,7 @@ #include "../xrRender/ResourceManager.h" #ifndef _EDITOR -#include "../../xrEngine/render.h" +#include "../../xrEngine/Render.h" #endif #include "../../xrEngine/tntQAVI.h" @@ -301,8 +301,8 @@ void CTexture::Load() void CTexture::Unload() { #ifdef DEBUG - string_path msg_buff; - sprintf_s(msg_buff, sizeof(msg_buff), "* Unloading texture [%s] pSurface ID=%d", cName.c_str(), pSurface); + string_path msg_buff; + sprintf_s(msg_buff, sizeof(msg_buff), "* Unloading texture [%s] pSurface ID=%d", cName.c_str(), pSurface); #endif // DEBUG //. if (flags.bLoaded) Msg ("* Unloaded: %s",cName.c_str()); diff --git a/src/Layers/xrRenderPC_GL/CMakeLists.txt b/src/Layers/xrRenderPC_GL/CMakeLists.txt index 6220c3bbe1a..996663ca956 100644 --- a/src/Layers/xrRenderPC_GL/CMakeLists.txt +++ b/src/Layers/xrRenderPC_GL/CMakeLists.txt @@ -28,8 +28,12 @@ list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../xrRend list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../xrRender/Texture.cpp") list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../xrRender/SH_Texture.cpp") list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../xrRender/ResourceManager_Resources.cpp") +list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../xrRender/xr_effgamma.cpp") +list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../xrRender/r__pixel_calculator.cpp") list(REMOVE_ITEM ${PROJECT_NAME}__INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../xrRender/stats_manager.h") +list(REMOVE_ITEM ${PROJECT_NAME}__INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../xrRender/xr_effgamma.h") +list(REMOVE_ITEM ${PROJECT_NAME}__INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../xrRender/r__pixel_calculator.h") add_definitions(-DXRLCUTIL_EXPORTS -D_USRDLL -DXRRENDER_GL_EXPORTS -DUSE_OGL -DNO_XR_VDECLARATOR) add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES}) diff --git a/src/xrEngine/xr_ioc_cmd.h b/src/xrEngine/xr_ioc_cmd.h index 739ef24db58..8e019bae27a 100644 --- a/src/xrEngine/xr_ioc_cmd.h +++ b/src/xrEngine/xr_ioc_cmd.h @@ -127,7 +127,7 @@ class ENGINE_API CCC_ToggleMask : public IConsole_Command u32 mask; public: - CCC_ToggleMask(LPCSTR N, Flags32* V, u32 M) : IConsole_Command(N), value(V), mask(M) { bEmptyArgsHandled = TRUE; }; + CCC_ToggleMask(LPCSTR N, Flags32* V, u32 M) : IConsole_Command(N), value(V), mask(M) { bEmptyArgsHandled = TRUE; } const BOOL GetValue() const { return value->test(mask); } virtual void Execute(LPCSTR /*args*/) { @@ -153,7 +153,7 @@ class ENGINE_API CCC_Token : public IConsole_Command const xr_token* tokens; public: - CCC_Token(LPCSTR N, u32* V, const xr_token* T) : IConsole_Command(N), value(V), tokens(T){}; + CCC_Token(LPCSTR N, u32* V, const xr_token* T) : IConsole_Command(N), value(V), tokens(T){} virtual void Execute(LPCSTR args) { @@ -239,8 +239,8 @@ class ENGINE_API CCC_Float : public IConsole_Command public: CCC_Float(LPCSTR N, float* V, float _min = 0, float _max = 1) - : IConsole_Command(N), value(V), min(_min), max(_max){}; - const float GetValue() const { return *value; }; + : IConsole_Command(N), value(V), min(_min), max(_max){} + const float GetValue() const { return *value; } void GetBounds(float& fmin, float& fmax) const { fmin = min; @@ -283,8 +283,8 @@ class ENGINE_API CCC_Vector3 : public IConsole_Command min.set(_min); max.set(_max); }; - const Fvector GetValue() const { return *value; }; - Fvector* GetValuePtr() const { return value; }; + const Fvector GetValue() const { return *value; } + Fvector* GetValuePtr() const { return value; } virtual void Execute(LPCSTR args) { Fvector v; @@ -327,14 +327,14 @@ class ENGINE_API CCC_Integer : public IConsole_Command int min, max; public: - const int GetValue() const { return *value; }; + const int GetValue() const { return *value; } void GetBounds(int& imin, int& imax) const { imin = min; imax = max; } - CCC_Integer(LPCSTR N, int* V, int _min = 0, int _max = 999) : IConsole_Command(N), value(V), min(_min), max(_max){}; + CCC_Integer(LPCSTR N, int* V, int _min = 0, int _max = 999) : IConsole_Command(N), value(V), min(_min), max(_max){} virtual void Execute(LPCSTR args) { @@ -382,7 +382,7 @@ class ENGINE_API CCC_String : public IConsole_Command class ENGINE_API CCC_LoadCFG : public IConsole_Command { public: - virtual bool allow(LPCSTR /*cmd*/) { return true; }; + virtual bool allow(LPCSTR /*cmd*/) { return true; } CCC_LoadCFG(LPCSTR N); virtual void Execute(LPCSTR args); };