added dcolour to set and get

This commit is contained in:
me4502 2011-09-18 12:02:48 +08:00 committed by Simon Robertshaw
parent baef6f20c2
commit 1403bd17f9

View File

@ -464,6 +464,9 @@ int luatpt_set_property(lua_State* l)
} else if (strcmp(prop,"y")==0){
offset = offsetof(particle, y);
format = 2;
} else if (strcmp(prop,"dcolour")==0){
offset = offsetof(particle, dcolour);
format = 1;
} else {
return luaL_error(l, "Invalid property '%s'", prop);
}
@ -612,6 +615,10 @@ int luatpt_get_property(lua_State* l)
lua_pushnumber(l, parts[i].y);
return 1;
}
if (strcmp(prop,"dcolour")==0){
lua_pushinteger(l, parts[i].dcolour);
return 1;
}
if (strcmp(prop,"id")==0){
lua_pushnumber(l, i);
return 1;