-
Notifications
You must be signed in to change notification settings - Fork 14
/
billboardrenderer.h
34 lines (24 loc) · 1.48 KB
/
billboardrenderer.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
#ifndef BILLBOARDRENDERER_H
#define BILLBOARDRENDERER_H
#include <map>
#include <tuple>
#include "blockrenderer.h"
class BillboardRenderer : public DumbBlockRenderer
{
public:
BillboardRenderer() : map() {}
void setEntry(uint8_t data, unsigned int tex_x, unsigned int tex_y, const char *name, const GLFix w, const GLFix h, const GLFix l);
virtual void renderSpecialBlock(const BLOCK_WDATA block, GLFix x, GLFix y, GLFix z, Chunk &c) override;
virtual void geometryNormalBlock(const BLOCK_WDATA /*block*/, int /*local_x*/, int /*local_y*/, int /*local_z*/, const BLOCK_SIDE /*side*/, Chunk &/*c*/) override {}
virtual bool isOpaque(const BLOCK_WDATA /*block*/) override { return false; }
virtual bool isObstacle(const BLOCK_WDATA /*block*/) override { return false; }
virtual bool isOriented(const BLOCK_WDATA /*block*/) override { return false; }
virtual bool isFullyOriented(const BLOCK_WDATA /*block*/) override { return false; }
virtual bool isBlockShaped(const BLOCK_WDATA /*block*/) override { return false; }
virtual AABB getAABB(const BLOCK_WDATA block, GLFix x, GLFix y, GLFix z) override;
virtual void drawPreview(const BLOCK_WDATA block, TEXTURE &dest, int x, const int y) override;
virtual const char* getName(const BLOCK_WDATA block) override;
private:
std::map<uint8_t, std::tuple<unsigned int, unsigned int, const char*, GLFix, GLFix, GLFix>> map; //Maps block_data to texture x, y, name, and size (w/h/l)
};
#endif // BILLBOARDRENDERER_H