Some output now going through PrintBuffer

This commit is contained in:
2021-10-21 13:15:04 -04:00
parent 458497956d
commit 1a25fed15f
9 changed files with 139 additions and 46 deletions

View File

@@ -1,5 +1,6 @@
#include "world.hpp"
#include "pprint.hpp"
LuaDefine(tangible_animstate, "c") {
LuaArg tanobj;
@@ -209,3 +210,14 @@ LuaDefine(world_settabletype, "f") {
return LS.result();
}
LuaDefine(world_pprint, "f") {
World *w = World::fetch_global_pointer(L);
std::ostream *ostream = w->lthread_print_stream();
LuaStack LS(L);
for (int i = 1; i <= lua_gettop(L); i++) {
LuaSpecial root(i);
pprint(LS, root, true, ostream);
(*ostream) << std::endl;
}
return LS.result();
}