2013-06-25 08:02:02 -07:00
|
|
|
/*
|
|
|
|
Minetest
|
|
|
|
Copyright (C) 2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2017-08-17 13:19:39 -07:00
|
|
|
#pragma once
|
2013-06-25 08:02:02 -07:00
|
|
|
|
2017-04-06 23:50:17 -07:00
|
|
|
#include "irr_v3d.h"
|
|
|
|
#include "lua_api/l_base.h"
|
2013-08-10 19:09:45 -07:00
|
|
|
|
|
|
|
class Map;
|
|
|
|
class MapBlock;
|
2015-01-04 23:42:27 -08:00
|
|
|
class MMVManip;
|
2013-06-25 08:02:02 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
VoxelManip
|
|
|
|
*/
|
2017-04-06 23:50:17 -07:00
|
|
|
class LuaVoxelManip : public ModApiBase
|
|
|
|
{
|
2013-06-25 08:02:02 -07:00
|
|
|
private:
|
2017-06-19 14:54:58 -07:00
|
|
|
bool is_mapgen_vm = false;
|
2013-06-25 08:02:02 -07:00
|
|
|
|
|
|
|
static const char className[];
|
2017-04-08 00:28:37 -07:00
|
|
|
static const luaL_Reg methods[];
|
2013-06-25 08:02:02 -07:00
|
|
|
|
|
|
|
static int gc_object(lua_State *L);
|
|
|
|
|
2013-06-27 18:12:44 -07:00
|
|
|
static int l_read_from_map(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);
|
|
|
|
|
2014-09-01 14:33:21 -07:00
|
|
|
static int l_get_node_at(lua_State *L);
|
|
|
|
static int l_set_node_at(lua_State *L);
|
|
|
|
|
2013-06-25 08:02:02 -07:00
|
|
|
static int l_update_map(lua_State *L);
|
|
|
|
static int l_update_liquids(lua_State *L);
|
2013-11-29 18:16:08 -08:00
|
|
|
|
2013-06-25 08:02:02 -07:00
|
|
|
static int l_calc_lighting(lua_State *L);
|
|
|
|
static int l_set_lighting(lua_State *L);
|
2013-11-29 18:16:08 -08:00
|
|
|
static int l_get_light_data(lua_State *L);
|
|
|
|
static int l_set_light_data(lua_State *L);
|
2013-06-25 08:02:02 -07:00
|
|
|
|
2014-01-18 23:55:34 -08:00
|
|
|
static int l_get_param2_data(lua_State *L);
|
|
|
|
static int l_set_param2_data(lua_State *L);
|
|
|
|
|
2014-09-01 11:20:31 -07:00
|
|
|
static int l_was_modified(lua_State *L);
|
2014-12-27 20:09:36 -08:00
|
|
|
static int l_get_emerged_area(lua_State *L);
|
2014-09-01 11:20:31 -07:00
|
|
|
|
2013-06-25 08:02:02 -07:00
|
|
|
public:
|
2017-06-19 14:54:58 -07:00
|
|
|
MMVManip *vm = nullptr;
|
2015-01-04 19:37:20 -08:00
|
|
|
|
2015-01-04 23:42:27 -08:00
|
|
|
LuaVoxelManip(MMVManip *mmvm, bool is_mapgen_vm);
|
2014-12-28 22:31:37 -08:00
|
|
|
LuaVoxelManip(Map *map, v3s16 p1, v3s16 p2);
|
2013-06-25 08:02:02 -07:00
|
|
|
LuaVoxelManip(Map *map);
|
|
|
|
~LuaVoxelManip();
|
|
|
|
|
|
|
|
// LuaVoxelManip()
|
|
|
|
// Creates a LuaVoxelManip and leaves it on top of stack
|
|
|
|
static int create_object(lua_State *L);
|
|
|
|
|
|
|
|
static LuaVoxelManip *checkobject(lua_State *L, int narg);
|
|
|
|
|
2022-05-02 11:55:04 -07:00
|
|
|
static void *packIn(lua_State *L, int idx);
|
|
|
|
static void packOut(lua_State *L, void *ptr);
|
|
|
|
|
2013-06-25 08:02:02 -07:00
|
|
|
static void Register(lua_State *L);
|
|
|
|
};
|