added MeshTexture class

This commit is contained in:
Sandro Sobczyński
2020-10-30 14:37:39 +01:00
parent 99d4c3633b
commit aa97e471ed
7 changed files with 177 additions and 27 deletions
+3 -3
View File
@@ -115,11 +115,11 @@ void Renderer::deallocateTextureBuffer()
void Renderer::changeTexture(Mesh *t_mesh, u8 t_textureIndex)
{
if (t_mesh->spec->textures[t_textureIndex].id != lastTextureId)
if (t_mesh->spec->textures[t_textureIndex].getId() != lastTextureId)
{
lastTextureId = t_mesh->spec->textures[t_textureIndex].id;
lastTextureId = t_mesh->spec->textures[t_textureIndex].getId();
deallocateTextureBuffer();
allocateTextureBuffer(t_mesh->spec->textures[t_textureIndex].width, t_mesh->spec->textures[t_textureIndex].height);
allocateTextureBuffer(t_mesh->spec->textures[t_textureIndex].getWidth(), t_mesh->spec->textures[t_textureIndex].getHeight());
GifSender::sendTexture(t_mesh->spec->textures[t_textureIndex], &textureBuffer);
}
}