Simplified the code for checking nodes and added simple shading
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user