diff options
author | LaG1924 <lag1924@gmail.com> | 2021-06-18 14:14:19 +0200 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-06-18 16:52:47 +0200 |
commit | 8c033fff3d82d5f0e4c5d2eb3c5d10efc60ee851 (patch) | |
tree | e0f585207f4dde33999e73d3fbde65f0c76f8b16 /src/Rml.hpp | |
parent | Implemented main menu in Rml and improved RmlUi support (diff) | |
download | AltCraft-8c033fff3d82d5f0e4c5d2eb3c5d10efc60ee851.tar AltCraft-8c033fff3d82d5f0e4c5d2eb3c5d10efc60ee851.tar.gz AltCraft-8c033fff3d82d5f0e4c5d2eb3c5d10efc60ee851.tar.bz2 AltCraft-8c033fff3d82d5f0e4c5d2eb3c5d10efc60ee851.tar.lz AltCraft-8c033fff3d82d5f0e4c5d2eb3c5d10efc60ee851.tar.xz AltCraft-8c033fff3d82d5f0e4c5d2eb3c5d10efc60ee851.tar.zst AltCraft-8c033fff3d82d5f0e4c5d2eb3c5d10efc60ee851.zip |
Diffstat (limited to 'src/Rml.hpp')
-rw-r--r-- | src/Rml.hpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Rml.hpp b/src/Rml.hpp index 7b312c0..6e4d857 100644 --- a/src/Rml.hpp +++ b/src/Rml.hpp @@ -1,10 +1,15 @@ #pragma once +#include <map> + #include <RmlUi/Core/SystemInterface.h> #include <RmlUi/Core/RenderInterface.h> +#include <RmlUi/Core/FileInterface.h> #include "Renderer.hpp" +class AssetTreeNode; + class RmlSystemInterface : public Rml::SystemInterface { double totalTime; public: @@ -58,3 +63,24 @@ public: void Update(unsigned int windowWidth, unsigned int windowHeight); }; + +class RmlFileInterface : public Rml::FileInterface { + struct AssetHandle { + std::string fileName; + unsigned long long filePos; + AssetTreeNode* assetPtr; + }; + std::map<Rml::FileHandle, AssetHandle> handles; +public: + + virtual Rml::FileHandle Open(const Rml::String& path) override; + + virtual void Close(Rml::FileHandle file) override; + + virtual size_t Read(void* buffer, size_t size, Rml::FileHandle file) override; + + virtual bool Seek(Rml::FileHandle file, long offset, int origin) override; + + virtual size_t Tell(Rml::FileHandle file) override; + +}; |