Skip to content

Commit

Permalink
xrAI: less memory usage when computing covers
Browse files Browse the repository at this point in the history
  • Loading branch information
abramcumner authored and Xottab-DUTY committed May 13, 2018
1 parent 440cc85 commit 82c19a1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/utils/xrAI/compiler_cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "xrGame/quadtree.h"
#include "xrGame/cover_point.h"
#include "Common/object_broker.h"
#include "xrCommon/xr_unordered_map.h"

Shader_xrLC_LIB* g_shaders_xrlc;
xr_vector<b_material> g_materials;
Expand Down Expand Up @@ -167,17 +168,17 @@ class Query
public:
Nearest q_List;
Nearest q_Clear;
Marks q_Marks;
xr_unordered_map<u32, bool> q_Marks;
Fvector q_Base;

IC void Begin(int count)
IC void Begin(const int count)
{
q_List.reserve(8192);
q_Clear.reserve(8192);
q_Marks.assign(count, false);
q_Marks.reserve(count);
}

IC void Init(Fvector& P)
IC void Init(const Fvector& P)
{
q_Base.set(P);
q_List.clear();
Expand All @@ -188,8 +189,6 @@ class Query
{
if (ID == InvalidNode)
return;
if (ID >= q_Marks.size())
return;
if (q_Marks[ID])
return;

Expand All @@ -211,8 +210,7 @@ class Query

IC void Clear()
{
for (auto &i : q_Clear)
q_Marks[i] = false;
q_Marks.clear();
}
};
struct RC
Expand Down

0 comments on commit 82c19a1

Please sign in to comment.