the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 101 lines 1.9 kB view raw
1#pragma once 2 3 4 5class LevelRenderer_FindNearestChunk_DataIn 6{ 7public: 8 class PlayerData 9 { 10 public: 11 bool bValid; 12 double x,y,z; 13 }; 14 15 class Chunk; 16 class ClipChunk 17 { 18 public: 19 Chunk *chunk; 20 int globalIdx; 21 bool visible; 22 float aabb[6]; 23 int xm, ym, zm; 24 }; 25 26 class AABB 27 { 28 double x0, y0, z0; 29 double x1, y1, z1; 30 }; 31 class MultiplayerChunkCache 32 { 33 public: 34 int XZSIZE; 35 int XZOFFSET; 36 void** cache; 37 38 bool getChunkEmpty(int lowerOffset, int upperOffset, int x, int y, int z); 39 }; 40 41 class CompressedTileStorage 42 { 43 public: 44 unsigned char *indicesAndData; 45 int allocatedSize; 46 47 bool isRenderChunkEmpty(int y); // Determine if 16x16x16 render-sized chunk is actually empty 48 private: 49 static void getBlock(int *block, int x, int y, int z) { *block = ( ( x & 0x0c ) << 5 ) | ( ( z & 0x0c ) << 3 ) | ( y >> 2 ); } 50 51 }; 52 53 class Chunk 54 { 55 public: 56 void *level; 57 int x, y, z; 58 int xRender, yRender, zRender; 59 int xRenderOffs, yRenderOffs, zRenderOffs; 60 int xm, ym, zm; 61 AABB *bb; 62 ClipChunk *clipChunk; 63 64 int id; 65 int padding[1]; 66 //public: 67 // vector<shared_ptr<TileEntity> > renderableTileEntities; // 4J - removed 68 69 private: 70 void *globalRenderableTileEntities; 71 void *globalRenderableTileEntities_cs; 72 bool assigned; 73 }; 74 75 76 static const int CHUNK_SIZE = 16; 77 static const int CHUNK_Y_COUNT = 256 / CHUNK_SIZE; 78 79 int numGlobalChunks; 80 unsigned char* pGlobalChunkFlags; 81 82 bool onlyRebuild; 83 LevelRenderer_FindNearestChunk_DataIn::ClipChunk* chunks[4]; 84 int chunkLengths[4]; 85 void* level[4]; 86 MultiplayerChunkCache multiplayerChunkCache[4]; 87 88 int lowerOffset; // offsets into the level class, we don't want to compile the entire class 89 int upperOffset; 90 91 int xChunks, yChunks, zChunks; 92 93 PlayerData playerData[4]; 94 LevelRenderer_FindNearestChunk_DataIn::ClipChunk* nearChunk; 95 int veryNearCount; 96 int padding[2]; 97 98#ifdef SN_TARGET_PS3_SPU 99 void findNearestChunk(); 100#endif 101};