Files
GabsPuNs-Project_Zenith_Main/Minecraft.Client/Windows64/RmlUi_FileInterface.h
2026-06-10 16:12:51 +02:00

37 lines
927 B
C++

#pragma once
#pragma push_macro("byte")
#pragma push_macro("GetNextSibling")
#pragma push_macro("GetFirstChild")
#undef byte
#undef GetNextSibling
#undef GetFirstChild
#include <RmlUi/Core/FileInterface.h>
// NOTE: pop_macro at end of file
class FileInterface_Game : public Rml::FileInterface
{
public:
FileInterface_Game();
~FileInterface_Game();
void SetAssetPath(const Rml::String& path) { m_asset_path = path; }
Rml::FileHandle Open(const Rml::String& path) override;
void Close(Rml::FileHandle file) override;
size_t Read(void* buffer, size_t size, Rml::FileHandle file) override;
bool Seek(Rml::FileHandle file, long offset, int origin) override;
size_t Tell(Rml::FileHandle file) override;
private:
static constexpr size_t MAX_OPEN_FILES = 32;
FILE* m_files[MAX_OPEN_FILES];
Rml::String m_asset_path;
};
#pragma pop_macro("GetFirstChild")
#pragma pop_macro("GetNextSibling")
#pragma pop_macro("byte")