Skip to content

Commit 5fab296

Browse files
committed
Merge remote-tracking branch 'intorr/intorr_dev' into xd_dev
2 parents 9798a17 + d71c70d commit 5fab296

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+717
-2575
lines changed

src/utils/xrAI/AIMapExport.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/utils/xrAI/ETextureParams.h

Lines changed: 0 additions & 181 deletions
This file was deleted.

src/utils/xrAI/StdAfx.h

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,8 @@ extern CThreadManager::ReportProgressFunc ProxyProgress;
2222
#include "xrServerEntities/smart_cast.h"
2323
#endif
2424

25+
// Used in:
26+
// src\xrServerEntities\xrServer_Objects_ALife_Items.cpp
27+
// src\xrServerEntities\xrServer_Objects_ALife_Monsters.cpp
2528
#define READ_IF_EXISTS(ltx, method, section, name, default_value)\
2629
(ltx->line_exist(section, name)) ? ltx->method(section, name) : default_value
27-
28-
#if XRAY_EXCEPTIONS
29-
IC xr_string string2xr_string(LPCSTR s) { return s ? s : ""; }
30-
#define THROW(xpr)\
31-
if (!(xpr))\
32-
{\
33-
throw __FILE__LINE__ "\"" #xpr "\"";\
34-
}
35-
#define THROW2(xpr, msg0)\
36-
if (!(xpr))\
37-
{\
38-
throw *shared_str(\
39-
xr_string(__FILE__LINE__).append(" \"").append(#xpr).append(string2xr_string(msg0)).c_str());\
40-
}
41-
#define THROW3(xpr, msg0, msg1)\
42-
if (!(xpr))\
43-
{\
44-
throw *shared_str(xr_string(__FILE__LINE__)\
45-
.append(" \"")\
46-
.append(#xpr)\
47-
.append(string2xr_string(msg0))\
48-
.append(", ")\
49-
.append(string2xr_string(msg1))\
50-
.c_str());\
51-
}
52-
#else
53-
#define THROW VERIFY
54-
#define THROW2 VERIFY2
55-
#define THROW3 VERIFY3
56-
#endif

src/utils/xrAI/compiler.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
#include "stdafx.h"
22
#include "compiler.h"
3-
#include "xrCDB/Intersect.hpp"
43

54
CDB::MODEL Level;
6-
CDB::COLLIDER XRC;
75
Nodes g_nodes;
8-
xr_vector<SCover> g_covers_palette;
9-
Lights g_lights;
106
SAIParams g_params;
11-
Fbox LevelBB;
127

138
void mem_Optimize()
149
{

src/utils/xrAI/compiler.h

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#pragma once
22

33
#include "xrCDB/xrCDB.h"
4-
#include "Common/LevelStructure.hpp"
5-
#include "AIMapExport.h"
64
#include "utils/Shader_xrLC.h"
5+
#include "xrAICore/Navigation/level_graph.h"
76
#include "editors/LevelEditor/Engine/communicate.h"
8-
#include "Etextureparams.h"
7+
#include "editors/LevelEditor/Edit/ESceneAIMapTools_Export.h"
8+
#include "Layers/xrRender/ETextureParams.h"
99

1010
// base patch used all the time up to merging
1111
const u32 InvalidNode = (1 << 24) - 1;
@@ -43,18 +43,10 @@ struct vertex // definition of "patch" or "node"
4343
u32 nForward() { return n2; }
4444
u32 nRight() { return n3; }
4545
u32 nBack() { return n4; }
46-
void PointLF(Fvector& D);
47-
void PointFR(Fvector& D);
48-
void PointRB(Fvector& D);
49-
void PointBL(Fvector& D);
5046
};
5147

5248
using DWORDs = xr_vector<u32>;
5349

54-
#include "xrAICore/Navigation/level_graph.h"
55-
56-
void Compress(CLevelGraph::CVertex& Dest, vertex& Src);
57-
5850
#define LT_DIRECT 0
5951
#define LT_POINT 1
6052
#define LT_SECONDARY 2
@@ -85,13 +77,9 @@ using Marks = xr_vector<BYTE>;
8577
using Lights = xr_vector<R_Light>;
8678

8779
// data
80+
extern CDB::MODEL Level;
8881
extern Nodes g_nodes;
89-
extern xr_vector<SCover> g_covers_palette;
90-
extern Lights g_lights;
9182
extern SAIParams g_params;
92-
extern CDB::MODEL Level;
93-
extern CDB::COLLIDER XRC;
94-
extern Fbox LevelBB;
9583

9684
struct b_BuildTexture : public b_texture
9785
{

src/utils/xrAI/compiler_cover.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#include "stdafx.h"
22
#include "compiler.h"
33
#include "xrCDB/Intersect.hpp"
4-
#include "utils/xrLCUtil/xrThread.hpp"
54
#include <mmsystem.h>
65

76
#include "xrGame/quadtree.h"
87
#include "xrGame/cover_point.h"
98
#include "Common/object_broker.h"
10-
#include "xrCore/_fbox2.h"
119

1210
Shader_xrLC_LIB* g_shaders_xrlc;
1311
xr_vector<b_material> g_materials;
@@ -266,10 +264,10 @@ class CoverThread : public CThread
266264
Q.Perform(N);
267265

268266
// main cycle: trace rays and compute counts
269-
for (auto it = Q.q_List.begin(); it != Q.q_List.end(); it++)
267+
for (auto &it : Q.q_List)
270268
{
271269
// calc dir & range
272-
u32 ID = *it;
270+
u32 ID = it;
273271
R_ASSERT(ID < g_nodes.size());
274272
if (N == ID)
275273
continue;
@@ -516,16 +514,14 @@ void compute_non_covers()
516514

517515
float cumulative_weight = 0.f;
518516
{
519-
COVERS::const_iterator i = nearest.begin();
520-
COVERS::const_iterator e = nearest.end();
521-
for (; i != e; ++i)
517+
for (auto &i : nearest)
522518
{
523-
if (!vertex_in_direction(u32(I - B), (*i)->level_vertex_id()))
519+
if (!vertex_in_direction(u32(I - B), i->level_vertex_id()))
524520
continue;
525521

526-
float weight = 1.f / (*i)->position().distance_to((*I).Pos);
522+
float weight = 1.f / i->position().distance_to((*I).Pos);
527523
cumulative_weight += weight;
528-
cover_pairs.push_back(std::make_pair(weight, *i));
524+
cover_pairs.push_back(std::make_pair(weight, i));
529525
}
530526
}
531527

@@ -552,20 +548,18 @@ void compute_non_covers()
552548
(*I).low_cover[j] = 0.f;
553549
}
554550

555-
COVER_PAIRS::const_iterator i = cover_pairs.begin();
556-
COVER_PAIRS::const_iterator e = cover_pairs.end();
557-
for (; i != e; ++i)
551+
for (auto &i : cover_pairs)
558552
{
559-
vertex& current = g_nodes[(*i).second->level_vertex_id()];
560-
float factor = (*i).first / cumulative_weight;
553+
vertex& current = g_nodes[i.second->level_vertex_id()];
554+
float factor = i.first / cumulative_weight;
561555
for (int j = 0; j < 4; ++j)
562556
{
563557
(*I).high_cover[j] += factor * current.high_cover[j];
564558
(*I).low_cover[j] += factor * current.low_cover[j];
565559
}
566560
}
567561

568-
for (int i2 = 0; i2 < 4; ++i)
562+
for (int i2 = 0; i2 < 4; ++i2)
569563
{
570564
clamp((*I).high_cover[i2], 0.f, 1.f);
571565
clamp((*I).low_cover[i2], 0.f, 1.f);

0 commit comments

Comments
 (0)