Merge branch 'master' into physics3d-material
This commit is contained in:
@@ -22,7 +22,7 @@ namespace Nz
|
||||
public:
|
||||
LuaInstance();
|
||||
LuaInstance(const LuaInstance&) = delete;
|
||||
LuaInstance(LuaInstance&& instance) = default;
|
||||
LuaInstance(LuaInstance&& instance);
|
||||
~LuaInstance();
|
||||
|
||||
inline std::size_t GetMemoryLimit() const;
|
||||
@@ -33,7 +33,7 @@ namespace Nz
|
||||
inline void SetTimeLimit(UInt32 limit);
|
||||
|
||||
LuaInstance& operator=(const LuaInstance&) = delete;
|
||||
LuaInstance& operator=(LuaInstance&& instance) = default;
|
||||
LuaInstance& operator=(LuaInstance&& instance);
|
||||
|
||||
private:
|
||||
inline void SetMemoryUsage(std::size_t memoryUsage);
|
||||
|
||||
@@ -30,6 +30,11 @@ namespace Nz
|
||||
{
|
||||
m_timeLimit = limit;
|
||||
}
|
||||
|
||||
inline void LuaInstance::SetMemoryUsage(std::size_t memoryUsage)
|
||||
{
|
||||
m_memoryUsage = memoryUsage;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Lua/DebugOff.hpp>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#define NAZARA_LUASTATE_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/MovablePtr.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <Nazara/Lua/Config.hpp>
|
||||
#include <Nazara/Lua/Enums.hpp>
|
||||
@@ -32,7 +33,7 @@ namespace Nz
|
||||
{
|
||||
public:
|
||||
LuaState(const LuaState&) = default;
|
||||
inline LuaState(LuaState&& instance) noexcept;
|
||||
LuaState(LuaState&& instance) = default;
|
||||
~LuaState() = default;
|
||||
|
||||
void ArgCheck(bool condition, unsigned int argNum, const char* error) const;
|
||||
@@ -173,7 +174,7 @@ namespace Nz
|
||||
void* ToUserdata(int index, const String& tname) const;
|
||||
|
||||
LuaState& operator=(const LuaState&) = default;
|
||||
inline LuaState& operator=(LuaState&& instance) noexcept;
|
||||
LuaState& operator=(LuaState&& instance) = default;
|
||||
|
||||
static int GetIndexOfUpValue(int upValue);
|
||||
static LuaInstance& GetInstance(lua_State* internalState);
|
||||
@@ -188,8 +189,8 @@ namespace Nz
|
||||
|
||||
static int ProxyFunc(lua_State* internalState);
|
||||
|
||||
MovablePtr<lua_State> m_state;
|
||||
String m_lastError;
|
||||
lua_State* m_state;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,6 @@ namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
inline LuaState::LuaState(LuaState&& state) noexcept :
|
||||
m_lastError(state.m_lastError),
|
||||
m_state(state.m_state)
|
||||
{
|
||||
state.m_state = nullptr;
|
||||
}
|
||||
|
||||
inline lua_State* LuaState::GetInternalState() const
|
||||
{
|
||||
return m_state;
|
||||
@@ -776,16 +769,6 @@ namespace Nz
|
||||
SetMetatable(tname);
|
||||
}
|
||||
|
||||
inline LuaState& LuaState::operator=(LuaState&& state) noexcept
|
||||
{
|
||||
m_lastError = std::move(state.m_lastError);
|
||||
m_state = state.m_state;
|
||||
|
||||
state.m_state = nullptr;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
std::enable_if_t<std::is_signed<T>::value, T> LuaState::CheckBounds(int index, long long value) const
|
||||
{
|
||||
|
||||
@@ -329,7 +329,7 @@ namespace Nz
|
||||
ss << "Index out of range: (" << i << " >= " << BoxCorner_Max << ")";
|
||||
|
||||
NazaraError(ss);
|
||||
throw std::out_of_range(ss.ToString());
|
||||
throw std::out_of_range(ss.ToString().ToStdString());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user