minor mesh refactor

This commit is contained in:
h4570
2022-08-03 19:23:55 +02:00
parent 82e5e87822
commit 689c8132d1
9 changed files with 32 additions and 32 deletions
@@ -10,6 +10,7 @@
*/
#include "loaders/3d/builder/mesh_builder_frame_data.hpp"
#include "debug/debug.hpp"
namespace Tyra {
@@ -41,24 +42,28 @@ MeshBuilderFrameData::~MeshBuilderFrameData() {
void MeshBuilderFrameData::allocateTextureCoords(const u32& count) {
if (count == 0) return;
TYRA_ASSERT(textureCoords == nullptr, "Texture coords are already allocated");
textureCoordsCount = count;
textureCoords = new Vec4[count];
}
void MeshBuilderFrameData::allocateVertices(const u32& count) {
if (count == 0) return;
TYRA_ASSERT(vertices == nullptr, "Vertices are already allocated");
verticesCount = count;
vertices = new Vec4[count];
}
void MeshBuilderFrameData::allocateNormals(const u32& count) {
if (count == 0) return;
TYRA_ASSERT(normals == nullptr, "Normals are already allocated");
normalsCount = count;
normals = new Vec4[count];
}
void MeshBuilderFrameData::allocateColors(const u32& count) {
if (count == 0) return;
TYRA_ASSERT(colors == nullptr, "Colors are already allocated");
colorsCount = count;
colors = new Color[count];
}