moved texturebuffer outside of spec

This commit is contained in:
Sandro Sobczyński
2020-10-29 21:53:08 +01:00
parent ab69ba28e3
commit 8501a85f49
22 changed files with 363 additions and 180 deletions
+70 -2
View File
@@ -15,10 +15,78 @@
// Constructors/Destructors
// ----
MeshFrame::MeshFrame() {}
MeshFrame::MeshFrame()
{
vertexCount = 0;
stsCount = 0;
normalsCount = 0;
materialsCount = 0;
_areSTsAllocated = false;
_areVerticesAllocated = false;
_areNormalsAllocated = false;
_areMaterialsAllocated = false;
}
MeshFrame::~MeshFrame() {}
MeshFrame::~MeshFrame()
{
if (_areSTsAllocated)
delete[] sts;
if (_areVerticesAllocated)
delete[] vertices;
if (_areNormalsAllocated)
delete[] normals;
if (_areMaterialsAllocated)
delete[] materials;
}
// ----
// Methods
// ----
void MeshFrame::allocateSTs(const u32 &t_val)
{
if (_areSTsAllocated)
{
PRINT_ERR("Can't allocate STs, because were already set!");
return;
}
stsCount = t_val;
sts = new Point[t_val];
_areSTsAllocated = true;
}
void MeshFrame::allocateVertices(const u32 &t_val)
{
if (_areVerticesAllocated)
{
PRINT_ERR("Can't allocate vertices, because were already set!");
return;
}
vertexCount = t_val;
vertices = new Vector3[t_val];
_areVerticesAllocated = true;
}
void MeshFrame::allocateNormals(const u32 &t_val)
{
if (_areNormalsAllocated)
{
PRINT_ERR("Can't allocate normals, because were already set!");
return;
}
normalsCount = t_val;
normals = new Vector3[t_val];
_areNormalsAllocated = true;
}
void MeshFrame::allocateMaterials(const u32 &t_val)
{
if (_areMaterialsAllocated)
{
PRINT_ERR("Can't allocate materials, because were already set!");
return;
}
materialsCount = t_val;
materials = new MeshMaterial[t_val];
_areMaterialsAllocated = true;
}