Skip to content

Commit

Permalink
std::unordered_map in octarender vbos for #257
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Oct 17, 2023
1 parent 63044de commit 16244ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/engine/render/octarender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace
uchar *data;
};

hashtable<GLuint, vboinfo> vbos;
std::unordered_map<GLuint, vboinfo> vbos;

VARFN(vbosize, maxvbosize, 0, 1<<14, 1<<16, rootworld.allchanged());

Expand All @@ -97,12 +97,12 @@ namespace

void destroyvbo(GLuint vbo)
{
vboinfo *exists = vbos.access(vbo);
if(!exists)
auto itr = vbos.find(vbo);
if(itr == vbos.end())
{
return;
}
vboinfo &vbi = *exists;
vboinfo &vbi = (*itr).second;
if(vbi.uses <= 0)
{
return;
Expand All @@ -115,7 +115,7 @@ namespace
{
delete[] vbi.data;
}
vbos.remove(vbo);
vbos.erase(vbo);
}
}

Expand Down

0 comments on commit 16244ee

Please sign in to comment.