Browse Source

Fixed Lua binding generation to work with tidied includes.

Cameron Hart 14 years ago
parent
commit
2ec7a76488

+ 4 - 7
Bindings/Contents/LUA/API/Polycode.lua

@@ -1,6 +1,6 @@
 require "Polycode/SkeletonAnimation"
-require "Polycode/BoneTrack"
 require "Polycode/Skeleton"
+require "Polycode/BoneTrack"
 require "Polycode/TweenManager"
 require "Polycode/Event"
 require "Polycode/EventHandler"
@@ -20,14 +20,11 @@ require "Polycode/ScenePrimitive"
 require "Polycode/SceneSound"
 require "Polycode/SceneSoundListener"
 require "Polycode/Config"
+require "Polycode/QuaternionTween"
 require "Polycode/Tween"
 require "Polycode/BezierPathTween"
-require "Polycode/QuaternionTween"
 require "Polycode/QuaternionCurve"
 require "Polycode/SceneManager"
-require "Polycode/SkeletonAnimation"
-require "Polycode/BoneTrack"
-require "Polycode/Skeleton"
 require "Polycode/Matrix4"
 require "Polycode/SceneLine"
 require "Polycode/ScreenEvent"
@@ -55,11 +52,11 @@ require "Polycode/ScreenSoundListener"
 require "Polycode/ScreenSound"
 require "Polycode/String"
 require "Polycode/PolycodeModule"
-require "Polycode/PolycodeViewBase"
 require "Polycode/Core"
+require "Polycode/PolycodeViewBase"
 require "Polycode/InputEvent"
-require "Polycode/Mesh"
 require "Polycode/VertexBuffer"
+require "Polycode/Mesh"
 require "Polycode/MaterialManager"
 require "Polycode/BezierCurve"
 require "Polycode/ScreenShape"

+ 1 - 1
Bindings/Contents/LUA/API/Polycode/MaterialManager.lua

@@ -73,7 +73,7 @@ function MaterialManager:createTextureFromImage(image, clamp)
 end
 
 function MaterialManager:createTextureFromFile(fileName, clamp)
-	local retVal = Polycore.MaterialManager_createTextureFromFile(self.__ptr, fileName, clamp)
+	local retVal = Polycore.MaterialManager_createTextureFromFile(self.__ptr, fileName.__ptr, clamp)
 	if retVal == nil then return nil end
 	if Polycore.__ptr_lookup[retVal] ~= nil then
 		return Polycore.__ptr_lookup[retVal]

+ 41 - 21
Bindings/Contents/LUA/API/Polycode/OSFileEntry.lua

@@ -6,15 +6,50 @@ TYPE_FILE = 0
 TYPE_FOLDER = 1
 function OSFileEntry:__index__(name)
 	if name == "name" then
-		return Polycore.OSFileEntry_get_name(self.__ptr)
+		retVal = Polycore.OSFileEntry_get_name(self.__ptr)
+		if Polycore.__ptr_lookup[retVal] ~= nil then
+			return Polycore.__ptr_lookup[retVal]
+		else
+			Polycore.__ptr_lookup[retVal] = Polycode::String("__skip_ptr__")
+			Polycore.__ptr_lookup[retVal].__ptr = retVal
+			return Polycore.__ptr_lookup[retVal]
+		end
 	elseif name == "extension" then
-		return Polycore.OSFileEntry_get_extension(self.__ptr)
+		retVal = Polycore.OSFileEntry_get_extension(self.__ptr)
+		if Polycore.__ptr_lookup[retVal] ~= nil then
+			return Polycore.__ptr_lookup[retVal]
+		else
+			Polycore.__ptr_lookup[retVal] = Polycode::String("__skip_ptr__")
+			Polycore.__ptr_lookup[retVal].__ptr = retVal
+			return Polycore.__ptr_lookup[retVal]
+		end
 	elseif name == "nameWithoutExtension" then
-		return Polycore.OSFileEntry_get_nameWithoutExtension(self.__ptr)
+		retVal = Polycore.OSFileEntry_get_nameWithoutExtension(self.__ptr)
+		if Polycore.__ptr_lookup[retVal] ~= nil then
+			return Polycore.__ptr_lookup[retVal]
+		else
+			Polycore.__ptr_lookup[retVal] = Polycode::String("__skip_ptr__")
+			Polycore.__ptr_lookup[retVal].__ptr = retVal
+			return Polycore.__ptr_lookup[retVal]
+		end
 	elseif name == "basePath" then
-		return Polycore.OSFileEntry_get_basePath(self.__ptr)
+		retVal = Polycore.OSFileEntry_get_basePath(self.__ptr)
+		if Polycore.__ptr_lookup[retVal] ~= nil then
+			return Polycore.__ptr_lookup[retVal]
+		else
+			Polycore.__ptr_lookup[retVal] = Polycode::String("__skip_ptr__")
+			Polycore.__ptr_lookup[retVal].__ptr = retVal
+			return Polycore.__ptr_lookup[retVal]
+		end
 	elseif name == "fullPath" then
-		return Polycore.OSFileEntry_get_fullPath(self.__ptr)
+		retVal = Polycore.OSFileEntry_get_fullPath(self.__ptr)
+		if Polycore.__ptr_lookup[retVal] ~= nil then
+			return Polycore.__ptr_lookup[retVal]
+		else
+			Polycore.__ptr_lookup[retVal] = Polycode::String("__skip_ptr__")
+			Polycore.__ptr_lookup[retVal].__ptr = retVal
+			return Polycore.__ptr_lookup[retVal]
+		end
 	elseif name == "type" then
 		return Polycore.OSFileEntry_get_type(self.__ptr)
 	end
@@ -22,22 +57,7 @@ end
 
 
 function OSFileEntry:__set_callback(name,value)
-	if name == "name" then
-		Polycore.OSFileEntry_set_name(self.__ptr, value)
-		return true
-	elseif name == "extension" then
-		Polycore.OSFileEntry_set_extension(self.__ptr, value)
-		return true
-	elseif name == "nameWithoutExtension" then
-		Polycore.OSFileEntry_set_nameWithoutExtension(self.__ptr, value)
-		return true
-	elseif name == "basePath" then
-		Polycore.OSFileEntry_set_basePath(self.__ptr, value)
-		return true
-	elseif name == "fullPath" then
-		Polycore.OSFileEntry_set_fullPath(self.__ptr, value)
-		return true
-	elseif name == "type" then
+	if name == "type" then
 		Polycore.OSFileEntry_set_type(self.__ptr, value)
 		return true
 	end

+ 4 - 8
Bindings/Contents/LUA/API/Polycode/Skeleton.lua

@@ -32,16 +32,12 @@ function Skeleton:loadSkeleton(fileName)
 	local retVal = Polycore.Skeleton_loadSkeleton(self.__ptr, fileName.__ptr)
 end
 
+function Skeleton:playAnimation(animName, once)
+	local retVal = Polycore.Skeleton_playAnimation(self.__ptr, animName.__ptr, once)
+end
+
 function Skeleton:playAnimationByIndex(index, once)
 	local retVal = Polycore.Skeleton_playAnimationByIndex(self.__ptr, index, once)
-	if retVal == nil then return nil end
-	if Polycore.__ptr_lookup[retVal] ~= nil then
-		return Polycore.__ptr_lookup[retVal]
-	else
-		Polycore.__ptr_lookup[retVal] = >>>>>>>mastervoid("__skip_ptr__")
-		Polycore.__ptr_lookup[retVal].__ptr = retVal
-		return Polycore.__ptr_lookup[retVal]
-	end
 end
 
 function Skeleton:addAnimation(name, fileName)

+ 1 - 13
Bindings/Contents/LUA/API/Polycode/String.lua

@@ -9,7 +9,7 @@ function String:__index__(name)
 		if Polycore.__ptr_lookup[retVal] ~= nil then
 			return Polycore.__ptr_lookup[retVal]
 		else
-			Polycore.__ptr_lookup[retVal] = string("__skip_ptr__")
+			Polycore.__ptr_lookup[retVal] = std::string("__skip_ptr__")
 			Polycore.__ptr_lookup[retVal].__ptr = retVal
 			return Polycore.__ptr_lookup[retVal]
 		end
@@ -46,18 +46,6 @@ function String:length()
 	return retVal
 end
 
-function String:getSTLString()
-	local retVal =  Polycore.String_getSTLString(self.__ptr)
-	if retVal == nil then return nil end
-	if Polycore.__ptr_lookup[retVal] ~= nil then
-		return Polycore.__ptr_lookup[retVal]
-	else
-		Polycore.__ptr_lookup[retVal] = string("__skip_ptr__")
-		Polycore.__ptr_lookup[retVal].__ptr = retVal
-		return Polycore.__ptr_lookup[retVal]
-	end
-end
-
 function String:substr(pos, n)
 	local retVal = Polycore.String_substr(self.__ptr, pos.__ptr, n.__ptr)
 	return retVal

+ 0 - 1
Bindings/Contents/LUA/Include/PolycodeLUA.h

@@ -1,6 +1,5 @@
 #pragma once
 #include <Polycode.h>
-#include "PolycodeLUAWrappers.h"
 extern "C" {
 #include <stdio.h>
 #include "lua.h"

File diff suppressed because it is too large
+ 535 - 476
Bindings/Contents/LUA/Include/PolycodeLUAWrappers.h


File diff suppressed because it is too large
+ 138 - 963
Bindings/Contents/LUA/Source/PolycodeLUA.cpp


+ 374 - 366
Bindings/Scripts/create_lua_library/create_lua_library.py

@@ -10,8 +10,9 @@ def createLUABindings(inputPath, prefix, mainInclude, libSmallName, libName, api
 	lfout = ""
 	
 	sout += "#include \"%sLUA.h\"\n" % (prefix)
-	sout += "#include \"%sLUAWrappers.h\"\n\n" % (prefix)
-	
+	sout += "#include \"%sLUAWrappers.h\"\n" % (prefix)
+	sout += "#include \"PolyCoreServices.h\"\n\n"
+	sout += "using namespace Polycode;\n\n"
 	sout += "int luaopen_%s(lua_State *L) {\n" % (prefix)
 	if prefix != "Polycode":
 		sout += "CoreServices *inst = (CoreServices*)lua_topointer(L, 1);\n"
@@ -19,13 +20,23 @@ def createLUABindings(inputPath, prefix, mainInclude, libSmallName, libName, api
 	sout += "\tstatic const struct luaL_reg %sLib [] = {" % (libSmallName)
 	
 	out += "#pragma once\n\n"
-	out += "#include <%s>\n\n" % (mainInclude)
-	
+
 	out += "extern \"C\" {\n\n"
 	out += "#include <stdio.h>\n"
 	out += "#include \"lua.h\"\n"
 	out += "#include \"lualib.h\"\n"
-	out += "#include \"lauxlib.h\"\n\n"
+	out += "#include \"lauxlib.h\"\n"
+	out += "} // extern \"C\" \n\n"
+
+	files = os.listdir(inputPath)
+	filteredFiles = []
+	for fileName in files:
+		ignore = ["PolyGLSLProgram", "PolyGLSLShader", "PolyGLSLShaderModule", "PolyWinCore", "PolyCocoaCore", "PolyAGLCore", "PolySDLCore", "Poly_iPhone", "PolyGLES1Renderer", "PolyGLRenderer", "tinyxml", "tinystr", "OpenGLCubemap", "PolyiPhoneCore", "PolyGLES1Texture", "PolyGLTexture", "PolyGLVertexBuffer", "PolyThreaded"]
+		if fileName.split(".")[1] == "h" and fileName.split(".")[0] not in ignore:
+			filteredFiles.append(fileName)
+			out += "#include \"%s\"\n" % (fileName)
+
+	out += "\nnamespace Polycode {\n\n"
 	
 	if prefix == "Polycode":
 		out += "class LuaEventHandler : public EventHandler {\n"
@@ -41,396 +52,394 @@ def createLUABindings(inputPath, prefix, mainInclude, libSmallName, libName, api
 		out += "	}\n"
 		out += "	int wrapperIndex;\n"
 		out += "	lua_State *L;\n"
-		out += "};\n"
+		out += "};\n\n"
 	
-	files = os.listdir(inputPath)
-	for fileName in files:
+	for fileName in filteredFiles:
 		inheritInModule = ["PhysicsSceneEntity", "CollisionScene", "CollisionSceneEntity"]
-		ignore = ["PolyGLSLProgram", "PolyGLSLShader", "PolyGLSLShaderModule", "PolyWinCore", "PolyCocoaCore", "PolyAGLCore", "PolySDLCore", "PolyGLES1Renderer", "PolyGLRenderer", "tinyxml", "tinystr", "OpenGLCubemap", "PolyiPhoneCore", "PolyGLES1Texture", "PolyGLTexture", "PolyGLVertexBuffer", "PolyThreaded"]
-		if fileName.split(".")[1] == "h" and fileName.split(".")[0] not in ignore:
-			headerFile = "%s/%s" % (inputPath, fileName)
-			print "Parsing %s" % fileName
-			try:
-				f = open(headerFile)
-				contents = f.read().replace("_PolyExport", "")
-				cppHeader = CppHeaderParser.CppHeader(contents, "string")
-				ignore_classes = ["PolycodeShaderModule", "Object", "Threaded", "OpenGLCubemap"]
-				for ckey in cppHeader.classes:
-					print ">> Parsing class %s" % ckey
-					c = cppHeader.classes[ckey]
-		#			if ckey == "ParticleEmitter":
-		#				print c
-					lout = ""
-					inherits = False
-					if len(c["inherits"]) > 0:
-						if c["inherits"][0]["class"] not in ignore_classes:	
-							if c["inherits"][0]["class"] in inheritInModule:
-								lout += "require \"%s/%s\"\n\n" % (prefix, c["inherits"][0]["class"])
-							else:
-								lout += "require \"Polycode/%s\"\n\n" % (c["inherits"][0]["class"])
-							lout += "class \"%s\" (%s)\n\n" % (ckey, c["inherits"][0]["class"])
-							inherits = True
-					if inherits == False:
-						lout += "class \"%s\"\n\n" % ckey
-			
-					if len(c["methods"]["public"]) < 2 or ckey in ignore_classes:
-						continue
-	
-					if ckey == "OSFileEntry":
-						print c["methods"]["public"]
-					parsed_methods = []
-					ignore_methods = ["readByte32", "readByte16", "getCustomEntitiesByType", "Core", "Renderer", "Shader", "Texture", "handleEvent", "secondaryHandler"]
-					lout += "\n\n"
-	
-					pps = []
-					for pp in c["properties"]["public"]:
-						if pp["type"].find("static ") != -1:
-							if "defaltValue" in pp:
-								lout += "%s = %s\n" % (pp["name"], pp["defaltValue"])
+		headerFile = "%s/%s" % (inputPath, fileName)
+		print "Parsing %s" % fileName
+		try:
+			f = open(headerFile)
+			contents = f.read().replace("_PolyExport", "")
+			cppHeader = CppHeaderParser.CppHeader(contents, "string")
+			ignore_classes = ["PolycodeShaderModule", "Object", "Threaded", "OpenGLCubemap"]
+
+			for ckey in cppHeader.classes:
+				print ">> Parsing class %s" % ckey
+				c = cppHeader.classes[ckey]
+	#			if ckey == "ParticleEmitter":
+	#				print c
+				lout = ""
+				inherits = False
+				if len(c["inherits"]) > 0:
+					if c["inherits"][0]["class"] not in ignore_classes:
+						if c["inherits"][0]["class"] in inheritInModule:
+							lout += "require \"%s/%s\"\n\n" % (prefix, c["inherits"][0]["class"])
 						else:
-							#there are some bugs in the class parser that cause it to return junk
-							if pp["type"].find("*") == -1 and pp["type"].find("vector") == -1 and pp["name"] != "16" and pp["name"] != "setScale" and pp["name"] != "setPosition" and pp["name"] != "BUFFER_CACHE_PRECISION":
-								pps.append(pp)
-							#if pp["type"] == "Number" or  pp["type"] == "String" or pp["type"] == "int" or pp["type"] == "bool":
-							#	pps.append(pp)
-							#else:
-							#	print(">>> Skipping %s[%s %s]" % (ckey, pp["type"], pp["name"]))
-	
-					pidx = 0
-			
-					# hack to fix the lack of multiple inheritance
-					#if ckey == "ScreenParticleEmitter" or ckey == "SceneParticleEmitter":
-					#		pps.append({"name": "emitter", "type": "ParticleEmitter"})
-	
-					if len(pps) > 0:
-						lout += "function %s:__index__(name)\n" % ckey
-						for pp in pps:
+							lout += "require \"Polycode/%s\"\n\n" % (c["inherits"][0]["class"])
+						lout += "class \"%s\" (%s)\n\n" % (ckey, c["inherits"][0]["class"])
+						inherits = True
+				if inherits == False:
+					lout += "class \"%s\"\n\n" % ckey
+
+				if len(c["methods"]["public"]) < 2 or ckey in ignore_classes:
+					continue
+
+				if ckey == "OSFileEntry":
+					print c["methods"]["public"]
+				parsed_methods = []
+				ignore_methods = ["readByte32", "readByte16", "getCustomEntitiesByType", "Core", "Renderer", "Shader", "Texture", "handleEvent", "secondaryHandler", "getSTLString"]
+				lout += "\n\n"
+
+				pps = []
+				for pp in c["properties"]["public"]:
+					if pp["type"].find("static ") != -1:
+						if "defaltValue" in pp:
+							lout += "%s = %s\n" % (pp["name"], pp["defaltValue"])
+					else:
+						#there are some bugs in the class parser that cause it to return junk
+						if pp["type"].find("*") == -1 and pp["type"].find("vector") == -1 and pp["name"] != "16" and pp["name"] != "setScale" and pp["name"] != "setPosition" and pp["name"] != "BUFFER_CACHE_PRECISION":
+							pps.append(pp)
+						#if pp["type"] == "Number" or  pp["type"] == "String" or pp["type"] == "int" or pp["type"] == "bool":
+						#	pps.append(pp)
+						#else:
+						#	print(">>> Skipping %s[%s %s]" % (ckey, pp["type"], pp["name"]))
+
+				pidx = 0
+
+				# hack to fix the lack of multiple inheritance
+				#if ckey == "ScreenParticleEmitter" or ckey == "SceneParticleEmitter":
+				#		pps.append({"name": "emitter", "type": "ParticleEmitter"})
+
+				if len(pps) > 0:
+					lout += "function %s:__index__(name)\n" % ckey
+					for pp in pps:
+						if pidx == 0:
+							lout += "\tif name == \"%s\" then\n" % (pp["name"])
+						else:
+							lout += "\telseif name == \"%s\" then\n" % (pp["name"])
+
+						if pp["type"] == "Number" or  pp["type"] == "String" or pp["type"] == "int" or pp["type"] == "bool":
+							lout += "\t\treturn %s.%s_get_%s(self.__ptr)\n" % (libName, ckey, pp["name"])
+						elif (ckey == "ScreenParticleEmitter" or ckey == "SceneParticleEmitter") and pp["name"] == "emitter":
+							lout += "\t\tlocal ret = %s(\"__skip_ptr__\")\n" % (pp["type"])
+							lout += "\t\tret.__ptr = self.__ptr\n"
+							lout += "\t\treturn ret\n"
+						else:
+							lout += "\t\tretVal = %s.%s_get_%s(self.__ptr)\n" % (libName, ckey, pp["name"])
+							lout += "\t\tif Polycore.__ptr_lookup[retVal] ~= nil then\n"
+							lout += "\t\t\treturn Polycore.__ptr_lookup[retVal]\n"
+							lout += "\t\telse\n"
+							lout += "\t\t\tPolycore.__ptr_lookup[retVal] = %s(\"__skip_ptr__\")\n" % (pp["type"])
+							lout += "\t\t\tPolycore.__ptr_lookup[retVal].__ptr = retVal\n"
+							lout += "\t\t\treturn Polycore.__ptr_lookup[retVal]\n"
+							lout += "\t\tend\n"
+
+						if not ((ckey == "ScreenParticleEmitter" or ckey == "SceneParticleEmitter") and pp["name"] == "emitter"):
+							sout += "\t\t{\"%s_get_%s\", %s_%s_get_%s},\n" % (ckey, pp["name"], libName, ckey, pp["name"])
+							out += "static int %s_%s_get_%s(lua_State *L) {\n" % (libName, ckey, pp["name"])
+							out += "\tluaL_checktype(L, 1, LUA_TLIGHTUSERDATA);\n"
+							out += "\t%s *inst = (%s*)lua_topointer(L, 1);\n" % (ckey, ckey)
+
+							outfunc = "lua_pushlightuserdata"
+							retFunc = ""
+							if pp["type"] == "Number":
+								outfunc = "lua_pushnumber"
+							if pp["type"] == "String":
+								outfunc = "lua_pushstring"
+								retFunc = ".c_str()"
+							if pp["type"] == "int":
+								outfunc = "lua_pushinteger"
+							if pp["type"] == "bool":
+								outfunc = "lua_pushboolean"
+
+							if pp["type"] == "Number" or  pp["type"] == "String" or pp["type"] == "int" or pp["type"] == "bool":
+								out += "\t%s(L, inst->%s%s);\n" % (outfunc, pp["name"], retFunc)
+							else:
+								out += "\t%s(L, &inst->%s%s);\n" % (outfunc, pp["name"], retFunc)
+							out += "\treturn 1;\n"
+							out += "}\n\n"
+						pidx = pidx + 1
+
+					lout += "\tend\n"
+					lout += "end\n"
+
+				lout += "\n\n"
+				pidx = 0
+				if len(pps) > 0:
+					lout += "function %s:__set_callback(name,value)\n" % ckey
+					for pp in pps:
+						if pp["type"] == "Number" or  pp["type"] == "String" or pp["type"] == "int" or pp["type"] == "bool":
 							if pidx == 0:
 								lout += "\tif name == \"%s\" then\n" % (pp["name"])
 							else:
 								lout += "\telseif name == \"%s\" then\n" % (pp["name"])
+							lout += "\t\t%s.%s_set_%s(self.__ptr, value)\n" % (libName, ckey, pp["name"])
+							lout += "\t\treturn true\n"
 
-							if pp["type"] == "Number" or  pp["type"] == "String" or pp["type"] == "int" or pp["type"] == "bool":
-								lout += "\t\treturn %s.%s_get_%s(self.__ptr)\n" % (libName, ckey, pp["name"])
-							elif (ckey == "ScreenParticleEmitter" or ckey == "SceneParticleEmitter") and pp["name"] == "emitter":
-								lout += "\t\tlocal ret = %s(\"__skip_ptr__\")\n" % (pp["type"])
-								lout += "\t\tret.__ptr = self.__ptr\n"
-								lout += "\t\treturn ret\n"
-							else:
-								lout += "\t\tretVal = %s.%s_get_%s(self.__ptr)\n" % (libName, ckey, pp["name"])
-								lout += "\t\tif Polycore.__ptr_lookup[retVal] ~= nil then\n"
-								lout += "\t\t\treturn Polycore.__ptr_lookup[retVal]\n"
-								lout += "\t\telse\n"
-								lout += "\t\t\tPolycore.__ptr_lookup[retVal] = %s(\"__skip_ptr__\")\n" % (pp["type"])
-								lout += "\t\t\tPolycore.__ptr_lookup[retVal].__ptr = retVal\n"
-								lout += "\t\t\treturn Polycore.__ptr_lookup[retVal]\n"
-								lout += "\t\tend\n"
+							sout += "\t\t{\"%s_set_%s\", %s_%s_set_%s},\n" % (ckey, pp["name"], libName, ckey, pp["name"])
+							out += "static int %s_%s_set_%s(lua_State *L) {\n" % (libName, ckey, pp["name"])
+							out += "\tluaL_checktype(L, 1, LUA_TLIGHTUSERDATA);\n"
+							out += "\t%s *inst = (%s*)lua_topointer(L, 1);\n" % (ckey, ckey)
 
-							if not ((ckey == "ScreenParticleEmitter" or ckey == "SceneParticleEmitter") and pp["name"] == "emitter"):
-								sout += "\t\t{\"%s_get_%s\", %s_%s_get_%s},\n" % (ckey, pp["name"], libName, ckey, pp["name"])
-								out += "static int %s_%s_get_%s(lua_State *L) {\n" % (libName, ckey, pp["name"])
-								out += "\tluaL_checktype(L, 1, LUA_TLIGHTUSERDATA);\n"
-								out += "\t%s *inst = (%s*)lua_topointer(L, 1);\n" % (ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"), ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
-	
-								outfunc = "lua_pushlightuserdata"
-								retFunc = ""
-								if pp["type"] == "Number":
-									outfunc = "lua_pushnumber"
-								if pp["type"] == "String":
-									outfunc = "lua_pushstring"
-									retFunc = ".c_str()"
-								if pp["type"] == "int":
-									outfunc = "lua_pushinteger"
-								if pp["type"] == "bool":
-									outfunc = "lua_pushboolean"
-	
-								if pp["type"] == "Number" or  pp["type"] == "String" or pp["type"] == "int" or pp["type"] == "bool":
-									out += "\t%s(L, inst->%s%s);\n" % (outfunc, pp["name"], retFunc)
-								else:
-									out += "\t%s(L, &inst->%s%s);\n" % (outfunc, pp["name"], retFunc)
-								out += "\treturn 1;\n"
-								out += "}\n\n"
+							outfunc = "lua_topointer"
+							if pp["type"] == "Number":
+								outfunc = "lua_tonumber"
+							if pp["type"] == "String":
+								outfunc = "lua_tostring"
+							if pp["type"] == "int":
+								outfunc = "lua_tointeger"
+							if pp["type"] == "bool":
+								outfunc = "lua_toboolean"
+
+							out += "\t%s param = %s(L, 2);\n" % (pp["type"], outfunc)
+							out += "\tinst->%s = param;\n" % (pp["name"])
+
+							out += "\treturn 0;\n"
+							out += "}\n\n"
 							pidx = pidx + 1
-	
+					if pidx != 0:
 						lout += "\tend\n"
-						lout += "end\n"
-	
-					lout += "\n\n"
-					pidx = 0
-					if len(pps) > 0:
-						lout += "function %s:__set_callback(name,value)\n" % ckey
-						for pp in pps:
-							if pp["type"] == "Number" or  pp["type"] == "String" or pp["type"] == "int" or pp["type"] == "bool":
-								if pidx == 0:
-									lout += "\tif name == \"%s\" then\n" % (pp["name"])
-								else:
-									lout += "\telseif name == \"%s\" then\n" % (pp["name"])
-								lout += "\t\t%s.%s_set_%s(self.__ptr, value)\n" % (libName, ckey, pp["name"])
-								lout += "\t\treturn true\n"
-	
-								sout += "\t\t{\"%s_set_%s\", %s_%s_set_%s},\n" % (ckey, pp["name"], libName, ckey, pp["name"])
-								out += "static int %s_%s_set_%s(lua_State *L) {\n" % (libName, ckey, pp["name"])
-								out += "\tluaL_checktype(L, 1, LUA_TLIGHTUSERDATA);\n"
-								out += "\t%s *inst = (%s*)lua_topointer(L, 1);\n" % (ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"), ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
-	
-								outfunc = "lua_topointer"
-								if pp["type"] == "Number":
-									outfunc = "lua_tonumber"
-								if pp["type"] == "String":
-									outfunc = "lua_tostring"
-								if pp["type"] == "int":
-									outfunc = "lua_tointeger"
-								if pp["type"] == "bool":
-									outfunc = "lua_toboolean"
-	
-								out += "\t%s param = %s(L, 2);\n" % (pp["type"], outfunc)
-								out += "\tinst->%s = param;\n" % (pp["name"])
-		
-								out += "\treturn 0;\n"
-								out += "}\n\n"
-								pidx = pidx + 1
-						if pidx != 0:
-							lout += "\tend\n"
-						lout += "\treturn false\n"
-						lout += "end\n"
-						
-	
-					lout += "\n\n"
-					for pm in c["methods"]["public"]:
-						if pm["name"] in parsed_methods or pm["name"].find("operator") > -1 or pm["name"] in ignore_methods:
-							continue 
-	
-						if pm["name"] == "~"+ckey or pm["rtnType"].find("<") > -1:
-							out += ""
+					lout += "\treturn false\n"
+					lout += "end\n"
+
+
+				lout += "\n\n"
+				for pm in c["methods"]["public"]:
+					if pm["name"] in parsed_methods or pm["name"].find("operator") > -1 or pm["name"] in ignore_methods:
+						continue
+
+					if pm["name"] == "~"+ckey or pm["rtnType"].find("<") > -1:
+						out += ""
+					else:
+						basicType = False
+						voidRet = False
+						if pm["name"] == ckey:
+							sout += "\t\t{\"%s\", %s_%s},\n" % (ckey, libName, ckey)
+							out += "static int %s_%s(lua_State *L) {\n" % (libName, ckey)
+							idx = 1
 						else:
-							basicType = False
-							voidRet = False
-							if pm["name"] == ckey:
-								sout += "\t\t{\"%s\", %s_%s},\n" % (ckey, libName, ckey)
-								out += "static int %s_%s(lua_State *L) {\n" % (libName, ckey)
-								idx = 1
-							else: 
-								sout += "\t\t{\"%s_%s\", %s_%s_%s},\n" % (ckey, pm["name"], libName, ckey, pm["name"])
-								out += "static int %s_%s_%s(lua_State *L) {\n" % (libName, ckey, pm["name"])
-	
-								if pm["rtnType"].find("static ") == -1:
-									out += "\tluaL_checktype(L, 1, LUA_TLIGHTUSERDATA);\n"
-									out += "\t%s *inst = (%s*)lua_topointer(L, 1);\n" % (ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"), ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
-								idx = 2
-							paramlist = []
-							lparamlist = []
-							for param in pm["parameters"]:
-								if not param.has_key("type"):
-									continue
-								if param["type"] == "0":
-									continue
-	
-								param["name"] = param["name"].replace("end", "_end").replace("repeat", "_repeat")
-								if"type" in param:
-									luatype = "LUA_TLIGHTUSERDATA"
-									checkfunc = "lua_islightuserdata"
-									if param["type"].find("*") > -1:
-										luafunc = "(%s)lua_topointer" % (param["type"].replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
-									elif param["type"].find("&") > -1:
-										luafunc = "*(%s*)lua_topointer" % (param["type"].replace("const", "").replace("&", "").replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
-									else:
-										luafunc = "*(%s*)lua_topointer" % (param["type"].replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
-									lend = ".__ptr"
-									if param["type"] == "int" or param["type"] == "unsigned int":
-										luafunc = "lua_tointeger"
-										luatype = "LUA_TNUMBER"
-										checkfunc = "lua_isnumber"
-										lend = ""
-									if param["type"] == "bool":
-										luafunc = "lua_toboolean"
-										luatype = "LUA_TBOOLEAN"
-										checkfunc = "lua_isboolean"
-										lend = ""
-									if param["type"] == "Number" or param["type"] == "float" or param["type"] == "double":
-										luatype = "LUA_TNUMBER"
-										luafunc = "lua_tonumber"
-										checkfunc = "lua_isnumber"
-										lend = ""
-									if param["type"] == "String":
-										luatype = "LUA_TSTRING"
-										luafunc = "lua_tostring"
-										checkfunc = "lua_isstring"
-										lend = ""
-									
-									param["type"] = param["type"].replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle")
-	
-									if "defaltValue" in param:
-										if checkfunc != "lua_islightuserdata" or (checkfunc == "lua_islightuserdata" and param["defaltValue"] == "NULL"):
-											#param["defaltValue"] = param["defaltValue"].replace(" 0f", ".0f")
-											param["defaltValue"] = param["defaltValue"].replace(": :", "::")
-											#param["defaltValue"] = param["defaltValue"].replace("0 ", "0.")
-											param["defaltValue"] = re.sub(r'([0-9]+) ([0-9])+', r'\1.\2', param["defaltValue"])
-	
-											out += "\t%s %s;\n" % (param["type"], param["name"])
-											out += "\tif(%s(L, %d)) {\n" % (checkfunc, idx)
-											out += "\t\t%s = %s(L, %d);\n" % (param["name"], luafunc, idx)
-											out += "\t} else {\n"
-											out += "\t\t%s = %s;\n" % (param["name"], param["defaltValue"])
-											out += "\t}\n"
-										else:
-											out += "\tluaL_checktype(L, %d, %s);\n" % (idx, luatype);
-											if param["type"] == "String":
-												out += "\t%s %s = String(%s(L, %d));\n" % (param["type"], param["name"], luafunc, idx)
-											else:
-												out += "\t%s %s = %s(L, %d);\n" % (param["type"], param["name"], luafunc, idx)
+							sout += "\t\t{\"%s_%s\", %s_%s_%s},\n" % (ckey, pm["name"], libName, ckey, pm["name"])
+							out += "static int %s_%s_%s(lua_State *L) {\n" % (libName, ckey, pm["name"])
+
+							if pm["rtnType"].find("static ") == -1:
+								out += "\tluaL_checktype(L, 1, LUA_TLIGHTUSERDATA);\n"
+								out += "\t%s *inst = (%s*)lua_topointer(L, 1);\n" % (ckey, ckey)
+							idx = 2
+						paramlist = []
+						lparamlist = []
+						for param in pm["parameters"]:
+							if not param.has_key("type"):
+								continue
+							if param["type"] == "0":
+								continue
+
+							param["name"] = param["name"].replace("end", "_end").replace("repeat", "_repeat")
+							if"type" in param:
+								luatype = "LUA_TLIGHTUSERDATA"
+								checkfunc = "lua_islightuserdata"
+								if param["type"].find("*") > -1:
+									luafunc = "(%s)lua_topointer" % (param["type"].replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
+								elif param["type"].find("&") > -1:
+									luafunc = "*(%s*)lua_topointer" % (param["type"].replace("const", "").replace("&", "").replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
+								else:
+									luafunc = "*(%s*)lua_topointer" % (param["type"].replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
+								lend = ".__ptr"
+								if param["type"] == "int" or param["type"] == "unsigned int":
+									luafunc = "lua_tointeger"
+									luatype = "LUA_TNUMBER"
+									checkfunc = "lua_isnumber"
+									lend = ""
+								if param["type"] == "bool":
+									luafunc = "lua_toboolean"
+									luatype = "LUA_TBOOLEAN"
+									checkfunc = "lua_isboolean"
+									lend = ""
+								if param["type"] == "Number" or param["type"] == "float" or param["type"] == "double":
+									luatype = "LUA_TNUMBER"
+									luafunc = "lua_tonumber"
+									checkfunc = "lua_isnumber"
+									lend = ""
+								if param["type"] == "String":
+									luatype = "LUA_TSTRING"
+									luafunc = "lua_tostring"
+									checkfunc = "lua_isstring"
+									lend = ""
+
+								param["type"] = param["type"].replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle")
+
+								if "defaltValue" in param:
+									if checkfunc != "lua_islightuserdata" or (checkfunc == "lua_islightuserdata" and param["defaltValue"] == "NULL"):
+										#param["defaltValue"] = param["defaltValue"].replace(" 0f", ".0f")
+										param["defaltValue"] = param["defaltValue"].replace(": :", "::")
+										#param["defaltValue"] = param["defaltValue"].replace("0 ", "0.")
+										param["defaltValue"] = re.sub(r'([0-9]+) ([0-9])+', r'\1.\2', param["defaltValue"])
+
+										out += "\t%s %s;\n" % (param["type"], param["name"])
+										out += "\tif(%s(L, %d)) {\n" % (checkfunc, idx)
+										out += "\t\t%s = %s(L, %d);\n" % (param["name"], luafunc, idx)
+										out += "\t} else {\n"
+										out += "\t\t%s = %s;\n" % (param["name"], param["defaltValue"])
+										out += "\t}\n"
 									else:
 										out += "\tluaL_checktype(L, %d, %s);\n" % (idx, luatype);
 										if param["type"] == "String":
 											out += "\t%s %s = String(%s(L, %d));\n" % (param["type"], param["name"], luafunc, idx)
 										else:
 											out += "\t%s %s = %s(L, %d);\n" % (param["type"], param["name"], luafunc, idx)
-									paramlist.append(param["name"])
-								
-									lparamlist.append(param["name"]+lend)
-									idx = idx +1
-						
-							if pm["name"] == ckey:
-								if ckey == "EventHandler":
-									out += "\tLuaEventHandler *inst = new LuaEventHandler();\n"
-									out += "\tinst->wrapperIndex = luaL_ref(L, LUA_REGISTRYINDEX );\n"
-									out += "\tinst->L = L;\n"
 								else:
-									out += "\t%s *inst = new %s(%s);\n" % (ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"), ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"), ", ".join(paramlist))
-								out += "\tlua_pushlightuserdata(L, (void*)inst);\n"
-								out += "\treturn 1;\n"
+									out += "\tluaL_checktype(L, %d, %s);\n" % (idx, luatype);
+									if param["type"] == "String":
+										out += "\t%s %s = String(%s(L, %d));\n" % (param["type"], param["name"], luafunc, idx)
+									else:
+										out += "\t%s %s = %s(L, %d);\n" % (param["type"], param["name"], luafunc, idx)
+								paramlist.append(param["name"])
+
+								lparamlist.append(param["name"]+lend)
+								idx = idx +1
+
+						if pm["name"] == ckey:
+							if ckey == "EventHandler":
+								out += "\tLuaEventHandler *inst = new LuaEventHandler();\n"
+								out += "\tinst->wrapperIndex = luaL_ref(L, LUA_REGISTRYINDEX );\n"
+								out += "\tinst->L = L;\n"
 							else:
-								if pm["rtnType"].find("static ") == -1:
-									call = "inst->%s(%s)" % (pm["name"], ", ".join(paramlist))
-								else:
-									call = "%s::%s(%s)" % (ckey, pm["name"], ", ".join(paramlist))
-								if pm["rtnType"] == "void" or pm["rtnType"] == "static void" or pm["rtnType"] == "virtual void" or pm["rtnType"] == "inline void":
-									out += "\t%s;\n" % (call)
+								out += "\t%s *inst = new %s(%s);\n" % (ckey, ckey, ", ".join(paramlist))
+							out += "\tlua_pushlightuserdata(L, (void*)inst);\n"
+							out += "\treturn 1;\n"
+						else:
+							if pm["rtnType"].find("static ") == -1:
+								call = "inst->%s(%s)" % (pm["name"], ", ".join(paramlist))
+							else:
+								call = "%s::%s(%s)" % (ckey, pm["name"], ", ".join(paramlist))
+							if pm["rtnType"] == "void" or pm["rtnType"] == "static void" or pm["rtnType"] == "virtual void" or pm["rtnType"] == "inline void":
+								out += "\t%s;\n" % (call)
+								basicType = True
+								voidRet = True
+								out += "\treturn 0;\n"
+							else:
+								outfunc = "lua_pushlightuserdata"
+								retFunc = ""
+								basicType = False
+								if pm["rtnType"] == "Number" or  pm["rtnType"] == "inline Number":
+									outfunc = "lua_pushnumber"
+									basicType = True
+								if pm["rtnType"] == "String" or pm["rtnType"] == "static String":
+									outfunc = "lua_pushstring"
 									basicType = True
-									voidRet = True
-									out += "\treturn 0;\n"
+									retFunc = ".c_str()"
+								if pm["rtnType"] == "int" or pm["rtnType"] == "static int" or  pm["rtnType"] == "size_t" or pm["rtnType"] == "static size_t" or pm["rtnType"] == "long" or pm["rtnType"] == "unsigned int" or pm["rtnType"] == "static long":
+									outfunc = "lua_pushinteger"
+									basicType = True
+								if pm["rtnType"] == "bool" or pm["rtnType"] == "static bool" or pm["rtnType"] == "virtual bool":
+									outfunc = "lua_pushboolean"
+									basicType = True
+
+								if pm["rtnType"].find("*") > -1:
+									out += "\tvoid *ptrRetVal = (void*)%s%s;\n" % (call, retFunc)
+									out += "\tif(ptrRetVal == NULL) {\n"
+									out += "\t\tlua_pushnil(L);\n"
+									out += "\t} else {\n"
+									out += "\t\t%s(L, ptrRetVal);\n" % (outfunc)
+									out += "\t}\n"
+								elif basicType == True:
+									out += "\t%s(L, %s%s);\n" % (outfunc, call, retFunc)
 								else:
-									outfunc = "lua_pushlightuserdata"
-									retFunc = ""
-									basicType = False
-									if pm["rtnType"] == "Number" or  pm["rtnType"] == "inline Number":
-										outfunc = "lua_pushnumber"
-										basicType = True
-									if pm["rtnType"] == "String" or pm["rtnType"] == "static String":
-										outfunc = "lua_pushstring"
-										basicType = True
-										retFunc = ".c_str()"
-									if pm["rtnType"] == "int" or pm["rtnType"] == "static int" or  pm["rtnType"] == "size_t" or pm["rtnType"] == "static size_t" or pm["rtnType"] == "long" or pm["rtnType"] == "unsigned int" or pm["rtnType"] == "static long":
-										outfunc = "lua_pushinteger"
-										basicType = True
-									if pm["rtnType"] == "bool" or pm["rtnType"] == "static bool" or pm["rtnType"] == "virtual bool":
-										outfunc = "lua_pushboolean"
-										basicType = True
-	
-									if pm["rtnType"].find("*") > -1:
-										out += "\tvoid *ptrRetVal = (void*)%s%s;\n" % (call, retFunc)
-										out += "\tif(ptrRetVal == NULL) {\n"
-										out += "\t\tlua_pushnil(L);\n"
-										out += "\t} else {\n"
-										out += "\t\t%s(L, ptrRetVal);\n" % (outfunc)
-										out += "\t}\n"
-									elif basicType == True:
-										out += "\t%s(L, %s%s);\n" % (outfunc, call, retFunc)
-									else:
-										className = pm["rtnType"].replace("const", "").replace("&", "").replace("inline", "").replace("virtual", "").replace("static", "")
-										if className == "Polygon":
-											className = "Polycode::Polygon"
-										if className == "Rectangle":
-											className = "Polycode::Rectangle"
-										out += "\t%s *retInst = new %s();\n" % (className, className)
-										out += "\t*retInst = %s;\n" % (call)
-										out += "\t%s(L, retInst);\n" % (outfunc)
-									out += "\treturn 1;\n"
-							out += "}\n\n"
-							
-							if pm["name"] == ckey:
-								lout += "function %s:%s(...)\n" % (ckey, ckey)
-								if inherits:
-									lout += "\tif type(arg[1]) == \"table\" and count(arg) == 1 then\n"
-									lout += "\t\tif \"\"..arg[1]:class() == \"%s\" then\n" % (c["inherits"][0]["class"])
-									lout += "\t\t\tself.__ptr = arg[1].__ptr\n"
-									lout += "\t\t\treturn\n"
-									lout += "\t\tend\n"
-									lout += "\tend\n"
-								lout += "\tfor k,v in pairs(arg) do\n"
-								lout += "\t\tif type(v) == \"table\" then\n"
-								lout += "\t\t\tif v.__ptr ~= nil then\n"
-								lout += "\t\t\t\targ[k] = v.__ptr\n"
-								lout += "\t\t\tend\n"
+									className = pm["rtnType"].replace("const", "").replace("&", "").replace("inline", "").replace("virtual", "").replace("static", "")
+									if className == "Polygon":
+										className = "Polycode::Polygon"
+									if className == "Rectangle":
+										className = "Polycode::Rectangle"
+									out += "\t%s *retInst = new %s();\n" % (className, className)
+									out += "\t*retInst = %s;\n" % (call)
+									out += "\t%s(L, retInst);\n" % (outfunc)
+								out += "\treturn 1;\n"
+						out += "}\n\n"
+
+						if pm["name"] == ckey:
+							lout += "function %s:%s(...)\n" % (ckey, ckey)
+							if inherits:
+								lout += "\tif type(arg[1]) == \"table\" and count(arg) == 1 then\n"
+								lout += "\t\tif \"\"..arg[1]:class() == \"%s\" then\n" % (c["inherits"][0]["class"])
+								lout += "\t\t\tself.__ptr = arg[1].__ptr\n"
+								lout += "\t\t\treturn\n"
 								lout += "\t\tend\n"
 								lout += "\tend\n"
-								lout += "\tif self.__ptr == nil and arg[1] ~= \"__skip_ptr__\" then\n"
-								if ckey == "EventHandler":
-									lout += "\t\tself.__ptr = %s.%s(self)\n" % (libName, ckey)
+							lout += "\tfor k,v in pairs(arg) do\n"
+							lout += "\t\tif type(v) == \"table\" then\n"
+							lout += "\t\t\tif v.__ptr ~= nil then\n"
+							lout += "\t\t\t\targ[k] = v.__ptr\n"
+							lout += "\t\t\tend\n"
+							lout += "\t\tend\n"
+							lout += "\tend\n"
+							lout += "\tif self.__ptr == nil and arg[1] ~= \"__skip_ptr__\" then\n"
+							if ckey == "EventHandler":
+								lout += "\t\tself.__ptr = %s.%s(self)\n" % (libName, ckey)
+							else:
+								lout += "\t\tself.__ptr = %s.%s(unpack(arg))\n" % (libName, ckey)
+							lout += "\t\tPolycore.__ptr_lookup[self.__ptr] = self\n"
+							lout += "\tend\n"
+							lout += "end\n\n"
+						else:
+							lout += "function %s:%s(%s)\n" % (ckey, pm["name"], ", ".join(paramlist))
+							if pm["rtnType"].find("static ") == -1:
+								if len(lparamlist):
+									lout += "\tlocal retVal = %s.%s_%s(self.__ptr, %s)\n" % (libName, ckey, pm["name"], ", ".join(lparamlist))
 								else:
-									lout += "\t\tself.__ptr = %s.%s(unpack(arg))\n" % (libName, ckey)
-								lout += "\t\tPolycore.__ptr_lookup[self.__ptr] = self\n"
-								lout += "\tend\n"
-								lout += "end\n\n"
+									lout += "\tlocal retVal =  %s.%s_%s(self.__ptr)\n" % (libName, ckey, pm["name"])
 							else:
-								lout += "function %s:%s(%s)\n" % (ckey, pm["name"], ", ".join(paramlist))
-								if pm["rtnType"].find("static ") == -1:
-									if len(lparamlist):
-										lout += "\tlocal retVal = %s.%s_%s(self.__ptr, %s)\n" % (libName, ckey, pm["name"], ", ".join(lparamlist))
-									else:
-										lout += "\tlocal retVal =  %s.%s_%s(self.__ptr)\n" % (libName, ckey, pm["name"])
+								if len(lparamlist):
+									lout += "\tlocal retVal = %s.%s_%s(%s)\n" % (libName, ckey, pm["name"], ", ".join(lparamlist))
 								else:
-									if len(lparamlist):
-										lout += "\tlocal retVal = %s.%s_%s(%s)\n" % (libName, ckey, pm["name"], ", ".join(lparamlist))
-									else:
-										lout += "\tlocal retVal =  %s.%s_%s()\n" % (libName, ckey, pm["name"])
-	
-								if not voidRet:
-									if basicType == True:
-										lout += "\treturn retVal\n"
-									else:
-										className = pm["rtnType"].replace("const", "").replace("&", "").replace("inline", "").replace("virtual", "").replace("static", "").replace("*","").replace(" ", "")
-										lout += "\tif retVal == nil then return nil end\n"
-										lout += "\tif Polycore.__ptr_lookup[retVal] ~= nil then\n"
-										lout += "\t\treturn Polycore.__ptr_lookup[retVal]\n"
-										lout += "\telse\n"
-										lout += "\t\tPolycore.__ptr_lookup[retVal] = %s(\"__skip_ptr__\")\n" % (className)
-										lout += "\t\tPolycore.__ptr_lookup[retVal].__ptr = retVal\n"
-										lout += "\t\treturn Polycore.__ptr_lookup[retVal]\n"
-										lout += "\tend\n"
-								lout += "end\n\n"
-	
-						parsed_methods.append(pm["name"])
-		
-					#cleanup
-					sout += "\t\t{\"delete_%s\", %s_delete_%s},\n" % (ckey, libName, ckey)
-					out += "static int %s_delete_%s(lua_State *L) {\n" % (libName, ckey)
-					out += "\tluaL_checktype(L, 1, LUA_TLIGHTUSERDATA);\n"
-					out += "\t%s *inst = (%s*)lua_topointer(L, 1);\n" % (ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"), ckey.replace("Polygon", "Polycode::Polygon").replace("Rectangle", "Polycode::Rectangle"))
-					out += "\tdelete inst;\n"
-					out += "\treturn 0;\n"
-					out += "}\n\n"
+									lout += "\tlocal retVal =  %s.%s_%s()\n" % (libName, ckey, pm["name"])
+
+							if not voidRet:
+								if basicType == True:
+									lout += "\treturn retVal\n"
+								else:
+									className = pm["rtnType"].replace("const", "").replace("&", "").replace("inline", "").replace("virtual", "").replace("static", "").replace("*","").replace(" ", "")
+									lout += "\tif retVal == nil then return nil end\n"
+									lout += "\tif Polycore.__ptr_lookup[retVal] ~= nil then\n"
+									lout += "\t\treturn Polycore.__ptr_lookup[retVal]\n"
+									lout += "\telse\n"
+									lout += "\t\tPolycore.__ptr_lookup[retVal] = %s(\"__skip_ptr__\")\n" % (className)
+									lout += "\t\tPolycore.__ptr_lookup[retVal].__ptr = retVal\n"
+									lout += "\t\treturn Polycore.__ptr_lookup[retVal]\n"
+									lout += "\tend\n"
+							lout += "end\n\n"
+
+					parsed_methods.append(pm["name"])
 
+				#cleanup
+				sout += "\t\t{\"delete_%s\", %s_delete_%s},\n" % (ckey, libName, ckey)
+				out += "static int %s_delete_%s(lua_State *L) {\n" % (libName, ckey)
+				out += "\tluaL_checktype(L, 1, LUA_TLIGHTUSERDATA);\n"
+				out += "\t%s *inst = (%s*)lua_topointer(L, 1);\n" % (ckey, ckey)
+				out += "\tdelete inst;\n"
+				out += "\treturn 0;\n"
+				out += "}\n\n"
+
+				lout += "\n\n"
+				lout += "function %s:__delete()\n" % (ckey)
+				lout += "\tPolycore.__ptr_lookup[self.__ptr] = nil\n"
+				lout += "\t%s.delete_%s(self.__ptr)\n" % (libName, ckey)
+				lout += "end\n"
+				if ckey == "EventHandler":
 					lout += "\n\n"
-					lout += "function %s:__delete()\n" % (ckey)
-					lout += "\tPolycore.__ptr_lookup[self.__ptr] = nil\n"
-					lout += "\t%s.delete_%s(self.__ptr)\n" % (libName, ckey)
+					lout += "function EventHandler:__handleEvent(event)\n"
+					lout += "\tevt = Event(\"__skip_ptr__\")\n"
+					lout += "\tevt.__ptr = event\n"
+					lout += "\tself:handleEvent(evt)\n"
+					#lout += "\tself:handleEvent(event)\n"
 					lout += "end\n"
-					if ckey == "EventHandler":
-						lout += "\n\n"
-						lout += "function EventHandler:__handleEvent(event)\n"
-						lout += "\tevt = Event(\"__skip_ptr__\")\n"
-						lout += "\tevt.__ptr = event\n"
-						lout += "\tself:handleEvent(evt)\n"
-						#lout += "\tself:handleEvent(event)\n"
-						lout += "end\n"
-					lfout += "require \"%s/%s\"\n" % (prefix, ckey)
-					fout = open("%s/%s.lua" % (apiClassPath, ckey), "w")
-					fout.write(lout)
-			except CppHeaderParser.CppParseError,  e:
-				print e
-				sys.exit(1)
-			
-	out += "}"
+				lfout += "require \"%s/%s\"\n" % (prefix, ckey)
+				fout = open("%s/%s.lua" % (apiClassPath, ckey), "w")
+				fout.write(lout)
+		except CppHeaderParser.CppParseError,  e:
+			print e
+			sys.exit(1)
+
+	out += "} // namespace Polycode\n"
 	
 	sout += "\t\t{NULL, NULL}\n"
 	sout += "\t};\n"
@@ -442,7 +451,6 @@ def createLUABindings(inputPath, prefix, mainInclude, libSmallName, libName, api
 	shout = ""
 	shout += "#pragma once\n"
 	shout += "#include <%s>\n" % (mainInclude)
-	shout += "#include \"%sLUAWrappers.h\"\n" % (prefix)
 	shout += "extern \"C\" {\n"
 	shout += "#include <stdio.h>\n"
 	shout += "#include \"lua.h\"\n"

+ 1 - 0
Core/Contents/Include/PolyData.h

@@ -20,6 +20,7 @@
  THE SOFTWARE.
  */
 
+#pragma once
 #include "PolyGlobals.h"
 #include "PolyString.h"
 

+ 1 - 0
Core/Contents/Include/PolySceneSound.h

@@ -20,6 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
 
+#pragma once
 #include "PolyGlobals.h"
 #include "PolySceneEntity.h"
 

+ 1 - 0
Core/Contents/Include/PolyScreenSound.h

@@ -20,6 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
 
+#pragma once
 #include "PolyGlobals.h"
 #include "PolyScreenEntity.h"
 

+ 1 - 1
Modules/Bindings/2DPhysics/API/Physics2D.lua

@@ -1,4 +1,4 @@
 require "Physics2D/PhysicsScreen"
-require "Physics2D/PhysicsJoint"
 require "Physics2D/PhysicsScreenEvent"
+require "Physics2D/PhysicsJoint"
 require "Physics2D/PhysicsScreenEntity"

+ 0 - 1
Modules/Bindings/2DPhysics/Include/Physics2DLUA.h

@@ -1,6 +1,5 @@
 #pragma once
 #include <Polycode2DPhysics.h>
-#include "Physics2DLUAWrappers.h"
 extern "C" {
 #include <stdio.h>
 #include "lua.h"

+ 21 - 16
Modules/Bindings/2DPhysics/Include/Physics2DLUAWrappers.h

@@ -1,13 +1,18 @@
 #pragma once
 
-#include <Polycode2DPhysics.h>
-
 extern "C" {
 
 #include <stdio.h>
 #include "lua.h"
 #include "lualib.h"
 #include "lauxlib.h"
+} // extern "C" 
+
+#include "Polycode2DPhysics.h"
+#include "PolyPhysicsScreen.h"
+#include "PolyPhysicsScreenEntity.h"
+
+namespace Polycode {
 
 static int Physics2D_PhysicsScreen(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TNUMBER);
@@ -489,19 +494,6 @@ static int Physics2D_delete_PhysicsScreen(lua_State *L) {
 	return 0;
 }
 
-static int Physics2D_PhysicsJoint(lua_State *L) {
-	PhysicsJoint *inst = new PhysicsJoint();
-	lua_pushlightuserdata(L, (void*)inst);
-	return 1;
-}
-
-static int Physics2D_delete_PhysicsJoint(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsJoint *inst = (PhysicsJoint*)lua_topointer(L, 1);
-	delete inst;
-	return 0;
-}
-
 static int Physics2D_PhysicsScreenEvent_get_localCollisionNormal(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
 	PhysicsScreenEvent *inst = (PhysicsScreenEvent*)lua_topointer(L, 1);
@@ -590,6 +582,19 @@ static int Physics2D_delete_PhysicsScreenEvent(lua_State *L) {
 	return 0;
 }
 
+static int Physics2D_PhysicsJoint(lua_State *L) {
+	PhysicsJoint *inst = new PhysicsJoint();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Physics2D_delete_PhysicsJoint(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsJoint *inst = (PhysicsJoint*)lua_topointer(L, 1);
+	delete inst;
+	return 0;
+}
+
 static int Physics2D_PhysicsScreenEntity_get_collisionOnly(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
 	PhysicsScreenEntity *inst = (PhysicsScreenEntity*)lua_topointer(L, 1);
@@ -686,4 +691,4 @@ static int Physics2D_delete_PhysicsScreenEntity(lua_State *L) {
 	return 0;
 }
 
-}
+} // namespace Polycode

+ 5 - 2
Modules/Bindings/2DPhysics/Source/Physics2DLUA.cpp

@@ -1,5 +1,8 @@
 #include "Physics2DLUA.h"
 #include "Physics2DLUAWrappers.h"
+#include "PolyCoreServices.h"
+
+using namespace Polycode;
 
 int luaopen_Physics2D(lua_State *L) {
 CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
@@ -34,8 +37,6 @@ CoreServices::setInstance(inst);
 		{"PhysicsScreen_getPhysicsByScreenEntity", Physics2D_PhysicsScreen_getPhysicsByScreenEntity},
 		{"PhysicsScreen_destroyMouseJoint", Physics2D_PhysicsScreen_destroyMouseJoint},
 		{"delete_PhysicsScreen", Physics2D_delete_PhysicsScreen},
-		{"PhysicsJoint", Physics2D_PhysicsJoint},
-		{"delete_PhysicsJoint", Physics2D_delete_PhysicsJoint},
 		{"PhysicsScreenEvent_get_localCollisionNormal", Physics2D_PhysicsScreenEvent_get_localCollisionNormal},
 		{"PhysicsScreenEvent_get_worldCollisionNormal", Physics2D_PhysicsScreenEvent_get_worldCollisionNormal},
 		{"PhysicsScreenEvent_get_localCollisionPoint", Physics2D_PhysicsScreenEvent_get_localCollisionPoint},
@@ -47,6 +48,8 @@ CoreServices::setInstance(inst);
 		{"PhysicsScreenEvent_getFirstEntity", Physics2D_PhysicsScreenEvent_getFirstEntity},
 		{"PhysicsScreenEvent_getSecondEntity", Physics2D_PhysicsScreenEvent_getSecondEntity},
 		{"delete_PhysicsScreenEvent", Physics2D_delete_PhysicsScreenEvent},
+		{"PhysicsJoint", Physics2D_PhysicsJoint},
+		{"delete_PhysicsJoint", Physics2D_delete_PhysicsJoint},
 		{"PhysicsScreenEntity_get_collisionOnly", Physics2D_PhysicsScreenEntity_get_collisionOnly},
 		{"PhysicsScreenEntity_set_collisionOnly", Physics2D_PhysicsScreenEntity_set_collisionOnly},
 		{"PhysicsScreenEntity", Physics2D_PhysicsScreenEntity},

+ 1 - 1
Modules/Bindings/3DPhysics/API/Physics3D.lua

@@ -2,5 +2,5 @@ require "Physics3D/CollisionScene"
 require "Physics3D/PhysicsScene"
 require "Physics3D/CollisionSceneEntity"
 require "Physics3D/PhysicsSceneEntity"
-require "Physics3D/PhysicsCharacter"
 require "Physics3D/PhysicsVehicle"
+require "Physics3D/PhysicsCharacter"

+ 0 - 1
Modules/Bindings/3DPhysics/Include/Physics3DLUA.h

@@ -1,6 +1,5 @@
 #pragma once
 #include <Polycode3DPhysics.h>
-#include "Physics3DLUAWrappers.h"
 extern "C" {
 #include <stdio.h>
 #include "lua.h"

+ 97 - 90
Modules/Bindings/3DPhysics/Include/Physics3DLUAWrappers.h

@@ -1,13 +1,20 @@
 #pragma once
 
-#include <Polycode3DPhysics.h>
-
 extern "C" {
 
 #include <stdio.h>
 #include "lua.h"
 #include "lualib.h"
 #include "lauxlib.h"
+} // extern "C" 
+
+#include "PolyCollisionScene.h"
+#include "PolyPhysicsScene.h"
+#include "PolyCollisionSceneEntity.h"
+#include "PolyPhysicsSceneEntity.h"
+#include "Polycode3DPhysics.h"
+
+namespace Polycode {
 
 static int Physics3D_CollisionScene(lua_State *L) {
 	CollisionScene *inst = new CollisionScene();
@@ -562,93 +569,6 @@ static int Physics3D_delete_PhysicsSceneEntity(lua_State *L) {
 	return 0;
 }
 
-static int Physics3D_PhysicsCharacter(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	SceneEntity * entity = (SceneEntity *)lua_topointer(L, 1);
-	luaL_checktype(L, 2, LUA_TNUMBER);
-	Number mass = lua_tonumber(L, 2);
-	luaL_checktype(L, 3, LUA_TNUMBER);
-	Number friction = lua_tonumber(L, 3);
-	luaL_checktype(L, 4, LUA_TNUMBER);
-	Number stepSize = lua_tonumber(L, 4);
-	PhysicsCharacter *inst = new PhysicsCharacter(entity, mass, friction, stepSize);
-	lua_pushlightuserdata(L, (void*)inst);
-	return 1;
-}
-
-static int Physics3D_PhysicsCharacter_Update(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
-	inst->Update();
-	return 0;
-}
-
-static int Physics3D_PhysicsCharacter_setWalkDirection(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
-	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
-	Vector3 direction = *(Vector3*)lua_topointer(L, 2);
-	inst->setWalkDirection(direction);
-	return 0;
-}
-
-static int Physics3D_PhysicsCharacter_jump(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
-	inst->jump();
-	return 0;
-}
-
-static int Physics3D_PhysicsCharacter_warpCharacter(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
-	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
-	Vector3 position = *(Vector3*)lua_topointer(L, 2);
-	inst->warpCharacter(position);
-	return 0;
-}
-
-static int Physics3D_PhysicsCharacter_setJumpSpeed(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
-	luaL_checktype(L, 2, LUA_TNUMBER);
-	Number jumpSpeed = lua_tonumber(L, 2);
-	inst->setJumpSpeed(jumpSpeed);
-	return 0;
-}
-
-static int Physics3D_PhysicsCharacter_setFallSpeed(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
-	luaL_checktype(L, 2, LUA_TNUMBER);
-	Number fallSpeed = lua_tonumber(L, 2);
-	inst->setFallSpeed(fallSpeed);
-	return 0;
-}
-
-static int Physics3D_PhysicsCharacter_setMaxJumpHeight(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
-	luaL_checktype(L, 2, LUA_TNUMBER);
-	Number maxJumpHeight = lua_tonumber(L, 2);
-	inst->setMaxJumpHeight(maxJumpHeight);
-	return 0;
-}
-
-static int Physics3D_PhysicsCharacter_onGround(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
-	lua_pushboolean(L, inst->onGround());
-	return 1;
-}
-
-static int Physics3D_delete_PhysicsCharacter(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
-	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
-	delete inst;
-	return 0;
-}
-
 static int Physics3D_PhysicsVehicle_get_tuning(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
 	PhysicsVehicle *inst = (PhysicsVehicle*)lua_topointer(L, 1);
@@ -777,4 +697,91 @@ static int Physics3D_delete_PhysicsVehicle(lua_State *L) {
 	return 0;
 }
 
-}
+static int Physics3D_PhysicsCharacter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneEntity * entity = (SceneEntity *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number mass = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number friction = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number stepSize = lua_tonumber(L, 4);
+	PhysicsCharacter *inst = new PhysicsCharacter(entity, mass, friction, stepSize);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Physics3D_PhysicsCharacter_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Physics3D_PhysicsCharacter_setWalkDirection(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vector3 direction = *(Vector3*)lua_topointer(L, 2);
+	inst->setWalkDirection(direction);
+	return 0;
+}
+
+static int Physics3D_PhysicsCharacter_jump(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
+	inst->jump();
+	return 0;
+}
+
+static int Physics3D_PhysicsCharacter_warpCharacter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vector3 position = *(Vector3*)lua_topointer(L, 2);
+	inst->warpCharacter(position);
+	return 0;
+}
+
+static int Physics3D_PhysicsCharacter_setJumpSpeed(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number jumpSpeed = lua_tonumber(L, 2);
+	inst->setJumpSpeed(jumpSpeed);
+	return 0;
+}
+
+static int Physics3D_PhysicsCharacter_setFallSpeed(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number fallSpeed = lua_tonumber(L, 2);
+	inst->setFallSpeed(fallSpeed);
+	return 0;
+}
+
+static int Physics3D_PhysicsCharacter_setMaxJumpHeight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number maxJumpHeight = lua_tonumber(L, 2);
+	inst->setMaxJumpHeight(maxJumpHeight);
+	return 0;
+}
+
+static int Physics3D_PhysicsCharacter_onGround(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->onGround());
+	return 1;
+}
+
+static int Physics3D_delete_PhysicsCharacter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PhysicsCharacter *inst = (PhysicsCharacter*)lua_topointer(L, 1);
+	delete inst;
+	return 0;
+}
+
+} // namespace Polycode

+ 12 - 9
Modules/Bindings/3DPhysics/Source/Physics3DLUA.cpp

@@ -1,5 +1,8 @@
 #include "Physics3DLUA.h"
 #include "Physics3DLUAWrappers.h"
+#include "PolyCoreServices.h"
+
+using namespace Polycode;
 
 int luaopen_Physics3D(lua_State *L) {
 CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
@@ -48,6 +51,15 @@ CoreServices::setInstance(inst);
 		{"PhysicsSceneEntity_setFriction", Physics3D_PhysicsSceneEntity_setFriction},
 		{"PhysicsSceneEntity_getType", Physics3D_PhysicsSceneEntity_getType},
 		{"delete_PhysicsSceneEntity", Physics3D_delete_PhysicsSceneEntity},
+		{"PhysicsVehicle_get_tuning", Physics3D_PhysicsVehicle_get_tuning},
+		{"PhysicsVehicle", Physics3D_PhysicsVehicle},
+		{"PhysicsVehicle_addWheel", Physics3D_PhysicsVehicle_addWheel},
+		{"PhysicsVehicle_applyEngineForce", Physics3D_PhysicsVehicle_applyEngineForce},
+		{"PhysicsVehicle_setSteeringValue", Physics3D_PhysicsVehicle_setSteeringValue},
+		{"PhysicsVehicle_setBrake", Physics3D_PhysicsVehicle_setBrake},
+		{"PhysicsVehicle_warpVehicle", Physics3D_PhysicsVehicle_warpVehicle},
+		{"PhysicsVehicle_Update", Physics3D_PhysicsVehicle_Update},
+		{"delete_PhysicsVehicle", Physics3D_delete_PhysicsVehicle},
 		{"PhysicsCharacter", Physics3D_PhysicsCharacter},
 		{"PhysicsCharacter_Update", Physics3D_PhysicsCharacter_Update},
 		{"PhysicsCharacter_setWalkDirection", Physics3D_PhysicsCharacter_setWalkDirection},
@@ -58,15 +70,6 @@ CoreServices::setInstance(inst);
 		{"PhysicsCharacter_setMaxJumpHeight", Physics3D_PhysicsCharacter_setMaxJumpHeight},
 		{"PhysicsCharacter_onGround", Physics3D_PhysicsCharacter_onGround},
 		{"delete_PhysicsCharacter", Physics3D_delete_PhysicsCharacter},
-		{"PhysicsVehicle_get_tuning", Physics3D_PhysicsVehicle_get_tuning},
-		{"PhysicsVehicle", Physics3D_PhysicsVehicle},
-		{"PhysicsVehicle_addWheel", Physics3D_PhysicsVehicle_addWheel},
-		{"PhysicsVehicle_applyEngineForce", Physics3D_PhysicsVehicle_applyEngineForce},
-		{"PhysicsVehicle_setSteeringValue", Physics3D_PhysicsVehicle_setSteeringValue},
-		{"PhysicsVehicle_setBrake", Physics3D_PhysicsVehicle_setBrake},
-		{"PhysicsVehicle_warpVehicle", Physics3D_PhysicsVehicle_warpVehicle},
-		{"PhysicsVehicle_Update", Physics3D_PhysicsVehicle_Update},
-		{"delete_PhysicsVehicle", Physics3D_delete_PhysicsVehicle},
 		{NULL, NULL}
 	};
 	luaL_openlib(L, "Physics3D", physics3dLib, 0);

Some files were not shown because too many files changed in this diff