summaryrefslogtreecommitdiff
path: root/scripting/test.cpp
blob: 5ec27da90d6d3b837d842027e2efc3cb6bddfe50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "scripting/test.h"
#include "scripting.h"

#include <iostream>

void print(lua_State *L, const char *s) {
	lua_getglobal(L, "lua_instance");
	Lua *lua = static_cast<Lua*>(lua_touserdata(L, -1));
	lua_pop(L, 1);
	lua->print(s);
}

void say(lua_State *L, const char *s) {
	lua_getglobal(L, "lua_instance");
	Lua *lua = static_cast<Lua*>(lua_touserdata(L, -1));
	lua_pop(L, 1);
	lua->say(s);
}