Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 519ddcd9 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

SCRIPT: Better debug messages

parent 15d3a38a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!9Lua cpp expose
......@@ -6,7 +6,12 @@ using namespace Vivy::Script;
SampleObject::SampleObject() noexcept
{
fprintf(stderr, "CREATE SampleObject");
fprintf(stderr, "CREATE SampleObject\n");
}
SampleObject::~SampleObject() noexcept
{
fprintf(stderr, "DESTROY SampleObject\n");
}
int
......
......@@ -49,16 +49,16 @@ protected:
return obj;
}
static inline const luaL_Reg luaRegDefaultGC = { "__gc", GC };
static inline constexpr luaL_Reg luaRegDefaultGC = { "__gc", GC };
public:
static void Register(lua_State *L) noexcept
{
// Fill the method table
// Fill the method table, newclass = {}
lua_newtable(L);
int methodtable = lua_gettop(L);
// Fill the meta-table
// Fill the meta-table, metatable = {}
{
luaL_newmetatable(L, Object::className);
int metatable = lua_gettop(L);
......@@ -100,6 +100,7 @@ class SampleObject final : LUA_DECL_SCRIPTABLE_CLASS(SampleObject) {
public:
SampleObject() noexcept;
~SampleObject() noexcept;
static int foo(lua_State *L) noexcept;
};
......
......@@ -35,7 +35,7 @@ LuaContext::loadFile(const char *file) noexcept
}
if (lua_pcall(L, 0, 0, 0) != LUA_OK) {
qCritical().nospace() << "LUA ERROR: " << getLastError();
puts(getLastError().toStdString().c_str());
return LUA_ERRERR;
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter