Skip to content
Permalink
Browse files

Cleanup various headers to reduce compilation times (#6255)

* Cleanup various headers to reduce compilation times
  • Loading branch information...
nerzhul committed Aug 16, 2017
1 parent 816bca3 commit 85511a642f851100d0d856f4ecbe7fea7a7bb049
Showing with 94 additions and 84 deletions.
  1. +1 −1 src/ban.h
  2. +9 −10 src/camera.cpp
  3. +1 −4 src/camera.h
  4. +3 −2 src/client.cpp
  5. +0 −1 src/client.h
  6. +1 −1 src/client/inputhandler.h
  7. +2 −0 src/client/renderingengine.cpp
  8. +1 −0 src/clientenvironment.cpp
  9. +1 −0 src/clientenvironment.h
  10. +2 −3 src/clientiface.cpp
  11. +1 −0 src/clientiface.h
  12. +1 −0 src/content_cao.cpp
  13. +1 −1 src/content_mapblock.h
  14. +1 −2 src/environment.h
  15. +1 −2 src/game.cpp
  16. +1 −0 src/gettext.h
  17. +0 −1 src/guiKeyChangeMenu.h
  18. +1 −3 src/guiPasswordChange.cpp
  19. +2 −1 src/guiPasswordChange.h
  20. +2 −3 src/guiVolumeChange.h
  21. +1 −1 src/irrlichttypes.h
  22. +2 −0 src/localplayer.h
  23. +1 −5 src/main.cpp
  24. +1 −0 src/mapblock_mesh.cpp
  25. +1 −0 src/mg_ore.cpp
  26. +4 −15 src/minimap.cpp
  27. +5 −4 src/minimap.h
  28. +2 −1 src/network/clientopcodes.h
  29. +14 −0 src/network/connection.cpp
  30. +2 −10 src/network/connection.h
  31. +1 −1 src/network/networkpacket.cpp
  32. +1 −1 src/network/networkpacket.h
  33. +2 −1 src/network/serveropcodes.h
  34. +0 −1 src/nodedef.h
  35. +1 −1 src/noise.h
  36. +2 −2 src/script/cpp_api/s_async.h
  37. +1 −1 src/script/cpp_api/s_base.h
  38. +1 −0 src/script/cpp_api/s_internal.h
  39. +1 −1 src/script/lua_api/l_base.h
  40. +1 −0 src/script/lua_api/l_camera.cpp
  41. +1 −0 src/script/lua_api/l_client.cpp
  42. +3 −0 src/script/lua_api/l_env.cpp
  43. +1 −0 src/script/lua_api/l_localplayer.cpp
  44. +1 −0 src/script/lua_api/l_minimap.cpp
  45. +1 −0 src/server.cpp
  46. +3 −2 src/server.h
  47. +1 −0 src/serverenvironment.h
  48. +1 −0 src/terminal_chat_console.cpp
  49. +4 −2 src/terminal_chat_console.h
  50. +1 −0 src/unittest/test.cpp
  51. +1 −0 src/unittest/test_connection.cpp
@@ -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();
@@ -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;
@@ -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 @@ class Camera
// 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();
@@ -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"
@@ -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

@@ -247,8 +247,8 @@ class RealInputHandler : public InputHandler
}

return m_mousepos;

}

virtual void setMousePos(s32 x, s32 y)
{
if (RenderingEngine::get_raw_device()->getCursorControl()) {
@@ -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"
@@ -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"
@@ -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;
@@ -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"

@@ -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>
@@ -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"
@@ -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>

@@ -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;
@@ -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();
@@ -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>
@@ -24,7 +24,6 @@

#include "irrlichttypes_extrabloated.h"
#include "modalMenu.h"
#include "client.h"
#include "gettext.h"
#include "keycode.h"
#include <string>
@@ -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>
@@ -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:
@@ -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 @@ class GUIVolumeChange : public GUIModalMenu
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr);
~GUIVolumeChange();

void removeChildren();
/*
Remove and re-add (or reposition) stuff
@@ -42,7 +41,7 @@ class GUIVolumeChange : public GUIModalMenu
void drawMenu();

bool OnEvent(const SEvent& event);

bool pausesGame() { return true; }
};

@@ -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>
@@ -144,7 +144,9 @@ class LocalPlayer : public Player
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);

@@ -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
@@ -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"
@@ -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>


@@ -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;
}
}
@@ -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,
Oops, something went wrong.

0 comments on commit 85511a6

Please sign in to comment.
You can’t perform that action at this time.