VERSIÓ 1.4.7
- [NEW] map.cell() per a establir o llegir el tamany dels tiles del mapa
This commit is contained in:
17
lua.cpp
17
lua.cpp
@@ -217,7 +217,21 @@ extern "C" {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int cpp_map_cell(lua_State *L) {
|
||||
if (lua_gettop(L)==2) {
|
||||
int celx = luaL_checknumber(L, 1);
|
||||
int cely = luaL_checknumber(L, 2);
|
||||
settilesize(celx, cely);
|
||||
lua_pushinteger(L, mget(celx, cely));
|
||||
return 0;
|
||||
} else {
|
||||
lua_pushinteger(L, gettilew());
|
||||
lua_pushinteger(L, gettileh());
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// palette
|
||||
// ===============================================
|
||||
@@ -1120,6 +1134,7 @@ void push_lua_funcs() {
|
||||
lua_pushcfunction(L,cpp_map_surf); lua_setfield(L, -2, "surf");
|
||||
lua_pushcfunction(L,cpp_map_draw); lua_setfield(L, -2, "draw");
|
||||
lua_pushcfunction(L,cpp_map_tile); lua_setfield(L, -2, "tile");
|
||||
lua_pushcfunction(L,cpp_map_cell); lua_setfield(L, -2, "cell");
|
||||
lua_setglobal(L, "map");
|
||||
|
||||
lua_newtable(L);
|
||||
|
||||
Reference in New Issue
Block a user