Skip to content

Commit

Permalink
More cleaning, compiler warnings etc.
Browse files Browse the repository at this point in the history
Xottab_DUTY: Remove some include guards
  • Loading branch information
tamlin-mike authored and Xottab-DUTY committed Jan 29, 2018
1 parent 0c0834b commit 6393ae6
Show file tree
Hide file tree
Showing 110 changed files with 313 additions and 193 deletions.
1 change: 1 addition & 0 deletions src/Common/object_cloner.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
////////////////////////////////////////////////////////////////////////////

#pragma once
#include "xrCore/xrMemory.h" // xr_strdup

struct CCloner
{
Expand Down
2 changes: 2 additions & 0 deletions src/Common/object_comparer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#pragma once
#include "xrCore/FixedVector.h"
#include "xrCore/xrstring.h"
#include "xrCommon/xr_stack.h"

template <typename P>
struct CComparer
Expand Down
3 changes: 2 additions & 1 deletion src/Common/object_interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
////////////////////////////////////////////////////////////////////////////

#pragma once
#include "xrCore/xrCore.h"
#include "xrCore/_types.h"
#include "xrCommon/inlining_macros.h"

class NET_Packet;
class IReader;
Expand Down
2 changes: 2 additions & 0 deletions src/Common/object_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#pragma once
#include <type_traits>
#include "xrCore/xrstring.h"
#include "xrCommon/xr_string.h"

template <class M, typename P>
struct CLoader
Expand Down
2 changes: 2 additions & 0 deletions src/Common/object_saver.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#pragma once
#include <type_traits>
#include "xrCore/xrstring.h"
#include "xrCommon/xr_string.h"

template <class M, typename P>
struct CSaver
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/ModelPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ dxRender_Visual* CModelPool::Create(const char* name, IReader* data)
string_path low_name;
VERIFY(xr_strlen(name) < sizeof(low_name));
xr_strcpy(low_name, name);
xd_strlwr(low_name);
xr_strlwr(low_name);
if (strext(low_name))
*strext(low_name) = 0;
// Msg ("-CREATE %s",low_name);
Expand Down Expand Up @@ -266,7 +266,7 @@ dxRender_Visual* CModelPool::CreateChild(LPCSTR name, IReader* data)
string256 low_name;
VERIFY(xr_strlen(name) < 256);
xr_strcpy(low_name, name);
xd_strlwr(low_name);
xr_strlwr(low_name);
if (strext(low_name))
*strext(low_name) = 0;

Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void CResourceManager::_ParseList(sh_list& dest, LPCSTR names)
{
// flush
N.push_back(0);
xd_strlwr(N.begin());
xr_strlwr(N.begin());

fix_texture_name(N.begin());
//. andy if (strext(N.begin())) *strext(N.begin())=0;
Expand All @@ -138,7 +138,7 @@ void CResourceManager::_ParseList(sh_list& dest, LPCSTR names)
{
// flush
N.push_back(0);
xd_strlwr(N.begin());
xr_strlwr(N.begin());

fix_texture_name(N.begin());
//. andy if (strext(N.begin())) *strext(N.begin())=0;
Expand Down
12 changes: 4 additions & 8 deletions src/Layers/xrRender/ResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ SVS* CResourceManager::_CreateVS(LPCSTR _name)
FlushLog();
}

CHECK_OR_EXIT(!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings."));
CHECK_OR_EXIT(!FAILED(_hr), "Your video card doesn't meet game requirements.\n\nTry to lower game settings.");

return _vs;
}
Expand Down Expand Up @@ -325,8 +324,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR name)
FlushLog();
}

CHECK_OR_EXIT(!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings."));
CHECK_OR_EXIT(!FAILED(_hr), "Your video card doesn't meet game requirements.\n\nTry to lower game settings.");

return _ps;
}
Expand Down Expand Up @@ -887,8 +885,7 @@ SVS* CResourceManager::_CreateVS(LPCSTR _name)
_RELEASE(pErrorBuf);
pConstants = NULL;

CHECK_OR_EXIT(!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings."));
CHECK_OR_EXIT(!FAILED(_hr), "Your video card doesn't meet game requirements.\n\nTry to lower game settings.");

return _vs;
}
Expand Down Expand Up @@ -1016,8 +1013,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR name)
_RELEASE(pErrorBuf);
pConstants = NULL;

CHECK_OR_EXIT(!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings."));
CHECK_OR_EXIT(!FAILED(_hr), "Your video card doesn't meet game requirements.\n\nTry to lower game settings.");

return _ps;
}
Expand Down
3 changes: 1 addition & 2 deletions src/Layers/xrRender/ShaderResourceTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ inline T* CResourceManager::CreateShader(const char* name)

VERIFY(SUCCEEDED(_hr));

CHECK_OR_EXIT(!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings."));
CHECK_OR_EXIT(!FAILED(_hr), "Your video card doesn't meet game requirements.\n\nTry to lower game settings.");

return sh;
}
Expand Down
9 changes: 3 additions & 6 deletions src/Layers/xrRenderDX10/dx10ResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ SVS* CResourceManager::_CreateVS(LPCSTR _name)

VERIFY(SUCCEEDED(_hr));

CHECK_OR_EXIT(!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings."));
CHECK_OR_EXIT(!FAILED(_hr), "Your video card doesn't meet game requirements.\n\nTry to lower game settings.");

return _vs;
}
Expand Down Expand Up @@ -337,8 +336,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR _name)

VERIFY(SUCCEEDED(_hr));

CHECK_OR_EXIT(!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings."));
CHECK_OR_EXIT(!FAILED(_hr), "Your video card doesn't meet game requirements.\n\nTry to lower game settings.");

return _ps;
}
Expand Down Expand Up @@ -409,8 +407,7 @@ SGS* CResourceManager::_CreateGS(LPCSTR name)

FS.r_close(file);

CHECK_OR_EXIT(!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings."));
CHECK_OR_EXIT(!FAILED(_hr), "Your video card doesn't meet game requirements.\n\nTry to lower game settings.");

return _gs;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Layers/xrRenderPC_GL/glResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ SVS* CResourceManager::_CreateVS (LPCSTR _name)

CHECK_OR_EXIT (
!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings.")
"Your video card doesn't meet game requirements.\n\nTry to lower game settings."
);

return _vs;
Expand Down Expand Up @@ -316,7 +316,7 @@ SPS* CResourceManager::_CreatePS (LPCSTR _name)

CHECK_OR_EXIT(
!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings.")
"Your video card doesn't meet game requirements.\n\nTry to lower game settings."
);

return _ps;
Expand Down Expand Up @@ -389,7 +389,7 @@ SGS* CResourceManager::_CreateGS (LPCSTR name)

CHECK_OR_EXIT (
!FAILED(_hr),
make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings.")
"Your video card doesn't meet game requirements.\n\nTry to lower game settings."
);

return _gs;
Expand Down
3 changes: 1 addition & 2 deletions src/Layers/xrRenderPC_R4/CSCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,5 @@ void CSCompiler::compile(const char* name)

VERIFY(SUCCEEDED(_hr));

CHECK_OR_EXIT(
!FAILED(_hr), make_string("Your video card doesn't meet game requirements.\n\nTry to lower game settings."));
CHECK_OR_EXIT(!FAILED(_hr), "Your video card doesn't meet game requirements.\n\nTry to lower game settings.");
}
2 changes: 1 addition & 1 deletion src/editors/ShaderEditor/GameMtlLib_Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma hdrstop

#include "xrEngine/GameMtlLib.h"
#include "xr_trims.h"
#include "xrCore/xr_trims.h"
#include "xrServerEntities/PropertiesListTypes.h"
#include "xrServerEntities/PropertiesListHelper.h"
#include "editors/xrEProps/FolderLib.h"
Expand Down
18 changes: 10 additions & 8 deletions src/utils/ETools/Intersect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,22 @@ IC static bool clip(float fDenom, float fNumer, float& rfT0, float& rfT1, bool&
return fNumer <= 0.0f;
}
}
IC static bool clip(float fDenom, float fNumer, float& rfT0, float& rfT1, box_axis& ax0, box_axis& ax1, box_axis ax)

IC static bool clip(float fDenom, float fNumer, float& rfT0, float& rfT1, box_axis& ax0, box_axis& ax1, box_axis ax_)
{
bool b0 = false, b1 = false;
if (!clip(fDenom, fNumer, rfT0, rfT1, b0, b1))
return false;

if (b0)
ax0 = ax;
ax0 = ax_;

if (b1)
ax1 = ax;
ax1 = ax_;

return true;
}

static bool intersect(const Fvector& start, const Fvector& dir, const Fvector& extent, float& rfT0, float& rfT1,
box_axis& ax0, box_axis& ax1)
{
Expand Down Expand Up @@ -95,7 +97,7 @@ bool intersect(const Fobb& box, const Fvector& origin, const Fvector& direction,
float fT0 = 0.0f, fT1 = type_max<float>;
box_axis ax0 = a_none;
box_axis ax1 = a_none;
box_axis ax = a_none;
box_axis ax_ = a_none;
if (intersect(kOrigin, kDirection, box.m_halfsize, fT0, fT1, ax0, ax1))
{
bool bPick = false;
Expand All @@ -105,14 +107,14 @@ bool intersect(const Fobb& box, const Fvector& origin, const Fvector& direction,
if (fT0 < dist)
{
dist = fT0;
ax = ax0;
ax_ = ax0;
bPick = true;
}

if (fT1 < dist)
{
dist = fT1;
ax = ax1;
ax_ = ax1;
bPick = true;
}
}
Expand All @@ -121,14 +123,14 @@ bool intersect(const Fobb& box, const Fvector& origin, const Fvector& direction,
if (fT1 < dist)
{
dist = fT1;
ax = ax1;
ax_ = ax1;
bPick = true;
}
}

if (bPick)
{
switch (ax)
switch (ax_)
{
case a_px: norm.set(box.m_rotate.i); break;
case a_nx: norm.invert(box.m_rotate.i); break;
Expand Down
1 change: 1 addition & 0 deletions src/utils/xrAI/xr_graph_merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "spawn_constructor_space.h"
#include "guid_generator.h"
#include "game_graph_builder.h"
#include "xrServerEntities/xrMessages.h"
#include <direct.h>

extern LPCSTR GAME_CONFIG;
Expand Down
3 changes: 3 additions & 0 deletions src/utils/xrMiscMath/matrix.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "pch.hpp"

#include <limits>

#include "xrCore/_matrix.h"
#include "xrCore/_quaternion.h"
#include "xrCore/xrDebug_macros.h"
Expand Down
1 change: 1 addition & 0 deletions src/utils/xrMiscMath/vector3d_ext.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "pch.hpp"
#include "xrCore/_vector3d_ext.h"
#include "xrCommon/math_funcs_inline.h"

float dotproduct(const Fvector& v1, const Fvector& v2)
{
Expand Down
6 changes: 3 additions & 3 deletions src/xrAICore/Navigation/game_graph_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ using namespace luabind;
using namespace luabind::policy;

const CGameGraph* get_game_graph() { return &GEnv.AISpace->game_graph(); }
const CGameGraph::CHeader* get_header(const CGameGraph* self) { return (&self->header()); }
bool get_accessible1(const CGameGraph* self, const u32& vertex_id) { return (self->accessible(vertex_id)); }
void get_accessible2(const CGameGraph* self, const u32& vertex_id, bool value) { self->accessible(vertex_id, value); }
const CGameGraph::CHeader* get_header(const CGameGraph* self_) { return (&self_->header()); }
bool get_accessible1(const CGameGraph* self_, const u32& vertex_id) { return (self_->accessible(vertex_id)); }
void get_accessible2(const CGameGraph* self_, const u32& vertex_id, bool value) { self_->accessible(vertex_id, value); }
Fvector CVertex__level_point(const CGameGraph::CVertex* vertex)
{
THROW(vertex);
Expand Down
1 change: 1 addition & 0 deletions src/xrAICore/Navigation/graph_abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "xrAICore/Navigation/graph_vertex.h"
#include "xrAICore/Navigation/graph_edge.h"
#include "Common/object_broker.h"
#include "xrCommon/xr_map.h"

template <typename _data_type = Loki::EmptyType, typename _edge_weight_type = float, typename _vertex_id_type = u32,
typename _edge_data_type = Loki::EmptyType>
Expand Down
3 changes: 2 additions & 1 deletion src/xrAICore/Navigation/graph_abstract_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
// Author : Dmitriy Iassenev
// Description : Graph class template inline functions
////////////////////////////////////////////////////////////////////////////

#pragma once

#include "xrCore/xrDebug_macros.h"

#define TEMPLATE_SPECIALIZATION \
template <typename _data_type, typename _edge_weight_type, typename _vertex_id_type, typename _edge_data_type\
>
Expand Down
1 change: 1 addition & 0 deletions src/xrAICore/Navigation/graph_vertex.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#pragma once

#include "Common/object_broker.h"
#include "xrCommon/xr_vector.h"

template <typename _data_type, typename _vertex_id_type, typename _graph_type>
class CVertex
Expand Down
3 changes: 2 additions & 1 deletion src/xrAICore/Navigation/graph_vertex_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
// Author : Dmitriy Iassenev
// Description : Graph vertex base class template inline functions
////////////////////////////////////////////////////////////////////////////

#pragma once

#include "xrCore/xrDebug_macros.h"

#define TEMPLATE_SPECIALIZATION \
template <typename _data_type, typename _vertex_id_type, typename _graph_type\
>
Expand Down
1 change: 1 addition & 0 deletions src/xrCDB/xrCDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "xrCore/Threading/Lock.hpp" // XXX: Remove from header. Put in .cpp.
#include "Common/Noncopyable.hpp"
#include "xrCore/math_constants.h"

// forward declarations
class CFrustum;
Expand Down
13 changes: 9 additions & 4 deletions src/xrCore/ChooseTypes.H
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#ifndef ChooseTypesH
#define ChooseTypesH
#pragma once
#include "xrCore/fastdelegate.h"
#include "xrCommon/xr_vector.h"

// fwd. decl.
template <class T>
struct _rect;
using Irect = _rect<int>;


enum EChooseMode
{
Expand Down Expand Up @@ -84,5 +91,3 @@ struct SChooseEvents
};

#define NONE_CAPTION "<none>"

#endif
4 changes: 1 addition & 3 deletions src/xrCore/FixedVector.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once
#ifndef FixedVectorH
#define FixedVectorH
#include "xrCore/_types.h"

// deprecated, use xr_array instead
template <class T, std::size_t dim>
Expand Down Expand Up @@ -114,4 +113,3 @@ class svector
return true;
}
};
#endif
Loading

0 comments on commit 6393ae6

Please sign in to comment.