Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(957)

Unified Diff: nacltoons/bindings/tolua_preload.lua

Issue 12634010: [nacltoons] Add Makefile for building lua bindings. (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« nacltoons/bindings/post_process.py ('K') | « nacltoons/bindings/post_process.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nacltoons/bindings/tolua_preload.lua
diff --git a/nacltoons/bindings/tolua_preload.lua b/nacltoons/bindings/tolua_preload.lua
new file mode 100644
index 0000000000000000000000000000000000000000..3cc2019e193de304edd0ae5dca2f8023a16f46eb
--- /dev/null
+++ b/nacltoons/bindings/tolua_preload.lua
@@ -0,0 +1,24 @@
+--- Helper script for generating bindings with tolua++
+-- This file is based on the file of the same name which ships
+-- as part of cocos2dx.
+-- example usage:
+-- tolua++ -L tolua_preload.lua -o LuaCocos2d.cpp Cocos2d.pkg
+
+_is_functions = _is_functions or {}
+_to_functions = _to_functions or {}
+_push_functions = _push_functions or {}
+
+local CCObjectTypes = {
+ "CCPhysicsSprite",
+}
+
+-- register CCObject types
+for i = 1, #CCObjectTypes do
+ _push_functions[CCObjectTypes[i]] = "toluafix_pushusertype_ccobject"
+end
+
+-- register LUA_FUNCTION, LUA_TABLE, LUA_HANDLE type
+_to_functions["LUA_FUNCTION"] = "toluafix_ref_function"
+_is_functions["LUA_FUNCTION"] = "toluafix_isfunction"
+_to_functions["LUA_TABLE"] = "toluafix_totable"
+_is_functions["LUA_TABLE"] = "toluafix_istable"
« nacltoons/bindings/post_process.py ('K') | « nacltoons/bindings/post_process.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698