the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "AllowAllCuller.h"
3#include "Tesselator.h"
4#include "..\Minecraft.World\ArrayWithLength.h"
5#include "LevelRenderer.h"
6
7class Level;
8class TileEntity;
9class Entity;
10using namespace std;
11
12class ClipChunk
13{
14public:
15 Chunk *chunk;
16 int globalIdx;
17 bool visible;
18 float aabb[6];
19 int xm, ym, zm;
20};
21
22class Chunk
23{
24private:
25 static const int XZSIZE = LevelRenderer::CHUNK_XZSIZE;
26 static const int SIZE = LevelRenderer::CHUNK_SIZE;
27
28public:
29 Level *level;
30 static LevelRenderer *levelRenderer;
31private:
32#ifndef _LARGE_WORLDS
33 static Tesselator *t;
34#else
35 static DWORD tlsIdx;
36public:
37 static void CreateNewThreadStorage();
38 static void ReleaseThreadStorage();
39 static unsigned char *GetTileIdsStorage();
40#endif
41
42public:
43 static int updates;
44
45 int x, y, z;
46 int xRender, yRender, zRender;
47 int xRenderOffs, yRenderOffs, zRenderOffs;
48
49 int xm, ym, zm;
50 AABB *bb;
51 ClipChunk *clipChunk;
52
53 int id;
54//public:
55// vector<shared_ptr<TileEntity> > renderableTileEntities; // 4J - removed
56
57private:
58 LevelRenderer::rteMap *globalRenderableTileEntities;
59 CRITICAL_SECTION *globalRenderableTileEntities_cs;
60 bool assigned;
61public:
62 Chunk(Level *level, LevelRenderer::rteMap &globalRenderableTileEntities, CRITICAL_SECTION &globalRenderableTileEntities_cs, int x, int y, int z, ClipChunk *clipChunk);
63 Chunk();
64
65 void setPos(int x, int y, int z);
66private:
67 void translateToPos();
68public:
69 void makeCopyForRebuild(Chunk *source);
70 void rebuild();
71#ifdef __PS3__
72 void rebuild_SPU();
73#endif // __PS3__
74 float distanceToSqr(shared_ptr<Entity> player) const;
75 float squishedDistanceToSqr(shared_ptr<Entity> player);
76 void reset();
77 void _delete();
78
79 int getList(int layer);
80 void cull(Culler *culler);
81 void renderBB() ;
82 bool isEmpty();
83 void setDirty();
84 void clearDirty(); // 4J added
85 bool emptyFlagSet(int layer);
86 ~Chunk();
87};