Skip to content

Commit 04b2050

Browse files
committed
Small refactoring. Comment out unused code. Remove unused files from vcxproj. Add some doc.
1 parent d752ba2 commit 04b2050

File tree

8 files changed

+71
-222
lines changed

8 files changed

+71
-222
lines changed

src/utils/xrAI/compiler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ struct b_BuildTexture : public b_texture
104104

105105
extern Shader_xrLC_LIB* g_shaders_xrlc;
106106
extern xr_vector<b_material> g_materials;
107-
extern xr_vector<b_shader> g_shader_render;
108-
extern xr_vector<b_shader> g_shader_compile;
107+
//extern xr_vector<b_shader> g_shader_render;
108+
//extern xr_vector<b_shader> g_shader_compile;
109109
extern xr_vector<b_BuildTexture> g_textures;
110110
extern xr_vector<b_rc_face> g_rc_faces;
111111

src/utils/xrAI/compiler_cover.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
Shader_xrLC_LIB* g_shaders_xrlc;
1111
xr_vector<b_material> g_materials;
12-
xr_vector<b_shader> g_shader_render;
13-
xr_vector<b_shader> g_shader_compile;
12+
//xr_vector<b_shader> g_shader_render;
13+
//xr_vector<b_shader> g_shader_compile;
1414
xr_vector<b_BuildTexture> g_textures;
1515
xr_vector<b_rc_face> g_rc_faces;
1616

@@ -40,7 +40,7 @@ IC float getLastRP_Scale(CDB::COLLIDER* DB, RayCache& C)
4040
b_rc_face& F = g_rc_faces[rpinf.id];
4141

4242
if (F.dwMaterial >= g_materials.size())
43-
Msg("[%d] -> [%d]", F.dwMaterial, g_materials.size());
43+
Logger.clMsg("[%d] -> [%d]", F.dwMaterial, g_materials.size());
4444
b_material& M = g_materials[F.dwMaterial];
4545
b_texture& T = g_textures[M.surfidx];
4646
Shader_xrLCVec& LIB = g_shaders_xrlc->Library();
@@ -89,7 +89,7 @@ IC float getLastRP_Scale(CDB::COLLIDER* DB, RayCache& C)
8989
}
9090
// X_CATCH
9191
// {
92-
// clMsg("* ERROR: getLastRP_Scale");
92+
// Logger.clMsg("* ERROR: getLastRP_Scale");
9393
// }
9494

9595
return scale;
@@ -587,7 +587,7 @@ void xrCover(bool pure_covers)
587587
Threads.start(
588588
new CoverThread(thID, thID * stride, thID * stride + ((thID == (NUM_THREADS - 1)) ? last : stride)));
589589
Threads.wait();
590-
Msg("%d seconds elapsed.", (timeGetTime() - start_time) / 1000);
590+
Logger.clMsg("%d seconds elapsed.", (timeGetTime() - start_time) / 1000);
591591

592592
if (!pure_covers)
593593
{

src/utils/xrAI/compiler_load.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#include "compiler.h"
33

44
// TODO: Do we really need this?
5-
Lights g_lights;
6-
Fbox LevelBB;
5+
//Lights g_lights;
76

87
IC const Fvector vertex_position(const CLevelGraph::CPosition& Psrc, const Fbox& bb, const SAIParams& params)
98
{
@@ -83,7 +82,6 @@ void xrLoad(LPCSTR name, bool draft_mode)
8382
R_ASSERT(fs->find_chunk(1));
8483
fs->r(&*g_rc_faces.begin(), g_rc_faces.size() * sizeof(b_rc_face));
8584

86-
LevelBB.set(H.aabb);
8785
FS.r_close(fs);
8886
}
8987

@@ -104,7 +102,7 @@ void xrLoad(LPCSTR name, bool draft_mode)
104102

105103
// Load level data
106104
transfer("materials", g_materials, *fs, EB_Materials);
107-
transfer("shaders_xrlc", g_shader_compile, *fs, EB_Shaders_Compile);
105+
//transfer("shaders_xrlc", g_shader_compile, *fs, EB_Shaders_Compile);
108106

109107
// process textures
110108
Logger.Status("Processing textures...");
@@ -181,7 +179,7 @@ void xrLoad(LPCSTR name, bool draft_mode)
181179
}
182180
}
183181
// Load lights
184-
{
182+
/*{
185183
strconcat(sizeof(file_name), file_name, name, "build.prj");
186184
IReader* F = FS.r_open(file_name);
187185
R_ASSERT2(F, "There is no file 'build.prj'!");
@@ -239,7 +237,7 @@ void xrLoad(LPCSTR name, bool draft_mode)
239237
}
240238
F->close();
241239
}
242-
}
240+
}*/
243241
// Load initial map from the Level Editor
244242
{
245243
strconcat(sizeof(file_name), file_name, name, "build.aimap");
@@ -249,6 +247,8 @@ void xrLoad(LPCSTR name, bool draft_mode)
249247
R_ASSERT(F->open_chunk(E_AIMAP_CHUNK_VERSION));
250248
R_ASSERT(F->r_u16() == E_AIMAP_VERSION);
251249

250+
Fbox LevelBB;
251+
252252
R_ASSERT(F->open_chunk(E_AIMAP_CHUNK_BOX));
253253
F->r(&LevelBB, sizeof(LevelBB));
254254

src/utils/xrAI/compiler_save.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@ class CNodeRenumberer
105105

106106
void xrSaveNodes(LPCSTR name, LPCSTR out_name)
107107
{
108-
Msg("NS: %d, CNS: %d, ratio: %f%%", sizeof(vertex), sizeof(CLevelGraph::CVertex),
109-
100 * float(sizeof(CLevelGraph::CVertex)) / float(sizeof(vertex)));
108+
Logger.Status("Saving nodes...");
110109

111-
Msg("Renumbering nodes...");
110+
Logger.clMsg("NS: %d, CNS: %d, ratio: %f%%", sizeof(vertex), sizeof(CLevelGraph::CVertex),
111+
100 * float(sizeof(CLevelGraph::CVertex)) / float(sizeof(vertex)));
112112

113113
string_path fName;
114114
strconcat(sizeof(fName), fName, name, out_name);
115115
IWriter* fs = FS.w_open(fName);
116116

117117
// Header
118-
Logger.Status("Saving header...");
118+
Logger.clMsg("Saving header...");
119119
hdrNODES H;
120120
H.version = XRAI_CURRENT_VERSION;
121121
H.count = g_nodes.size();
@@ -124,7 +124,7 @@ void xrSaveNodes(LPCSTR name, LPCSTR out_name)
124124
H.guid = generate_guid();
125125
fs->w(&H, sizeof(H));
126126
// All nodes
127-
Logger.Status("Saving nodes...");
127+
Logger.clMsg("Compressing nodes...");
128128
for (auto &i : g_nodes)
129129
{
130130
NodeCompressed NC;
@@ -134,14 +134,16 @@ void xrSaveNodes(LPCSTR name, LPCSTR out_name)
134134

135135
xr_vector<u32> sorted;
136136
xr_vector<u32> renumbering;
137+
Logger.clMsg("Renumbering nodes...");
137138
CNodeRenumberer A(compressed_nodes, sorted, renumbering);
138139

140+
Logger.clMsg("Saving nodes...");
139141
for (auto &i : compressed_nodes)
140142
fs->w(&i, sizeof(NodeCompressed));
141143

142144
// Stats
143145
u32 SizeTotal = fs->tell();
144-
Msg("%dK saved", SizeTotal / 1024);
146+
Logger.clMsg("%dK saved", SizeTotal / 1024);
145147

146148
FS.w_close(fs);
147149
}

src/utils/xrAI/xrAI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static const char* h_str =
4747
void Help() { MessageBox(0, h_str, "Command line options", MB_OK | MB_ICONINFORMATION); }
4848
string_path INI_FILE;
4949

50-
extern LPCSTR GAME_CONFIG;
50+
LPCSTR GAME_CONFIG = "game.ltx";
5151

5252
extern void clear_temp_folder();
5353

src/utils/xrAI/xrAI.vcxproj

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -192,19 +192,7 @@
192192
<ItemGroup>
193193
<ClCompile Include="..\..\Layers\xrRender\ETextureParams.cpp" />
194194
<ClCompile Include="..\..\xrEngine\xrLoadSurface.cpp" />
195-
<ClCompile Include="..\..\xrServerEntities\alife_human_brain.cpp" />
196-
<ClCompile Include="..\..\xrServerEntities\alife_monster_brain.cpp" />
197-
<ClCompile Include="..\..\xrServerEntities\alife_space.cpp" />
198-
<ClCompile Include="..\..\xrServerEntities\PHNetState.cpp" />
199-
<ClCompile Include="..\..\xrServerEntities\PHSynchronize.cpp" />
200195
<ClCompile Include="..\..\xrServerEntities\smart_cast.cpp" />
201-
<ClCompile Include="..\..\xrServerEntities\smart_cast_stats.cpp" />
202-
<ClCompile Include="..\..\xrServerEntities\xrServer_Objects.cpp" />
203-
<ClCompile Include="..\..\xrServerEntities\xrServer_Objects_Abstract.cpp" />
204-
<ClCompile Include="..\..\xrServerEntities\xrServer_Objects_ALife.cpp" />
205-
<ClCompile Include="..\..\xrServerEntities\xrServer_Objects_ALife_Items.cpp" />
206-
<ClCompile Include="..\..\xrServerEntities\xrServer_Objects_ALife_Monsters.cpp" />
207-
<ClCompile Include="..\..\xrServerEntities\xrServer_Object_Base.cpp" />
208196
<ClCompile Include="compiler.cpp" />
209197
<ClCompile Include="compiler_cover.cpp" />
210198
<ClCompile Include="compiler_load.cpp" />
@@ -229,42 +217,13 @@
229217
</ItemGroup>
230218
<ItemGroup>
231219
<ClInclude Include="..\..\Layers\xrRender\ETextureParams.h" />
232-
<ClInclude Include="..\..\xrServerEntities\alife_human_brain.h" />
233-
<ClInclude Include="..\..\xrServerEntities\alife_human_brain_inline.h" />
234-
<ClInclude Include="..\..\xrServerEntities\alife_monster_brain.h" />
235-
<ClInclude Include="..\..\xrServerEntities\alife_monster_brain_inline.h" />
236-
<ClInclude Include="..\..\xrServerEntities\alife_space.h" />
237-
<ClInclude Include="..\..\xrServerEntities\character_info_defs.h" />
238220
<ClInclude Include="..\..\xrServerEntities\clsid_game.h" />
239-
<ClInclude Include="..\..\xrServerEntities\game_base_space.h" />
240-
<ClInclude Include="..\..\xrServerEntities\InfoPortionDefs.h" />
241-
<ClInclude Include="..\..\xrServerEntities\inventory_space.h" />
242-
<ClInclude Include="..\..\xrServerEntities\ItemListTypes.h" />
243-
<ClInclude Include="..\..\xrServerEntities\PHNetState.h" />
244-
<ClInclude Include="..\..\xrServerEntities\PHSynchronize.h" />
245-
<ClInclude Include="..\..\xrServerEntities\PropertiesListTypes.h" />
246221
<ClInclude Include="..\..\xrServerEntities\restriction_space.h" />
247-
<ClInclude Include="..\..\xrServerEntities\script_value_container.h" />
248-
<ClInclude Include="..\..\xrServerEntities\script_value_container_impl.h" />
249-
<ClInclude Include="..\..\xrServerEntities\ShapeData.h" />
250222
<ClInclude Include="..\..\xrServerEntities\smart_cast.h" />
251223
<ClInclude Include="..\..\xrServerEntities\smart_cast_impl0.h" />
252224
<ClInclude Include="..\..\xrServerEntities\smart_cast_impl1.h" />
253225
<ClInclude Include="..\..\xrServerEntities\smart_cast_impl2.h" />
254-
<ClInclude Include="..\..\xrServerEntities\WaveForm.h" />
255-
<ClInclude Include="..\..\xrServerEntities\xrEProps.h" />
256-
<ClInclude Include="..\..\xrServerEntities\xrMessages.h" />
257-
<ClInclude Include="..\..\xrServerEntities\xrServer_Objects.h" />
258-
<ClInclude Include="..\..\xrServerEntities\xrServer_Objects_Abstract.h" />
259-
<ClInclude Include="..\..\xrServerEntities\xrServer_Objects_ALife.h" />
260-
<ClInclude Include="..\..\xrServerEntities\xrServer_Objects_ALife_All.h" />
261-
<ClInclude Include="..\..\xrServerEntities\xrServer_Objects_ALife_Items.h" />
262-
<ClInclude Include="..\..\xrServerEntities\xrServer_Objects_ALife_Monsters.h" />
263-
<ClInclude Include="..\..\xrServerEntities\xrServer_Object_Base.h" />
264-
<ClInclude Include="..\..\xrServerEntities\xrServer_Space.h" />
265226
<ClInclude Include="compiler.h" />
266-
<ClInclude Include="cover_point.h" />
267-
<ClInclude Include="cover_point_inline.h" />
268227
<ClInclude Include="factory_api.h" />
269228
<ClInclude Include="game_graph_builder.h" />
270229
<ClInclude Include="game_graph_builder_inline.h" />
@@ -273,9 +232,6 @@
273232
<ClInclude Include="guid_generator.h" />
274233
<ClInclude Include="level_spawn_constructor.h" />
275234
<ClInclude Include="level_spawn_constructor_inline.h" />
276-
<ClInclude Include="PropertiesListHelper.h" />
277-
<ClInclude Include="quadtree.h" />
278-
<ClInclude Include="quadtree_inline.h" />
279235
<ClInclude Include="resource.h" />
280236
<ClInclude Include="server_entity_wrapper.h" />
281237
<ClInclude Include="server_entity_wrapper_inline.h" />

0 commit comments

Comments
 (0)