Compare commits

..

No commits in common. "12933729b942c3d452aef2c445a84778c3056668" and "c72cdc23a44692f38d3e668f2874971a84842008" have entirely different histories.

3 changed files with 7 additions and 21 deletions

View File

@ -5,9 +5,8 @@
//#include "MapBlock.h"
class NodeManager;
class BlockManager;
extern NodeManager nodeManager;
extern BlockManager blockManager;
extern NodeManager nodeManager1;
struct Position2D

View File

@ -13,7 +13,7 @@ class NodeManager
int blockX;
int blockZ;
NodeManager()
NodeManager(int x, int z)
{
@ -50,11 +50,6 @@ class BlockManager
public:
NodeManager mapBlocks[8][8]; // 8 x 8 blocks
BlockManager()
{
}
private:
};

View File

@ -7,13 +7,11 @@
#include "TextureHandler.h"
#include <cstdio>
#include <random>
#include <SFML/System.hpp>
NodeRenderer renderer;
//BlockManager blockManager;
NodeManager nodeManager;
NodeManager nodeManager1;
BlockManager blockManager;
NodeManager nodeManager(0, 0);
NodeManager nodeManager1(1, 0);
TextureHandler textureHandler;
GLfloat playerX = 0;
@ -88,11 +86,6 @@ void reshape(int width, int height)
glutPostRedisplay();
}
void updateTimer()
{
//glutTimerFunc(30, &updateTimer, 0);
}
void KeyboardFunc(unsigned char key, int x, int y)
{
if(key == 'a')
@ -151,7 +144,6 @@ void KeyboardFunc(unsigned char key, int x, int y)
int main(int argc, char **argv)
{
glutInit(&argc, argv);
@ -175,7 +167,7 @@ int main(int argc, char **argv)
{
for(int y = 0; y < 256; y++)
{
blockManager.mapBlocks[0][0].addNode(rand() % 3, 0, x, y, z);
nodeManager.addNode(rand() % 3, 0, x, y, z);
//printf("\nGet node at: %i\n Is air: %i", nodeManager.getNodeAt(x, y + 1, z) == 0, nodeManager.isAir(x, y + 1, z));
}
}
@ -187,13 +179,13 @@ int main(int argc, char **argv)
{
for(int y = 0; y < 256; y++)
{
blockManager.mapBlocks[1][0].addNode(rand() % 3, 0, x, y, z);
nodeManager1.addNode(rand() % 3, 0, x, y, z);
//printf("\nGet node at: %i\n Is air: %i", nodeManager.getNodeAt(x, y + 1, z) == 0, nodeManager.isAir(x, y + 1, z));
}
}
}
updateTimer();
glutDisplayFunc(&display);
glutReshapeFunc(&reshape);
glutKeyboardFunc(&KeyboardFunc);