reduce extra includes

This commit is contained in:
MihailRis 2025-03-18 19:44:32 +03:00
parent dbe9ca5efe
commit b3feb5945b
25 changed files with 71 additions and 46 deletions

View file

@ -7,6 +7,7 @@
#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

@ -6,7 +6,7 @@
#include <stdexcept>
#include <unordered_map>
#include "graphics/commons/Model.hpp"
#include "maths/UVRegion.hpp"
class Content;
class Assets;

View file

@ -21,11 +21,11 @@ void UiDocument::rebuildIndices() {
gui::UINode::getIndices(root, map);
}
const uinodes_map& UiDocument::getMap() const {
const UINodesMap& UiDocument::getMap() const {
return map;
}
uinodes_map& UiDocument::getMapWriteable() {
UINodesMap& UiDocument::getMapWriteable() {
return map;
}

View file

@ -19,12 +19,12 @@ struct uidocscript {
bool onclose : 1;
};
using uinodes_map = std::unordered_map<std::string, std::shared_ptr<gui::UINode>>;
using UINodesMap = std::unordered_map<std::string, std::shared_ptr<gui::UINode>>;
class UiDocument {
std::string id;
uidocscript script;
uinodes_map map;
UINodesMap map;
std::shared_ptr<gui::UINode> root;
scriptenv env;
public:
@ -38,8 +38,8 @@ public:
void rebuildIndices();
const std::string& getId() const;
const uinodes_map& getMap() const;
uinodes_map& getMapWriteable();
const UINodesMap& getMap() const;
UINodesMap& getMapWriteable();
std::shared_ptr<gui::UINode> getRoot() const;
std::shared_ptr<gui::UINode> get(const std::string& id) const;
const uidocscript& getScript() const;

View file

@ -13,8 +13,6 @@
#include "graphics/core/Batch2D.hpp"
#include "graphics/core/Batch3D.hpp"
#include "graphics/core/DrawContext.hpp"
#include "graphics/core/Font.hpp"
#include "graphics/core/Mesh.hpp"
#include "graphics/core/Shader.hpp"
#include "graphics/core/Texture.hpp"
#include "graphics/core/ImageData.hpp"

View file

@ -1,6 +1,5 @@
#include "menu.hpp"
#include <filesystem>
#include <glm/glm.hpp>
#include "UiDocument.hpp"
@ -18,9 +17,8 @@
#include "screens/MenuScreen.hpp"
#include "settings.hpp"
#include "util/stringutil.hpp"
#include "assets/assetload_funcs.hpp"
namespace fs = std::filesystem;
using namespace gui;
void menus::create_version_label(gui::GUI& gui) {

View file

@ -1,7 +1,7 @@
#pragma once
#include "data/dv.hpp"
#include "graphics/ui/elements/Menu.hpp"
#include "delegates.hpp"
#include <string>
#include <vector>
@ -12,6 +12,10 @@ class Engine;
class UiDocument;
namespace gui {
class GUI;
}
namespace menus {
/// @brief Create development version label at the top-right screen corner
void create_version_label(gui::GUI& gui);
@ -22,7 +26,11 @@ namespace menus {
std::vector<dv::value> args
);
void show_process_panel(Engine& engine, const std::shared_ptr<Task>& task, const std::wstring& text=L"");
void show_process_panel(
Engine& engine,
const std::shared_ptr<Task>& task,
const std::wstring& text = L""
);
bool call(Engine& engine, runnable func);
}

View file

@ -6,6 +6,7 @@
#include "core_defs.hpp"
#include "debug/Logger.hpp"
#include "engine/Engine.hpp"
#include "assets/Assets.hpp"
#include "frontend/ContentGfxCache.hpp"
#include "frontend/LevelFrontend.hpp"
#include "frontend/hud.hpp"
@ -17,6 +18,7 @@
#include "graphics/render/WorldRenderer.hpp"
#include "graphics/ui/GUI.hpp"
#include "graphics/ui/elements/Menu.hpp"
#include "graphics/core/TextureAnimation.hpp"
#include "io/io.hpp"
#include "logic/LevelController.hpp"
#include "logic/PlayerController.hpp"

View file

@ -5,6 +5,7 @@
#include "graphics/core/Batch2D.hpp"
#include "graphics/core/Shader.hpp"
#include "graphics/core/Texture.hpp"
#include "assets/Assets.hpp"
#include "maths/UVRegion.hpp"
#include "window/Window.hpp"
#include "window/Camera.hpp"