diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-10-12 13:53:38 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-10-12 13:53:38 +0300 |
commit | 9e46cbf7ea512330f35d0f2ede0c7c0c085c7cf4 (patch) | |
tree | f937a97b67b5ecd0ee65ed9a845e6e4a640bb629 /src/mapblockobject.h | |
parent | b60b58b627f078faba002401d300b522e0077efc (diff) | |
download | minetest-9e46cbf7ea512330f35d0f2ede0c7c0c085c7cf4.tar.gz minetest-9e46cbf7ea512330f35d0f2ede0c7c0c085c7cf4.tar.bz2 minetest-9e46cbf7ea512330f35d0f2ede0c7c0c085c7cf4.zip |
Header file tweaking; mainly for speed
Diffstat (limited to 'src/mapblockobject.h')
-rw-r--r-- | src/mapblockobject.h | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/src/mapblockobject.h b/src/mapblockobject.h index b852812e2..406c32fce 100644 --- a/src/mapblockobject.h +++ b/src/mapblockobject.h @@ -346,8 +346,10 @@ class SignObject : public MapBlockObject public: // The constructor of every MapBlockObject should be like this SignObject(MapBlock *block, s16 id, v3f pos): - MapBlockObject(block, id, pos), - m_node(NULL) + MapBlockObject(block, id, pos) +#ifndef SERVER + ,m_node(NULL) +#endif { m_selection_box = new core::aabbox3d<f32> (-BS*0.4,-BS*0.5,-BS*0.4, BS*0.4,BS*0.5,BS*0.4); @@ -534,7 +536,9 @@ public: } protected: +#ifndef SERVER scene::IMeshSceneNode *m_node; +#endif std::string m_text; f32 m_yaw; }; @@ -543,8 +547,10 @@ class RatObject : public MovingObject { public: RatObject(MapBlock *block, s16 id, v3f pos): - MovingObject(block, id, pos), - m_node(NULL) + MovingObject(block, id, pos) +#ifndef SERVER + ,m_node(NULL) +#endif { m_collision_box = new core::aabbox3d<f32> (-BS*0.3,-BS*.25,-BS*0.3, BS*0.3,BS*0.25,BS*0.3); @@ -681,15 +687,19 @@ public: void updateNodePos() { +#ifndef SERVER if(m_node == NULL) return; m_node->setPosition(getAbsoluteShowPos()); m_node->setRotation(v3f(0, -m_yaw+180, 0)); +#endif } protected: +#ifndef SERVER scene::IMeshSceneNode *m_node; +#endif float m_yaw; float m_counter1; @@ -708,8 +718,10 @@ class ItemObject : public MapBlockObject public: // The constructor of every MapBlockObject should be like this ItemObject(MapBlock *block, s16 id, v3f pos): - MapBlockObject(block, id, pos), - m_node(NULL) + MapBlockObject(block, id, pos) +#ifndef SERVER + ,m_node(NULL) +#endif { /*m_selection_box = new core::aabbox3d<f32> (-BS*0.4,-BS*0.5,-BS*0.4, BS*0.4,BS*0.5,BS*0.4);*/ @@ -855,7 +867,9 @@ public: } protected: +#ifndef SERVER scene::IMeshSceneNode *m_node; +#endif std::string m_itemstring; f32 m_yaw; }; @@ -868,7 +882,9 @@ class PlayerObject : public MovingObject public: PlayerObject(MapBlock *block, s16 id, v3f pos): MovingObject(block, id, pos), +#ifndef SERVER m_node(NULL), +#endif m_yaw(0) { m_collision_box = new core::aabbox3d<f32> @@ -954,15 +970,19 @@ public: void updateNodePos() { +#ifndef SERVER if(m_node == NULL) return; m_node->setPosition(getAbsoluteShowPos()); m_node->setRotation(v3f(0, -m_yaw+180, 0)); +#endif } protected: +#ifndef SERVER scene::IMeshSceneNode *m_node; +#endif float m_yaw; v3f m_oldpos; @@ -985,6 +1005,13 @@ struct DistanceSortedObject } }; +namespace irr{ +namespace scene{ + class ISceneManager; +} +} +using namespace irr; + class MapBlockObjectList { public: |