feat: Switch from default sq stack parsing to NoNut

This commit is contained in:
AURUMVORXX
2024-11-04 14:57:54 +03:00
parent 965c65147f
commit 3f477f5a32
6 changed files with 91 additions and 89 deletions

View File

@@ -13,6 +13,7 @@ namespace nonut
public:
static void registerFunction(String funcName, const SQFUNCTION func, size_t funcSize)
{
HSQUIRRELVM vm = Sqrat::DefaultVM::Get();
const auto top = sq_gettop(vm);
sq_pushroottable(vm);
sq_pushstring(vm, funcName.c_str(), funcName.length());

View File

@@ -15,7 +15,4 @@ namespace nonut
constexpr SQObject SQ_NULL{ OT_NULL };
}
namespace nonut::g2o{}
namespace g2o = nonut::g2o;
#endif // CORE_COMMONHEADER_H_

View File

@@ -1,6 +1,8 @@
#ifndef NONUT_CORE_USER_DATA_H
#define NONUT_CORE_USER_DATA_H
#include <sqapi.h>
namespace nonut
{
class UserData

View File

@@ -18,7 +18,7 @@ namespace nonut
std::is_same_v<T, Bool*> ||
std::is_same_v<T, Int*> ||
std::is_same_v<T, Float*> ||
std::is_same_v<T, SQChar**> ||
std::is_same_v<T, const SQChar**> ||
std::is_same_v<T, HSQOBJECT*> ||
std::is_same_v<T, SQUserPointer*>,
"Not supported return type");
@@ -29,7 +29,7 @@ namespace nonut
sq_getinteger(vm, idx, outPtr);
if constexpr (std::is_same_v<T, Float*>)
sq_getfloat(vm, idx, outPtr);
if constexpr (std::is_same_v<T, SQChar**>)
if constexpr (std::is_same_v<T, const SQChar**>)
sq_getstring(vm, idx, outPtr);
if constexpr (std::is_same_v<T, HSQOBJECT*>)
{