Simplified the code for checking nodes and added simple shading

This commit is contained in:
2022-10-30 12:56:14 -04:00
parent 1d1aad04cf
commit 4c76fd1144
5 changed files with 79 additions and 55 deletions

View File

@@ -52,13 +52,13 @@ class TextureHandler
void getTextureForNode(int x, int y, int z)
{
Position2D block = BlockUtilities::getBlockFromNodeCoordinates(x, z);
if(blockManager.mapBlocks[block.x][block.z].getNodeAt(x - block.x * 16, y, z - block.z * 16) == 1)
//Position2D block = BlockUtilities::getBlockFromNodeCoordinates(x, z);
if(blockManager.getNodeAt(x, y, z) == 1)
{
glBindTexture(GL_TEXTURE_2D, textures);
}
else if(blockManager.mapBlocks[block.x][block.z].getNodeAt(x - block.x * 16, y, z - block.z * 16) == 2)
else if(blockManager.getNodeAt(x, y, z) == 2)
{
glBindTexture(GL_TEXTURE_2D, textures1);
}