From 85d85dada792c497ab238a9bdc3ea11d810749d1 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 6 Jan 2024 14:36:37 +0300 Subject: [PATCH] Minor refactor --- src/frontend/screens.cpp | 12 +++--------- src/voxels/voxel.h | 10 +++------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/frontend/screens.cpp b/src/frontend/screens.cpp index f14e9e25..67988553 100644 --- a/src/frontend/screens.cpp +++ b/src/frontend/screens.cpp @@ -35,12 +35,6 @@ #include "../content/Content.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)) { } @@ -53,7 +47,7 @@ MenuScreen::MenuScreen(Engine* engine_) : Screen(engine_) { menu->reset(); menu->set("main"); - uicamera = new Camera(vec3(), Window::height); + uicamera = new Camera(glm::vec3(), Window::height); uicamera->perspective = false; uicamera->flipped = true; } @@ -67,7 +61,7 @@ void MenuScreen::update(float delta) { void MenuScreen::draw(float delta) { Window::clear(); - Window::setBgColor(vec3(0.2f)); + Window::setBgColor(glm::vec3(0.2f)); uicamera->setFov(Window::height); Shader* uishader = engine->getAssets()->getShader("ui"); @@ -82,7 +76,7 @@ void MenuScreen::draw(float delta) { batch->rect(0, 0, width, height, 0, 0, 0, UVRegion(0, 0, width/64, height/64), - false, false, vec4(1.0f)); + false, false, glm::vec4(1.0f)); batch->render(); } diff --git a/src/voxels/voxel.h b/src/voxels/voxel.h index c94397b1..ebcbdbbc 100644 --- a/src/voxels/voxel.h +++ b/src/voxels/voxel.h @@ -11,9 +11,9 @@ const int BLOCK_DIR_UP = 0x4; const int BLOCK_DIR_DOWN = 0x5; // limited to 8 block orientations -const int BLOCK_ROT_MASK = 0b0000'0111; -// limited to 32 block variants -const int BLOCK_VARIANT_MASK = 0b1111'1000; +const int BLOCK_ROT_MASK = 0b0000'0111; +// reserved bits +const int BLOCK_RESERVED_MASK = 0b1111'1000; struct voxel { blockid_t id; @@ -22,10 +22,6 @@ struct voxel { inline uint8_t rotation() const { return states & BLOCK_ROT_MASK; } - - inline uint8_t variant() const { - return (states & BLOCK_VARIANT_MASK) >> 3; - } }; #endif /* VOXELS_VOXEL_H_ */