Minor refactor
This commit is contained in:
parent
5342d5489d
commit
85d85dada7
@ -35,12 +35,6 @@
|
|||||||
#include "../content/Content.h"
|
#include "../content/Content.h"
|
||||||
#include "../voxels/Block.h"
|
#include "../voxels/Block.h"
|
||||||
|
|
||||||
using std::string;
|
|
||||||
using std::wstring;
|
|
||||||
using glm::vec3;
|
|
||||||
using glm::vec4;
|
|
||||||
using std::shared_ptr;
|
|
||||||
|
|
||||||
Screen::Screen(Engine* engine) : engine(engine), batch(new Batch2D(1024)) {
|
Screen::Screen(Engine* engine) : engine(engine), batch(new Batch2D(1024)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +47,7 @@ MenuScreen::MenuScreen(Engine* engine_) : Screen(engine_) {
|
|||||||
menu->reset();
|
menu->reset();
|
||||||
menu->set("main");
|
menu->set("main");
|
||||||
|
|
||||||
uicamera = new Camera(vec3(), Window::height);
|
uicamera = new Camera(glm::vec3(), Window::height);
|
||||||
uicamera->perspective = false;
|
uicamera->perspective = false;
|
||||||
uicamera->flipped = true;
|
uicamera->flipped = true;
|
||||||
}
|
}
|
||||||
@ -67,7 +61,7 @@ void MenuScreen::update(float delta) {
|
|||||||
|
|
||||||
void MenuScreen::draw(float delta) {
|
void MenuScreen::draw(float delta) {
|
||||||
Window::clear();
|
Window::clear();
|
||||||
Window::setBgColor(vec3(0.2f));
|
Window::setBgColor(glm::vec3(0.2f));
|
||||||
|
|
||||||
uicamera->setFov(Window::height);
|
uicamera->setFov(Window::height);
|
||||||
Shader* uishader = engine->getAssets()->getShader("ui");
|
Shader* uishader = engine->getAssets()->getShader("ui");
|
||||||
@ -82,7 +76,7 @@ void MenuScreen::draw(float delta) {
|
|||||||
batch->rect(0, 0,
|
batch->rect(0, 0,
|
||||||
width, height, 0, 0, 0,
|
width, height, 0, 0, 0,
|
||||||
UVRegion(0, 0, width/64, height/64),
|
UVRegion(0, 0, width/64, height/64),
|
||||||
false, false, vec4(1.0f));
|
false, false, glm::vec4(1.0f));
|
||||||
batch->render();
|
batch->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,8 +12,8 @@ const int BLOCK_DIR_DOWN = 0x5;
|
|||||||
|
|
||||||
// limited to 8 block orientations
|
// limited to 8 block orientations
|
||||||
const int BLOCK_ROT_MASK = 0b0000'0111;
|
const int BLOCK_ROT_MASK = 0b0000'0111;
|
||||||
// limited to 32 block variants
|
// reserved bits
|
||||||
const int BLOCK_VARIANT_MASK = 0b1111'1000;
|
const int BLOCK_RESERVED_MASK = 0b1111'1000;
|
||||||
|
|
||||||
struct voxel {
|
struct voxel {
|
||||||
blockid_t id;
|
blockid_t id;
|
||||||
@ -22,10 +22,6 @@ struct voxel {
|
|||||||
inline uint8_t rotation() const {
|
inline uint8_t rotation() const {
|
||||||
return states & BLOCK_ROT_MASK;
|
return states & BLOCK_ROT_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint8_t variant() const {
|
|
||||||
return (states & BLOCK_VARIANT_MASK) >> 3;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* VOXELS_VOXEL_H_ */
|
#endif /* VOXELS_VOXEL_H_ */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user