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

71 lines
1.6 KiB
C
Raw Normal View History

// Luanti
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (C) 2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
2013-06-25 11:02:02 -04:00
#pragma once
2013-06-25 11:02:02 -04:00
#include "irr_v3d.h"
#include "lua_api/l_base.h"
class Map;
class MapBlock;
class MMVManip;
2013-06-25 11:02:02 -04:00
/*
VoxelManip
*/
class LuaVoxelManip : public ModApiBase
{
2013-06-25 11:02:02 -04:00
private:
bool is_mapgen_vm = false;
2013-06-25 11:02:02 -04:00
static const luaL_Reg methods[];
2013-06-25 11:02:02 -04:00
static int gc_object(lua_State *L);
static int l_read_from_map(lua_State *L);
static int l_initialize(lua_State *L);
static int l_get_data(lua_State *L);
static int l_set_data(lua_State *L);
static int l_write_to_map(lua_State *L);
static int l_get_node_at(lua_State *L);
static int l_set_node_at(lua_State *L);
2013-06-25 11:02:02 -04:00
static int l_update_map(lua_State *L);
static int l_update_liquids(lua_State *L);
2013-06-25 11:02:02 -04:00
static int l_calc_lighting(lua_State *L);
static int l_set_lighting(lua_State *L);
static int l_get_light_data(lua_State *L);
static int l_set_light_data(lua_State *L);
2013-06-25 11:02:02 -04:00
static int l_get_param2_data(lua_State *L);
static int l_set_param2_data(lua_State *L);
static int l_was_modified(lua_State *L);
static int l_get_emerged_area(lua_State *L);
static int l_close(lua_State *L);
2013-06-25 11:02:02 -04:00
public:
MMVManip *vm = nullptr;
LuaVoxelManip(MMVManip *mmvm, bool is_mapgen_vm);
2013-06-25 11:02:02 -04:00
LuaVoxelManip(Map *map);
~LuaVoxelManip();
// LuaVoxelManip()
// Creates a LuaVoxelManip and leaves it on top of stack
static int create_object(lua_State *L);
2022-12-28 23:37:31 +01:00
// Not callable from Lua
static void create(lua_State *L, MMVManip *mmvm, bool is_mapgen_vm);
2013-06-25 11:02:02 -04:00
static void *packIn(lua_State *L, int idx);
static void packOut(lua_State *L, void *ptr);
2013-06-25 11:02:02 -04:00
static void Register(lua_State *L);
static const char className[];
2013-06-25 11:02:02 -04:00
};