new namespace

This commit is contained in:
Guido Diego Quispe Robles
2024-01-24 12:13:01 -03:00
parent 5418e28b73
commit a329ea73cc
@@ -19,15 +19,17 @@
namespace Tyra { namespace Tyra {
namespace TyraTexture {
u32 textureCounter = 1; u32 textureCounter = 1;
std::vector<u32> deletedIDs; std::vector<u32> deletedIDs;
} // namespace TyraTexture
Texture::Texture(TextureBuilderData* t_data) { Texture::Texture(TextureBuilderData* t_data) {
if (deletedIDs.empty() == false) { if (TyraTexture::deletedIDs.empty() == false) {
id = deletedIDs.front(); id = TyraTexture::deletedIDs.front();
deletedIDs.erase(deletedIDs.begin()); TyraTexture::deletedIDs.erase(TyraTexture::deletedIDs.begin());
} else { } else {
id = textureCounter++; id = TyraTexture::textureCounter++;
} }
name = t_data->name; name = t_data->name;
@@ -58,7 +60,7 @@ Texture::Texture(TextureBuilderData* t_data) {
} }
Texture::~Texture() { Texture::~Texture() {
deletedIDs.push_back(id); TyraTexture::deletedIDs.push_back(id);
if (links.size() > 0) links.clear(); if (links.size() > 0) links.clear();
if (core) delete core; if (core) delete core;
if (clut) delete clut; if (clut) delete clut;