Skip to content

Commit

Permalink
xrRender: portion of fixes linux compile errors, and small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg authored and q4a committed Sep 29, 2018
1 parent e108808 commit 49fd484
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
24 changes: 13 additions & 11 deletions src/Common/PlatformLinux.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -929,5 +929,7 @@ typedef struct _D3DRECT {
#define D3DRECT_DEFINED
#endif

typedef DWORD FOURCC;

inline BOOL SwitchToThread() { return (0 == pthread_yield()); }

2 changes: 1 addition & 1 deletion src/Layers/xrRender/r__occlusion.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "./r__occlusion.h"
#include "r__occlusion.h"

#include "QueryHelper.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderGL/glHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/Layers/xrRenderGL/glSH_Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "../xrRender/ResourceManager.h"

#ifndef _EDITOR
#include "../../xrEngine/render.h"
#include "../../xrEngine/Render.h"
#endif

#include "../../xrEngine/tntQAVI.h"
Expand Down Expand Up @@ -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());
Expand Down
4 changes: 4 additions & 0 deletions src/Layers/xrRenderPC_GL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
18 changes: 9 additions & 9 deletions src/xrEngine/xr_ioc_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*/)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
};
Expand Down

0 comments on commit 49fd484

Please sign in to comment.