Skip to content

Commit d6ee7a1

Browse files
Zegeriq4a
authored andcommitted
Fix some includes, template issues and other stuff when DEBUG is on
1 parent e05f7bd commit d6ee7a1

19 files changed

+41
-47
lines changed

src/xrAICore/Components/problem_solver_inline.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,12 @@ IC void CProblemSolverAbstract::add_operator(const _operator_id_type& operator_i
9090
TEMPLATE_SPECIALIZATION
9191
IC void CProblemSolverAbstract::validate_properties(const CState& conditions) const
9292
{
93-
xr_vector<_operator_condition>::const_iterator I = conditions.conditions().begin();
94-
xr_vector<_operator_condition>::const_iterator E = conditions.conditions().end();
95-
for (; I != E; ++I)
93+
for (const auto& cond : conditions.conditions())
9694
{
97-
if (evaluators().find((*I).condition()) == evaluators().end())
95+
if (evaluators().find(cond.condition()) == evaluators().end())
9896
{
99-
Msg("! cannot find corresponding evaluator to the property with id %d", (*I).condition());
100-
THROW(evaluators().find((*I).condition()) != evaluators().end());
97+
Msg("! cannot find corresponding evaluator to the property with id %d", cond.condition());
98+
THROW(evaluators().find(cond.condition()) != evaluators().end());
10199
}
102100
}
103101
}

src/xrCDB/ISpatial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "xrEngine/Render.h"
55
#ifdef DEBUG
66
#include "xrEngine/xr_object.h"
7-
#include "xrEngine/PS_Instance.h"
7+
#include "xrEngine/PS_instance.h"
88
#endif
99
#include "xrEngine/device.h"
1010
#include "xrEngine/GameFont.h"

src/xrCore/LocatorAPI_auth.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void CLocatorAPI::auth_runtime(void* params)
107107
{
108108
string64 c_auth_code;
109109
sscanf(strstr(Core.Params, "asdf ") + 5, "%[^ ] ", c_auth_code);
110-
m_auth_code = _atoi64(c_auth_code);
110+
m_auth_code = atoll(c_auth_code);
111111
}
112112
#endif // DEBUG
113113
xr_delete(_o);

src/xrEngine/xr_collide_form.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ IC float DET(const Fmatrix& a)
1616
return ((a._11 * (a._22 * a._33 - a._23 * a._32) - a._12 * (a._21 * a._33 - a._23 * a._31) +
1717
a._13 * (a._21 * a._32 - a._22 * a._31)));
1818
}
19-
#include "objectdump.h"
19+
#include "ObjectDump.h"
2020
#endif
2121
using namespace collide;
2222
//----------------------------------------------------------------------

src/xrGame/ElevatorState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "MathUtils.h"
66
#include "xrPhysics/PHWorld.h"
77
#ifdef DEBUG
8-
#include "../xrEngine/Statgraph.h"
8+
#include "../xrEngine/StatGraph.h"
99
#include "PHDebug.h"
1010
#endif
1111
static const float getting_on_dist = 0.3f;

src/xrGame/PHDebug.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "Include/xrRender/Kinematics.h"
1919
#include "Include/xrRender/KinematicsAnimated.h"
2020
#include "xrCore/Animation/Bone.hpp"
21-
#include "xrEngine/iphdebug.h"
21+
#include "xrEngine/IPHdebug.h"
2222
#include "xrCore/xr_token.h"
2323
#include "xrEngine/GameFont.h"
2424

@@ -707,8 +707,8 @@ static LPCSTR name_bool(BOOL v)
707707

708708
static LPCSTR name_blend_type(CBlend::ECurvature blend)
709709
{
710-
static xr_token token_blend[] = {{"eFREE_SLOT", CBlend::eFREE_SLOT}, {"eAccrue", CBlend::eAccrue},
711-
{"eFalloff", CBlend::eFalloff}, {"eFORCEDWORD", CBlend::eFORCEDWORD}};
710+
static xr_token token_blend[] = {{"eFREE_SLOT", int(CBlend::eFREE_SLOT)}, {"eAccrue", int(CBlend::eAccrue)},
711+
{"eFalloff", int(CBlend::eFalloff)}, {"eFORCEDWORD", int(CBlend::eFORCEDWORD)}};
712712
return get_token_name(token_blend, blend);
713713
}
714714
/*

src/xrGame/PhysicObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "xrPhysics/ExtendedGeom.h"
1616
#ifdef DEBUG
1717
#include "PHDebug.h"
18-
#include "xrEngine/objectdump.h"
18+
#include "xrEngine/ObjectDump.h"
1919
#endif
2020
BOOL dbg_draw_doors = false;
2121
CPhysicObject::CPhysicObject(void)

src/xrGame/PhysicsShellHolder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "PHCollisionDamageReceiver.h"
2121
#include "xrEngine/IPhysicsShell.h"
2222
#ifdef DEBUG
23-
#include "xrEngine/objectdump.h"
23+
#include "xrEngine/ObjectDump.h"
2424
#endif
2525
CPhysicsShellHolder::CPhysicsShellHolder() { init(); }
2626
CPhysicsShellHolder::~CPhysicsShellHolder()

src/xrGame/WeaponMagazined.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ void CWeaponMagazined::switch2_Idle()
695695
}
696696

697697
#ifdef DEBUG
698-
#include "ai\stalker\ai_stalker.h"
698+
#include "ai/stalker/ai_stalker.h"
699699
#include "object_handler_planner.h"
700700
#endif
701701
void CWeaponMagazined::switch2_Fire()

src/xrGame/ai/monsters/basemonster/base_monster.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class CBaseMonster : public CCustomMonster, public CStepManager
427427
#ifdef DEBUG
428428

429429
template <class Type>
430-
bool get_debug_var(pcstr var_name, OUT Type& result);
430+
bool get_debug_var(pcstr var_name, Type& result);
431431

432432
public:
433433
struct SDebugInfo
@@ -593,7 +593,7 @@ class CBaseMonster : public CCustomMonster, public CStepManager
593593

594594
#ifdef DEBUG
595595
template <class Type>
596-
bool CBaseMonster::get_debug_var(pcstr var_name, OUT Type& result)
596+
bool CBaseMonster::get_debug_var(pcstr var_name, Type& result)
597597
{
598598
char* full_var_name;
599599
STRCONCAT(full_var_name, get_monster_class_name(), "_", var_name);

src/xrGame/ai/monsters/state_inline.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ void CStateAbstract::add_debug_info(debug::text_tree& root_s)
161161
}
162162
else
163163
{
164-
for (SubStates::const_iterator i = substates.begin(), e = substates.end(); i != e; ++i)
164+
for (const auto& [id, substate] : substates)
165165
{
166-
TextTree& current_state_s = root_s.add_line(EMonsterState((*i).first));
167-
if (current_substate == (*i).first)
166+
TextTree& current_state_s = root_s.add_line(EMonsterState(id));
167+
if (current_substate == id)
168168
{
169-
if ((*i).second)
169+
if (substate)
170170
{
171-
(*i).second->add_debug_info(current_state_s);
171+
substate->add_debug_info(current_state_s);
172172
}
173173
else
174174
{

src/xrGame/ai/stalker/ai_stalker_debug.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
#include "cover_point.h"
4444
#include "xrEngine/CameraBase.h"
4545
#include "mt_config.h"
46-
#include "weaponmagazined.h"
46+
#include "WeaponMagazined.h"
4747
#include "object_handler_space.h"
4848
#include "debug_renderer.h"
4949
#include "CharacterPhysicsSupport.h"
5050
#include "smart_cover_animation_selector.h"
5151
#include "animation_movement_controller.h"
52-
#include "phdebug.h"
52+
#include "PHDebug.h"
5353
#include "game_object_space.h"
5454
#include "aimers_weapon.h"
5555
#include "aimers_bone.h"
@@ -166,7 +166,7 @@ void draw_planner(const planner_type& brain, LPCSTR start_indent, LPCSTR indent,
166166
for (; I != E; ++I)
167167
{
168168
const auto J = std::lower_bound(brain.current_state().conditions().cbegin(), brain.current_state().conditions().cend(),
169-
planner_type::CWorldProperty((*I).first, false));
169+
typename planner_type::CWorldProperty((*I).first, false));
170170
char temp = '?';
171171
if ((J != brain.current_state().conditions().end()) && ((*J).condition() == (*I).first))
172172
{
@@ -181,7 +181,7 @@ void draw_planner(const planner_type& brain, LPCSTR start_indent, LPCSTR indent,
181181
for (; I != E; ++I)
182182
{
183183
const auto J = std::lower_bound(brain.target_state().conditions().cbegin(), brain.target_state().conditions().cend(),
184-
planner_type::CWorldProperty((*I).first, false));
184+
typename planner_type::CWorldProperty((*I).first, false));
185185
char temp = '?';
186186
if ((J != brain.target_state().conditions().end()) && ((*J).condition() == (*I).first))
187187
{

src/xrGame/debug_text_tree.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,5 @@ void log_text_tree(text_tree& tree);
100100
#include "debug_text_tree_inline.h"
101101

102102
} // namespace debug
103+
103104
#endif // defined(AI_DEBUG_TEXT_TREE_H_INCLUDED)

src/xrGame/level_debug.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class CLevelDebug
6262
std::sort(m_data.begin(), m_data.end(), sort_id_pred());
6363
}
6464
IC void clear() { m_data.clear(); }
65-
template <class T>
66-
IC void process(T& process_pred)
65+
template <class H>
66+
IC void process(H& process_pred)
6767
{
6868
for (ITEM_STORAGE_VEC_IT it = m_data.begin(); it != m_data.end(); ++it)
6969
{

src/xrGame/static_cast_checked.hpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,11 @@ struct value
3636
template <typename source_type, typename destination_type>
3737
struct helper
3838
{
39-
template <bool is_polymrphic>
39+
template <bool is_polymorphic>
4040
inline static void check(source_type source)
4141
{
42-
value<destination_type>::check(source);
43-
}
44-
45-
template <>
46-
inline static void check<false>(source_type source)
47-
{
42+
if constexpr (is_polymorphic)
43+
value<destination_type>::check(source);
4844
}
4945
};
5046

@@ -55,23 +51,23 @@ struct helper
5551
template <typename destination_type, typename source_type>
5652
inline destination_type static_cast_checked(source_type const& source)
5753
{
58-
typedef object_type_traits::remove_pointer<source_type>::type pointerless_type;
59-
typedef object_type_traits::remove_reference<pointerless_type>::type pure_source_type;
54+
using pointerless_type = typename object_type_traits::remove_pointer<source_type>::type;
55+
using pure_source_type = typename object_type_traits::remove_reference<pointerless_type>::type;
6056

6157
debug::detail::static_cast_checked::helper<source_type const&,
62-
destination_type>::check<std::is_polymorphic<pure_source_type>::value>(source);
58+
destination_type>::template check<std::is_polymorphic<pure_source_type>::value>(source);
6359

6460
return (static_cast<destination_type>(source));
6561
}
6662

6763
template <typename destination_type, typename source_type>
6864
inline destination_type static_cast_checked(source_type& source)
6965
{
70-
typedef object_type_traits::remove_pointer<source_type>::type pointerless_type;
71-
typedef object_type_traits::remove_reference<pointerless_type>::type pure_source_type;
66+
using pointerless_type = typename object_type_traits::remove_pointer<source_type>::type;
67+
using pure_source_type = typename object_type_traits::remove_reference<pointerless_type>::type;
7268

7369
debug::detail::static_cast_checked::helper<source_type&,
74-
destination_type>::check<std::is_polymorphic<pure_source_type>::value>(source);
70+
destination_type>::template check<std::is_polymorphic<pure_source_type>::value>(source);
7571

7672
return (static_cast<destination_type>(source));
7773
}

src/xrGame/ui/UIKeyBinding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void CUIKeyBinding::FillUpList(CUIXml& xml_doc_ui, LPCSTR path_ui)
104104
void CUIKeyBinding::CheckStructure(CUIXml& xml_doc)
105105
{
106106
bool first = true;
107-
CUITextWnd* pItem = false;
107+
CUITextWnd* pItem = nullptr;
108108

109109
for (int i = 0; true; i++)
110110
{

src/xrPhysics/ElevatorState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "PHWorld.h"
77
#include "xrEngine/device.h"
88
#ifdef DEBUG
9-
#include "xrEngine/Statgraph.h"
9+
#include "xrEngine/StatGraph.h"
1010
#include "debug_output.h"
1111
#endif
1212
static const float getting_on_dist = 0.3f;

src/xrPhysics/stdafx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "xrPhysics.h"
1818

19-
#ifdef DEBUG
19+
#if defined(DEBUG) && defined(WINDOWS)
2020
#include <d3d9types.h>
2121
#endif
2222

src/xrScriptEngine/LuaStudio/Defines.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
STATIC_CHECK(false, CS_STRING_CONCAT_or_CS_STRING_CONCAT_HELPER_or_CS_STRING_CONCAT4_macro_already_defined);
2323
#endif // #if defined(CS_STRING_CONCAT) || defined(CS_STRING_CONCAT_HELPER)
2424

25-
#define CS_STRING_CONCAT_HELPER(a, b) a##b
26-
#define CS_STRING_CONCAT(a, b) CS_STRING_CONCAT_HELPER(a, b)
25+
#define CS_STRING_CONCAT(a, b) (a"" b)
2726

2827
// CS_MAKE_STRING macro
2928
#if defined(CS_MAKE_STRING) || defined(CS_MAKE_STRING_HELPER)

0 commit comments

Comments
 (0)