Skip to content

Commit

Permalink
Cleanup some header inclusions to improve compilation times
Browse files Browse the repository at this point in the history
  • Loading branch information
nerzhul committed Jan 11, 2017
1 parent 6647939 commit 430d3b2
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/client.h
Expand Up @@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "localplayer.h"
#include "hud.h"
#include "particles.h"
#include "mapnode.h"

struct MeshMakeData;
class MapBlockMesh;
Expand Down
1 change: 1 addition & 0 deletions src/clientenvironment.cpp
Expand Up @@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "profiler.h"
#include "raycast.h"
#include "voxelalgorithms.h"
#include "settings.h"

/*
ClientEnvironment
Expand Down
4 changes: 2 additions & 2 deletions src/environment.h
Expand Up @@ -36,12 +36,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irr_v3d.h"
#include "activeobject.h"
#include "util/numeric.h"
#include "mapnode.h"
#include "mapblock.h"
#include "threading/mutex.h"
#include "threading/atomic.h"
#include "network/networkprotocol.h" // for AccessDeniedCode

class Map;

class Environment
{
public:
Expand Down
1 change: 0 additions & 1 deletion src/guiFormSpecMenu.h
Expand Up @@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <stack>

#include "irrlichttypes_extrabloated.h"
#include "inventory.h"
#include "inventorymanager.h"
#include "modalMenu.h"
#include "guiTable.h"
Expand Down
11 changes: 11 additions & 0 deletions src/localplayer.cpp
Expand Up @@ -655,6 +655,17 @@ v3s16 LocalPlayer::getStandingNodePos()
return floatToInt(getPosition() - v3f(0, BS, 0), BS);
}

v3s16 LocalPlayer::getLightPosition() const
{
return floatToInt(m_position + v3f(0,BS+BS/2,0), BS);
}

v3f LocalPlayer::getEyeOffset() const
{
float eye_height = camera_barely_in_ceiling ? 1.5f : 1.625f;
return v3f(0, BS * eye_height, 0);
}

// Horizontal acceleration (X and Z), Y direction is ignored
void LocalPlayer::accelerateHorizontal(const v3f &target_speed, const f32 max_increase)
{
Expand Down
11 changes: 2 additions & 9 deletions src/localplayer.h
Expand Up @@ -105,10 +105,7 @@ class LocalPlayer : public Player
u16 getBreath() const { return m_breath; }
void setBreath(u16 breath) { m_breath = breath; }

v3s16 getLightPosition() const
{
return floatToInt(m_position + v3f(0,BS+BS/2,0), BS);
}
v3s16 getLightPosition() const;

void setYaw(f32 yaw)
{
Expand All @@ -131,11 +128,7 @@ class LocalPlayer : public Player

v3f getPosition() const { return m_position; }
v3f getEyePosition() const { return m_position + getEyeOffset(); }
v3f getEyeOffset() const
{
float eye_height = camera_barely_in_ceiling ? 1.5f : 1.625f;
return v3f(0, BS * eye_height, 0);
}
v3f getEyeOffset() const;
private:
void accelerateHorizontal(const v3f &target_speed, const f32 max_increase);
void accelerateVertical(const v3f &target_speed, const f32 max_increase);
Expand Down
1 change: 1 addition & 0 deletions src/minimap.cpp
Expand Up @@ -26,6 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "porting.h"
#include "util/numeric.h"
#include "util/string.h"
#include "mapblock.h"
#include <math.h>


Expand Down
1 change: 1 addition & 0 deletions src/network/serverpackethandler.cpp
Expand Up @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "content_abm.h"
#include "content_sao.h"
#include "emerge.h"
#include "mapblock.h"
#include "nodedef.h"
#include "player.h"
#include "rollback_interface.h"
Expand Down
1 change: 0 additions & 1 deletion src/player.h
Expand Up @@ -22,7 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,

#include "irrlichttypes_bloated.h"
#include "inventory.h"
#include "constants.h" // BS
#include "threading/mutex.h"
#include <list>

Expand Down
3 changes: 3 additions & 0 deletions src/serverenvironment.h
Expand Up @@ -21,6 +21,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define SERVER_ENVIRONMENT_HEADER

#include "environment.h"
#include "mapnode.h"
#include "mapblock.h"
#include <set>

class IGameDef;
class ServerMap;
Expand Down

0 comments on commit 430d3b2

Please sign in to comment.