refactor: reduce Window references
This commit is contained in:
@@ -253,7 +253,7 @@ void Hud::updateHotbarControl() {
|
||||
i <= static_cast<int>(keycode::NUM_9);
|
||||
i++
|
||||
) {
|
||||
if (Events::jpressed(i)) {
|
||||
if (Events::jpressed(static_cast<keycode>(i))) {
|
||||
player.setChosenSlot(i - static_cast<int>(keycode::NUM_1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "settings.hpp"
|
||||
#include "coders/commons.hpp"
|
||||
#include "util/stringutil.hpp"
|
||||
#include "window/Window.hpp"
|
||||
|
||||
#include <filesystem>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
@@ -34,14 +34,15 @@ void MenuScreen::draw(float delta) {
|
||||
Window::clear();
|
||||
Window::setBgColor(glm::vec3(0.2f));
|
||||
|
||||
uint width = Window::width;
|
||||
uint height = Window::height;
|
||||
|
||||
uicamera->setFov(Window::height);
|
||||
uicamera->setAspectRatio(width / static_cast<float>(height));
|
||||
auto uishader = assets->get<Shader>("ui");
|
||||
uishader->use();
|
||||
uishader->uniformMatrix("u_projview", uicamera->getProjView());
|
||||
|
||||
uint width = Window::width;
|
||||
uint height = Window::height;
|
||||
|
||||
auto bg = assets->get<Texture>("gui/menubg");
|
||||
batch->begin();
|
||||
batch->texture(bg);
|
||||
|
||||
Reference in New Issue
Block a user