Cleanup various headers to reduce compilation times (#6255)
authorLoïc Blot <nerzhul@users.noreply.github.com>
Wed, 16 Aug 2017 20:11:45 +0000 (22:11 +0200)
committerGitHub <noreply@github.com>
Wed, 16 Aug 2017 20:11:45 +0000 (22:11 +0200)
* Cleanup various headers to reduce compilation times

51 files changed:
src/ban.h
src/camera.cpp
src/camera.h
src/client.cpp
src/client.h
src/client/inputhandler.h
src/client/renderingengine.cpp
src/clientenvironment.cpp
src/clientenvironment.h
src/clientiface.cpp
src/clientiface.h
src/content_cao.cpp
src/content_mapblock.h
src/environment.h
src/game.cpp
src/gettext.h
src/guiKeyChangeMenu.h
src/guiPasswordChange.cpp
src/guiPasswordChange.h
src/guiVolumeChange.h
src/irrlichttypes.h
src/localplayer.h
src/main.cpp
src/mapblock_mesh.cpp
src/mg_ore.cpp
src/minimap.cpp
src/minimap.h
src/network/clientopcodes.h
src/network/connection.cpp
src/network/connection.h
src/network/networkpacket.cpp
src/network/networkpacket.h
src/network/serveropcodes.h
src/nodedef.h
src/noise.h
src/script/cpp_api/s_async.h
src/script/cpp_api/s_base.h
src/script/cpp_api/s_internal.h
src/script/lua_api/l_base.h
src/script/lua_api/l_camera.cpp
src/script/lua_api/l_client.cpp
src/script/lua_api/l_env.cpp
src/script/lua_api/l_localplayer.cpp
src/script/lua_api/l_minimap.cpp
src/server.cpp
src/server.h
src/serverenvironment.h
src/terminal_chat_console.cpp
src/terminal_chat_console.h
src/unittest/test.cpp
src/unittest/test_connection.cpp

index 35bf10abb8d5ed4015128cbdc9c517b979f6498d..44cc94e6ea2f257a707624a92d4ff0e7a89196c9 100644 (file)
--- a/src/ban.h
+++ b/src/ban.h
@@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 class BanManager
 {
 public:
-       BanManager(const std::string &bannfilepath);
+       BanManager(const std::string &banfilepath);
        ~BanManager();
        void load();
        void save();
index 7406aba0323533402b7ddf46009a84e6912e0244..b7aed5d748fda67dc330d4d40f8194f4af7189d9 100644 (file)
@@ -283,8 +283,7 @@ void Camera::addArmInertia(f32 player_yaw)
        }
 }
 
-void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
-               f32 tool_reload_ratio, ClientEnvironment &c_env)
+void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, f32 tool_reload_ratio)
 {
        // Get player position
        // Smooth the movement when walking up stairs
@@ -408,19 +407,19 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
 
                // Calculate new position
                bool abort = false;
-               for (int i = BS; i <= BS*2.75; i++)
-               {
-                       my_cp.X = m_camera_position.X + m_camera_direction.X*-i;
-                       my_cp.Z = m_camera_position.Z + m_camera_direction.Z*-i;
+               for (int i = BS; i <= BS * 2.75; i++) {
+                       my_cp.X = m_camera_position.X + m_camera_direction.X * -i;
+                       my_cp.Z = m_camera_position.Z + m_camera_direction.Z * -i;
                        if (i > 12)
-                               my_cp.Y = m_camera_position.Y + (m_camera_direction.Y*-i);
+                               my_cp.Y = m_camera_position.Y + (m_camera_direction.Y * -i);
 
                        // Prevent camera positioned inside nodes
                        INodeDefManager *nodemgr = m_client->ndef();
-                       MapNode n = c_env.getClientMap().getNodeNoEx(floatToInt(my_cp, BS));
+                       MapNode n = m_client->getEnv().getClientMap()
+                               .getNodeNoEx(floatToInt(my_cp, BS));
+
                        const ContentFeatures& features = nodemgr->get(n);
-                       if(features.walkable)
-                       {
+                       if (features.walkable) {
                                my_cp.X += m_camera_direction.X*-1*-BS/2;
                                my_cp.Z += m_camera_direction.Z*-1*-BS/2;
                                my_cp.Y += m_camera_direction.Y*-1*-BS/2;
index 052284cace32970e799b26879e32e6b4059a5cec..ce80fa9f8bef834df884c17fe3a82e2179fa864c 100644 (file)
@@ -24,13 +24,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "inventory.h"
 #include "mesh.h"
 #include "client/tile.h"
-#include "util/numeric.h"
 #include <ICameraSceneNode.h>
 #include <ISceneNode.h>
 #include <list>
 
-#include "client.h"
-
 class LocalPlayer;
 struct MapDrawControl;
 class Client;
@@ -120,7 +117,7 @@ public:
        // Update the camera from the local player's position.
        // busytime is used to adjust the viewing range.
        void update(LocalPlayer* player, f32 frametime, f32 busytime,
-                       f32 tool_reload_ratio, ClientEnvironment &c_env);
+                       f32 tool_reload_ratio);
 
        // Update render distance
        void updateViewingRange();
index 402418ea2a9c129d3ee07bfa66864ed56b859e7a..dc8e0d4e2cc38de7f0ed8ce1318190c7b2a3be69 100644 (file)
@@ -22,6 +22,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <sstream>
 #include <cmath>
 #include <IFileSystem.h>
+#include "client.h"
+#include "network/clientopcodes.h"
+#include "network/networkpacket.h"
 #include "threading/mutex_auto_lock.h"
 #include "client/renderingengine.h"
 #include "util/auth.h"
@@ -30,8 +33,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "util/serialize.h"
 #include "util/string.h"
 #include "util/srp.h"
-#include "client.h"
-#include "network/clientopcodes.h"
 #include "filesys.h"
 #include "mapblock_mesh.h"
 #include "mapblock.h"
index 05f3ab9ea4e22898a69c661a6550319b90e607d6..121f825b9cf4c320b341febd216a87be8cd20490 100644 (file)
@@ -38,7 +38,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "tileanimation.h"
 #include "mesh_generator_thread.h"
 #include <fstream>
-#include "filesys.h"
 
 #define CLIENT_CHAT_MESSAGE_LIMIT_PER_10S 10.0f
 
index bc8251887565f6852ae42799c39229ff8decf502..f14e7d8018e258573e7cb4e51506a057bc1a1695 100644 (file)
@@ -247,8 +247,8 @@ public:
                }
 
                return m_mousepos;
-
        }
+
        virtual void setMousePos(s32 x, s32 y)
        {
                if (RenderingEngine::get_raw_device()->getCursorControl()) {
index 21af8948a907f818f0463afdf49fc2f87c24ac62..7058711600f29e4b6db2f9d7d55aae73b6b337e3 100644 (file)
@@ -21,10 +21,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <IrrlichtDevice.h>
 #include <irrlicht.h>
 #include "fontengine.h"
+#include "client.h"
 #include "clouds.h"
 #include "util/numeric.h"
 #include "guiscalingfilter.h"
 #include "hud.h"
+#include "localplayer.h"
 #include "camera.h"
 #include "minimap.h"
 #include "clientmap.h"
index 9abb6a23d6975d796539f58724e4a35d4dc10dc6..c98b5fc9020a24eaa764bed022b1816e66fe361d 100644 (file)
@@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "util/serialize.h"
 #include "util/pointedthing.h"
+#include "client.h"
 #include "clientenvironment.h"
 #include "clientsimpleobject.h"
 #include "clientmap.h"
index 070ff95fbae37cff588f806de2d25730e11da1d2..35dca5718c411c1222c0a3571fccee30f8b5a3c7 100644 (file)
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <ISceneManager.h>
 #include "environment.h"
 #include "clientobject.h"
+#include "util/numeric.h"
 
 class ClientSimpleObject;
 class ClientMap;
index fdabcc7839fadc56813a770943fa738e883ccf3c..cdb64e19226dcb602c2ac3318a23ad472905af41 100644 (file)
@@ -18,18 +18,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include <sstream>
-
 #include "clientiface.h"
+#include "network/connection.h"
+#include "network/serveropcodes.h"
 #include "remoteplayer.h"
 #include "settings.h"
 #include "mapblock.h"
-#include "network/connection.h"
 #include "serverenvironment.h"
 #include "map.h"
 #include "emerge.h"
 #include "content_sao.h"              // TODO this is used for cleanup of only
 #include "log.h"
-#include "network/serveropcodes.h"
 #include "util/srp.h"
 #include "face_position_cache.h"
 
index ce74cfeced0ee42b4fa64278f5d0312dde9f5ccd..edc389cbb2a3ecd7a06692ee7eebb97031beac94 100644 (file)
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "constants.h"
 #include "serialization.h"             // for SER_FMT_VER_INVALID
 #include "network/networkpacket.h"
+#include "network/networkprotocol.h"
 #include "porting.h"
 
 #include <list>
index 771820cb09c1003cc5c1a61dab10d15b4f4b47bf..90f08f366d84ef4b91a3184efd843226f965ab49 100644 (file)
@@ -41,6 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "localplayer.h"
 #include "map.h"
 #include "camera.h" // CameraModes
+#include "client.h"
 #include "wieldmesh.h"
 #include <algorithm>
 #include "client/renderingengine.h"
index 51c5fc6ea70cb1bf3009a2eb82731700e6233b87..d1c8c7caf3e95376a4242bdf1e8934143f949d32 100644 (file)
@@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #ifndef CONTENT_MAPBLOCK_HEADER
 #define CONTENT_MAPBLOCK_HEADER
-#include "util/numeric.h"
+
 #include "nodedef.h"
 #include <IMeshManipulator.h>
 
index 1b1cfc50a7091ab0ca1243897b71b7da22efdc48..6c45592dc12103d376eee9d4038cd81e992f0500 100644 (file)
@@ -36,9 +36,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <atomic>
 #include <mutex>
 #include "irr_v3d.h"
-#include "activeobject.h"
-#include "util/numeric.h"
 #include "network/networkprotocol.h" // for AccessDeniedCode
+#include "util/basic_macros.h"
 
 class IGameDef;
 class Map;
index 4588e21e0cf992b4d62197636ff9dd5e56507471..cdbd9230106ccfaf2bb8afaa200a469ad9015cda 100644 (file)
@@ -3445,8 +3445,7 @@ void Game::updateCamera(u32 busy_time, f32 dtime)
        float tool_reload_ratio = runData.time_from_last_punch / full_punch_interval;
 
        tool_reload_ratio = MYMIN(tool_reload_ratio, 1.0);
-       camera->update(player, dtime, busy_time / 1000.0f, tool_reload_ratio,
-                     client->getEnv());
+       camera->update(player, dtime, busy_time / 1000.0f, tool_reload_ratio);
        camera->step(dtime);
 
        v3f camera_position = camera->getPosition();
index 885d7ca2da165691cf5e1c38a2394b175cd26d87..b87bdd9cc3a523d4d76b605e0ad0acb3ced24400 100644 (file)
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define GETTEXT_HEADER
 
 #include "config.h" // for USE_GETTEXT
+#include <string>
 
 #if USE_GETTEXT
        #include <libintl.h>
index 84d3fffcd927850c079d26ec28f86a70a3070255..84807c79f36783bd0782fd0621b3c214d270d54d 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "irrlichttypes_extrabloated.h"
 #include "modalMenu.h"
-#include "client.h"
 #include "gettext.h"
 #include "keycode.h"
 #include <string>
index ce1b66fd04ac8df84dc0f56603fd945573638cb6..69db4e6b22d8046cd1a95bdb77a86eb6d491f497 100644 (file)
@@ -17,9 +17,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
 
 #include "guiPasswordChange.h"
-#include "debug.h"
-#include "serialization.h"
-#include <string>
+#include "client.h"
 #include <IGUICheckBox.h>
 #include <IGUIEditBox.h>
 #include <IGUIButton.h>
index d9d21e7c4223244c9dfb315420bfcf94b4620a47..bb678fe2c0977cd117e3f3de0e7059279aa8b1ab 100644 (file)
@@ -21,9 +21,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 #include "irrlichttypes_extrabloated.h"
 #include "modalMenu.h"
-#include "client.h"
 #include <string>
 
+class Client;
+
 class GUIPasswordChange : public GUIModalMenu
 {
 public:
index 98731c6737273d68b17ec6459c6171be33d08857..0a743dcdb12ecbd61a309f60af53353304050fa5 100644 (file)
@@ -22,7 +22,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 #include "irrlichttypes_extrabloated.h"
 #include "modalMenu.h"
-#include "client.h"
 #include <string>
 
 class GUIVolumeChange : public GUIModalMenu
@@ -32,7 +31,7 @@ public:
                        gui::IGUIElement* parent, s32 id,
                        IMenuManager *menumgr);
        ~GUIVolumeChange();
-       
+
        void removeChildren();
        /*
                Remove and re-add (or reposition) stuff
@@ -42,7 +41,7 @@ public:
        void drawMenu();
 
        bool OnEvent(const SEvent& event);
-       
+
        bool pausesGame() { return true; }
 };
 
index dedebd45b4a87c67bceecbb6ba6413a572644a13..33bfa9ee953b4d5ef85943703c8000107d64fc10 100644 (file)
@@ -28,7 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
  *       regardless of the compiler.
  */
 #ifndef _MSC_VER
-#      include <stdint.h>
+#      include <cstdint>
 #endif
 
 #include <irrTypes.h>
index ffaa83f33667e1f7a8785e755f53a39e027cf3e4..5c52a9c0e9caae0f1679bbe1e466db8bdffaa535 100644 (file)
@@ -144,7 +144,9 @@ public:
        void setCollisionbox(const aabb3f &box) { m_collisionbox = box; }
 
 private:
+       // clang-format off
        void accelerateHorizontal(const v3f &target_speed, f32 max_increase, bool slippery);
+       // clang-format on
        void accelerateVertical(const v3f &target_speed, const f32 max_increase);
        bool updateSneakNode(Map *map, const v3f &position, const v3f &sneak_max);
 
index b9530c55ec586940823a962bc3270666212b37a1..ee391cf68d725341002d42f1efa627f12079b40e 100644 (file)
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "mainmenumanager.h"
 #include "irrlichttypes_extrabloated.h"
+#include "chat_interface.h"
 #include "debug.h"
 #include "unittest/test.h"
 #include "server.h"
@@ -34,10 +35,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "quicktune.h"
 #include "httpfetch.h"
 #include "guiEngine.h"
-#include "map.h"
-#include "player.h"
-#include "mapsector.h"
-#include "fontengine.h"
 #include "gameparams.h"
 #include "database.h"
 #include "config.h"
@@ -47,7 +44,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #endif
 #ifndef SERVER
 #include "client/clientlauncher.h"
-
 #endif
 
 #ifdef HAVE_TOUCHSCREENGUI
index 67195cab3696469a35972f9a085af0706979b4dc..5ab96a156c2fb44b7a8274ac9e9219a380dc5d29 100644 (file)
@@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "mapblock_mesh.h"
+#include "client.h"
 #include "mapblock.h"
 #include "map.h"
 #include "profiler.h"
index 36100f762ac80183542bb0544d28205398566139..044d58db888de64829c54dd19d0a8370030bf989 100644 (file)
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "noise.h"
 #include "map.h"
 #include "log.h"
+#include "util/numeric.h"
 #include <algorithm>
 
 
index 71a4c9c67874f7fa05f0d133847101a7dcc0b321..dab5f3aa5c9bb5e236744e03bc1765877e7640f3 100644 (file)
@@ -18,16 +18,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "minimap.h"
-#include "threading/mutex_auto_lock.h"
-#include "threading/semaphore.h"
+#include "client.h"
 #include "clientmap.h"
 #include "settings.h"
-#include "nodedef.h"
-#include "porting.h"
-#include "util/numeric.h"
-#include "util/string.h"
 #include "mapblock.h"
-#include <math.h>
 #include "client/renderingengine.h"
 
 
@@ -37,16 +31,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 MinimapUpdateThread::~MinimapUpdateThread()
 {
-       for (std::map<v3s16, MinimapMapblock *>::iterator
-                       it = m_blocks_cache.begin();
-                       it != m_blocks_cache.end(); ++it) {
-               delete it->second;
+       for (auto &it : m_blocks_cache) {
+               delete it.second;
        }
 
-       for (std::deque<QueuedMinimapUpdate>::iterator
-                       it = m_update_queue.begin();
-                       it != m_update_queue.end(); ++it) {
-               QueuedMinimapUpdate &q = *it;
+       for (auto &q : m_update_queue) {
                delete q.data;
        }
 }
index 01eafbe595070ba5b3278b57c7dd041ee709a4d3..f087dbfab64e4379d55ea21debc0882ed529f9b6 100644 (file)
@@ -21,18 +21,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define MINIMAP_HEADER
 
 #include "irrlichttypes_extrabloated.h"
-#include "client.h"
+#include "util/thread.h"
 #include "voxel.h"
-#include "threading/semaphore.h"
 #include <map>
 #include <string>
 #include <vector>
-#include "camera.h"
+
+class Client;
+class ITextureSource;
+class IShaderSource;
 
 #define MINIMAP_MAX_SX 512
 #define MINIMAP_MAX_SY 512
 
-
 enum MinimapMode {
        MINIMAP_MODE_OFF,
        MINIMAP_MODE_SURFACEx1,
index 43a93bb4f11016e1874953fb6380c9da2ce59449..789c9c0bb906b45417863596e9680373c76f9323 100644 (file)
@@ -23,7 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "client.h"
 #include "networkprotocol.h"
-#include "networkpacket.h"
+
+class NetworkPacket;
 
 enum ToClientConnectionState {
        TOCLIENT_STATE_NOT_CONNECTED,
index d1ab948db8db5bc0426aa999341908f99da34d50..c93971cac6660ffcc917ca2981ea8a313e5f165d 100644 (file)
@@ -563,6 +563,20 @@ void IncomingSplitBuffer::removeUnreliableTimedOuts(float dtime, float timeout)
        }
 }
 
+/*
+       ConnectionCommand
+ */
+
+void ConnectionCommand::send(u16 peer_id_, u8 channelnum_, NetworkPacket *pkt,
+       bool reliable_)
+{
+       type = CONNCMD_SEND;
+       peer_id = peer_id_;
+       channelnum = channelnum_;
+       data = pkt->oldForgePacket();
+       reliable = reliable_;
+}
+
 /*
        Channel
 */
index 289c791259a6f403618771ed4886bec742ea54b6..3dc87b489eaf4995844703aa5a2efb4eeecd8222 100644 (file)
@@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "socket.h"
 #include "exceptions.h"
 #include "constants.h"
-#include "network/networkpacket.h"
 #include "util/pointer.h"
 #include "util/container.h"
 #include "util/thread.h"
@@ -433,15 +432,8 @@ struct ConnectionCommand
                type = CONNCMD_DISCONNECT_PEER;
                peer_id = peer_id_;
        }
-       void send(u16 peer_id_, u8 channelnum_,
-                       NetworkPacket* pkt, bool reliable_)
-       {
-               type = CONNCMD_SEND;
-               peer_id = peer_id_;
-               channelnum = channelnum_;
-               data = pkt->oldForgePacket();
-               reliable = reliable_;
-       }
+
+       void send(u16 peer_id_, u8 channelnum_, NetworkPacket* pkt, bool reliable_);
 
        void ack(u16 peer_id_, u8 channelnum_, const SharedBuffer<u8> &data_)
        {
index 78c73d253183652e80f3f0a710c6de8b5470a37d..ab7ddfb57173bfc76b5d34faafa3b059be0edc5a 100644 (file)
@@ -18,7 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "networkpacket.h"
-#include "debug.h"
+#include <sstream>
 #include "exceptions.h"
 #include "util/serialize.h"
 
index 7eb8cc3ff4d6961c4836611ae8647d5143de0bea..40a20eb2e6483098375392b5a16a0eef9b0ad28f 100644 (file)
@@ -20,9 +20,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef NETWORKPACKET_HEADER
 #define NETWORKPACKET_HEADER
 
+#include <SColor.h>
 #include "util/pointer.h"
 #include "util/numeric.h"
-#include "networkprotocol.h"
 
 class NetworkPacket
 {
index 72323ae2476c429616390a9f8663e1fa6797d386..296b7d471083fc281d5dbcf77a42c57f597f01c7 100644 (file)
@@ -23,7 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "server.h"
 #include "networkprotocol.h"
-#include "networkpacket.h"
+
+class NetworkPacket;
 
 enum ToServerConnectionState {
        TOSERVER_STATE_NOT_CONNECTED,
index 66296016af4a0b21d374112d8d3325f4821b5705..6ae7294092372ea2565d24933786d9ac7f1efce4 100644 (file)
@@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <iostream>
 #include <map>
 #include <list>
-#include "util/numeric.h"
 #include "mapnode.h"
 #ifndef SERVER
 #include "client/tile.h"
index d5aca4def899666619c5bb32697fd3faa0ad5637..53cab5754def2ad26ff709a064b5d5d81b9971e3 100644 (file)
@@ -111,7 +111,7 @@ struct NoiseParams {
        float lacunarity = 2.0f;
        u32 flags = NOISE_FLAG_DEFAULTS;
 
-       NoiseParams() {}
+       NoiseParams() = default;
 
        NoiseParams(float offset_, float scale_, v3f spread_, s32 seed_,
                u16 octaves_, float persist_, float lacunarity_,
index 94b55db6e5a23cf2f72f0176671a043cdc7bd944..aa1559ed1d1681d257e8c79e143ef2dbadcb9ad1 100644 (file)
@@ -24,8 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <deque>
 #include <map>
 
-#include "threading/thread.h"
 #include "threading/semaphore.h"
+#include "threading/thread.h"
 #include "debug.h"
 #include "lua.h"
 #include "cpp_api/s_base.h"
@@ -39,7 +39,7 @@ class AsyncEngine;
 // Data required to queue a job
 struct LuaJobInfo
 {
-       LuaJobInfo() {};
+       LuaJobInfo() = default;
 
        // Function to be called in async environment
        std::string serializedFunction = "";
index 28fefdd3796f587c4a0010e5bf42b006124a4b12..ff92bdf939b23f018cf7cef2667c14396abf2408 100644 (file)
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <iostream>
 #include <string>
 #include <thread>
+#include <mutex>
 #include "util/basic_macros.h"
 
 extern "C" {
@@ -30,7 +31,6 @@ extern "C" {
 }
 
 #include "irrlichttypes.h"
-#include "threading/mutex_auto_lock.h"
 #include "common/c_types.h"
 #include "common/c_internal.h"
 
index 315561e088df601600771c8de33cf2a06121073a..b493cb6fa9cd3cb679df8e5386c3623a705d70eb 100644 (file)
@@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <thread>
 #include "common/c_internal.h"
 #include "cpp_api/s_base.h"
+#include "threading/mutex_auto_lock.h"
 
 #ifdef SCRIPTAPI_LOCK_DEBUG
 #include "debug.h" // assert()
index af89afd931e179bf6c5fa614cc1c227f6297acc0..e9b28b36a6fa7af796f84c6b90c01a85614fac88 100644 (file)
@@ -30,7 +30,7 @@ extern "C" {
 }
 
 #ifndef SERVER
-#include "client.h"
+class Client;
 #endif
 
 class ScriptApiBase;
index ef842a222633d8530f854e310a5d2cee1bbf3e8f..49622df00a20db178c95a7c06f65786392769068 100644 (file)
@@ -3,6 +3,7 @@
 #include "l_internal.h"
 #include "content_cao.h"
 #include "camera.h"
+#include "client.h"
 
 LuaCamera::LuaCamera(Camera *m) : m_camera(m)
 {
index 6f9240466994870d5d96f140de92bec5b25525d4..81dfdb1e98d9699a57a6f8a0e221fa36c6061d2c 100644 (file)
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "l_client.h"
 #include "chatmessage.h"
+#include "client.h"
 #include "clientenvironment.h"
 #include "common/c_content.h"
 #include "common/c_converter.h"
index 2a57ca59bc303c60ff0d95ee8e71feae4aa06629..9a2ce334b70cf1d0be0bae53984e844d7bb91d43 100644 (file)
@@ -37,6 +37,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "emerge.h"
 #include "pathfinder.h"
 #include "face_position_cache.h"
+#ifndef SERVER
+#include "client.h"
+#endif
 
 struct EnumString ModApiEnvMod::es_ClearObjectsMode[] =
 {
index 7f932cbca2b86082412dc2c76c5e19bc0248e94c..da560c3acb630cfdbd6e81508640deeff73695b0 100644 (file)
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "l_localplayer.h"
 #include "l_internal.h"
 #include "script/common/c_converter.h"
+#include "localplayer.h"
 
 LuaLocalPlayer::LuaLocalPlayer(LocalPlayer *m) : m_localplayer(m)
 {
index be981c88449546c59207ca122e87f15faefbc72d..b59e790958de44f382a3577d6268a76b37760521 100644 (file)
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "lua_api/l_minimap.h"
 #include "lua_api/l_internal.h"
 #include "common/c_converter.h"
+#include "client.h"
 #include "minimap.h"
 #include "settings.h"
 
index 4ccac57486e7befcf038c1bc00ad7afe0b765ea2..41493a8628586bc0b7df1bb347c2302672a31362 100644 (file)
@@ -61,6 +61,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "util/hex.h"
 #include "database.h"
 #include "chatmessage.h"
+#include "chat_interface.h"
 
 class ClientNotFoundException : public BaseException
 {
index ac7ba4f619a817bd7091d129a91f3400a72cdf76..aae589f9af05bf06996b6abc87647230bccd00ff 100644 (file)
@@ -34,16 +34,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "util/thread.h"
 #include "util/basic_macros.h"
 #include "serverenvironment.h"
-#include "chat_interface.h"
 #include "clientiface.h"
 #include "remoteplayer.h"
-#include "network/networkpacket.h"
 #include "chatmessage.h"
 #include <string>
 #include <list>
 #include <map>
 #include <vector>
 
+class ChatEvent;
+struct ChatEventChat;
+struct ChatInterface;
 class IWritableItemDefManager;
 class IWritableNodeDefManager;
 class IWritableCraftDefManager;
index 4cfe7f7d646ee44404e454313500f0e28a694852..c9f80a4c4931f656151a1d5f33fd27ff4d4d398b 100644 (file)
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "environment.h"
 #include "mapnode.h"
 #include "mapblock.h"
+#include "activeobject.h"
 #include <set>
 
 class IGameDef;
index a8c4ebaef1a8926e559f06ae534567b46fe8c3f1..222c086466679cba9c52978c9f4eaba7c10c3e12 100644 (file)
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "settings.h"
 #include "util/numeric.h"
 #include "util/string.h"
+#include "chat_interface.h"
 
 TerminalChatConsole g_term_console;
 
index 8f6abe29524766a7e480d33c9f00172e91ca214b..b656f887272dd43950f59aa7d5b193663f53d56b 100644 (file)
@@ -22,11 +22,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "chat.h"
 #include "threading/thread.h"
-#include "chat_interface.h"
+#include "util/container.h"
 #include "log.h"
-
 #include <sstream>
 
+
+struct ChatInterface;
+
 class TermLogOutput : public ILogOutput {
 public:
 
index 911b647f7cfe0d8640b097ed97e708a2952b1b64..b52189cb443573c3ee45614924c79194386bf775 100644 (file)
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "itemdef.h"
 #include "gamedef.h"
 #include "mods.h"
+#include "util/numeric.h"
 
 content_t t_CONTENT_STONE;
 content_t t_CONTENT_GRASS;
index 3ea3d74447982490c3a76426357e07a67fded464..c23d2a06823c8df28eef0edbb61ed4b74feb0b87 100644 (file)
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "settings.h"
 #include "util/serialize.h"
 #include "network/connection.h"
+#include "network/networkpacket.h"
 
 class TestConnection : public TestBase {
 public: