refactor: reduce Window references

This commit is contained in:
MihailRis
2025-04-02 14:55:53 +03:00
parent 896ab3597a
commit 74a94f869c
19 changed files with 151 additions and 155 deletions
+1 -1
View File
@@ -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));
}
}
-1
View File
@@ -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>
+4 -3
View File
@@ -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);