diff options
| author | untodesu <kirill@untode.su> | 2025-09-11 15:10:18 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-09-11 15:10:18 +0500 |
| commit | a6ea7b7bbc66327cc2a957496f65dcfab5361cee (patch) | |
| tree | a4fda8a1a490bf1d88afe4e8d2f8814afdcc0de1 /core/resource/binfile.cc | |
| parent | 8784cbfebcb8a0220fb947a6070032e20b80fc2f (diff) | |
| download | voxelius-a6ea7b7bbc66327cc2a957496f65dcfab5361cee.tar.bz2 voxelius-a6ea7b7bbc66327cc2a957496f65dcfab5361cee.zip | |
Update ImGui to a newer version with font scaling
Diffstat (limited to 'core/resource/binfile.cc')
| -rw-r--r-- | core/resource/binfile.cc | 51 |
1 files changed, 0 insertions, 51 deletions
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<std::size_t>(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<const BinFile*>(resource); - delete[] binfile->buffer; - - delete binfile; -} - -void BinFile::register_resource(void) -{ - resource::register_loader<BinFile>(&binfile_load_func, &binfile_free_func); -} |
