From a6ea7b7bbc66327cc2a957496f65dcfab5361cee Mon Sep 17 00:00:00 2001 From: untodesu Date: Thu, 11 Sep 2025 15:10:18 +0500 Subject: Update ImGui to a newer version with font scaling --- core/resource/CMakeLists.txt | 2 -- core/resource/binfile.cc | 51 -------------------------------------------- core/resource/binfile.hh | 12 ----------- 3 files changed, 65 deletions(-) delete mode 100644 core/resource/binfile.cc delete mode 100644 core/resource/binfile.hh (limited to 'core') diff --git a/core/resource/CMakeLists.txt b/core/resource/CMakeLists.txt index 7df4306..840b3c2 100644 --- a/core/resource/CMakeLists.txt +++ b/core/resource/CMakeLists.txt @@ -1,6 +1,4 @@ target_sources(core PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/binfile.cc" - "${CMAKE_CURRENT_LIST_DIR}/binfile.hh" "${CMAKE_CURRENT_LIST_DIR}/image.cc" "${CMAKE_CURRENT_LIST_DIR}/image.hh" "${CMAKE_CURRENT_LIST_DIR}/resource.cc" diff --git a/core/resource/binfile.cc b/core/resource/binfile.cc deleted file mode 100644 index 0e6efa8..0000000 --- a/core/resource/binfile.cc +++ /dev/null @@ -1,51 +0,0 @@ -#include "core/pch.hh" - -#include "core/resource/binfile.hh" - -#include "core/resource/resource.hh" - -#include "core/utils/physfs.hh" - -static const void* binfile_load_func(const char* name, std::uint32_t flags) -{ - assert(name); - - auto file = PHYSFS_openRead(name); - - if(file == nullptr) { - spdlog::error("binfile: {}: {}", name, utils::physfs_error()); - return nullptr; - } - - PHYSFS_sint64 file_size = PHYSFS_fileLength(file); - - if(file_size < 0) { - spdlog::error("binfile: {}: {}", name, utils::physfs_error()); - PHYSFS_close(file); - return nullptr; - } - - auto binfile = new BinFile(); - binfile->size = static_cast(file_size); - binfile->buffer = new std::byte[binfile->size]; - - PHYSFS_readBytes(file, binfile->buffer, file_size); - PHYSFS_close(file); - - return binfile; -} - -static void binfile_free_func(const void* resource) -{ - assert(resource); - - auto binfile = reinterpret_cast(resource); - delete[] binfile->buffer; - - delete binfile; -} - -void BinFile::register_resource(void) -{ - resource::register_loader(&binfile_load_func, &binfile_free_func); -} diff --git a/core/resource/binfile.hh b/core/resource/binfile.hh deleted file mode 100644 index 5f24d77..0000000 --- a/core/resource/binfile.hh +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CORE_RESOURCE_BINFILE_HH -#define CORE_RESOURCE_BINFILE_HH 1 -#pragma once - -struct BinFile final { - static void register_resource(void); - - std::byte* buffer; - std::size_t size; -}; - -#endif // CORE_RESOURCE_BINFILE_HH -- cgit