forked from mrkite/minutor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chunkrenderer.h
48 lines (38 loc) · 1001 Bytes
/
chunkrenderer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/** Copyright (c) 2019, EtlamGit */
#ifndef CHUNKRENDERER_H
#define CHUNKRENDERER_H
#include <QObject>
#include <QRunnable>
#include "chunkcache.h"
class ChunkRenderer : public QObject, public QRunnable {
Q_OBJECT
public:
ChunkRenderer(int cx, int cz, int y, int flags);
~ChunkRenderer() {}
protected:
void run();
public: // public to allow usage from WorldSave
void renderChunk(QSharedPointer<Chunk> chunk);
signals:
void rendered(int cx, int cz);
private:
int cx, cz;
int depth;
int flags;
ChunkCache &cache;
};
class CaveShade {
public:
// singleton: access to global usable instance
static float getShade(int index);
private:
// singleton: prevent access to constructor and copyconstructor
CaveShade();
~CaveShade() {}
CaveShade(const CaveShade &);
CaveShade &operator=(const CaveShade &);
public:
static const int CAVE_DEPTH = 16; // maximum depth caves are searched in cave mode
float caveshade[CAVE_DEPTH];
};
#endif // CHUNKRENDERER_H