Skip to content

Commit e17c8b0

Browse files
committed
Remove meaningless globals inside globals
VectorNames was used for rmg and now useless
1 parent 659d8b0 commit e17c8b0

8 files changed

Lines changed: 0 additions & 117 deletions

File tree

src/Ext/Rules/Body.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -428,17 +428,6 @@ void RulesExt::ExtData::ReplaceVoxelLightSources()
428428
Game::DestroyVoxelCaches();
429429
}
430430

431-
432-
bool RulesExt::LoadGlobals(PhobosStreamReader& Stm)
433-
{
434-
return Stm.Success();
435-
}
436-
437-
bool RulesExt::SaveGlobals(PhobosStreamWriter& Stm)
438-
{
439-
return Stm.Success();
440-
}
441-
442431
// =============================
443432
// container hooks
444433

src/Ext/Rules/Body.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,4 @@ class RulesExt
332332
Global()->InvalidatePointer(ptr, removed);
333333
}
334334

335-
static bool LoadGlobals(PhobosStreamReader& Stm);
336-
static bool SaveGlobals(PhobosStreamWriter& Stm);
337-
338335
};

src/Ext/Scenario/Body.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,6 @@ void ScenarioExt::ExtData::SaveToStream(PhobosStreamWriter& Stm)
177177
this->Serialize(Stm);
178178
}
179179

180-
bool ScenarioExt::LoadGlobals(PhobosStreamReader& Stm)
181-
{
182-
return Stm.Success();
183-
}
184-
185-
bool ScenarioExt::SaveGlobals(PhobosStreamWriter& Stm)
186-
{
187-
return Stm.Success();
188-
}
189-
190-
191180
// =============================
192181
// container hooks
193182

src/Ext/Scenario/Body.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,4 @@ class ScenarioExt
9494
Global()->InvalidatePointer(ptr, removed);
9595
}
9696

97-
static bool LoadGlobals(PhobosStreamReader& Stm);
98-
static bool SaveGlobals(PhobosStreamWriter& Stm);
9997
};

src/Ext/Sidebar/Body.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ void SidebarExt::ExtData::SaveToStream(PhobosStreamWriter& Stm)
3636
this->Serialize(Stm);
3737
}
3838

39-
bool SidebarExt::LoadGlobals(PhobosStreamReader& Stm)
40-
{
41-
return Stm.Success();
42-
}
43-
44-
bool SidebarExt::SaveGlobals(PhobosStreamWriter& Stm)
45-
{
46-
return Stm.Success();
47-
}
48-
4939

5040
// =============================
5141
// container hooks

src/Ext/Sidebar/Body.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,4 @@ class SidebarExt
5858
{
5959
Global()->InvalidatePointer(ptr, removed);
6060
}
61-
62-
static bool LoadGlobals(PhobosStreamReader& Stm);
63-
static bool SaveGlobals(PhobosStreamWriter& Stm);
6461
};

src/Utilities/Constructs.h

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -134,81 +134,6 @@ class CustomPalette
134134
void CreateConvert();
135135
};
136136

137-
// vector of char* with builtin storage
138-
class VectorNames
139-
{
140-
protected:
141-
DynamicVectorClass<const char*> Strings;
142-
char* Buffer { nullptr };
143-
144-
public:
145-
VectorNames() = default;
146-
147-
VectorNames(const char* pBuffer)
148-
{
149-
this->Tokenize(pBuffer);
150-
}
151-
152-
~VectorNames()
153-
{
154-
this->Clear();
155-
}
156-
157-
const char* operator[] (int index) const
158-
{
159-
return this->Strings.GetItemOrDefault(index);
160-
}
161-
162-
const DynamicVectorClass<const char*>& Entries() const
163-
{
164-
return this->Strings;
165-
}
166-
167-
const char** ToString() const
168-
{
169-
return this->Strings.Items;
170-
}
171-
172-
int Count() const
173-
{
174-
return this->Strings.Count;
175-
}
176-
177-
void Clear()
178-
{
179-
if (this->Buffer)
180-
{
181-
this->Strings.Clear();
182-
free(this->Buffer);
183-
this->Buffer = nullptr;
184-
}
185-
}
186-
187-
void Tokenize()
188-
{
189-
if (this->Buffer)
190-
{
191-
this->Strings.Clear();
192-
193-
char* context = nullptr;
194-
for (auto cur = strtok_s(this->Buffer, ",", &context); cur && *cur; cur = strtok_s(nullptr, ",", &context))
195-
{
196-
this->Strings.AddItem(cur);
197-
}
198-
}
199-
}
200-
201-
void Tokenize(const char* pBuffer)
202-
{
203-
if (pBuffer)
204-
{
205-
this->Clear();
206-
this->Buffer = _strdup(pBuffer);
207-
this->Tokenize();
208-
}
209-
}
210-
};
211-
212137
// a poor man's map with contiguous storage
213138
template <typename TKey, typename TValue>
214139
class PhobosMap

src/Utilities/TemplateDef.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@
5353
#include <VoxClass.h>
5454
#include <CRT.h>
5555
#include <LocomotionClass.h>
56-
#ifdef CUSTOM_LOCO_EXAMPLE_ENABLED
5756
#include <Locomotion/TestLocomotionClass.h>
58-
#endif
5957

6058
namespace detail
6159
{

0 commit comments

Comments
 (0)