From 8e7449e09253e138716d8dbad6a2ab5c6e089e28 Mon Sep 17 00:00:00 2001 From: Ner'zhul Date: Mon, 9 Jan 2017 20:39:22 +0100 Subject: Environment & IGameDef code refactoring (#4985) * Environment code refactoring * Cleanup includes & class declarations in client & server environment to improve build speed * ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts. * Cleanup IGameDef * Move ITextureSource* IGameDef::getTextureSource() to Client only. * Also move ITextureSource *IGameDef::tsrc() helper * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call * drop unused emerge() call * cleanup server unused functions (mentionned before) * Drop one unused parameter from ContentFeatures::updateTextures * move checkLocalPrivilege to Client * Remove some unnecessary casts * create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it * Fix some comments * Change required IGameDef to Server/Client pointers * Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects * Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu * drop ClientMap::sectorWasDrawn which is unused --- src/mg_biome.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/mg_biome.cpp') diff --git a/src/mg_biome.cpp b/src/mg_biome.cpp index 78034bf6c..d564e9415 100644 --- a/src/mg_biome.cpp +++ b/src/mg_biome.cpp @@ -20,10 +20,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "mg_biome.h" #include "mg_decoration.h" #include "emerge.h" -#include "gamedef.h" +#include "server.h" #include "nodedef.h" #include "map.h" //for MMVManip -#include "log.h" #include "util/numeric.h" #include "util/mathconstants.h" #include "porting.h" @@ -33,10 +32,10 @@ with this program; if not, write to the Free Software Foundation, Inc., /////////////////////////////////////////////////////////////////////////////// -BiomeManager::BiomeManager(IGameDef *gamedef) : - ObjDefManager(gamedef, OBJDEF_BIOME) +BiomeManager::BiomeManager(Server *server) : + ObjDefManager(server, OBJDEF_BIOME) { - m_gamedef = gamedef; + m_server = server; // Create default biome to be used in case none exist Biome *b = new Biome; @@ -73,7 +72,7 @@ BiomeManager::~BiomeManager() void BiomeManager::clear() { - EmergeManager *emerge = m_gamedef->getEmergeManager(); + EmergeManager *emerge = m_server->getEmergeManager(); // Remove all dangling references in Decorations DecorationManager *decomgr = emerge->decomgr; -- cgit v1.2.3 From 0dada51a550c5eb52faf700dcbde4cee22a6bc70 Mon Sep 17 00:00:00 2001 From: red-001 Date: Fri, 20 Jan 2017 22:19:41 +0000 Subject: Remove `mathconstants.h` and use the correct way to get `M_PI` in MSVC. (#5072) --- src/CMakeLists.txt | 2 ++ src/camera.cpp | 1 - src/clientiface.cpp | 1 - src/clientmap.cpp | 1 - src/content_cao.cpp | 1 - src/content_sao.cpp | 1 - src/map.cpp | 1 - src/mg_biome.cpp | 1 - src/server.cpp | 1 - src/treegen.cpp | 1 - src/util/mathconstants.h | 7 ------- src/util/numeric.cpp | 1 - 12 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 src/util/mathconstants.h (limited to 'src/mg_biome.cpp') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f90542be9..cab5a1139 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -284,6 +284,8 @@ if(WIN32) set(PLATFORM_LIBS dbghelp.lib ${PLATFORM_LIBS}) # Surpress some useless warnings add_definitions ( /D "_CRT_SECURE_NO_DEPRECATE" /W1 ) + # Get M_PI to work + add_definitions(/D "_USE_MATH_DEFINES") else() # Probably MinGW = GCC set(PLATFORM_LIBS "") endif() diff --git a/src/camera.cpp b/src/camera.cpp index 4768e8778..2ad835817 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -31,7 +31,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "event.h" #include "profiler.h" #include "util/numeric.h" -#include "util/mathconstants.h" #include "constants.h" #include "fontengine.h" diff --git a/src/clientiface.cpp b/src/clientiface.cpp index 1610c21fd..47730343c 100644 --- a/src/clientiface.cpp +++ b/src/clientiface.cpp @@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "clientiface.h" #include "util/numeric.h" -#include "util/mathconstants.h" #include "remoteplayer.h" #include "settings.h" #include "mapblock.h" diff --git a/src/clientmap.cpp b/src/clientmap.cpp index fa326f0b4..11719539f 100644 --- a/src/clientmap.cpp +++ b/src/clientmap.cpp @@ -29,7 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "profiler.h" #include "settings.h" #include "camera.h" // CameraModes -#include "util/mathconstants.h" #include "util/basic_macros.h" #include diff --git a/src/content_cao.cpp b/src/content_cao.cpp index 83756c963..93ac1f785 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -26,7 +26,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "content_cao.h" #include "util/numeric.h" // For IntervalLimiter #include "util/serialize.h" -#include "util/mathconstants.h" #include "util/basic_macros.h" #include "client/tile.h" #include "environment.h" diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 840e04ed9..bf8282af4 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "content_sao.h" -#include "util/mathconstants.h" #include "util/serialize.h" #include "collision.h" #include "environment.h" diff --git a/src/map.cpp b/src/map.cpp index 0659f66aa..f2a4b7ffe 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -32,7 +32,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "nodedef.h" #include "gamedef.h" #include "util/directiontables.h" -#include "util/mathconstants.h" #include "util/basic_macros.h" #include "rollback_interface.h" #include "environment.h" diff --git a/src/mg_biome.cpp b/src/mg_biome.cpp index d564e9415..ef7e52685 100644 --- a/src/mg_biome.cpp +++ b/src/mg_biome.cpp @@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "nodedef.h" #include "map.h" //for MMVManip #include "util/numeric.h" -#include "util/mathconstants.h" #include "porting.h" #include "settings.h" diff --git a/src/server.cpp b/src/server.cpp index d3d5fd3d1..1656b9f5a 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -53,7 +53,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "event_manager.h" #include "serverlist.h" #include "util/string.h" -#include "util/mathconstants.h" #include "rollback.h" #include "util/serialize.h" #include "util/thread.h" diff --git a/src/treegen.cpp b/src/treegen.cpp index e6c514ab9..4df574f34 100644 --- a/src/treegen.cpp +++ b/src/treegen.cpp @@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include "util/pointer.h" #include "util/numeric.h" -#include "util/mathconstants.h" #include "map.h" #include "serverenvironment.h" #include "nodedef.h" diff --git a/src/util/mathconstants.h b/src/util/mathconstants.h deleted file mode 100644 index 1b478aa95..000000000 --- a/src/util/mathconstants.h +++ /dev/null @@ -1,7 +0,0 @@ -#include - -// MSVC doesn't seem to define this -#ifndef M_PI - #define M_PI 3.1415926535 -#endif - diff --git a/src/util/numeric.cpp b/src/util/numeric.cpp index a9e7ae584..87f1040ea 100644 --- a/src/util/numeric.cpp +++ b/src/util/numeric.cpp @@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "numeric.h" -#include "mathconstants.h" #include "log.h" #include "../constants.h" // BS, MAP_BLOCKSIZE -- cgit v1.2.3 From 210a339dce754a6cb03d4ef82f5bacc80b63262b Mon Sep 17 00:00:00 2001 From: paramat Date: Thu, 25 May 2017 18:53:47 +0100 Subject: Mapgen files: Update and correct copyright credits --- src/mapgen.cpp | 3 ++- src/mapgen.h | 4 +++- src/mapgen_flat.cpp | 4 ++-- src/mapgen_flat.h | 4 ++-- src/mapgen_fractal.cpp | 4 ++-- src/mapgen_fractal.h | 4 ++-- src/mapgen_singlenode.cpp | 4 +++- src/mapgen_singlenode.h | 4 +++- src/mapgen_v5.cpp | 4 ++-- src/mapgen_v5.h | 4 ++-- src/mapgen_v6.cpp | 2 ++ src/mapgen_v6.h | 2 ++ src/mapgen_v7.cpp | 4 ++-- src/mapgen_v7.h | 4 ++-- src/mapgen_valleys.cpp | 5 ++--- src/mapgen_valleys.h | 5 ++--- src/mg_biome.cpp | 3 ++- src/mg_biome.h | 3 ++- src/mg_decoration.cpp | 3 ++- src/mg_decoration.h | 3 ++- src/mg_ore.cpp | 3 ++- src/mg_ore.h | 3 ++- src/mg_schematic.cpp | 3 ++- src/mg_schematic.h | 3 ++- 24 files changed, 51 insertions(+), 34 deletions(-) (limited to 'src/mg_biome.cpp') diff --git a/src/mapgen.cpp b/src/mapgen.cpp index bd0e94ac7..6fd2ac580 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1,7 +1,8 @@ /* Minetest -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek Copyright (C) 2010-2015 celeron55, Perttu Ahola +Copyright (C) 2013-2016 kwolekr, Ryan Kwolek +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 diff --git a/src/mapgen.h b/src/mapgen.h index 653b79ed8..1efd2bff7 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -1,6 +1,8 @@ /* Minetest -Copyright (C) 2010-2013 celeron55, Perttu Ahola +Copyright (C) 2010-2015 celeron55, Perttu Ahola +Copyright (C) 2013-2016 kwolekr, Ryan Kwolek +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 diff --git a/src/mapgen_flat.cpp b/src/mapgen_flat.cpp index 0a44f71a5..604c79dd0 100644 --- a/src/mapgen_flat.cpp +++ b/src/mapgen_flat.cpp @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory +Copyright (C) 2015-2017 paramat +Copyright (C) 2015-2016 kwolekr, Ryan Kwolek 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 diff --git a/src/mapgen_flat.h b/src/mapgen_flat.h index 7a6696329..18b84de76 100644 --- a/src/mapgen_flat.h +++ b/src/mapgen_flat.h @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory +Copyright (C) 2015-2017 paramat +Copyright (C) 2015-2016 kwolekr, Ryan Kwolek 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 diff --git a/src/mapgen_fractal.cpp b/src/mapgen_fractal.cpp index d48d38b65..faac9e1c1 100644 --- a/src/mapgen_fractal.cpp +++ b/src/mapgen_fractal.cpp @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory +Copyright (C) 2015-2017 paramat +Copyright (C) 2015-2016 kwolekr, Ryan Kwolek 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 diff --git a/src/mapgen_fractal.h b/src/mapgen_fractal.h index d049724b4..a5a09ccb9 100644 --- a/src/mapgen_fractal.h +++ b/src/mapgen_fractal.h @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory +Copyright (C) 2015-2017 paramat +Copyright (C) 2015-2016 kwolekr, Ryan Kwolek Fractal formulas from http://www.bugman123.com/Hypercomplex/index.html by Paul Nylander, and from http://www.fractalforums.com, thank you. diff --git a/src/mapgen_singlenode.cpp b/src/mapgen_singlenode.cpp index ff985dd34..f49059f7f 100644 --- a/src/mapgen_singlenode.cpp +++ b/src/mapgen_singlenode.cpp @@ -1,6 +1,8 @@ /* Minetest -Copyright (C) 2010-2015 celeron55, Perttu Ahola +Copyright (C) 2013-2015 celeron55, Perttu Ahola +Copyright (C) 2013-2016 kwolekr, Ryan Kwolek +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 diff --git a/src/mapgen_singlenode.h b/src/mapgen_singlenode.h index 55a503374..5171bfbca 100644 --- a/src/mapgen_singlenode.h +++ b/src/mapgen_singlenode.h @@ -1,6 +1,8 @@ /* Minetest -Copyright (C) 2010-2015 celeron55, Perttu Ahola +Copyright (C) 2013-2015 celeron55, Perttu Ahola +Copyright (C) 2013-2016 kwolekr, Ryan Kwolek +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 diff --git a/src/mapgen_v5.cpp b/src/mapgen_v5.cpp index 1c4d1fd70..932677e2a 100644 --- a/src/mapgen_v5.cpp +++ b/src/mapgen_v5.cpp @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory +Copyright (C) 2014-2017 paramat +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek 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 diff --git a/src/mapgen_v5.h b/src/mapgen_v5.h index 1cdb33683..b742638cd 100644 --- a/src/mapgen_v5.h +++ b/src/mapgen_v5.h @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory +Copyright (C) 2014-2017 paramat +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek 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 diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp index ff0d93496..fe2b0b36f 100644 --- a/src/mapgen_v6.cpp +++ b/src/mapgen_v6.cpp @@ -1,6 +1,8 @@ /* Minetest Copyright (C) 2010-2015 celeron55, Perttu Ahola +Copyright (C) 2013-2016 kwolekr, Ryan Kwolek +Copyright (C) 2014-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 diff --git a/src/mapgen_v6.h b/src/mapgen_v6.h index 44591e3dc..2b3b4444e 100644 --- a/src/mapgen_v6.h +++ b/src/mapgen_v6.h @@ -1,6 +1,8 @@ /* Minetest Copyright (C) 2010-2015 celeron55, Perttu Ahola +Copyright (C) 2013-2016 kwolekr, Ryan Kwolek +Copyright (C) 2014-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 diff --git a/src/mapgen_v7.cpp b/src/mapgen_v7.cpp index dbf2b02ae..5e9bc4aa3 100644 --- a/src/mapgen_v7.cpp +++ b/src/mapgen_v7.cpp @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory +Copyright (C) 2013-2016 kwolekr, Ryan Kwolek +Copyright (C) 2014-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 diff --git a/src/mapgen_v7.h b/src/mapgen_v7.h index 71a341afe..a69170057 100644 --- a/src/mapgen_v7.h +++ b/src/mapgen_v7.h @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory +Copyright (C) 2013-2016 kwolekr, Ryan Kwolek +Copyright (C) 2014-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 diff --git a/src/mapgen_valleys.cpp b/src/mapgen_valleys.cpp index 32a32eb88..df318291c 100644 --- a/src/mapgen_valleys.cpp +++ b/src/mapgen_valleys.cpp @@ -1,8 +1,7 @@ /* Minetest Valleys C -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory -Copyright (C) 2016 Duane Robertson +Copyright (C) 2016-2017 Duane Robertson +Copyright (C) 2016-2017 paramat Based on Valleys Mapgen by Gael de Sailly (https://forum.minetest.net/viewtopic.php?f=9&t=11430) diff --git a/src/mapgen_valleys.h b/src/mapgen_valleys.h index 0c67c3232..8a32a5a82 100644 --- a/src/mapgen_valleys.h +++ b/src/mapgen_valleys.h @@ -1,8 +1,7 @@ /* Minetest Valleys C -Copyright (C) 2010-2015 kwolekr, Ryan Kwolek -Copyright (C) 2010-2015 paramat, Matt Gregory -Copyright (C) 2016 Duane Robertson +Copyright (C) 2016-2017 Duane Robertson +Copyright (C) 2016-2017 paramat Based on Valleys Mapgen by Gael de Sailly (https://forum.minetest.net/viewtopic.php?f=9&t=11430) diff --git a/src/mg_biome.cpp b/src/mg_biome.cpp index ef7e52685..2ef2ed16a 100644 --- a/src/mg_biome.cpp +++ b/src/mg_biome.cpp @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2013 kwolekr, Ryan Kwolek +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek +Copyright (C) 2014-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 diff --git a/src/mg_biome.h b/src/mg_biome.h index 15088f7dd..2e07fd9cf 100644 --- a/src/mg_biome.h +++ b/src/mg_biome.h @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2013 kwolekr, Ryan Kwolek +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek +Copyright (C) 2014-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 diff --git a/src/mg_decoration.cpp b/src/mg_decoration.cpp index ec31a9c01..b0566e830 100644 --- a/src/mg_decoration.cpp +++ b/src/mg_decoration.cpp @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2014 kwolekr, Ryan Kwolek +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek +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 diff --git a/src/mg_decoration.h b/src/mg_decoration.h index 986328ec3..950800ec8 100644 --- a/src/mg_decoration.h +++ b/src/mg_decoration.h @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2013 kwolekr, Ryan Kwolek +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek +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 diff --git a/src/mg_ore.cpp b/src/mg_ore.cpp index c6c1c45a7..89319238e 100644 --- a/src/mg_ore.cpp +++ b/src/mg_ore.cpp @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2014 kwolekr, Ryan Kwolek +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek +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 diff --git a/src/mg_ore.h b/src/mg_ore.h index e95fdd330..0503a6ca0 100644 --- a/src/mg_ore.h +++ b/src/mg_ore.h @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2013 kwolekr, Ryan Kwolek +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek +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 diff --git a/src/mg_schematic.cpp b/src/mg_schematic.cpp index 92e138df4..67931497f 100644 --- a/src/mg_schematic.cpp +++ b/src/mg_schematic.cpp @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2014 kwolekr, Ryan Kwolek +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek +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 diff --git a/src/mg_schematic.h b/src/mg_schematic.h index 2f60c843b..db040343c 100644 --- a/src/mg_schematic.h +++ b/src/mg_schematic.h @@ -1,6 +1,7 @@ /* Minetest -Copyright (C) 2010-2013 kwolekr, Ryan Kwolek +Copyright (C) 2014-2016 kwolekr, Ryan Kwolek +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 -- cgit v1.2.3