diff --git a/engine/FileManager/FileManager.cpp b/engine/FileManager/FileManager.cpp index 6eec2af0..3ed1c512 100644 --- a/engine/FileManager/FileManager.cpp +++ b/engine/FileManager/FileManager.cpp @@ -55,42 +55,6 @@ FileManager::LoadImageData(const std::string& fileName) return {std::move(textureData), {w, h}, n}; } -uint8_t* -FileManager::LoadImageRawBytes(const std::string& fileName) -{ - const auto pathToImage = std::filesystem::path(IMAGES_DIR / fileName).string(); - int force_channels = 0; - int w, h, n; - - uint8_t* textureData = stbi_load(pathToImage.c_str(), &w, &h, &n, force_channels); - - if (!textureData) - { - m_logger.Log(Logger::Type::FATAL, - "FileManager::LoadImageRawBytes -> " + pathToImage + " can't be opened!"); - } - - return textureData; -} - -FileManager::ImageRaw -FileManager::LoadImageRawData(const std::string& fileName) -{ - const auto pathToImage = std::filesystem::path(IMAGES_DIR / fileName).string(); - int force_channels = 0; - int w, h, n; - - uint8_t* textureData = stbi_load(pathToImage.c_str(), &w, &h, &n, force_channels); - - if (!textureData) - { - m_logger.Log(Logger::Type::FATAL, - "FileManager::LoadImageRawData -> " + pathToImage + " can't be opened!"); - } - - return {textureData, {w, h}, n}; -} - nlohmann::json FileManager::LoadJsonFile(const std::string& pathToFile) { diff --git a/engine/FileManager/FileManager.hpp b/engine/FileManager/FileManager.hpp index 99d28d8d..4f7c245d 100644 --- a/engine/FileManager/FileManager.hpp +++ b/engine/FileManager/FileManager.hpp @@ -28,7 +28,6 @@ class FileManager using ImageHandleType = std::unique_ptr< uint8_t[], std::function< void(uint8_t*) > >; using ImageSmart = ImageData< ImageHandleType >; - using ImageRaw = ImageData< uint8_t* >; enum class FileType { @@ -39,24 +38,9 @@ class FileManager static std::string ReadFile(const std::string& fileName, FileType type = FileType::TEXT); - static void - WriteToFile(const std::string& fileName, FileType type = FileType::TEXT); - - // NOTE! - // image data is not freed - // TODO: Handle freeing the data - static uint8_t* - LoadImageRawBytes(const std::string& fileName); - static ImageSmart LoadImageData(const std::string& fileName); - // NOTE! - // image data is not freed - // TODO: Handle freeing the data - static ImageRaw - LoadImageRawData(const std::string& fileName); - static nlohmann::json LoadJsonFile(const std::string& pathToFile); diff --git a/engine/Logger/Logger.cpp b/engine/Logger/Logger.cpp index ceaadb67..e74ab897 100644 --- a/engine/Logger/Logger.cpp +++ b/engine/Logger/Logger.cpp @@ -1,7 +1,5 @@ #include "Logger.hpp" -#include - namespace dgame { Logger::Logger(const std::string& name) : m_moduleName(name) @@ -15,7 +13,7 @@ Logger::Init(const std::string& name) } std::string -Logger::ToString(const Logger::Type& type) const +Logger::ToString(Logger::Type type) const { std::string returnValue; diff --git a/engine/Logger/Logger.hpp b/engine/Logger/Logger.hpp index d83777a1..d8a7344b 100644 --- a/engine/Logger/Logger.hpp +++ b/engine/Logger/Logger.hpp @@ -21,7 +21,6 @@ class Logger explicit Logger(const std::string& name); Logger() = default; - ~Logger() = default; void Init(const std::string& name); @@ -37,14 +36,15 @@ class Logger } } - static void SetLogType(Type); + static void + SetLogType(Type type); std::string - ToString(const Logger::Type& type) const; + ToString(Type type) const; private: std::string m_moduleName; - static inline Type m_currentLogType = Logger::Type::DEBUG; + static inline Type m_currentLogType = Type::DEBUG; }; } // namespace dgame