Skip to content

Commit

Permalink
Lots of header files compile-time distanglement.
Browse files Browse the repository at this point in the history
  • Loading branch information
tamlin-mike authored and Xottab-DUTY committed Jan 29, 2018
1 parent c810d6d commit 28f695d
Show file tree
Hide file tree
Showing 92 changed files with 439 additions and 145 deletions.
11 changes: 7 additions & 4 deletions src/Include/xrRender/DebugRender.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#ifndef DebugRender_included
#define DebugRender_included
#pragma once

#ifdef DEBUG

#include "xrCore/_types.h"
#include "DebugShader.h"

// fwd. decl.
template <class T> struct _vector3;
using Fvector = _vector3<float>;
template <class T> struct _matrix;
using Fmatrix = _matrix<float>;

class IDebugRender
{
public:
Expand Down Expand Up @@ -47,5 +52,3 @@ class IDebugRender
};

#endif // DEBUG

#endif // DebugRender_included
6 changes: 1 addition & 5 deletions src/Include/xrRender/DebugShader.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef DebugShader_included
#define DebugShader_included
#pragma once

#include "FactoryPtr.h"
#include "UIShader.h"

typedef FactoryPtr<IUIShader> debug_shader;

#endif // DebugShader_included
using debug_shader = FactoryPtr<IUIShader>;
8 changes: 8 additions & 0 deletions src/Include/xrRender/UIRender.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#ifndef UIRender_included
#define UIRender_included
#pragma once
#include "xrCore/_types.h"

// fwd. decl.
class IUIShader;
template <class T> struct _rect;
using Irect = _rect<int>;
template <class T> struct _vector2;
using Fvector2 = _vector2<float>;
template <class T> struct _matrix;
using Fmatrix = _matrix<float>;

class IUIRender
{
Expand Down
2 changes: 2 additions & 0 deletions src/xrAICore/Components/operator_condition.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
////////////////////////////////////////////////////////////////////////////

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

template <typename _condition_type, typename _value_type>
class COperatorConditionAbstract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
////////////////////////////////////////////////////////////////////////////

#pragma once
#include "xrCore/_vector3d.h"

template <typename _dist_type, typename _index_type, typename _iteration_type>
struct SStraightLineParams : public SBaseParameters<_dist_type, _index_type, _iteration_type>
Expand Down
1 change: 1 addition & 0 deletions src/xrAICore/Navigation/data_storage_binary_heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
////////////////////////////////////////////////////////////////////////////

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

struct CDataStorageBinaryHeap
{
Expand Down
2 changes: 2 additions & 0 deletions src/xrAICore/Navigation/vertex_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
////////////////////////////////////////////////////////////////////////////

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

template <bool EuclidianHeuristics = true>
struct CVertexPath
Expand Down
2 changes: 2 additions & 0 deletions src/xrCDB/xrCDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "xrCore/Threading/Lock.hpp" // XXX: Remove from header. Put in .cpp.
#include "Common/Noncopyable.hpp"
#include "xrCore/math_constants.h"
#include "xrCore/_vector3d.h"
#include "xrCommon/xr_vector.h"

// forward declarations
class CFrustum;
Expand Down
4 changes: 4 additions & 0 deletions src/xrCDB/xr_collide_defs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#pragma once

#include <algorithm>

#include "xrCDB.h"
#include "xrCore/_vector3d.h"
#include "xrCore/_matrix.h"

class IGameObject;
namespace collide
Expand Down
2 changes: 2 additions & 0 deletions src/xrCore/FixedVector.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once
#include "xrCore/_types.h"
#include "xrCore/xrDebug_macros.h"
#include "xrCore/xrMemory.h"

// deprecated, use xr_array instead
template <class T, std::size_t dim>
Expand Down
18 changes: 10 additions & 8 deletions src/xrCore/XML/XMLDocument.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#define PUGIXML_NO_XPATH
#define PUGIXML_HAS_LONG_LONG
#include "pugixml.hpp"
#include "xrCommon/xr_vector.h"
#include "xrCore/xrstring.h"

static constexpr pcstr CONFIG_PATH = "$game_config$";
static constexpr pcstr UI_PATH = "ui";
Expand All @@ -34,7 +36,7 @@ class XML_NODE
return XML_NODE(node.first_child());
}

XML_NODE firstChild(const char* name) const
XML_NODE firstChild(pcstr name) const
{
return XML_NODE(node.child(name));
}
Expand All @@ -44,18 +46,18 @@ class XML_NODE
return XML_NODE(node.next_sibling());
}

XML_NODE nextSibling(const char* name) const
XML_NODE nextSibling(pcstr name) const
{
return XML_NODE(node.next_sibling(name));
}

const char* textValueOr(const char* defaultValue) const
pcstr textValueOr(pcstr defaultValue) const
{
const auto text = node.text();
return text ? text.get() : defaultValue;
}

const char* elementAttribute(const char* name) const
pcstr elementAttribute(pcstr name) const
{
if (node.type() == pugi::node_element)
{
Expand All @@ -65,15 +67,15 @@ class XML_NODE
return nullptr;
}

const char* elementValue() const
pcstr elementValue() const
{
if (node.type() == pugi::node_element)
return node.name();

return nullptr;
}

const char* value() const
pcstr value() const
{
switch (node.type())
{
Expand All @@ -95,7 +97,7 @@ struct XML_DOC
doc.reset();
}

void parse(const char* data)
void parse(pcstr data)
{
res = doc.load_string(data);
}
Expand All @@ -105,7 +107,7 @@ struct XML_DOC
return !res;
}

const char* error() const
pcstr error() const
{
return res.description();
}
Expand Down
1 change: 1 addition & 0 deletions src/xrCore/clsid.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#ifndef _CLSID_H
#define _CLSID_H
#include "_types.h"

//***** CLASS ID type
typedef u64 CLASS_ID;
Expand Down
2 changes: 1 addition & 1 deletion src/xrCore/xrDebug_macros.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#ifndef xrDebug_macrosH
#define xrDebug_macrosH
#include "xrDebug.h"

#define DEBUG_INFO {__FILE__, __LINE__, __FUNCTION__}
#define CHECK_OR_EXIT(expr, message)\
Expand Down Expand Up @@ -61,7 +62,6 @@
#endif

#ifdef DEBUG
#include "xrDebug.h"
#define NODEFAULT FATAL("nodefault reached")
#define VERIFY(expr)\
do\
Expand Down
4 changes: 3 additions & 1 deletion src/xrEngine/CameraDefs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#pragma once
#ifndef CAMERA_DEFS_H_INCLUDED
#define CAMERA_DEFS_H_INCLUDED

#pragma once
#include "xrCore/fastdelegate.h"
#include "xrCore/_vector3d.h"

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

#include "CameraDefs.h"
#include "xrCore/PostProcess/PPInfo.hpp"
#include "xrCommon/xr_list.h"
#include "xrCommon/xr_vector.h"

using EffectorCamVec = xr_list<CEffectorCam*>;
using EffectorPPVec = xr_vector<CEffectorPP*>;
Expand Down
6 changes: 4 additions & 2 deletions src/xrEngine/CustomHUD.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#pragma once
#include "xrEngine/EngineAPI.h"
#include "xrEngine/EventAPI.h"
#include "xrEngine/pure.h"

ENGINE_API extern Flags32 psHUD_Flags;
#define HUD_CROSSHAIR (1 << 0)
Expand All @@ -14,8 +17,7 @@ ENGINE_API extern Flags32 psHUD_Flags;
#define HUD_WEAPON_RT2 (1 << 11)
#define HUD_DRAW_RT2 (1 << 12)

class ENGINE_API IRender_Visual;
class CUI;
class IGameObject;

class ENGINE_API CCustomHUD : public FactoryObjectBase, public IEventReceiver, public pureScreenResolutionChanged
{
Expand Down
4 changes: 2 additions & 2 deletions src/xrEngine/Effector.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#pragma once

#include "CameraDefs.h"
#include "xrCore/xrCore_benchmark_macros.h"
#include "device.h"

class ENGINE_API CEffectorCam : public SBaseEffector
{
Expand Down
5 changes: 3 additions & 2 deletions src/xrEngine/Engine.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#pragma once

#include "engineAPI.h"
#include "eventAPI.h"
#include "EngineAPI.h"
#include "EventAPI.h"
#include "xrCore/xrCore_benchmark_macros.h"
#include "xrSheduler.h"

class ENGINE_API CEngine
Expand Down
1 change: 1 addition & 0 deletions src/xrEngine/EngineAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "xrEngine/Engine.h"
#include "xrCore/ModuleLookup.hpp"
#include "xrCore/clsid.h"
#include "xrCore/xrCore_benchmark_macros.h"

class IFactoryObject
{
Expand Down
1 change: 1 addition & 0 deletions src/xrEngine/EventAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "xrCore/Threading/Lock.hpp"
#include "Common/Noncopyable.hpp"
#include "xrCommon/xr_vector.h"

class ENGINE_API CEvent;
typedef CEvent* EVENT;
Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/Feel_Touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using namespace Feel;
Touch::Touch() : pure_relcase(&Touch::feel_touch_relcase) {}
Touch::~Touch() {}
bool Touch::feel_touch_contact(IGameObject* O) { return true; }
void Touch::feel_touch_deny(IGameObject* O, DWORD T)
void Touch::feel_touch_deny(IGameObject* O, /*DWORD*/ unsigned long T)
{
DenyTouch D;
D.O = O;
Expand Down
9 changes: 7 additions & 2 deletions src/xrEngine/Feel_Touch.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#pragma once

#include "pure_relcase.h"
#include "xrCommon/xr_vector.h"

// fwd. decl.
class IGameObject;
template <class T> struct _vector3;
using Fvector = _vector3<float>;

class ENGINE_API IGameObject;
namespace Feel
{
class ENGINE_API Touch : private pure_relcase
Expand All @@ -13,7 +18,7 @@ class ENGINE_API Touch : private pure_relcase
struct DenyTouch
{
IGameObject* O;
DWORD Expire;
/*DWORD*/ unsigned long Expire;
};

protected:
Expand Down
4 changes: 4 additions & 0 deletions src/xrEngine/IGame_Level.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#include "xr_object_list.h"
#include "xrCDB/xr_area.h"
#include "xrSound/Sound.h"
#include "xrCore/FixedVector.h"
#include "EngineAPI.h"
#include "EventAPI.h"
#include "pure.h"

// refs
class ENGINE_API CCameraManager;
Expand Down
6 changes: 6 additions & 0 deletions src/xrEngine/IInputReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
#pragma once
#ifndef IINPUTRECEIVERH
#define IINPUTRECEIVERH
#include "xrCore/_flags.h"

// fwd. decl.
template <class T> struct _vector2;
using Fvector2 = _vector2<float>;
using Ivector2 = _vector2<int>;

class ENGINE_API IInputReceiver
{
Expand Down
1 change: 1 addition & 0 deletions src/xrEngine/pure.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#ifndef _PURE_H_AAA_
#define _PURE_H_AAA_
#include "xrCommon/xr_vector.h"

// messages
#define REG_PRIORITY_LOW 0x11111111ul
Expand Down
4 changes: 4 additions & 0 deletions src/xrEngine/pure_relcase.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#pragma once
#ifndef pure_relcaseH
#define pure_relcaseH
#include "xrCore/xrDebug_macros.h"
#include "xrCore/fastdelegate.h" // XXX: Inluding this VERY heavy file for just xr_stdcall seems suboptimal.

class IGameObject;

class ENGINE_API pure_relcase
{
Expand Down
1 change: 1 addition & 0 deletions src/xrEngine/xrSheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

//#include "ISheduled.h"
#include "xrCore/xrstring.h"
#include "xrCore/FTimer.h"

class ISheduled;

Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ActorEffector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "ActorEffector.h"
#include "PostprocessAnimator.h"
#include "xrEngine/effectorPP.h"
#include "xrEngine/EffectorPP.h"
#include "xrEngine/ObjectAnimator.h"
#include "Common/object_broker.h"
#include "actor.h"
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/CameraEffector.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include "xrEngine/CameraManager.h"
#include "xrEngine/effector.h"
#include "xrEngine/effectorPP.h"
#include "xrEngine/Effector.h"
#include "xrEngine/EffectorPP.h"

#define eStartEffectorID 50

Expand Down
Loading

0 comments on commit 28f695d

Please sign in to comment.