1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Lua on each mapgen thread (#13092)

This commit is contained in:
sfan5 2024-02-13 22:47:30 +01:00 committed by GitHub
parent d4b107e2e8
commit 3cac17d23e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 1329 additions and 193 deletions

View file

@ -25,6 +25,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
typedef u16 biome_t; // copy from mg_biome.h to avoid an unnecessary include
class MMVManip;
class BiomeManager;
class BiomeGen;
class Mapgen;
class ModApiMapgen : public ModApiBase
{
@ -68,6 +71,9 @@ private:
// get_mapgen_edges([mapgen_limit[, chunksize]])
static int l_get_mapgen_edges(lua_State *L);
// get_seed([add])
static int l_get_seed(lua_State *L);
// get_mapgen_setting(name)
static int l_get_mapgen_setting(lua_State *L);
@ -86,12 +92,15 @@ private:
// get_noiseparam_defaults(name)
static int l_get_noiseparams(lua_State *L);
// set_gen_notify(flags, {deco_id_table})
// set_gen_notify(flags, {deco_ids}, {ud_ids})
static int l_set_gen_notify(lua_State *L);
// get_gen_notify()
static int l_get_gen_notify(lua_State *L);
// save_gen_notify(ud_id, data)
static int l_save_gen_notify(lua_State *L);
// get_decoration_id(decoration_name)
// returns the decoration ID as used in gennotify
static int l_get_decoration_id(lua_State *L);
@ -158,8 +167,18 @@ private:
static int set_lighting(lua_State *L, MMVManip *vm,
v3s16 pmin, v3s16 pmax, u8 light);
// Helpers
// get a read-only(!) EmergeManager
static const EmergeManager *getEmergeManager(lua_State *L);
// get the thread-local or global BiomeGen (still read-only)
static const BiomeGen *getBiomeGen(lua_State *L);
// get the thread-local mapgen
static Mapgen *getMapgen(lua_State *L);
public:
static void Initialize(lua_State *L, int top);
static void InitializeEmerge(lua_State *L, int top);
static struct EnumString es_BiomeTerrainType[];
static struct EnumString es_DecorationType[];