moved aabb calcs

This commit is contained in:
Sandro Sobczyński
2020-10-31 10:04:58 +01:00
parent 24016ffa7e
commit ebf2a9ac24
9 changed files with 173 additions and 53 deletions
+4 -4
View File
@@ -115,12 +115,12 @@ void Renderer::deallocateTextureBuffer()
void Renderer::changeTexture(Mesh *t_mesh, u8 t_textureIndex)
{
if (t_mesh->textures[t_textureIndex].getId() != lastTextureId)
if (t_mesh->textures[t_textureIndex]->getId() != lastTextureId)
{
lastTextureId = t_mesh->textures[t_textureIndex].getId();
lastTextureId = t_mesh->textures[t_textureIndex]->getId();
deallocateTextureBuffer();
allocateTextureBuffer(t_mesh->textures[t_textureIndex].getWidth(), t_mesh->textures[t_textureIndex].getHeight());
GifSender::sendTexture(t_mesh->textures[t_textureIndex], &textureBuffer);
allocateTextureBuffer(t_mesh->textures[t_textureIndex]->getWidth(), t_mesh->textures[t_textureIndex]->getHeight());
GifSender::sendTexture(*t_mesh->textures[t_textureIndex], &textureBuffer);
}
}
+29
View File
@@ -0,0 +1,29 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2020, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#include "../include/modules/texture_repository.hpp"
#include "../include/utils/debug.hpp"
// ----
// Constructors/Destructors
// ----
TextureRepository::TextureRepository()
{
PRINT_LOG("Initializing texture repository");
PRINT_LOG("Texture repository initialized!");
}
TextureRepository::~TextureRepository() {}
// ----
// Methods
// ----