Browse Source

Removing python

Panagiotis Christopoulos Charitos 13 years ago
parent
commit
df2a1cb69c

+ 10 - 53
include/anki/script/Common.h

@@ -1,61 +1,18 @@
-#ifndef ANKI_SCRIPT_COMMON_H
-#define ANKI_SCRIPT_COMMON_H
-
 /// @file
-/// This file is included by all the *.bpi.cpp files
-#include <boost/python.hpp>
-#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
+/// This file is included by all the .cpp files that wrap something
 
-namespace anki
-{}
+#ifndef ANKI_SCRIPT_COMMON_H
+#define ANKI_SCRIPT_COMMON_H
 
-using namespace boost;
-using namespace boost::python;
-using namespace anki;
+#include "anki/script/LuaBinder.h"
 
 /// Wrap a class
-#define ANKI_WRAP(x) \
-	void boostPythonWrap##x()
-
-/// Wrap a singleton class
-#define ANKI_WRAP_SINGLETON(x) \
-	WRAP(x) { \
-		class_<x, noncopyable>(#x, no_init) \
-			.def("get", & x ::get, \
-				return_value_policy<reference_existing_object>()) \
-			.staticmethod("get") \
-		; \
-	}
-
-#define ANKI_WRAP_CONTAINER(x) \
-	class_<x >(#x) \
-		.def(vector_indexing_suite<x >()) \
-	;
-
-#define ANKI_CALL_WRAP(x) extern void boostPythonWrap##x(); boostPythonWrap##x()
-
-//==============================================================================
-// Property for simple types                                                   =
-//==============================================================================
-
-template<typename ClassType, typename RetType,
-	const RetType& (ClassType::* accessor)() const>
-RetType getterSv(const ClassType* t)
-{
-	return (t->*accessor)();
-}
-
-template<typename ClassType, typename InType,
-	void (ClassType::* accessor)(const InType&)>
-void setterSv(ClassType* t, InType in)
-{
-	(t->*accessor)(in);
-}
+#define ANKI_SCRIPT_WRAP(x) \
+	void ankiScriptWrap##x(LuaBinder& lb)
 
-/// Boost python property for simple types (int, float etc) that cannot be
-/// wrapped by boost::python correctly
-#define BP_PROPERTY_BASIC_TYPE(Type__, Class__, var__, getter__, setter__) \
-	.add_property(#var__, &getterSv<Class__, Type__, &Class__::getter__>, \
-		&setterSv<Class__, Type__, &Class__::setter__>)
+/// XXX
+#define ANKI_SCRIPT_CALL_WRAP(x) \
+	extern void ankiScriptWrap##x(LuaBinder&); \
+	ankiScriptWrap##x(*this);
 
 #endif

+ 43 - 5
include/anki/script/LuaBinder.h

@@ -42,9 +42,18 @@ const char* ClassProxy<Class>::NAME = nullptr;
 extern void checkArgsCount(lua_State* l, int argsCount);
 
 //==============================================================================
-/// Used mainly to push a method return value to the stack
-template<typename T>
-struct PushStack;
+/// Used mainly to push a method's return value to the stack
+template<typename Class>
+struct PushStack
+{
+	void operator()(lua_State* l, Class& x)
+	{
+		UserData* d = (UserData*)lua_newuserdata(l, sizeof(UserData));
+		luaL_setmetatable(l, ClassProxy<Class>::getName());
+		d->ptr = new Class(x);
+		d->gc = true;
+	}
+};
 
 // Specialization ref
 template<typename Class>
@@ -240,6 +249,20 @@ struct CallMethod<TReturn (Class::*)(Arg0)>
 	}
 };
 
+// R (_1) const
+template<typename Class, typename TReturn, typename Arg0>
+struct CallMethod<TReturn (Class::*)(Arg0) const>
+{
+	int operator()(lua_State* l, const Class* obj, 
+		TReturn (Class::* method)(Arg0) const)
+	{
+		TReturn out = (obj->*method)(StackGet<Arg0, 2>()(l));
+		PushStack<TReturn> ps;
+		ps(l, out);
+		return 1;
+	}
+};
+
 // R (_1, _2)
 template<typename Class, typename TReturn, typename Arg0, typename Arg1>
 struct CallMethod<TReturn (Class::*)(Arg0, Arg1)>
@@ -281,7 +304,7 @@ struct CallMethod<void (Class::*)(Arg0, Arg1)>
 template<typename Class>
 struct CallMethod<void (Class::*)(void)>
 {
-	int operator()(lua_State* l, Class* obj, void (Class::* method)(void))
+	int operator()(lua_State* /*l*/, Class* obj, void (Class::* method)(void))
 	{
 		(obj->*method)();
 		return 0;
@@ -372,7 +395,7 @@ struct CallFunction<TReturn (*)(void)>
 template<>
 struct CallFunction<void (*)(void)>
 {
-	int operator()(lua_State* l, void (*func)(void))
+	int operator()(lua_State* /*l*/, void (*func)(void))
 	{
 		(*func)();
 		return 0;
@@ -471,6 +494,21 @@ struct MethodSignature<TReturn (Class::*)(Args...)>
 	}
 };
 
+template<typename Class, typename TReturn, typename... Args>
+struct MethodSignature<TReturn (Class::*)(Args...) const>
+{
+	template<TReturn (Class::* method)(Args...) const>
+	static int luafunc(lua_State* l)
+	{
+		checkArgsCount(l, sizeof...(Args) + 1);
+		UserData* d = (UserData*)luaL_checkudata(l, 1, 
+			ClassProxy<Class>::getName());
+		const Class* obj = reinterpret_cast<const Class*>(d->ptr);
+		CallMethod<decltype(method)> cm;
+		return cm(l, obj, method);
+	}
+};
+
 //==============================================================================
 /// Function signature
 template<typename T>

+ 6 - 21
include/anki/script/ScriptManager.h

@@ -1,14 +1,13 @@
 #ifndef ANKI_SCRIPT_SCRIPT_MANAGER_H
 #define ANKI_SCRIPT_SCRIPT_MANAGER_H
 
-#include <boost/python.hpp>
-
+#include "anki/script/LuaBinder.h"
+#include "anki/util/Singleton.h"
 
 namespace anki {
 
-
-/// The scripting manager using Python
-class ScriptManager
+/// The scripting manager
+class ScriptManager: public LuaBinder
 {
 public:
 	ScriptManager()
@@ -21,26 +20,12 @@ public:
 	/// @return true on success
 	void execScript(const char* script, const char* scriptName = "unamed");
 
-	/// Expose a C++ variable to python
-	/// @param varName The name to referenced in python
-	/// @param var The actual variable
-	template<typename Type>
-	void exposeVar(const char* varName, Type* var)
-	{
-		using namespace boost::python;
-		scope(ankiModule).attr(varName) = ptr(var);
-	}
-
 private:
-	boost::python::object mainModule;
-	boost::python::object ankiModule;
-	boost::python::object mainNamespace;
-
 	void init();
 };
 
+typedef Singleton<ScriptManager> ScriptManagerSingleton;
 
-} // end namespace
-
+} // end namespace anki
 
 #endif

+ 2 - 51
src/script/ScriptManager.cpp

@@ -2,42 +2,6 @@
 #include "anki/util/Exception.h"
 #include "anki/core/Logger.h"
 #include "anki/script/Common.h"
-#include <Python.h>
-
-using namespace boost;
-using namespace boost::python;
-
-/// Define the classes
-BOOST_PYTHON_MODULE(anki)
-{
-	ANKI_CALL_WRAP(HighRezTimer);
-
-	ANKI_CALL_WRAP(Vec2);
-	ANKI_CALL_WRAP(Vec3);
-	ANKI_CALL_WRAP(Vec4);
-
-	ANKI_CALL_WRAP(Logger);
-
-	ANKI_CALL_WRAP(SceneNode);
-	ANKI_CALL_WRAP(Camera);
-	ANKI_CALL_WRAP(Scene);
-
-	ANKI_CALL_WRAP(SwitchableRenderingPass);
-	ANKI_CALL_WRAP(Hdr);
-	ANKI_CALL_WRAP(Bl);
-	ANKI_CALL_WRAP(Pps);
-	ANKI_CALL_WRAP(Renderer);
-	ANKI_CALL_WRAP(Dbg);
-	ANKI_CALL_WRAP(MainRenderer);
-
-	ANKI_CALL_WRAP(SceneColorEvent);
-	ANKI_CALL_WRAP(MainRendererPpsHdrEvent);
-	ANKI_CALL_WRAP(EventManager);
-
-	ANKI_CALL_WRAP(App);
-
-	ANKI_CALL_WRAP(Input);
-}
 
 namespace anki {
 
@@ -46,11 +10,7 @@ void ScriptManager::init()
 {
 	ANKI_LOGI("Initializing scripting engine...");
 
-	PyImport_AppendInittab((char*)("anki"), &initanki);
-	Py_Initialize();
-	mainModule = object(handle<>(borrowed(PyImport_AddModule("__main__"))));
-	mainNamespace = mainModule.attr("__dict__");
-	ankiModule = object(handle<>(PyImport_ImportModule("anki")));
+	ANKI_SCRIPT_CALL_WRAP(Vec2);
 
 	ANKI_LOGI("Scripting engine initialized");
 }
@@ -58,16 +18,7 @@ void ScriptManager::init()
 //==============================================================================
 void ScriptManager::execScript(const char* script, const char* scriptName)
 {
-	try
-	{
-		handle<>ignored(PyRun_String(script, Py_file_input,
-			mainNamespace.ptr(), mainNamespace.ptr()));
-	}
-	catch(error_already_set)
-	{
-		PyErr_Print();
-		throw ANKI_EXCEPTION("Script \"" + scriptName + "\" failed with error");
-	}
+	// XXX
 }
 
 } // end namespace

+ 0 - 6
src/script/core/App.cpp

@@ -1,9 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/core/App.h"
 
-ANKI_WRAP(App)
-{
-	class_<App, noncopyable>("App", no_init)
-		.def("quit", &App::quit)
-	;
-}

+ 0 - 13
src/script/core/Logger.cpp

@@ -1,16 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/core/Logger.h"
 
-ANKI_WRAP(Logger)
-{
-	scope loggerScope(
-	class_<Logger, noncopyable>("Logger", no_init)
-		.def("write", &Logger::write)
-	);
-
-	enum_<Logger::LoggerMessageType>("LoggerMessageType")
-		.value("LMT_NORMAL", Logger::LMT_NORMAL)
-		.value("LMT_ERROR", Logger::LMT_ERROR)
-		.value("LMT_WARNING", Logger::LMT_WARNING)
-	;
-}

+ 0 - 10
src/script/event/EventManager.cpp

@@ -4,13 +4,3 @@
 #include "anki/event/SceneColorEvent.h"
 #include "anki/event/MainRendererPpsHdrEvent.h"
 
-ANKI_WRAP(EventManager)
-{
-	class_<EventManager, noncopyable>("EventManager", no_init)
-		/*.def("createEvent", &EventManager::createEvent<SceneColorEvent>,
-			return_value_policy<reference_existing_object>())
-		.def("createEvent",
-			&EventManager::createEvent<MainRendererPpsHdrEvent>,
-			return_value_policy<reference_existing_object>())*/
-	;
-}

+ 0 - 7
src/script/event/MainRendererPpsHdrEvent.cpp

@@ -1,10 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/event/MainRendererPpsHdrEvent.h"
 
-ANKI_WRAP(MainRendererPpsHdrEvent)
-{
-	class_<MainRendererPpsHdrEvent>("MainRendererPpsHdrEvent", no_init)
-		.def(init<float, float, float, uint, float>())
-		.def(init<const MainRendererPpsHdrEvent&>())
-	;
-}

+ 0 - 7
src/script/event/SceneColorEvent.cpp

@@ -1,10 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/event/SceneColorEvent.h"
 
-ANKI_WRAP(SceneColorEvent)
-{
-	class_<SceneColorEvent>("SceneColorEvent", no_init)
-		.def(init<float, float, const Vec3&>())
-		.def(init<const SceneColorEvent&>())
-	;
-}

+ 0 - 7
src/script/input/Input.cpp

@@ -1,10 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/input/Input.h"
 
-ANKI_WRAP(Input)
-{
-	class_<Input, noncopyable>("Input", no_init)
-		.def("getWarpMouse", (bool (Input::*)() const)(&Input::getWarpMouse))
-		.def("setWarpMouse", &Input::setWarpMouse)
-	;
-}

+ 41 - 38
src/script/math/Vec2.cpp

@@ -1,44 +1,47 @@
 #include "anki/script/MathCommon.h"
 #include "anki/math/Math.h"
 
-ANKI_WRAP(Vec2)
+namespace anki {
+
+static float vec2GetX(Vec2* self)
 {
-	class_<Vec2>("Vec2")
-		// constructors
-		.def(init<>())
-		.def(init<float>())
-		.def(init<float, float>())
-		.def(init<const Vec2&>())
-		.def(init<const Vec3&>())
-		.def(init<const Vec4&>())
+	return self->x();
+}
+
+static void vec2SetX(Vec2* self, float x)
+{
+	self->x() = x;
+}
+
+static float vec2GetY(Vec2* self)
+{
+	return self->y();
+}
+
+static void vec2SetY(Vec2* self, float y)
+{
+	self->y() = y;
+}
+
+static float vec2GetAt(Vec2* self, int i)
+{
+	return (*self)[i];
+}
+
+ANKI_SCRIPT_WRAP(Vec2)
+{
+	ANKI_LUA_CLASS_BEGIN(lb, Vec2)
+		ANKI_LUA_CONSTRUCTOR(float, float)
 		// Accessors
-		ANKI_BP_PROPERTY_MATH(Vec2, x)
-		ANKI_BP_PROPERTY_MATH(Vec2, y)
-		// ops with same type
-		.def(self + self)
-		.def(self += self)
-		.def(self - self)
-		.def(self -= self)
-		.def(self * self)
-		.def(self *= self)
-		.def(self / self)
-		.def(self /= self)
-		.def(- self)
-		.def(self == self)
-		.def(self != self)
-		// ops with float
-		.def(self + float())
-		.def(self += float())
-		.def(self - float())
-		.def(self -= float())
-		.def(self * float())
-		.def(self *= float())
-		.def(self / float())
-		.def(self /= float())
-		// other
-		.def("getLength", &Vec2::getLength)
-		.def("getNormalized", &Vec2::getNormalized)
-		.def("normalize", &Vec2::normalize)
-		.def("dot", &Vec2::dot)
-	;
+		ANKI_LUA_FUNCTION_AS_METHOD("getX", &vec2GetX)
+		ANKI_LUA_FUNCTION_AS_METHOD("getY", &vec2GetY)
+		ANKI_LUA_FUNCTION_AS_METHOD("setX", &vec2SetX)
+		ANKI_LUA_FUNCTION_AS_METHOD("setY", &vec2SetY)
+		ANKI_LUA_FUNCTION_AS_METHOD("getAt", &vec2GetAt)
+		// Ops with same
+		ANKI_LUA_METHOD("add", 
+			(Vec2 (Vec2::*)(const Vec2&) const)(&Vec2::operator+))
+	ANKI_LUA_CLASS_END()
 }
+
+} // end namespace anki

+ 0 - 38
src/script/math/Vec3.cpp

@@ -1,41 +1,3 @@
 #include "anki/script/MathCommon.h"
 #include "anki/math/Math.h"
 
-ANKI_WRAP(Vec3)
-{
-	class_<Vec3>("Vec3")
-		// Constructors
-		.def(init<>())
-		.def(init<float>())
-		.def(init<float, float, float>())
-		.def(init<const Vec2&, float>())
-		.def(init<const Vec3&>())
-		.def(init<const Vec4&>())
-		.def(init<const Quat&>())
-		// Accessors
-		ANKI_BP_PROPERTY_MATH(Vec3, x)
-		ANKI_BP_PROPERTY_MATH(Vec3, y)
-		ANKI_BP_PROPERTY_MATH(Vec3, z)
-		// ops with self
-		.def(self + self) // +
-		.def(self += self) // +=
-		.def(self - self) // -
-		.def(self -= self) // -=
-		.def(self * self) // *
-		.def(self *= self) // *=
-		.def(self / self) // /
-		.def(self /= self) // /=
-		.def(- self) // negative
-		.def(self == self) // ==
-		.def(self != self) // ==
-		// ops with float
-		.def(self + float()) // +
-		.def(self += float()) // +=
-		.def(self - float()) // -
-		.def(self -= float()) // -=
-		.def(self * float()) // *
-		.def(self *= float()) // *=
-		.def(self / float()) // /
-		.def(self /= float()) // /=
-	;
-}

+ 0 - 39
src/script/math/Vec4.cpp

@@ -1,42 +1,3 @@
 #include "anki/script/MathCommon.h"
 #include "anki/math/Math.h"
 
-ANKI_WRAP(Vec4)
-{
-	class_<Vec4>("Vec4")
-		// constructors
-		.def(init<>())
-		.def(init<float>())
-		.def(init<float, float, float, float>())
-		.def(init<const Vec2&, float, float>())
-		.def(init<const Vec3&, float>())
-		.def(init<const Vec4&>())
-		.def(init<const Quat&>())
-		// Accessors
-		ANKI_BP_PROPERTY_MATH(Vec4, x)
-		ANKI_BP_PROPERTY_MATH(Vec4, y)
-		ANKI_BP_PROPERTY_MATH(Vec4, z)
-		ANKI_BP_PROPERTY_MATH(Vec4, w)
-		// ops with self
-		.def(self + self) // +
-		.def(self += self) // +=
-		.def(self - self) // -
-		.def(self -= self) // -=
-		.def(self * self) // *
-		.def(self *= self) // *=
-		.def(self / self) // /
-		.def(self /= self) // /=
-		.def(- self) // negative
-		.def(self == self) // ==
-		.def(self != self) // ==
-		// ops with float
-		.def(self + float()) // +
-		.def(self += float()) // +=
-		.def(self - float()) // -
-		.def(self -= float()) // -=
-		.def(self * float()) // *
-		.def(self *= float()) // *=
-		.def(self / float()) // /
-		.def(self /= float()) // /=
-	;
-}

+ 0 - 15
src/script/renderer/Bl.cpp

@@ -1,18 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/renderer/Bl.h"
 
-ANKI_WRAP(Bl)
-{
-	class_<Bl, noncopyable>("Bl", no_init)
-		.def("getEnabled", (bool (Bl::*)() const)(&Bl::getEnabled))
-		.def("setEnabled", &Bl::setEnabled)
-
-		.def("getBlurringIterationsNum", (uint (Bl::*)() const)(
-			&Bl::getBlurringIterationsNum))
-		.def("setBlurringIterationsNum", &Bl::setBlurringIterationsNum)
-
-		.def("getSideBlurFactor", (float (Bl::*)() const)(
-			&Bl::getSideBlurFactor))
-		.def("setSideBlurFactor", &Bl::setSideBlurFactor)
-	;
-}

+ 0 - 5
src/script/renderer/Dbg.cpp

@@ -1,8 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/renderer/Dbg.h"
 
-ANKI_WRAP(Dbg)
-{
-	class_<Dbg, bases<SwitchableRenderingPass>, noncopyable>("Dbg", no_init)
-	;
-}

+ 0 - 15
src/script/renderer/Hdr.cpp

@@ -1,18 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/renderer/Hdr.h"
 
-ANKI_WRAP(Hdr)
-{
-	class_<Hdr, noncopyable>("Hdr", no_init)
-		.def("getBlurringIterationsNum", (uint (Hdr::*)() const)(
-			&Hdr::getBlurringIterationsNum))
-		.def("setBlurringIterationsNum", &Hdr::setBlurringIterationsNum)
-
-		.def("getExposure", (float (Hdr::*)() const)(&Hdr::getExposure))
-		.def("setExposure", &Hdr::setExposure)
-
-		.def("getBlurringDistance", (float (Hdr::*)() const)(
-			&Hdr::getBlurringDistance))
-		.def("setBlurringDistance", &Hdr::setBlurringDistance)
-	;
-}

+ 0 - 11
src/script/renderer/MainRenderer.cpp

@@ -3,14 +3,3 @@
 #include "anki/renderer/Dbg.h"
 #include "anki/renderer/Deformer.h"
 
-ANKI_WRAP(MainRenderer)
-{
-	class_<MainRenderer, bases<Renderer>, noncopyable>("MainRenderer",
-		no_init)
-		.def("getDbg", (Dbg& (MainRenderer::*)())(
-			&MainRenderer::getDbg),
-			return_value_policy<reference_existing_object>())
-
-		.def("getDbgTime", &MainRenderer::getDbgTime)
-	;
-}

+ 0 - 10
src/script/renderer/Pps.cpp

@@ -3,13 +3,3 @@
 #include "anki/renderer/Hdr.h"
 #include "anki/renderer/Bl.h"
 
-ANKI_WRAP(Pps)
-{
-	class_<Pps, noncopyable>("Pps", no_init)
-		.def("getHdr", (Hdr& (Pps::*)())(&Pps::getHdr),
-			return_value_policy<reference_existing_object>())
-
-		.def("getBl", (Bl& (Pps::*)())(&Pps::getBl),
-			return_value_policy<reference_existing_object>())
-	;
-}

+ 0 - 16
src/script/renderer/Renderer.cpp

@@ -1,19 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/renderer/Renderer.h"
 
-ANKI_WRAP(Renderer)
-{
-	typedef Pps& (Renderer::* getPpsAccessor)();
-
-	class_<Renderer, noncopyable>("Renderer", no_init)
-		.def("getPps", (getPpsAccessor)(&Renderer::getPps),
-			return_value_policy<reference_existing_object>())
-		.def("getMsTime", &Renderer::getMsTime)
-		.def("getIsTime", &Renderer::getIsTime)
-		.def("getPpsTime", &Renderer::getPpsTime)
-		.def("getBsTime", &Renderer::getBsTime)
-		.def("getStagesProfilingEnabled",
-			(bool (Renderer::*)() const)(&Renderer::getStagesProfilingEnabled))
-		.def("setStagesProfilingEnabled", &Renderer::setStagesProfilingEnabled)
-	;
-}

+ 0 - 9
src/script/renderer/RenderingPass.cpp

@@ -1,12 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/renderer/RenderingPass.h"
 
-ANKI_WRAP(SwitchableRenderingPass)
-{
-	class_<SwitchableRenderingPass, noncopyable>("SwitchableRenderingPass",
-		no_init)
-		.def("getEnabled", (bool (SwitchableRenderingPass::*)() const)(
-			&SwitchableRenderingPass::getEnabled))
-		.def("setEnabled", &SwitchableRenderingPass::setEnabled)
-	;
-}

+ 0 - 8
src/script/scene/Camera.cpp

@@ -1,11 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/scene/Camera.h"
 
-ANKI_WRAP(Camera)
-{
-	class_<Camera, bases<SceneNode>, noncopyable>("Camera", no_init)
-		/*.def("setFovX", &Camera::setFovX)
-		.def("getFovX", &Camera::getFovX)*/
-	;
-}
-

+ 0 - 20
src/script/scene/Scene.cpp

@@ -3,23 +3,3 @@
 #include "anki/scene/Camera.h"
 #include "anki/scene/ModelNode.h"
 
-ANKI_WRAP(Scene)
-{
-	ANKI_WRAP_CONTAINER(Scene::Types<Camera>::Container)
-	ANKI_WRAP_CONTAINER(Scene::Types<ModelNode>::Container)
-
-	class_<Scene, noncopyable>("Scene", no_init)
-		.def("setAmbientColor", &Scene::setAmbientColor)
-		.def("getAmbientColor", (const Vec3& (Scene::*)() const)(&
-			Scene::getAmbientColor),
-			return_value_policy<reference_existing_object>())
-
-		/*.def("getCameras", (Scene::Types<Camera>::Container& (Scene::*)())(&
-			Scene::getCameras),
-			return_value_policy<reference_existing_object>())
-
-		.def("getModelNodes", (Scene::Types<ModelNode>::Container&
-			(Scene::*)())(&Scene::getModelNodes),
-			return_value_policy<reference_existing_object>())*/
-	;
-}

+ 0 - 7
src/script/scene/SceneNode.cpp

@@ -1,10 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/scene/SceneNode.h"
 
-ANKI_WRAP(SceneNode)
-{
-	class_<SceneNode, noncopyable>("SceneNode", no_init)
-		/*.def("getSceneNodeName", &SceneNode::getSceneNodeName,
-			return_value_policy<copy_const_reference>())*/
-	;
-}

+ 0 - 7
src/script/util/HighRezTimer.cpp

@@ -1,10 +1,3 @@
 #include "anki/script/Common.h"
 #include "anki/util/HighRezTimer.h"
 
-ANKI_WRAP(HighRezTimer)
-{
-	class_<HighRezTimer>("HighRezTimer")
-		.def("getCurrentTime", &HighRezTimer::getCurrentTime)
-		.staticmethod("getCurrentTime")
-	;
-}

+ 1 - 0
tests/framework/Framework.cpp

@@ -85,6 +85,7 @@ Options:
 		else if(strcmp(arg, "--help") == 0)
 		{
 			std::cout << helpMessage << std::endl;
+			return 0;
 		}
 		else if(strcmp(arg, "--suite") == 0)
 		{

+ 9 - 2
tests/script/LuaBinder.cpp

@@ -1,7 +1,14 @@
-#include "anki/script/LuaBinder.h"
 #include "tests/framework/Framework.h"
+#include "anki/script/ScriptManager.h"
 
 ANKI_TEST(Script, LuaBinder)
 {
-	std::cout << "XXX" << std::endl;
+	ScriptManager sm;
+
+	const char* script = R"(
+v = Vec2.new(1.1, 2.2)
+print(v:getX())
+)";
+
+	sm.evalString(script);
 }