Merge branch 'master' into NDK-ShadowMapping
Former-commit-id: 0d9c61835b3e42a932299c6d759e9af0f56019b8
This commit is contained in:
commit
5f16da5e73
|
|
@ -7,6 +7,16 @@
|
||||||
#ifndef NAZARA_ENUMS_LUA_HPP
|
#ifndef NAZARA_ENUMS_LUA_HPP
|
||||||
#define NAZARA_ENUMS_LUA_HPP
|
#define NAZARA_ENUMS_LUA_HPP
|
||||||
|
|
||||||
|
namespace Nz
|
||||||
|
{
|
||||||
|
enum LuaBindMode
|
||||||
|
{
|
||||||
|
LuaBindMode_Table,
|
||||||
|
LuaBindMode_Userdata,
|
||||||
|
|
||||||
|
LuaBindMode_Max = LuaBindMode_Userdata
|
||||||
|
};
|
||||||
|
|
||||||
enum LuaComparison
|
enum LuaComparison
|
||||||
{
|
{
|
||||||
LuaComparison_Equality,
|
LuaComparison_Equality,
|
||||||
|
|
@ -51,5 +61,6 @@ enum LuaType
|
||||||
|
|
||||||
LuaType_Max = LuaType_Userdata
|
LuaType_Max = LuaType_Userdata
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#endif // NAZARA_ENUMS_LUA_HPP
|
#endif // NAZARA_ENUMS_LUA_HPP
|
||||||
|
|
|
||||||
|
|
@ -8,17 +8,17 @@
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
// Functions args
|
// Functions args
|
||||||
bool LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<bool>)
|
inline bool LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<bool>)
|
||||||
{
|
{
|
||||||
return instance.CheckBoolean(index);
|
return instance.CheckBoolean(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
double LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<double>)
|
inline double LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<double>)
|
||||||
{
|
{
|
||||||
return instance.CheckNumber(index);
|
return instance.CheckNumber(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
float LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<float>)
|
inline float LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<float>)
|
||||||
{
|
{
|
||||||
return static_cast<float>(instance.CheckNumber(index));
|
return static_cast<float>(instance.CheckNumber(index));
|
||||||
}
|
}
|
||||||
|
|
@ -41,7 +41,7 @@ namespace Nz
|
||||||
return static_cast<T>(LuaImplQueryArg(instance, index, TypeTag<typename std::make_signed<T>::type>()));
|
return static_cast<T>(LuaImplQueryArg(instance, index, TypeTag<typename std::make_signed<T>::type>()));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<std::string>)
|
inline std::string LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<std::string>)
|
||||||
{
|
{
|
||||||
std::size_t strLength = 0;
|
std::size_t strLength = 0;
|
||||||
const char* str = instance.CheckString(index, &strLength);
|
const char* str = instance.CheckString(index, &strLength);
|
||||||
|
|
@ -49,7 +49,7 @@ namespace Nz
|
||||||
return std::string(str, strLength);
|
return std::string(str, strLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
String LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<String>)
|
inline String LuaImplQueryArg(LuaInstance& instance, unsigned int index, TypeTag<String>)
|
||||||
{
|
{
|
||||||
std::size_t strLength = 0;
|
std::size_t strLength = 0;
|
||||||
const char* str = instance.CheckString(index, &strLength);
|
const char* str = instance.CheckString(index, &strLength);
|
||||||
|
|
@ -64,19 +64,19 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function returns
|
// Function returns
|
||||||
int LuaImplReplyVal(LuaInstance& instance, bool val, TypeTag<bool>)
|
inline int LuaImplReplyVal(LuaInstance& instance, bool val, TypeTag<bool>)
|
||||||
{
|
{
|
||||||
instance.PushBoolean(val);
|
instance.PushBoolean(val);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LuaImplReplyVal(LuaInstance& instance, double val, TypeTag<double>)
|
inline int LuaImplReplyVal(LuaInstance& instance, double val, TypeTag<double>)
|
||||||
{
|
{
|
||||||
instance.PushNumber(val);
|
instance.PushNumber(val);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LuaImplReplyVal(LuaInstance& instance, float val, TypeTag<float>)
|
inline int LuaImplReplyVal(LuaInstance& instance, float val, TypeTag<float>)
|
||||||
{
|
{
|
||||||
instance.PushNumber(val);
|
instance.PushNumber(val);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -105,13 +105,13 @@ namespace Nz
|
||||||
return LuaImplReplyVal(instance, static_cast<SignedT>(val), TypeTag<SignedT>());
|
return LuaImplReplyVal(instance, static_cast<SignedT>(val), TypeTag<SignedT>());
|
||||||
}
|
}
|
||||||
|
|
||||||
int LuaImplReplyVal(LuaInstance& instance, std::string val, TypeTag<std::string>)
|
inline int LuaImplReplyVal(LuaInstance& instance, std::string val, TypeTag<std::string>)
|
||||||
{
|
{
|
||||||
instance.PushString(val.c_str(), val.size());
|
instance.PushString(val.c_str(), val.size());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int LuaImplReplyVal(LuaInstance& instance, String val, TypeTag<String>)
|
inline int LuaImplReplyVal(LuaInstance& instance, String val, TypeTag<String>)
|
||||||
{
|
{
|
||||||
instance.PushString(std::move(val));
|
instance.PushString(std::move(val));
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue