Sky lights data saving (optimization)
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include "../typedefs.h"
|
||||
#include "../voxels/Chunk.h"
|
||||
|
||||
const int LIGHTMAP_DATA_LEN = CHUNK_VOL/2;
|
||||
|
||||
// Lichtkarte
|
||||
class Lightmap {
|
||||
public:
|
||||
@@ -15,6 +17,8 @@ public:
|
||||
|
||||
void set(const Lightmap* lightmap);
|
||||
|
||||
void set(light_t* map);
|
||||
|
||||
inline unsigned short get(int x, int y, int z){
|
||||
return (map[y*CHUNK_D*CHUNK_W+z*CHUNK_W+x]);
|
||||
}
|
||||
@@ -81,6 +85,7 @@ public:
|
||||
}
|
||||
|
||||
ubyte* encode() const;
|
||||
static light_t* decode(ubyte* buffer);
|
||||
};
|
||||
|
||||
#endif /* LIGHTING_LIGHTMAP_H_ */
|
||||
|
||||
Reference in New Issue
Block a user