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

Shorten ManualMapVoxelManipulator to MMVManip

This commit is contained in:
kwolekr 2015-01-05 02:42:27 -05:00
parent 7289d61e99
commit 2d849b0a19
18 changed files with 103 additions and 110 deletions

View file

@ -44,7 +44,7 @@ int LuaVoxelManip::gc_object(lua_State *L)
int LuaVoxelManip::l_read_from_map(lua_State *L)
{
LuaVoxelManip *o = checkobject(L, 1);
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
v3s16 bp1 = getNodeBlockPos(read_v3s16(L, 2));
v3s16 bp2 = getNodeBlockPos(read_v3s16(L, 3));
@ -63,7 +63,7 @@ int LuaVoxelManip::l_get_data(lua_State *L)
NO_MAP_LOCK_REQUIRED;
LuaVoxelManip *o = checkobject(L, 1);
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
int volume = vm->m_area.getVolume();
@ -82,7 +82,7 @@ int LuaVoxelManip::l_set_data(lua_State *L)
NO_MAP_LOCK_REQUIRED;
LuaVoxelManip *o = checkobject(L, 1);
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
if (!lua_istable(L, 2))
return 0;
@ -103,7 +103,7 @@ int LuaVoxelManip::l_set_data(lua_State *L)
int LuaVoxelManip::l_write_to_map(lua_State *L)
{
LuaVoxelManip *o = checkobject(L, 1);
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
vm->blitBackAll(&o->modified_blocks);
@ -144,7 +144,7 @@ int LuaVoxelManip::l_update_liquids(lua_State *L)
Map *map = &(env->getMap());
INodeDefManager *ndef = getServer(L)->getNodeDefManager();
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
Mapgen mg;
mg.vm = vm;
@ -166,7 +166,7 @@ int LuaVoxelManip::l_calc_lighting(lua_State *L)
INodeDefManager *ndef = getServer(L)->getNodeDefManager();
EmergeManager *emerge = getServer(L)->getEmergeManager();
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
v3s16 yblock = v3s16(0, 1, 0) * MAP_BLOCKSIZE;
v3s16 fpmin = vm->m_area.MinEdge;
@ -203,7 +203,7 @@ int LuaVoxelManip::l_set_lighting(lua_State *L)
light = (getintfield_default(L, 2, "day", 0) & 0x0F);
light |= (getintfield_default(L, 2, "night", 0) & 0x0F) << 4;
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
v3s16 yblock = v3s16(0, 1, 0) * MAP_BLOCKSIZE;
v3s16 pmin = lua_istable(L, 3) ? read_v3s16(L, 3) : vm->m_area.MinEdge + yblock;
@ -226,7 +226,7 @@ int LuaVoxelManip::l_get_light_data(lua_State *L)
NO_MAP_LOCK_REQUIRED;
LuaVoxelManip *o = checkobject(L, 1);
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
int volume = vm->m_area.getVolume();
@ -245,7 +245,7 @@ int LuaVoxelManip::l_set_light_data(lua_State *L)
NO_MAP_LOCK_REQUIRED;
LuaVoxelManip *o = checkobject(L, 1);
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
if (!lua_istable(L, 2))
return 0;
@ -268,7 +268,7 @@ int LuaVoxelManip::l_get_param2_data(lua_State *L)
NO_MAP_LOCK_REQUIRED;
LuaVoxelManip *o = checkobject(L, 1);
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
int volume = vm->m_area.getVolume();
@ -287,7 +287,7 @@ int LuaVoxelManip::l_set_param2_data(lua_State *L)
NO_MAP_LOCK_REQUIRED;
LuaVoxelManip *o = checkobject(L, 1);
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
if (!lua_istable(L, 2))
return 0;
@ -344,7 +344,7 @@ int LuaVoxelManip::l_was_modified(lua_State *L)
NO_MAP_LOCK_REQUIRED;
LuaVoxelManip *o = checkobject(L, 1);
ManualMapVoxelManipulator *vm = o->vm;
MMVManip *vm = o->vm;
lua_pushboolean(L, vm->m_is_dirty);
@ -361,7 +361,7 @@ int LuaVoxelManip::l_get_emerged_area(lua_State *L)
return 2;
}
LuaVoxelManip::LuaVoxelManip(ManualMapVoxelManipulator *mmvm, bool is_mg_vm)
LuaVoxelManip::LuaVoxelManip(MMVManip *mmvm, bool is_mg_vm)
{
this->vm = mmvm;
this->is_mapgen_vm = is_mg_vm;
@ -369,13 +369,13 @@ LuaVoxelManip::LuaVoxelManip(ManualMapVoxelManipulator *mmvm, bool is_mg_vm)
LuaVoxelManip::LuaVoxelManip(Map *map)
{
this->vm = new ManualMapVoxelManipulator(map);
this->vm = new MMVManip(map);
this->is_mapgen_vm = false;
}
LuaVoxelManip::LuaVoxelManip(Map *map, v3s16 p1, v3s16 p2)
{
this->vm = new ManualMapVoxelManipulator(map);
this->vm = new MMVManip(map);
this->is_mapgen_vm = false;
v3s16 bp1 = getNodeBlockPos(p1);