summaryrefslogtreecommitdiff
path: root/src/mg_schematic.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2017-06-03 14:55:10 -0400
committerShadowNinja <shadowninja@minetest.net>2017-06-03 14:55:10 -0400
commitcaecdb681c428c1aab9c0f7eec2570c0460f995c (patch)
treee5115982ea59bbf2343ba9b35bc4a0cfbb56f407 /src/mg_schematic.cpp
parent81d56b94919dceb7b2e51d70b21a7ca22f852bd5 (diff)
parent80dc961d24e1964e25d57039ddb2ba639f9f4d22 (diff)
downloadminetest-caecdb681c428c1aab9c0f7eec2570c0460f995c.tar.gz
minetest-caecdb681c428c1aab9c0f7eec2570c0460f995c.tar.bz2
minetest-caecdb681c428c1aab9c0f7eec2570c0460f995c.zip
Merge 0.4.16 into stable-0.4
Diffstat (limited to 'src/mg_schematic.cpp')
-rw-r--r--src/mg_schematic.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/mg_schematic.cpp b/src/mg_schematic.cpp
index e028215dc..67931497f 100644
--- a/src/mg_schematic.cpp
+++ b/src/mg_schematic.cpp
@@ -1,6 +1,7 @@
/*
Minetest
-Copyright (C) 2010-2014 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
+Copyright (C) 2014-2016 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
+Copyright (C) 2015-2017 paramat
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
@@ -20,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <fstream>
#include <typeinfo>
#include "mg_schematic.h"
-#include "gamedef.h"
+#include "server.h"
#include "mapgen.h"
#include "emerge.h"
#include "map.h"
@@ -30,20 +31,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/serialize.h"
#include "serialization.h"
#include "filesys.h"
+#include "voxelalgorithms.h"
///////////////////////////////////////////////////////////////////////////////
-SchematicManager::SchematicManager(IGameDef *gamedef) :
- ObjDefManager(gamedef, OBJDEF_SCHEMATIC)
+SchematicManager::SchematicManager(Server *server) :
+ ObjDefManager(server, OBJDEF_SCHEMATIC)
{
- m_gamedef = gamedef;
+ m_server = server;
}
void SchematicManager::clear()
{
- EmergeManager *emerge = m_gamedef->getEmergeManager();
+ EmergeManager *emerge = m_server->getEmergeManager();
// Remove all dangling references in Decorations
DecorationManager *decomgr = emerge->decomgr;
@@ -202,7 +204,7 @@ bool Schematic::placeOnVManip(MMVManip *vm, v3s16 p, u32 flags,
return vm->m_area.contains(VoxelArea(p, p + s - v3s16(1,1,1)));
}
-void Schematic::placeOnMap(Map *map, v3s16 p, u32 flags,
+void Schematic::placeOnMap(ServerMap *map, v3s16 p, u32 flags,
Rotation rot, bool force_place)
{
std::map<v3s16, MapBlock *> lighting_modified_blocks;
@@ -238,15 +240,10 @@ void Schematic::placeOnMap(Map *map, v3s16 p, u32 flags,
blitToVManip(&vm, p, rot, force_place);
- vm.blitBackAll(&modified_blocks);
+ voxalgo::blit_back_with_light(map, &vm, &modified_blocks);
//// Carry out post-map-modification actions
- //// Update lighting
- // TODO: Optimize this by using Mapgen::calcLighting() instead
- lighting_modified_blocks.insert(modified_blocks.begin(), modified_blocks.end());
- map->updateLighting(lighting_modified_blocks, modified_blocks);
-
//// Create & dispatch map modification events to observers
MapEditEvent event;
event.type = MEET_OTHER;