summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVitaliy <silverunicorn2011@yandex.ru>2017-11-09 01:56:20 +0300
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-11-08 23:56:20 +0100
commit20a85d76d94c9c5c7fbe198c3d0e1fbee97a485f (patch)
tree67378802190117d8271b3b6d489a92bcb16203b7 /src
parentfc9747eb4b7f75e59a28957bc50f7a78256b3d66 (diff)
downloadminetest-20a85d76d94c9c5c7fbe198c3d0e1fbee97a485f.tar.gz
minetest-20a85d76d94c9c5c7fbe198c3d0e1fbee97a485f.tar.bz2
minetest-20a85d76d94c9c5c7fbe198c3d0e1fbee97a485f.zip
Move files to subdirectories (#6599)
* Move files around
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt39
-rw-r--r--src/client.cpp2
-rw-r--r--src/client/clientlauncher.cpp6
-rw-r--r--src/client/inputhandler.cpp2
-rw-r--r--src/client/inputhandler.h2
-rw-r--r--src/client/joystick_controller.cpp2
-rw-r--r--src/database/CMakeLists.txt10
-rw-r--r--src/database/database-dummy.cpp (renamed from src/database-dummy.cpp)0
-rw-r--r--src/database/database-dummy.h (renamed from src/database-dummy.h)0
-rw-r--r--src/database/database-files.cpp (renamed from src/database-files.cpp)0
-rw-r--r--src/database/database-files.h (renamed from src/database-files.h)0
-rw-r--r--src/database/database-leveldb.cpp (renamed from src/database-leveldb.cpp)0
-rw-r--r--src/database/database-leveldb.h (renamed from src/database-leveldb.h)0
-rw-r--r--src/database/database-postgresql.cpp (renamed from src/database-postgresql.cpp)0
-rw-r--r--src/database/database-postgresql.h (renamed from src/database-postgresql.h)0
-rw-r--r--src/database/database-redis.cpp (renamed from src/database-redis.cpp)0
-rw-r--r--src/database/database-redis.h (renamed from src/database-redis.h)0
-rw-r--r--src/database/database-sqlite3.cpp (renamed from src/database-sqlite3.cpp)0
-rw-r--r--src/database/database-sqlite3.h (renamed from src/database-sqlite3.h)0
-rw-r--r--src/database/database.cpp (renamed from src/database.cpp)0
-rw-r--r--src/database/database.h (renamed from src/database.h)0
-rw-r--r--src/emerge.cpp8
-rw-r--r--src/emerge.h2
-rw-r--r--src/game.cpp12
-rw-r--r--src/gui/CMakeLists.txt13
-rw-r--r--src/gui/guiChatConsole.cpp (renamed from src/guiChatConsole.cpp)0
-rw-r--r--src/gui/guiChatConsole.h (renamed from src/guiChatConsole.h)0
-rw-r--r--src/gui/guiEditBoxWithScrollbar.cpp (renamed from src/guiEditBoxWithScrollbar.cpp)0
-rw-r--r--src/gui/guiEditBoxWithScrollbar.h (renamed from src/guiEditBoxWithScrollbar.h)0
-rw-r--r--src/gui/guiEngine.cpp (renamed from src/guiEngine.cpp)0
-rw-r--r--src/gui/guiEngine.h (renamed from src/guiEngine.h)0
-rw-r--r--src/gui/guiFormSpecMenu.cpp (renamed from src/guiFormSpecMenu.cpp)0
-rw-r--r--src/gui/guiFormSpecMenu.h (renamed from src/guiFormSpecMenu.h)0
-rw-r--r--src/gui/guiKeyChangeMenu.cpp (renamed from src/guiKeyChangeMenu.cpp)0
-rw-r--r--src/gui/guiKeyChangeMenu.h (renamed from src/guiKeyChangeMenu.h)0
-rw-r--r--src/gui/guiMainMenu.h (renamed from src/guiMainMenu.h)0
-rw-r--r--src/gui/guiPasswordChange.cpp (renamed from src/guiPasswordChange.cpp)0
-rw-r--r--src/gui/guiPasswordChange.h (renamed from src/guiPasswordChange.h)0
-rw-r--r--src/gui/guiPathSelectMenu.cpp (renamed from src/guiPathSelectMenu.cpp)0
-rw-r--r--src/gui/guiPathSelectMenu.h (renamed from src/guiPathSelectMenu.h)0
-rw-r--r--src/gui/guiTable.cpp (renamed from src/guiTable.cpp)0
-rw-r--r--src/gui/guiTable.h (renamed from src/guiTable.h)0
-rw-r--r--src/gui/guiVolumeChange.cpp (renamed from src/guiVolumeChange.cpp)0
-rw-r--r--src/gui/guiVolumeChange.h (renamed from src/guiVolumeChange.h)0
-rw-r--r--src/gui/intlGUIEditBox.cpp (renamed from src/intlGUIEditBox.cpp)0
-rw-r--r--src/gui/intlGUIEditBox.h (renamed from src/intlGUIEditBox.h)0
-rw-r--r--src/gui/mainmenumanager.h (renamed from src/mainmenumanager.h)0
-rw-r--r--src/gui/modalMenu.h (renamed from src/modalMenu.h)0
-rw-r--r--src/gui/touchscreengui.cpp (renamed from src/touchscreengui.cpp)0
-rw-r--r--src/gui/touchscreengui.h (renamed from src/touchscreengui.h)0
-rw-r--r--src/hud.cpp2
-rw-r--r--src/main.cpp10
-rw-r--r--src/map.cpp16
-rw-r--r--src/map_settings_manager.cpp2
-rw-r--r--src/mapblock.h2
-rw-r--r--src/mapgen/CMakeLists.txt19
-rw-r--r--src/mapgen/cavegen.cpp (renamed from src/cavegen.cpp)0
-rw-r--r--src/mapgen/cavegen.h (renamed from src/cavegen.h)0
-rw-r--r--src/mapgen/dungeongen.cpp (renamed from src/dungeongen.cpp)0
-rw-r--r--src/mapgen/dungeongen.h (renamed from src/dungeongen.h)0
-rw-r--r--src/mapgen/mapgen.cpp (renamed from src/mapgen.cpp)0
-rw-r--r--src/mapgen/mapgen.h (renamed from src/mapgen.h)0
-rw-r--r--src/mapgen/mapgen_carpathian.cpp (renamed from src/mapgen_carpathian.cpp)0
-rw-r--r--src/mapgen/mapgen_carpathian.h (renamed from src/mapgen_carpathian.h)0
-rw-r--r--src/mapgen/mapgen_flat.cpp (renamed from src/mapgen_flat.cpp)0
-rw-r--r--src/mapgen/mapgen_flat.h (renamed from src/mapgen_flat.h)0
-rw-r--r--src/mapgen/mapgen_fractal.cpp (renamed from src/mapgen_fractal.cpp)0
-rw-r--r--src/mapgen/mapgen_fractal.h (renamed from src/mapgen_fractal.h)0
-rw-r--r--src/mapgen/mapgen_singlenode.cpp (renamed from src/mapgen_singlenode.cpp)0
-rw-r--r--src/mapgen/mapgen_singlenode.h (renamed from src/mapgen_singlenode.h)0
-rw-r--r--src/mapgen/mapgen_v5.cpp (renamed from src/mapgen_v5.cpp)0
-rw-r--r--src/mapgen/mapgen_v5.h (renamed from src/mapgen_v5.h)0
-rw-r--r--src/mapgen/mapgen_v6.cpp (renamed from src/mapgen_v6.cpp)0
-rw-r--r--src/mapgen/mapgen_v6.h (renamed from src/mapgen_v6.h)0
-rw-r--r--src/mapgen/mapgen_v7.cpp (renamed from src/mapgen_v7.cpp)0
-rw-r--r--src/mapgen/mapgen_v7.h (renamed from src/mapgen_v7.h)0
-rw-r--r--src/mapgen/mapgen_valleys.cpp (renamed from src/mapgen_valleys.cpp)0
-rw-r--r--src/mapgen/mapgen_valleys.h (renamed from src/mapgen_valleys.h)0
-rw-r--r--src/mapgen/mg_biome.cpp (renamed from src/mg_biome.cpp)0
-rw-r--r--src/mapgen/mg_biome.h (renamed from src/mg_biome.h)0
-rw-r--r--src/mapgen/mg_decoration.cpp (renamed from src/mg_decoration.cpp)0
-rw-r--r--src/mapgen/mg_decoration.h (renamed from src/mg_decoration.h)0
-rw-r--r--src/mapgen/mg_ore.cpp (renamed from src/mg_ore.cpp)0
-rw-r--r--src/mapgen/mg_ore.h (renamed from src/mg_ore.h)0
-rw-r--r--src/mapgen/mg_schematic.cpp (renamed from src/mg_schematic.cpp)0
-rw-r--r--src/mapgen/mg_schematic.h (renamed from src/mg_schematic.h)0
-rw-r--r--src/mapgen/treegen.cpp (renamed from src/treegen.cpp)0
-rw-r--r--src/mapgen/treegen.h (renamed from src/treegen.h)0
-rw-r--r--src/network/connectionthreads.h2
-rw-r--r--src/script/common/c_content.cpp2
-rw-r--r--src/script/cpp_api/s_env.cpp2
-rw-r--r--src/script/cpp_api/s_mainmenu.h2
-rw-r--r--src/script/lua_api/l_client.cpp2
-rw-r--r--src/script/lua_api/l_env.cpp2
-rw-r--r--src/script/lua_api/l_mainmenu.cpp10
-rw-r--r--src/script/lua_api/l_mapgen.cpp12
-rw-r--r--src/script/lua_api/l_sound.cpp2
-rw-r--r--src/script/lua_api/l_vmanip.cpp2
-rw-r--r--src/server.cpp6
-rw-r--r--src/serverenvironment.cpp8
-rw-r--r--src/subgame.cpp2
-rw-r--r--src/unittest/test_map_settings_manager.cpp2
-rw-r--r--src/unittest/test_schematic.cpp2
-rw-r--r--src/util/container.h8
-rw-r--r--src/util/directiontables.h4
-rw-r--r--src/util/numeric.cpp6
-rw-r--r--src/util/numeric.h8
-rw-r--r--src/util/pointedthing.cpp2
-rw-r--r--src/util/pointedthing.h4
-rw-r--r--src/util/pointer.h4
-rw-r--r--src/util/serialize.cpp4
-rw-r--r--src/util/serialize.h6
-rw-r--r--src/util/string.cpp4
-rw-r--r--src/util/thread.h6
-rw-r--r--src/util/timetaker.cpp4
-rw-r--r--src/util/timetaker.h4
116 files changed, 143 insertions, 128 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 82f60be86..9964b828b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -371,6 +371,9 @@ add_custom_target(GenerateVersion
add_subdirectory(threading)
+add_subdirectory(database)
+add_subdirectory(gui)
+add_subdirectory(mapgen)
add_subdirectory(network)
add_subdirectory(script)
add_subdirectory(unittest)
@@ -378,8 +381,9 @@ add_subdirectory(util)
add_subdirectory(irrlicht_changes)
set(common_SRCS
+ ${database_SRCS}
+ ${mapgen_SRCS}
ban.cpp
- cavegen.cpp
chat.cpp
clientiface.cpp
collision.cpp
@@ -388,16 +392,8 @@ set(common_SRCS
content_sao.cpp
convert_json.cpp
craftdef.cpp
- database-dummy.cpp
- database-files.cpp
- database-leveldb.cpp
- database-postgresql.cpp
- database-redis.cpp
- database-sqlite3.cpp
- database.cpp
debug.cpp
defaultsettings.cpp
- dungeongen.cpp
emerge.cpp
environment.cpp
face_position_cache.cpp
@@ -414,22 +410,9 @@ set(common_SRCS
map.cpp
map_settings_manager.cpp
mapblock.cpp
- mapgen.cpp
- mapgen_carpathian.cpp
- mapgen_flat.cpp
- mapgen_fractal.cpp
- mapgen_singlenode.cpp
- mapgen_v5.cpp
- mapgen_v6.cpp
- mapgen_v7.cpp
- mapgen_valleys.cpp
mapnode.cpp
mapsector.cpp
metadata.cpp
- mg_biome.cpp
- mg_decoration.cpp
- mg_ore.cpp
- mg_schematic.cpp
modchannels.cpp
mods.cpp
nameidmapping.cpp
@@ -462,7 +445,6 @@ set(common_SRCS
tileanimation.cpp
tool.cpp
translation.cpp
- treegen.cpp
version.cpp
voxel.cpp
voxelalgorithms.cpp
@@ -503,6 +485,7 @@ endif(BUILD_CLIENT)
set(client_SRCS
${client_SRCS}
${common_SRCS}
+ ${gui_SRCS}
${sound_SRCS}
${client_network_SRCS}
${client_irrlicht_changes_SRCS}
@@ -520,19 +503,9 @@ set(client_SRCS
filecache.cpp
fontengine.cpp
game.cpp
- guiChatConsole.cpp
- guiEditBoxWithScrollbar.cpp
- guiEngine.cpp
- guiPathSelectMenu.cpp
- guiFormSpecMenu.cpp
- guiKeyChangeMenu.cpp
- guiPasswordChange.cpp
guiscalingfilter.cpp
- guiTable.cpp
- guiVolumeChange.cpp
hud.cpp
imagefilters.cpp
- intlGUIEditBox.cpp
keycode.cpp
localplayer.cpp
main.cpp
diff --git a/src/client.cpp b/src/client.cpp
index 2538f52aa..bca9f41d0 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -47,7 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "clientmap.h"
#include "clientmedia.h"
#include "version.h"
-#include "database-sqlite3.h"
+#include "database/database-sqlite3.h"
#include "serialization.h"
#include "guiscalingfilter.h"
#include "script/scripting_client.h"
diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp
index dbaba8040..741a90d9f 100644
--- a/src/client/clientlauncher.cpp
+++ b/src/client/clientlauncher.cpp
@@ -17,18 +17,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "mainmenumanager.h"
+#include "gui/mainmenumanager.h"
#include "clouds.h"
#include "server.h"
#include "filesys.h"
-#include "guiMainMenu.h"
+#include "gui/guiMainMenu.h"
#include "game.h"
#include "player.h"
#include "chat.h"
#include "gettext.h"
#include "profiler.h"
#include "serverlist.h"
-#include "guiEngine.h"
+#include "gui/guiEngine.h"
#include "fontengine.h"
#include "clientlauncher.h"
#include "version.h"
diff --git a/src/client/inputhandler.cpp b/src/client/inputhandler.cpp
index b176f3ad7..48b94ae95 100644
--- a/src/client/inputhandler.cpp
+++ b/src/client/inputhandler.cpp
@@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/numeric.h"
#include "inputhandler.h"
-#include "mainmenumanager.h"
+#include "gui/mainmenumanager.h"
bool MyEventReceiver::OnEvent(const SEvent &event)
{
diff --git a/src/client/inputhandler.h b/src/client/inputhandler.h
index 249336947..165c75990 100644
--- a/src/client/inputhandler.h
+++ b/src/client/inputhandler.h
@@ -26,7 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "renderingengine.h"
#ifdef HAVE_TOUCHSCREENGUI
-#include "touchscreengui.h"
+#include "gui/touchscreengui.h"
#endif
class KeyList : private std::list<KeyPress>
diff --git a/src/client/joystick_controller.cpp b/src/client/joystick_controller.cpp
index 95bd77bc4..c29e8b639 100644
--- a/src/client/joystick_controller.cpp
+++ b/src/client/joystick_controller.cpp
@@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "settings.h"
#include "gettime.h"
#include "porting.h"
-#include "../util/string.h"
+#include "util/string.h"
bool JoystickButtonCmb::isTriggered(const irr::SEvent::SJoystickEvent &ev) const
{
diff --git a/src/database/CMakeLists.txt b/src/database/CMakeLists.txt
new file mode 100644
index 000000000..e9d157c29
--- /dev/null
+++ b/src/database/CMakeLists.txt
@@ -0,0 +1,10 @@
+set(database_SRCS
+ ${CMAKE_CURRENT_SOURCE_DIR}/database.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/database-dummy.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/database-files.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/database-leveldb.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/database-postgresql.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/database-redis.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/database-sqlite3.cpp
+ PARENT_SCOPE
+)
diff --git a/src/database-dummy.cpp b/src/database/database-dummy.cpp
index a3d8cd579..a3d8cd579 100644
--- a/src/database-dummy.cpp
+++ b/src/database/database-dummy.cpp
diff --git a/src/database-dummy.h b/src/database/database-dummy.h
index 2d87d58f6..2d87d58f6 100644
--- a/src/database-dummy.h
+++ b/src/database/database-dummy.h
diff --git a/src/database-files.cpp b/src/database/database-files.cpp
index 70de8c8d2..70de8c8d2 100644
--- a/src/database-files.cpp
+++ b/src/database/database-files.cpp
diff --git a/src/database-files.h b/src/database/database-files.h
index f0824a304..f0824a304 100644
--- a/src/database-files.h
+++ b/src/database/database-files.h
diff --git a/src/database-leveldb.cpp b/src/database/database-leveldb.cpp
index 4a4904c6a..4a4904c6a 100644
--- a/src/database-leveldb.cpp
+++ b/src/database/database-leveldb.cpp
diff --git a/src/database-leveldb.h b/src/database/database-leveldb.h
index d30f9f8f5..d30f9f8f5 100644
--- a/src/database-leveldb.h
+++ b/src/database/database-leveldb.h
diff --git a/src/database-postgresql.cpp b/src/database/database-postgresql.cpp
index 74651135a..74651135a 100644
--- a/src/database-postgresql.cpp
+++ b/src/database/database-postgresql.cpp
diff --git a/src/database-postgresql.h b/src/database/database-postgresql.h
index db0b505c9..db0b505c9 100644
--- a/src/database-postgresql.h
+++ b/src/database/database-postgresql.h
diff --git a/src/database-redis.cpp b/src/database/database-redis.cpp
index 096ea504d..096ea504d 100644
--- a/src/database-redis.cpp
+++ b/src/database/database-redis.cpp
diff --git a/src/database-redis.h b/src/database/database-redis.h
index 6bea563bc..6bea563bc 100644
--- a/src/database-redis.h
+++ b/src/database/database-redis.h
diff --git a/src/database-sqlite3.cpp b/src/database/database-sqlite3.cpp
index 78c182f86..78c182f86 100644
--- a/src/database-sqlite3.cpp
+++ b/src/database/database-sqlite3.cpp
diff --git a/src/database-sqlite3.h b/src/database/database-sqlite3.h
index 8d9f91f21..8d9f91f21 100644
--- a/src/database-sqlite3.h
+++ b/src/database/database-sqlite3.h
diff --git a/src/database.cpp b/src/database/database.cpp
index 12e0e1a0f..12e0e1a0f 100644
--- a/src/database.cpp
+++ b/src/database/database.cpp
diff --git a/src/database.h b/src/database/database.h
index 9926c7b93..9926c7b93 100644
--- a/src/database.h
+++ b/src/database/database.h
diff --git a/src/emerge.cpp b/src/emerge.cpp
index e9d96c0ba..ffe387f63 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -34,10 +34,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#include "map.h"
#include "mapblock.h"
-#include "mg_biome.h"
-#include "mg_ore.h"
-#include "mg_decoration.h"
-#include "mg_schematic.h"
+#include "mapgen/mg_biome.h"
+#include "mapgen/mg_ore.h"
+#include "mapgen/mg_decoration.h"
+#include "mapgen/mg_schematic.h"
#include "nodedef.h"
#include "profiler.h"
#include "scripting_server.h"
diff --git a/src/emerge.h b/src/emerge.h
index 135121b39..e1f5d5ab0 100644
--- a/src/emerge.h
+++ b/src/emerge.h
@@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "network/networkprotocol.h"
#include "irr_v3d.h"
#include "util/container.h"
-#include "mapgen.h" // for MapgenParams
+#include "mapgen/mapgen.h" // for MapgenParams
#include "map.h"
#define BLOCK_EMERGE_ALLOW_GEN (1 << 0)
diff --git a/src/game.cpp b/src/game.cpp
index 200de2c59..462fd37a9 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -39,12 +39,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#include "filesys.h"
#include "gettext.h"
-#include "guiChatConsole.h"
-#include "guiFormSpecMenu.h"
-#include "guiKeyChangeMenu.h"
-#include "guiPasswordChange.h"
-#include "guiVolumeChange.h"
-#include "mainmenumanager.h"
+#include "gui/guiChatConsole.h"
+#include "gui/guiFormSpecMenu.h"
+#include "gui/guiKeyChangeMenu.h"
+#include "gui/guiPasswordChange.h"
+#include "gui/guiVolumeChange.h"
+#include "gui/mainmenumanager.h"
#include "mapblock.h"
#include "minimap.h"
#include "nodedef.h" // Needed for determining pointing to nodes
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
new file mode 100644
index 000000000..067ba09a8
--- /dev/null
+++ b/src/gui/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(gui_SRCS
+ ${CMAKE_CURRENT_SOURCE_DIR}/guiChatConsole.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/guiEditBoxWithScrollbar.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/guiEngine.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/guiFormSpecMenu.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/guiKeyChangeMenu.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/guiPasswordChange.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/guiPathSelectMenu.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/guiTable.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/guiVolumeChange.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/intlGUIEditBox.cpp
+ PARENT_SCOPE
+)
diff --git a/src/guiChatConsole.cpp b/src/gui/guiChatConsole.cpp
index b194834e2..b194834e2 100644
--- a/src/guiChatConsole.cpp
+++ b/src/gui/guiChatConsole.cpp
diff --git a/src/guiChatConsole.h b/src/gui/guiChatConsole.h
index ef8a87673..ef8a87673 100644
--- a/src/guiChatConsole.h
+++ b/src/gui/guiChatConsole.h
diff --git a/src/guiEditBoxWithScrollbar.cpp b/src/gui/guiEditBoxWithScrollbar.cpp
index d4d2a0c1c..d4d2a0c1c 100644
--- a/src/guiEditBoxWithScrollbar.cpp
+++ b/src/gui/guiEditBoxWithScrollbar.cpp
diff --git a/src/guiEditBoxWithScrollbar.h b/src/gui/guiEditBoxWithScrollbar.h
index cca2f6536..cca2f6536 100644
--- a/src/guiEditBoxWithScrollbar.h
+++ b/src/gui/guiEditBoxWithScrollbar.h
diff --git a/src/guiEngine.cpp b/src/gui/guiEngine.cpp
index e9b4e54c1..e9b4e54c1 100644
--- a/src/guiEngine.cpp
+++ b/src/gui/guiEngine.cpp
diff --git a/src/guiEngine.h b/src/gui/guiEngine.h
index 817d76014..817d76014 100644
--- a/src/guiEngine.h
+++ b/src/gui/guiEngine.h
diff --git a/src/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 0691bc598..0691bc598 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
diff --git a/src/guiFormSpecMenu.h b/src/gui/guiFormSpecMenu.h
index 071efb37f..071efb37f 100644
--- a/src/guiFormSpecMenu.h
+++ b/src/gui/guiFormSpecMenu.h
diff --git a/src/guiKeyChangeMenu.cpp b/src/gui/guiKeyChangeMenu.cpp
index 53677a57b..53677a57b 100644
--- a/src/guiKeyChangeMenu.cpp
+++ b/src/gui/guiKeyChangeMenu.cpp
diff --git a/src/guiKeyChangeMenu.h b/src/gui/guiKeyChangeMenu.h
index 7cf11d3f9..7cf11d3f9 100644
--- a/src/guiKeyChangeMenu.h
+++ b/src/gui/guiKeyChangeMenu.h
diff --git a/src/guiMainMenu.h b/src/gui/guiMainMenu.h
index 43a3b1a33..43a3b1a33 100644
--- a/src/guiMainMenu.h
+++ b/src/gui/guiMainMenu.h
diff --git a/src/guiPasswordChange.cpp b/src/gui/guiPasswordChange.cpp
index 46de2026c..46de2026c 100644
--- a/src/guiPasswordChange.cpp
+++ b/src/gui/guiPasswordChange.cpp
diff --git a/src/guiPasswordChange.h b/src/gui/guiPasswordChange.h
index 59f3513b2..59f3513b2 100644
--- a/src/guiPasswordChange.h
+++ b/src/gui/guiPasswordChange.h
diff --git a/src/guiPathSelectMenu.cpp b/src/gui/guiPathSelectMenu.cpp
index b999f0a68..b999f0a68 100644
--- a/src/guiPathSelectMenu.cpp
+++ b/src/gui/guiPathSelectMenu.cpp
diff --git a/src/guiPathSelectMenu.h b/src/gui/guiPathSelectMenu.h
index f69d0acd7..f69d0acd7 100644
--- a/src/guiPathSelectMenu.h
+++ b/src/gui/guiPathSelectMenu.h
diff --git a/src/guiTable.cpp b/src/gui/guiTable.cpp
index a2738afa9..a2738afa9 100644
--- a/src/guiTable.cpp
+++ b/src/gui/guiTable.cpp
diff --git a/src/guiTable.h b/src/gui/guiTable.h
index f9337ff6d..f9337ff6d 100644
--- a/src/guiTable.h
+++ b/src/gui/guiTable.h
diff --git a/src/guiVolumeChange.cpp b/src/gui/guiVolumeChange.cpp
index 8c462312b..8c462312b 100644
--- a/src/guiVolumeChange.cpp
+++ b/src/gui/guiVolumeChange.cpp
diff --git a/src/guiVolumeChange.h b/src/gui/guiVolumeChange.h
index 7c7e19a86..7c7e19a86 100644
--- a/src/guiVolumeChange.h
+++ b/src/gui/guiVolumeChange.h
diff --git a/src/intlGUIEditBox.cpp b/src/gui/intlGUIEditBox.cpp
index 279e7a48a..279e7a48a 100644
--- a/src/intlGUIEditBox.cpp
+++ b/src/gui/intlGUIEditBox.cpp
diff --git a/src/intlGUIEditBox.h b/src/gui/intlGUIEditBox.h
index aa35e2e71..aa35e2e71 100644
--- a/src/intlGUIEditBox.h
+++ b/src/gui/intlGUIEditBox.h
diff --git a/src/mainmenumanager.h b/src/gui/mainmenumanager.h
index ea9327813..ea9327813 100644
--- a/src/mainmenumanager.h
+++ b/src/gui/mainmenumanager.h
diff --git a/src/modalMenu.h b/src/gui/modalMenu.h
index f41591c3f..f41591c3f 100644
--- a/src/modalMenu.h
+++ b/src/gui/modalMenu.h
diff --git a/src/touchscreengui.cpp b/src/gui/touchscreengui.cpp
index e849b4053..e849b4053 100644
--- a/src/touchscreengui.cpp
+++ b/src/gui/touchscreengui.cpp
diff --git a/src/touchscreengui.h b/src/gui/touchscreengui.h
index da97381cd..da97381cd 100644
--- a/src/touchscreengui.h
+++ b/src/gui/touchscreengui.h
diff --git a/src/hud.cpp b/src/hud.cpp
index 29beef16a..ecd2a521d 100644
--- a/src/hud.cpp
+++ b/src/hud.cpp
@@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "client/renderingengine.h"
#ifdef HAVE_TOUCHSCREENGUI
-#include "touchscreengui.h"
+#include "gui/touchscreengui.h"
#endif
Hud::Hud(gui::IGUIEnvironment *guienv, Client *client, LocalPlayer *player,
diff --git a/src/main.cpp b/src/main.cpp
index 792cd104d..8fce83dcb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "quicktune.h"
#include "httpfetch.h"
#include "gameparams.h"
-#include "database.h"
+#include "database/database.h"
#include "config.h"
#include "player.h"
#include "porting.h"
@@ -41,14 +41,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "terminal_chat_console.h"
#endif
#ifndef SERVER
-#include "guiMainMenu.h"
+#include "gui/guiMainMenu.h"
#include "client/clientlauncher.h"
-#include "guiEngine.h"
-#include "mainmenumanager.h"
+#include "gui/guiEngine.h"
+#include "gui/mainmenumanager.h"
#endif
#ifdef HAVE_TOUCHSCREENGUI
- #include "touchscreengui.h"
+ #include "gui/touchscreengui.h"
#endif
#if !defined(SERVER) && \
diff --git a/src/map.cpp b/src/map.cpp
index 9bcbc6c00..256c542a1 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -37,24 +37,24 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "environment.h"
#include "reflowscan.h"
#include "emerge.h"
-#include "mapgen_v6.h"
-#include "mg_biome.h"
+#include "mapgen/mapgen_v6.h"
+#include "mapgen/mg_biome.h"
#include "config.h"
#include "server.h"
-#include "database.h"
-#include "database-dummy.h"
-#include "database-sqlite3.h"
+#include "database/database.h"
+#include "database/database-dummy.h"
+#include "database/database-sqlite3.h"
#include "script/scripting_server.h"
#include <deque>
#include <queue>
#if USE_LEVELDB
-#include "database-leveldb.h"
+#include "database/database-leveldb.h"
#endif
#if USE_REDIS
-#include "database-redis.h"
+#include "database/database-redis.h"
#endif
#if USE_POSTGRESQL
-#include "database-postgresql.h"
+#include "database/database-postgresql.h"
#endif
diff --git a/src/map_settings_manager.cpp b/src/map_settings_manager.cpp
index c1dcf5215..16e7d8230 100644
--- a/src/map_settings_manager.cpp
+++ b/src/map_settings_manager.cpp
@@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "debug.h"
#include "filesys.h"
#include "log.h"
-#include "mapgen.h"
+#include "mapgen/mapgen.h"
#include "settings.h"
#include "map_settings_manager.h"
diff --git a/src/mapblock.h b/src/mapblock.h
index b93007d72..3871c656d 100644
--- a/src/mapblock.h
+++ b/src/mapblock.h
@@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "modifiedstate.h"
#include "util/numeric.h" // getContainerPos
#include "settings.h"
-#include "mapgen.h"
+#include "mapgen/mapgen.h"
class Map;
class NodeMetadataList;
diff --git a/src/mapgen/CMakeLists.txt b/src/mapgen/CMakeLists.txt
new file mode 100644
index 000000000..e74bd85db
--- /dev/null
+++ b/src/mapgen/CMakeLists.txt
@@ -0,0 +1,19 @@
+set(mapgen_SRCS
+ ${CMAKE_CURRENT_SOURCE_DIR}/cavegen.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/dungeongen.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mapgen_carpathian.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mapgen.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mapgen_flat.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mapgen_fractal.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mapgen_singlenode.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mapgen_v5.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mapgen_v6.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mapgen_v7.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mapgen_valleys.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mg_biome.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mg_decoration.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mg_ore.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/mg_schematic.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/treegen.cpp
+ PARENT_SCOPE
+)
diff --git a/src/cavegen.cpp b/src/mapgen/cavegen.cpp
index e66634517..e66634517 100644
--- a/src/cavegen.cpp
+++ b/src/mapgen/cavegen.cpp
diff --git a/src/cavegen.h b/src/mapgen/cavegen.h
index ce146e0cd..ce146e0cd 100644
--- a/src/cavegen.h
+++ b/src/mapgen/cavegen.h
diff --git a/src/dungeongen.cpp b/src/mapgen/dungeongen.cpp
index fa867b398..fa867b398 100644
--- a/src/dungeongen.cpp
+++ b/src/mapgen/dungeongen.cpp
diff --git a/src/dungeongen.h b/src/mapgen/dungeongen.h
index 6799db79e..6799db79e 100644
--- a/src/dungeongen.h
+++ b/src/mapgen/dungeongen.h
diff --git a/src/mapgen.cpp b/src/mapgen/mapgen.cpp
index f73e16dd0..f73e16dd0 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen/mapgen.cpp
diff --git a/src/mapgen.h b/src/mapgen/mapgen.h
index 8994fdc00..8994fdc00 100644
--- a/src/mapgen.h
+++ b/src/mapgen/mapgen.h
diff --git a/src/mapgen_carpathian.cpp b/src/mapgen/mapgen_carpathian.cpp
index 9884ce40b..9884ce40b 100644
--- a/src/mapgen_carpathian.cpp
+++ b/src/mapgen/mapgen_carpathian.cpp
diff --git a/src/mapgen_carpathian.h b/src/mapgen/mapgen_carpathian.h
index 7dbccde2a..7dbccde2a 100644
--- a/src/mapgen_carpathian.h
+++ b/src/mapgen/mapgen_carpathian.h
diff --git a/src/mapgen_flat.cpp b/src/mapgen/mapgen_flat.cpp
index 57c20d470..57c20d470 100644
--- a/src/mapgen_flat.cpp
+++ b/src/mapgen/mapgen_flat.cpp
diff --git a/src/mapgen_flat.h b/src/mapgen/mapgen_flat.h
index 635d40625..635d40625 100644
--- a/src/mapgen_flat.h
+++ b/src/mapgen/mapgen_flat.h
diff --git a/src/mapgen_fractal.cpp b/src/mapgen/mapgen_fractal.cpp
index b06885826..b06885826 100644
--- a/src/mapgen_fractal.cpp
+++ b/src/mapgen/mapgen_fractal.cpp
diff --git a/src/mapgen_fractal.h b/src/mapgen/mapgen_fractal.h
index be4941581..be4941581 100644
--- a/src/mapgen_fractal.h
+++ b/src/mapgen/mapgen_fractal.h
diff --git a/src/mapgen_singlenode.cpp b/src/mapgen/mapgen_singlenode.cpp
index ee8746b83..ee8746b83 100644
--- a/src/mapgen_singlenode.cpp
+++ b/src/mapgen/mapgen_singlenode.cpp
diff --git a/src/mapgen_singlenode.h b/src/mapgen/mapgen_singlenode.h
index 7678613e5..7678613e5 100644
--- a/src/mapgen_singlenode.h
+++ b/src/mapgen/mapgen_singlenode.h
diff --git a/src/mapgen_v5.cpp b/src/mapgen/mapgen_v5.cpp
index 5f5487288..5f5487288 100644
--- a/src/mapgen_v5.cpp
+++ b/src/mapgen/mapgen_v5.cpp
diff --git a/src/mapgen_v5.h b/src/mapgen/mapgen_v5.h
index 44b0a09e7..44b0a09e7 100644
--- a/src/mapgen_v5.h
+++ b/src/mapgen/mapgen_v5.h
diff --git a/src/mapgen_v6.cpp b/src/mapgen/mapgen_v6.cpp
index 6dcf834d2..6dcf834d2 100644
--- a/src/mapgen_v6.cpp
+++ b/src/mapgen/mapgen_v6.cpp
diff --git a/src/mapgen_v6.h b/src/mapgen/mapgen_v6.h
index 9c8794217..9c8794217 100644
--- a/src/mapgen_v6.h
+++ b/src/mapgen/mapgen_v6.h
diff --git a/src/mapgen_v7.cpp b/src/mapgen/mapgen_v7.cpp
index 404780158..404780158 100644
--- a/src/mapgen_v7.cpp
+++ b/src/mapgen/mapgen_v7.cpp
diff --git a/src/mapgen_v7.h b/src/mapgen/mapgen_v7.h
index 6fb7dc4bb..6fb7dc4bb 100644
--- a/src/mapgen_v7.h
+++ b/src/mapgen/mapgen_v7.h
diff --git a/src/mapgen_valleys.cpp b/src/mapgen/mapgen_valleys.cpp
index a13bb4582..a13bb4582 100644
--- a/src/mapgen_valleys.cpp
+++ b/src/mapgen/mapgen_valleys.cpp
diff --git a/src/mapgen_valleys.h b/src/mapgen/mapgen_valleys.h
index 7b5eb187d..7b5eb187d 100644
--- a/src/mapgen_valleys.h
+++ b/src/mapgen/mapgen_valleys.h
diff --git a/src/mg_biome.cpp b/src/mapgen/mg_biome.cpp
index 8dbb78e59..8dbb78e59 100644
--- a/src/mg_biome.cpp
+++ b/src/mapgen/mg_biome.cpp
diff --git a/src/mg_biome.h b/src/mapgen/mg_biome.h
index f45238f28..f45238f28 100644
--- a/src/mg_biome.h
+++ b/src/mapgen/mg_biome.h
diff --git a/src/mg_decoration.cpp b/src/mapgen/mg_decoration.cpp
index 2c2fbc647..2c2fbc647 100644
--- a/src/mg_decoration.cpp
+++ b/src/mapgen/mg_decoration.cpp
diff --git a/src/mg_decoration.h b/src/mapgen/mg_decoration.h
index 1ca632f25..1ca632f25 100644
--- a/src/mg_decoration.h
+++ b/src/mapgen/mg_decoration.h
diff --git a/src/mg_ore.cpp b/src/mapgen/mg_ore.cpp
index 979135ed4..979135ed4 100644
--- a/src/mg_ore.cpp
+++ b/src/mapgen/mg_ore.cpp
diff --git a/src/mg_ore.h b/src/mapgen/mg_ore.h
index e715f348b..e715f348b 100644
--- a/src/mg_ore.h
+++ b/src/mapgen/mg_ore.h
diff --git a/src/mg_schematic.cpp b/src/mapgen/mg_schematic.cpp
index 8874abd42..8874abd42 100644
--- a/src/mg_schematic.cpp
+++ b/src/mapgen/mg_schematic.cpp
diff --git a/src/mg_schematic.h b/src/mapgen/mg_schematic.h
index 069b594f1..069b594f1 100644
--- a/src/mg_schematic.h
+++ b/src/mapgen/mg_schematic.h
diff --git a/src/treegen.cpp b/src/mapgen/treegen.cpp
index 9e11b1a06..9e11b1a06 100644
--- a/src/treegen.cpp
+++ b/src/mapgen/treegen.cpp
diff --git a/src/treegen.h b/src/mapgen/treegen.h
index 8e5306560..8e5306560 100644
--- a/src/treegen.h
+++ b/src/mapgen/treegen.h
diff --git a/src/network/connectionthreads.h b/src/network/connectionthreads.h
index 15c247f76..ddac4ae20 100644
--- a/src/network/connectionthreads.h
+++ b/src/network/connectionthreads.h
@@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
#include <cassert>
-#include "../threading/thread.h"
+#include "threading/thread.h"
#include "connection.h"
namespace con
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 73661a7b6..a9ff1be44 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "tool.h"
#include "serverobject.h"
#include "porting.h"
-#include "mg_schematic.h"
+#include "mapgen/mg_schematic.h"
#include "noise.h"
#include "util/pointedthing.h"
#include "debug.h" // For FATAL_ERROR
diff --git a/src/script/cpp_api/s_env.cpp b/src/script/cpp_api/s_env.cpp
index 517892b03..170640ce0 100644
--- a/src/script/cpp_api/s_env.cpp
+++ b/src/script/cpp_api/s_env.cpp
@@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "common/c_converter.h"
#include "log.h"
#include "environment.h"
-#include "mapgen.h"
+#include "mapgen/mapgen.h"
#include "lua_api/l_env.h"
#include "server.h"
diff --git a/src/script/cpp_api/s_mainmenu.h b/src/script/cpp_api/s_mainmenu.h
index f89d5d889..aef36ce39 100644
--- a/src/script/cpp_api/s_mainmenu.h
+++ b/src/script/cpp_api/s_mainmenu.h
@@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "cpp_api/s_base.h"
#include "util/string.h"
-#include "../guiMainMenu.h"
+#include "gui/guiMainMenu.h"
class ScriptApiMainMenu : virtual public ScriptApiBase {
public:
diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp
index a3605be79..4e08c15d4 100644
--- a/src/script/lua_api/l_client.cpp
+++ b/src/script/lua_api/l_client.cpp
@@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "l_internal.h"
#include "lua_api/l_item.h"
#include "lua_api/l_nodemeta.h"
-#include "mainmenumanager.h"
+#include "gui/mainmenumanager.h"
#include "map.h"
#include "util/string.h"
#include "nodedef.h"
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp
index ca8b6bf13..f45a8da80 100644
--- a/src/script/lua_api/l_env.cpp
+++ b/src/script/lua_api/l_env.cpp
@@ -34,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "daynightratio.h"
#include "util/pointedthing.h"
#include "content_sao.h"
-#include "treegen.h"
+#include "mapgen/treegen.h"
#include "emerge.h"
#include "pathfinder.h"
#include "face_position_cache.h"
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index 9cc4533a8..cdb27fb60 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -21,17 +21,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "lua_api/l_internal.h"
#include "common/c_content.h"
#include "cpp_api/s_async.h"
-#include "guiEngine.h"
-#include "guiMainMenu.h"
-#include "guiKeyChangeMenu.h"
-#include "guiPathSelectMenu.h"
+#include "gui/guiEngine.h"
+#include "gui/guiMainMenu.h"
+#include "gui/guiKeyChangeMenu.h"
+#include "gui/guiPathSelectMenu.h"
#include "subgame.h"
#include "version.h"
#include "porting.h"
#include "filesys.h"
#include "convert_json.h"
#include "serverlist.h"
-#include "mapgen.h"
+#include "mapgen/mapgen.h"
#include "settings.h"
#include <IFileArchive.h>
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index 9ec4d5002..01f9d1c41 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -27,12 +27,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "server.h"
#include "environment.h"
#include "emerge.h"
-#include "mg_biome.h"
-#include "mg_ore.h"
-#include "mg_decoration.h"
-#include "mg_schematic.h"
-#include "mapgen_v5.h"
-#include "mapgen_v7.h"
+#include "mapgen/mg_biome.h"
+#include "mapgen/mg_ore.h"
+#include "mapgen/mg_decoration.h"
+#include "mapgen/mg_schematic.h"
+#include "mapgen/mapgen_v5.h"
+#include "mapgen/mapgen_v7.h"
#include "filesys.h"
#include "settings.h"
#include "log.h"
diff --git a/src/script/lua_api/l_sound.cpp b/src/script/lua_api/l_sound.cpp
index 07ce36daa..e7d517ce0 100644
--- a/src/script/lua_api/l_sound.cpp
+++ b/src/script/lua_api/l_sound.cpp
@@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "l_sound.h"
#include "l_internal.h"
#include "common/c_content.h"
-#include "guiEngine.h"
+#include "gui/guiEngine.h"
int ModApiSound::l_sound_play(lua_State *L)
diff --git a/src/script/lua_api/l_vmanip.cpp b/src/script/lua_api/l_vmanip.cpp
index a84ecfc0f..ca837b655 100644
--- a/src/script/lua_api/l_vmanip.cpp
+++ b/src/script/lua_api/l_vmanip.cpp
@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "map.h"
#include "mapblock.h"
#include "server.h"
-#include "mapgen.h"
+#include "mapgen/mapgen.h"
#include "voxelalgorithms.h"
// garbage collector
diff --git a/src/server.cpp b/src/server.cpp
index b7627f6cd..98c3eca9a 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -44,8 +44,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "itemdef.h"
#include "craftdef.h"
#include "emerge.h"
-#include "mapgen.h"
-#include "mg_biome.h"
+#include "mapgen/mapgen.h"
+#include "mapgen/mg_biome.h"
#include "content_mapnode.h"
#include "content_nodemeta.h"
#include "content_sao.h"
@@ -61,7 +61,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/base64.h"
#include "util/sha1.h"
#include "util/hex.h"
-#include "database.h"
+#include "database/database.h"
#include "chatmessage.h"
#include "chat_interface.h"
#include "remoteplayer.h"
diff --git a/src/serverenvironment.cpp b/src/serverenvironment.cpp
index aed1dc22f..f68f2a27d 100644
--- a/src/serverenvironment.cpp
+++ b/src/serverenvironment.cpp
@@ -37,11 +37,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "threading/mutex_auto_lock.h"
#include "filesys.h"
#include "gameparams.h"
-#include "database-dummy.h"
-#include "database-files.h"
-#include "database-sqlite3.h"
+#include "database/database-dummy.h"
+#include "database/database-files.h"
+#include "database/database-sqlite3.h"
#if USE_POSTGRESQL
-#include "database-postgresql.h"
+#include "database/database-postgresql.h"
#endif
#include <algorithm>
diff --git a/src/subgame.cpp b/src/subgame.cpp
index eb2ea01c1..f5ff870fb 100644
--- a/src/subgame.cpp
+++ b/src/subgame.cpp
@@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#include "util/strfnd.h"
#include "defaultsettings.h" // for override_default_settings
-#include "mapgen.h" // for MapgenParams
+#include "mapgen/mapgen.h" // for MapgenParams
#include "util/string.h"
#ifndef SERVER
diff --git a/src/unittest/test_map_settings_manager.cpp b/src/unittest/test_map_settings_manager.cpp
index 4f5ac80f2..0a5c971b9 100644
--- a/src/unittest/test_map_settings_manager.cpp
+++ b/src/unittest/test_map_settings_manager.cpp
@@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "noise.h"
#include "settings.h"
-#include "mapgen_v5.h"
+#include "mapgen/mapgen_v5.h"
#include "util/sha1.h"
#include "map_settings_manager.h"
diff --git a/src/unittest/test_schematic.cpp b/src/unittest/test_schematic.cpp
index 3fea44829..2e2417a3b 100644
--- a/src/unittest/test_schematic.cpp
+++ b/src/unittest/test_schematic.cpp
@@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "test.h"
-#include "mg_schematic.h"
+#include "mapgen/mg_schematic.h"
#include "gamedef.h"
#include "nodedef.h"
diff --git a/src/util/container.h b/src/util/container.h
index 81f085017..2ad2bbfc7 100644
--- a/src/util/container.h
+++ b/src/util/container.h
@@ -19,10 +19,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
-#include "../irrlichttypes.h"
-#include "../exceptions.h"
-#include "../threading/mutex_auto_lock.h"
-#include "../threading/semaphore.h"
+#include "irrlichttypes.h"
+#include "exceptions.h"
+#include "threading/mutex_auto_lock.h"
+#include "threading/semaphore.h"
#include <list>
#include <vector>
#include <map>
diff --git a/src/util/directiontables.h b/src/util/directiontables.h
index 97e18343a..ef00e3bfe 100644
--- a/src/util/directiontables.h
+++ b/src/util/directiontables.h
@@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
-#include "../irrlichttypes.h"
-#include "../irr_v3d.h"
+#include "irrlichttypes.h"
+#include "irr_v3d.h"
extern const v3s16 g_6dirs[6];
diff --git a/src/util/numeric.cpp b/src/util/numeric.cpp
index a48a72a8a..ebc81185f 100644
--- a/src/util/numeric.cpp
+++ b/src/util/numeric.cpp
@@ -20,9 +20,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "numeric.h"
#include "log.h"
-#include "../constants.h" // BS, MAP_BLOCKSIZE
-#include "../noise.h" // PseudoRandom, PcgRandom
-#include "../threading/mutex_auto_lock.h"
+#include "constants.h" // BS, MAP_BLOCKSIZE
+#include "noise.h" // PseudoRandom, PcgRandom
+#include "threading/mutex_auto_lock.h"
#include <cstring>
diff --git a/src/util/numeric.h b/src/util/numeric.h
index f09c4e9f5..347e7a49e 100644
--- a/src/util/numeric.h
+++ b/src/util/numeric.h
@@ -20,10 +20,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
#include "basic_macros.h"
-#include "../irrlichttypes.h"
-#include "../irr_v2d.h"
-#include "../irr_v3d.h"
-#include "../irr_aabb3d.h"
+#include "irrlichttypes.h"
+#include "irr_v2d.h"
+#include "irr_v3d.h"
+#include "irr_aabb3d.h"
#define rangelim(d, min, max) ((d) < (min) ? (min) : ((d) > (max) ? (max) : (d)))
#define myfloor(x) ((x) < 0.0 ? (int)(x) - 1 : (int)(x))
diff --git a/src/util/pointedthing.cpp b/src/util/pointedthing.cpp
index e5c5dcf4c..c5961d56e 100644
--- a/src/util/pointedthing.cpp
+++ b/src/util/pointedthing.cpp
@@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "pointedthing.h"
#include "serialize.h"
-#include "../exceptions.h"
+#include "exceptions.h"
#include <sstream>
PointedThing::PointedThing(const v3s16 &under, const v3s16 &above,
diff --git a/src/util/pointedthing.h b/src/util/pointedthing.h
index bd95ef1f3..4c4c04234 100644
--- a/src/util/pointedthing.h
+++ b/src/util/pointedthing.h
@@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
-#include "../irrlichttypes.h"
-#include "../irr_v3d.h"
+#include "irrlichttypes.h"
+#include "irr_v3d.h"
#include <iostream>
#include <string>
diff --git a/src/util/pointer.h b/src/util/pointer.h
index 59b6f5216..d29ec8739 100644
--- a/src/util/pointer.h
+++ b/src/util/pointer.h
@@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
-#include "../irrlichttypes.h"
-#include "../debug.h" // For assert()
+#include "irrlichttypes.h"
+#include "debug.h" // For assert()
#include <cstring>
template <typename T>
diff --git a/src/util/serialize.cpp b/src/util/serialize.cpp
index a272d82ee..53c7c2add 100644
--- a/src/util/serialize.cpp
+++ b/src/util/serialize.cpp
@@ -21,8 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "pointer.h"
#include "porting.h"
#include "util/string.h"
-#include "../exceptions.h"
-#include "../irrlichttypes.h"
+#include "exceptions.h"
+#include "irrlichttypes.h"
#include <sstream>
#include <iomanip>
diff --git a/src/util/serialize.h b/src/util/serialize.h
index f2b0dab2f..89bc0b097 100644
--- a/src/util/serialize.h
+++ b/src/util/serialize.h
@@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
-#include "../irrlichttypes_bloated.h"
-#include "../exceptions.h" // for SerializationError
-#include "../debug.h" // for assert
+#include "irrlichttypes_bloated.h"
+#include "exceptions.h" // for SerializationError
+#include "debug.h" // for assert
#include "config.h"
#if HAVE_ENDIAN_H
diff --git a/src/util/string.cpp b/src/util/string.cpp
index bb2d2f6a7..3eabcbe11 100644
--- a/src/util/string.cpp
+++ b/src/util/string.cpp
@@ -23,8 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#include "hex.h"
-#include "../porting.h"
-#include "../translation.h"
+#include "porting.h"
+#include "translation.h"
#include <algorithm>
#include <sstream>
diff --git a/src/util/thread.h b/src/util/thread.h
index 5338dad03..73e9beb80 100644
--- a/src/util/thread.h
+++ b/src/util/thread.h
@@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
-#include "../irrlichttypes.h"
-#include "../threading/thread.h"
-#include "../threading/mutex_auto_lock.h"
+#include "irrlichttypes.h"
+#include "threading/thread.h"
+#include "threading/mutex_auto_lock.h"
#include "porting.h"
#include "log.h"
#include "container.h"
diff --git a/src/util/timetaker.cpp b/src/util/timetaker.cpp
index 6079e5cca..717449c6d 100644
--- a/src/util/timetaker.cpp
+++ b/src/util/timetaker.cpp
@@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "timetaker.h"
-#include "../porting.h"
-#include "../log.h"
+#include "porting.h"
+#include "log.h"
#include <ostream>
TimeTaker::TimeTaker(const std::string &name, u64 *result, TimePrecision prec)
diff --git a/src/util/timetaker.h b/src/util/timetaker.h
index 2988e8133..bc3d4a88d 100644
--- a/src/util/timetaker.h
+++ b/src/util/timetaker.h
@@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#pragma once
-#include "../irrlichttypes.h"
-#include "../gettime.h"
+#include "irrlichttypes.h"
+#include "gettime.h"
/*
TimeTaker