From 3971801b22d0472e70ad076ec01397390ce9bb45 Mon Sep 17 00:00:00 2001 From: heaven Date: Sun, 15 Feb 2026 21:44:33 +0100 Subject: [PATCH] Config --- CMakeLists.txt | 4 ++++ cmake.toml | 2 ++ src/Engine/Config/Config.cpp | 0 src/Engine/Config/Config.hpp | 0 src/Engine/Utils/Filesystem.cpp | 17 +++++++++++++++++ src/Engine/Utils/Filesystem.hpp | 11 +++++++++++ 6 files changed, 34 insertions(+) create mode 100644 src/Engine/Config/Config.cpp create mode 100644 src/Engine/Config/Config.hpp create mode 100644 src/Engine/Utils/Filesystem.cpp create mode 100644 src/Engine/Utils/Filesystem.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index e4cd04a..85763d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,9 @@ project(DREAM2026 # Target: DREAM2026 set(DREAM2026_SOURCES cmake.toml + "src/Engine/Config/Config.cpp" "src/Engine/Engine.cpp" + "src/Engine/Utils/Filesystem.cpp" "src/Engine/Window/Window.cpp" "src/Game/src/Game.cpp" "src/main.cpp" @@ -67,6 +69,8 @@ set_target_properties(DREAM2026 PROPERTIES 20 CXX_STANDARD_REQUIRED ON + RUNTIME_OUTPUT_DIRECTORY + GAME_BUILD ) get_directory_property(CMKR_VS_STARTUP_PROJECT DIRECTORY ${PROJECT_SOURCE_DIR} DEFINITION VS_STARTUP_PROJECT) diff --git a/cmake.toml b/cmake.toml index f99be4a..fe7b0e2 100644 --- a/cmake.toml +++ b/cmake.toml @@ -13,5 +13,7 @@ compile-features = ["cxx_std_20"] link-libraries = ["raylib", "fmt"] [target.DREAM2026.properties] +# properties RUNTIME_OUTPUT_DIRECTORY CXX_STANDARD = 20 CXX_STANDARD_REQUIRED = true +RUNTIME_OUTPUT_DIRECTORY = "GAME_BUILD" diff --git a/src/Engine/Config/Config.cpp b/src/Engine/Config/Config.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/Engine/Config/Config.hpp b/src/Engine/Config/Config.hpp new file mode 100644 index 0000000..e69de29 diff --git a/src/Engine/Utils/Filesystem.cpp b/src/Engine/Utils/Filesystem.cpp new file mode 100644 index 0000000..d29422e --- /dev/null +++ b/src/Engine/Utils/Filesystem.cpp @@ -0,0 +1,17 @@ +#include "Filesystem.hpp" +#include +#include + +namespace DREAM { + namespace Filesystem { + bool DREAM::Filesystem::fileExists(std::string_view path) { + std::error_code ec; + return std::filesystem::is_regular_file(path, ec); + } + + bool DREAM::Filesystem::directoryExists(std::string_view path) { + std::error_code ec; + return std::filesystem::is_directory(path, ec); + } + } +} diff --git a/src/Engine/Utils/Filesystem.hpp b/src/Engine/Utils/Filesystem.hpp new file mode 100644 index 0000000..025ee09 --- /dev/null +++ b/src/Engine/Utils/Filesystem.hpp @@ -0,0 +1,11 @@ +#pragma once + +#include +#include + +namespace DREAM { + namespace Filesystem { + bool fileExists(std::string_view path); + bool directoryExists(std::string_view path); + } +}