summaryrefslogtreecommitdiff
path: root/src/camera.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-06-16 11:25:52 +0200
committerGitHub <noreply@github.com>2017-06-16 11:25:52 +0200
commit76be103a91d6987527af19e87d93007be8ba8a67 (patch)
treec83c21e7c0adc37251f77788023eb3c242a751ca /src/camera.h
parent49d6e5f4ab79078d1608c22a9cce286b3cf86eb9 (diff)
downloadminetest-76be103a91d6987527af19e87d93007be8ba8a67.tar.gz
minetest-76be103a91d6987527af19e87d93007be8ba8a67.tar.bz2
minetest-76be103a91d6987527af19e87d93007be8ba8a67.zip
C++11 patchset 9: move hardcoded init parameters to class definitions (part 1) (#5984)
* C++11 patchset 9: move hardcoded init parameters to class definitions C++11 introduced the possibility to define the default values directly in class definitions, do it on current code Also remove some unused attributes * CollisionInfo::bouncy * collisionMoveResult::collides_xy * collisionMoveResult::standing_on_unloaded * Clouds::speed * More constructor cleanups + some variables removal * remove only write guiFormSpecMenu::m_old_tooltip * move header included inside defintions in genericobject.h * remove some unused since years exception classes * remove unused & empty debug_stacks_init * remove unused & empty content_nodemeta_serialize_legacy * remove forgotten useless bool (bouncy) in collision.cpp code
Diffstat (limited to 'src/camera.h')
-rw-r--r--src/camera.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/camera.h b/src/camera.h
index 1e4800cba..8d213ede7 100644
--- a/src/camera.h
+++ b/src/camera.h
@@ -168,12 +168,12 @@ public:
private:
// Nodes
- scene::ISceneNode* m_playernode;
- scene::ISceneNode* m_headnode;
- scene::ICameraSceneNode* m_cameranode;
+ scene::ISceneNode *m_playernode = nullptr;
+ scene::ISceneNode *m_headnode = nullptr;
+ scene::ICameraSceneNode *m_cameranode = nullptr;
- scene::ISceneManager* m_wieldmgr;
- WieldMeshSceneNode* m_wieldnode;
+ scene::ISceneManager *m_wieldmgr = nullptr;
+ WieldMeshSceneNode *m_wieldnode = nullptr;
// draw control
MapDrawControl& m_draw_control;
@@ -189,33 +189,33 @@ private:
v3s16 m_camera_offset;
// Field of view and aspect ratio stuff
- f32 m_aspect;
- f32 m_fov_x;
- f32 m_fov_y;
+ f32 m_aspect = 1.0f;
+ f32 m_fov_x = 1.0f;
+ f32 m_fov_y = 1.0f;
// View bobbing animation frame (0 <= m_view_bobbing_anim < 1)
- f32 m_view_bobbing_anim;
+ f32 m_view_bobbing_anim = 0.0f;
// If 0, view bobbing is off (e.g. player is standing).
// If 1, view bobbing is on (player is walking).
// If 2, view bobbing is getting switched off.
- s32 m_view_bobbing_state;
+ s32 m_view_bobbing_state = 0;
// Speed of view bobbing animation
- f32 m_view_bobbing_speed;
+ f32 m_view_bobbing_speed = 0.0f;
// Fall view bobbing
- f32 m_view_bobbing_fall;
+ f32 m_view_bobbing_fall = 0.0f;
// Digging animation frame (0 <= m_digging_anim < 1)
- f32 m_digging_anim;
+ f32 m_digging_anim = 0.0f;
// If -1, no digging animation
// If 0, left-click digging animation
// If 1, right-click digging animation
- s32 m_digging_button;
+ s32 m_digging_button = -1;
// Animation when changing wielded item
- f32 m_wield_change_timer;
+ f32 m_wield_change_timer = 0.125f;
ItemStack m_wield_item_next;
- CameraMode m_camera_mode;
+ CameraMode m_camera_mode = CAMERA_MODE_FIRST;
f32 m_cache_fall_bobbing_amount;
f32 m_cache_view_bobbing_amount;