摘要:
闲来无事,搞了搞cocos2dx的lua脚本,话说lua这东西几年前学过一段时间,也自己开发过c++接口,做过一些小东西,不过时间久远,记忆模糊。捡起来还是费了点功夫,下面就是我的一些体会。 cocos2dx使用的是tolua++来制作的lua接口,tolua++文档不多,网上的一些文章也是... 阅读全文
摘要:
extern "C" { #include "lua.h" #include "lualib.h" #include "lauxlib.h" } #include #include using namespace std; int main() { //Lua示例... 阅读全文
摘要:
InterLockedIncrement() and InterLockedDecrement() 实现数的原子性加减。什么是原子性的加减呢? 举个例子:如果一个变量 Long value =0; 首先说一下正常情况下的加减操作:value+=1; 1:系统从Value的空间取出值,... 阅读全文
摘要:
1,lua_State在Lua中的定义如下: struct lua_State { CommonHeader; lu_byte status; StkId top; /* first free slot in the stack */ glo... 阅读全文
摘要:
“你调过的最难调的bug是哪个?”(编注:这个问题源自 Quora 上的同名问答帖,在众多回复中,Dave Baggett 遭遇和量子力学相关的Bug经历最让人惊叹,得到了3500 多个顶。去年伯乐在线技术翻译组已把 Dave 的回复翻译成中文。本文来自另外一位程序员 Peter Lundg... 阅读全文