Skip to content

Commit 2fc32b2

Browse files
tamlin-mikeXottab-DUTY
authored andcommitted
Moved a bunch of CALifeSimulatorBase member functions to not-inline for DEBUG builds to reduce macro-expansion bloat.
1 parent 56d8280 commit 2fc32b2

File tree

3 files changed

+107
-109
lines changed

3 files changed

+107
-109
lines changed

src/xrGame/alife_simulator_base.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
////////////////////////////////////////////////////////////////////////////
2-
// Module : alife_simulator_base.cpp
3-
// Created : 25.12.2002
4-
// Modified : 12.05.2004
5-
// Author : Dmitriy Iassenev
6-
// Description : ALife Simulator base class
2+
// Module : alife_simulator_base.cpp
3+
// Created : 25.12.2002
4+
// Modified : 12.05.2004
5+
// Author : Dmitriy Iassenev
6+
// Description : ALife Simulator base class
77
////////////////////////////////////////////////////////////////////////////
88

99
#include "pch_script.h"
@@ -23,6 +23,10 @@
2323
#include "inventory_upgrade_manager.h"
2424
#include "Level.h"
2525

26+
#ifdef DEBUG
27+
#include "alife_simulator_base_inline.h"
28+
#endif
29+
2630
#pragma warning(push)
2731
#pragma warning(disable : 4995)
2832
#include <malloc.h>
@@ -94,7 +98,7 @@ CSE_Abstract* CALifeSimulatorBase::spawn_item(LPCSTR section, const Fvector& pos
9498
R_ASSERT3(abstract, "Cannot find item with section", section);
9599

96100
abstract->s_name = section;
97-
//. abstract->s_gameid = u8(GAME_SINGLE);
101+
//. abstract->s_gameid = u8(GAME_SINGLE);
98102
abstract->s_RP = 0xff;
99103
abstract->ID = server().PerformIDgen(0xffff);
100104
abstract->ID_Parent = parent_id;
@@ -132,7 +136,7 @@ CSE_Abstract* CALifeSimulatorBase::spawn_item(LPCSTR section, const Fvector& pos
132136
dynamic_object->spawn_supplies();
133137
dynamic_object->on_spawn();
134138

135-
// Msg ("LSS : SPAWN : [%s],[%s], level
139+
// Msg ("LSS : SPAWN : [%s],[%s], level
136140
//%s",*dynamic_object->s_name,dynamic_object->name_replace(),*ai().game_graph().header().level(ai().game_graph().vertex(dynamic_object->m_tGraphID)->level_id()).name());
137141
return (dynamic_object);
138142
}
@@ -240,7 +244,7 @@ void CALifeSimulatorBase::create(CSE_ALifeObject* object)
240244
VERIFY(dynamic_object->m_bOnline);
241245

242246
#ifdef DEBUG
243-
// Msg ("Creating object from client spawn
247+
// Msg ("Creating object from client spawn
244248
//[%d][%d][%s][%s]",dynamic_object->ID,dynamic_object->ID_Parent,dynamic_object->name(),dynamic_object->name_replace());
245249
#endif
246250

src/xrGame/alife_simulator_base.h

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
////////////////////////////////////////////////////////////////////////////
2-
// Module : alife_simulator_base.h
3-
// Created : 25.12.2002
4-
// Modified : 12.05.2004
5-
// Author : Dmitriy Iassenev
6-
// Description : ALife Simulator base class
2+
// Module : alife_simulator_base.h
3+
// Created : 25.12.2002
4+
// Modified : 12.05.2004
5+
// Author : Dmitriy Iassenev
6+
// Description : ALife Simulator base class
77
////////////////////////////////////////////////////////////////////////////
88

99
#pragma once
@@ -62,48 +62,47 @@ class CALifeSimulatorBase : public IPureDestroyableObject
6262
ALife::SCHEDULE_P_VECTOR m_tpaCombatGroups[2];
6363

6464
protected:
65-
IC CALifeSimulatorHeader& header();
66-
IC CALifeTimeManager& time();
67-
IC CALifeSpawnRegistry& spawns();
68-
IC CALifeObjectRegistry& objects();
69-
IC CALifeStoryRegistry& story_objects();
70-
IC CALifeSmartTerrainRegistry& smart_terrains();
71-
IC CALifeGroupRegistry& groups();
72-
IC void can_register_objects(const bool& value);
73-
IC const bool& can_register_objects() const;
65+
CALifeSimulatorHeader& header();
66+
CALifeTimeManager& time();
67+
CALifeSpawnRegistry& spawns();
68+
CALifeObjectRegistry& objects();
69+
CALifeStoryRegistry& story_objects();
70+
CALifeSmartTerrainRegistry& smart_terrains();
71+
CALifeGroupRegistry& groups();
72+
void can_register_objects(bool value);
73+
const bool& can_register_objects() const { return m_can_register_objects; }
7474

7575
public:
76-
IC CALifeGraphRegistry& graph();
77-
IC CALifeScheduleRegistry& scheduled();
78-
IC CALifeTimeManager& time_manager();
79-
IC CALifeRegistryContainer& registry() const;
80-
IC inventory::upgrade::Manager& inventory_upgrade_manager() const;
76+
CALifeGraphRegistry& graph();
77+
CALifeScheduleRegistry& scheduled();
78+
CALifeTimeManager& time_manager();
79+
CALifeRegistryContainer& registry() const;
80+
inventory::upgrade::Manager& inventory_upgrade_manager() const;
8181

8282
public:
8383
CALifeSimulatorBase(IPureServer* server, LPCSTR section);
8484
virtual ~CALifeSimulatorBase();
8585
virtual void destroy();
86-
IC bool initialized() const;
87-
IC const CALifeSimulatorHeader& header() const;
88-
IC const CALifeTimeManager& time() const;
89-
IC const CALifeSpawnRegistry& spawns() const;
90-
IC const CALifeObjectRegistry& objects() const;
91-
IC const CALifeGraphRegistry& graph() const;
92-
IC const CALifeScheduleRegistry& scheduled() const;
93-
IC const CALifeStoryRegistry& story_objects() const;
94-
IC const CALifeSmartTerrainRegistry& smart_terrains() const;
95-
IC const CALifeGroupRegistry& groups() const;
96-
IC CRandom32& random();
97-
IC IPureServer& server() const;
98-
IC const CALifeTimeManager& time_manager() const;
99-
IC shared_str* server_command_line() const;
86+
bool initialized() const { return m_initialized; }
87+
const CALifeSimulatorHeader& header() const;
88+
const CALifeTimeManager& time() const;
89+
const CALifeSpawnRegistry& spawns() const;
90+
const CALifeObjectRegistry& objects() const;
91+
const CALifeGraphRegistry& graph() const;
92+
const CALifeScheduleRegistry& scheduled() const;
93+
const CALifeStoryRegistry& story_objects() const;
94+
const CALifeSmartTerrainRegistry& smart_terrains() const;
95+
const CALifeGroupRegistry& groups() const;
96+
CRandom32& random();
97+
IPureServer& server() const;
98+
const CALifeTimeManager& time_manager() const;
99+
shared_str* server_command_line() const;
100100
template <typename T>
101-
IC T& registry(T* t) const;
102-
101+
T& registry(T* t) const { return registry()(t); }
103102
protected:
104103
void unload();
105104
virtual void reload(LPCSTR section);
106-
IC void setup_command_line(shared_str* command_line);
105+
void setup_command_line(shared_str* command_line);
107106
void assign_death_position(CSE_ALifeCreatureAbstract* tpALifeCreatureAbstract, GameGraph::_GRAPH_ID tGraphID,
108107
CSE_ALifeSchedulable* tpALifeSchedulable = 0);
109108
virtual void setup_simulator(CSE_ALifeObject* object) = 0;
@@ -126,4 +125,6 @@ class CALifeSimulatorBase : public IPureDestroyableObject
126125
ALife::ITEM_P_VECTOR m_temp_item_vector;
127126
};
128127

128+
#ifndef DEBUG // for debug builds, the functions are instantiated by alife_simulator_base.cpp
129129
#include "alife_simulator_base_inline.h"
130+
#endif

0 commit comments

Comments
 (0)