diff options
Diffstat (limited to '')
-rw-r--r-- | src/Plugin.cpp | 6 | ||||
-rw-r--r-- | src/Rml.cpp | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/Plugin.cpp b/src/Plugin.cpp index e3188e6..5134aa6 100644 --- a/src/Plugin.cpp +++ b/src/Plugin.cpp @@ -237,6 +237,11 @@ void PluginSystem::Init() { "name", &Dimension::name, "skylight", &Dimension::skylight); + lua.new_usertype<LoopExecutionTimeController>("LoopExecutionTimeController", + "GetIterations", &LoopExecutionTimeController::GetIterations, + "GetDeltaS", &LoopExecutionTimeController::GetDeltaS, + "GetRealDeltaS", &LoopExecutionTimeController::GetRealDeltaS); + sol::table apiTable = lua["AC"].get_or_create<sol::table>(); sol::table apiSettings = lua["AC"]["Settings"].get_or_create<sol::table>(); @@ -262,6 +267,7 @@ void PluginSystem::Init() { apiSettings["ReadDouble"] = Settings::ReadDouble; apiSettings["WriteDouble"] = Settings::WriteDouble; apiTable["SettingsUpdate"] = PluginApi::SettingsUpdate; + apiTable["GetTime"] = GetTime; } lua_State* PluginSystem::GetLuaState() { diff --git a/src/Rml.cpp b/src/Rml.cpp index cbc795f..6ed83c1 100644 --- a/src/Rml.cpp +++ b/src/Rml.cpp @@ -189,7 +189,7 @@ void RmlFileInterface::Close(Rml::FileHandle file) { size_t RmlFileInterface::Read(void* buffer, size_t size, Rml::FileHandle file) { size_t readed = 0; - readed = _min(handles[file].assetPtr->data.size() - handles[file].filePos, size); + readed = _min((size_t)(handles[file].assetPtr->data.size() - handles[file].filePos), size); std::memcpy(buffer, handles[file].assetPtr->data.data() + handles[file].filePos, readed); handles[file].filePos += readed; return readed; |