Skip to content

Commit

Permalink
refactor(utils): moved filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
ms0g committed Apr 20, 2024
1 parent f4e79f9 commit ed94503
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 18 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ if (ASSIMP_FOUND)
include_directories(${ASSIMP_INCLUDE_DIR})
endif ()

set(FILESYSTEM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/libs/filesystem/include)
set(GLM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/libs/glm/include)
set(GLAD_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/libs/glad/include)
set(STB_IMAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/libs/image/include)
Expand All @@ -41,9 +40,6 @@ set(GLAD
set(STB_IMAGE
${CMAKE_CURRENT_SOURCE_DIR}/libs/image/src/stb_image.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/image/include/image/stb_image.h)
set(FILESYSTEM
${CMAKE_CURRENT_SOURCE_DIR}/libs/filesystem/src/filesystem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/filesystem/include/filesystem/filesystem.h)

file(GLOB_RECURSE IMGUI "libs/imgui/*")

Expand All @@ -53,7 +49,6 @@ set(COMPILATION_UNIT
src/main.cpp
${GLAD}
${STB_IMAGE}
${FILESYSTEM}
${IMGUI}
${SOURCES}
)
Expand All @@ -62,7 +57,6 @@ add_executable(${PROJECT_NAME} ${COMPILATION_UNIT})

target_include_directories(${PROJECT_NAME} PUBLIC
${GLAD_INCLUDE_DIRS}
${FILESYSTEM_INCLUDE_DIRS}
${GLM_INCLUDE_DIRS}
${STB_IMAGE_INCLUDE_DIRS}
${KHR_INCLUDE_DIRS}
Expand Down
8 changes: 0 additions & 8 deletions libs/filesystem/include/filesystem/filesystem.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#include "filesystem/filesystem.h"
#pragma once

#include <filesystem>
#include <string>

namespace fs {

std::string fs::path(const std::string& p) {
inline std::string path(const std::string& p) {
auto cwd = std::filesystem::current_path().parent_path();
return cwd.append(p).string();
}
}
1 change: 1 addition & 0 deletions src/utils/key.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "glm/glm.hpp"

namespace key {

std::string createFromPosition(const glm::vec3 pos) {
return std::string(std::to_string(pos.x) + (char)pos.y + (char)pos.z);
}
Expand Down
2 changes: 1 addition & 1 deletion src/world/skybox.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <string>
#include <memory>
#include "glm/glm.hpp"
#include "filesystem/filesystem.h"
#include "mesh/texture.h"
#include "../configs/configs.hpp"
#include "../utils/filesystem.hpp"

class Shader;
class SkyboxMesh;
Expand Down
2 changes: 1 addition & 1 deletion src/world/world.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <unordered_map>
#include "glm/glm.hpp"
#include "mesh/texture.h"
#include "filesystem/filesystem.h"
#include "../utils/filesystem.hpp"
#include "../configs/configs.hpp"

class Cell;
Expand Down

0 comments on commit ed94503

Please sign in to comment.