aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/default/textures/crack_anylength.png
diff options
context:
space:
mode:
authorDuane Robertson <duane@duanerobertson.com>2015-09-29 12:38:08 -0500
committerest31 <MTest31@outlook.com>2015-10-02 22:49:31 +0200
commita5bdfb6b3cfddaac1e961bd8c8780c74ccde3567 (patch)
tree3844d522cc817395be35dfac4d9d61f562d0854e /games/minimal/mods/default/textures/crack_anylength.png
parent21944a0d3c5284f6bf1e61286ddbcc2ab2f1e2aa (diff)
downloadminetest-a5bdfb6b3cfddaac1e961bd8c8780c74ccde3567.tar.gz
minetest-a5bdfb6b3cfddaac1e961bd8c8780c74ccde3567.tar.bz2
minetest-a5bdfb6b3cfddaac1e961bd8c8780c74ccde3567.zip
Add get_biome_id(biome_name) callback
It returns the index used in mg->biomemap for a given biome name. The biomemap is useless without this unless you re-register all existing biomes, which could cause problems for anyone else trying to use biomemap. With this, you can quickly create a lookup table of ids and names.
Diffstat (limited to 'games/minimal/mods/default/textures/crack_anylength.png')
0 files changed, 0 insertions, 0 deletions
n class="hl ppc">#define MINSIZEARRAY 4 void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems, int limit, const char *errormsg) { void *newblock; int newsize; if (*size >= limit/2) { /* cannot double it? */ if (*size >= limit) /* cannot grow even a little? */ luaG_runerror(L, errormsg); newsize = limit; /* still have at least one free place */ } else { newsize = (*size)*2; if (newsize < MINSIZEARRAY) newsize = MINSIZEARRAY; /* minimum size */ } newblock = luaM_reallocv(L, block, *size, newsize, size_elems); *size = newsize; /* update only when everything else is OK */ return newblock; } void *luaM_toobig (lua_State *L) { luaG_runerror(L, "memory allocation error: block too big"); return NULL; /* to avoid warnings */ } /* ** generic allocation routine. */ void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { global_State *g = G(L); lua_assert((osize == 0) == (block == NULL)); block = (*g->frealloc)(g->ud, block, osize, nsize); if (block == NULL && nsize > 0) luaD_throw(L, LUA_ERRMEM); lua_assert((nsize == 0) == (block == NULL)); g->totalbytes = (g->totalbytes - osize) + nsize; return block; }