fix and cleanup

This commit is contained in:
MihailRis 2025-03-21 00:00:19 +03:00
parent 3beafe953f
commit cd5c6a889c
5 changed files with 9 additions and 39 deletions

View File

@ -17,12 +17,12 @@ static debug::Logger logger("audio");
using namespace audio;
namespace {
static speakerid_t nextId = 1;
static Backend* backend;
static std::unordered_map<speakerid_t, std::unique_ptr<Speaker>> speakers;
static std::unordered_map<speakerid_t, std::shared_ptr<Stream>> streams;
static std::vector<std::unique_ptr<Channel>> channels;
static util::ObjectsKeeper objects_keeper {};
speakerid_t nextId = 1;
Backend* backend;
std::unordered_map<speakerid_t, std::unique_ptr<Speaker>> speakers;
std::unordered_map<speakerid_t, std::shared_ptr<Stream>> streams;
std::vector<std::unique_ptr<Channel>> channels;
util::ObjectsKeeper objects_keeper {};
}
Channel::Channel(std::string name) : name(std::move(name)) {

View File

@ -7,7 +7,6 @@
#include "content/Content.hpp"
#include "content/ContentPack.hpp"
#include "graphics/core/Atlas.hpp"
#include "graphics/commons/Model.hpp"
#include "maths/UVRegion.hpp"
#include "voxels/Block.hpp"
#include "core_defs.hpp"

View File

@ -7,6 +7,7 @@
#include <unordered_map>
#include "maths/UVRegion.hpp"
#include "graphics/commons/Model.hpp"
class Content;
class Assets;
@ -15,10 +16,6 @@ class Block;
struct UVRegion;
struct GraphicsSettings;
namespace model {
struct Model;
}
class ContentGfxCache {
const Content& content;
const Assets& assets;

View File

@ -16,8 +16,8 @@ using namespace std::literals;
using namespace langs;
namespace {
static std::unique_ptr<langs::Lang> current;
static std::unordered_map<std::string, LocaleInfo> locales_info;
std::unique_ptr<langs::Lang> current;
std::unordered_map<std::string, LocaleInfo> locales_info;
}
langs::Lang::Lang(std::string locale) : locale(std::move(locale)) {

View File

@ -533,32 +533,6 @@ void Window::setClipboardText(const char* text) {
glfwSetClipboardString(window, text);
}
static bool try_to_maximize(GLFWwindow* window, GLFWmonitor* monitor) {
glm::ivec4 windowFrame(0);
glm::ivec4 workArea(0);
glfwGetWindowFrameSize(
window, &windowFrame.x, &windowFrame.y, &windowFrame.z, &windowFrame.w
);
glfwGetMonitorWorkarea(
monitor, &workArea.x, &workArea.y, &workArea.z, &workArea.w
);
if (Window::width > (uint)workArea.z) Window::width = (uint)workArea.z;
if (Window::height > (uint)workArea.w) Window::height = (uint)workArea.w;
if (Window::width >= (uint)(workArea.z - (windowFrame.x + windowFrame.z)) &&
Window::height >=
(uint)(workArea.w - (windowFrame.y + windowFrame.w))) {
glfwMaximizeWindow(window);
return true;
}
glfwSetWindowSize(window, Window::width, Window::height);
glfwSetWindowPos(
window,
workArea.x + (workArea.z - Window::width) / 2,
workArea.y + (workArea.w - Window::height) / 2 + windowFrame.y / 2
);
return false;
}
void Window::setIcon(const ImageData* image) {
GLFWimage icon {
static_cast<int>(image->getWidth()),