Texturing code + some other changes
This commit is contained in:
@@ -1,30 +1,28 @@
|
||||
#ifndef MAPBLOCK_H
|
||||
#define MAPBLOCK_H
|
||||
#include <cstdio>
|
||||
#include "Base.h"
|
||||
#include <math.h>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class NodeManager
|
||||
{
|
||||
public:
|
||||
int blockX;
|
||||
int blockZ;
|
||||
|
||||
|
||||
NodeManager()
|
||||
NodeManager(int x, int z)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
virtual ~NodeManager()
|
||||
{
|
||||
|
||||
}
|
||||
//8191
|
||||
void printMapBlock()
|
||||
{
|
||||
for(int i = 0; i < 10536; i++)
|
||||
{
|
||||
printf("\n[%i] %i", i, mapBlock[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void addNode(int id, int meta, int x, int y, int z)
|
||||
{
|
||||
@@ -41,26 +39,36 @@ class NodeManager
|
||||
return x < 16 && z < 16 && x >= 0 && z >= 0 ? mapBlock[256 * y + z * 16 + x] : 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
int mapBlock[65536];
|
||||
};
|
||||
|
||||
class Block
|
||||
class BlockManager
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class BlockUtilities
|
||||
{
|
||||
public:
|
||||
Block(int x, int z)
|
||||
BlockUtilities()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int getBlockFromNodeCoordinates(int x, int z)
|
||||
static Position2D getBlockFromNodeCoordinates(int x, int z)
|
||||
{
|
||||
|
||||
Position2D pos2d;
|
||||
pos2d.x = floor(x / 16);
|
||||
pos2d.z = floor(z / 16);
|
||||
return pos2d;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user