]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/camera.cpp
Translated using Weblate (Korean)
[dragonfireclient.git] / src / camera.cpp
index df7ea35b12e737697eccd30a13ff197a0c2f8de8..ca28555d2e15daee9ff0484266bed0a2183d3801 100644 (file)
@@ -20,14 +20,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "camera.h"
 #include "debug.h"
 #include "client.h"
-#include "main.h" // for g_settings
 #include "map.h"
-#include "clientmap.h" // MapDrawControl
+#include "clientmap.h"     // MapDrawControl
 #include "player.h"
 #include <cmath>
 #include "settings.h"
 #include "wieldmesh.h"
-#include "noise.h" // easeCurve
+#include "noise.h"         // easeCurve
 #include "gamedef.h"
 #include "sound.h"
 #include "event.h"
@@ -119,34 +118,22 @@ Camera::~Camera()
        m_wieldmgr->drop();
 }
 
-bool Camera::successfullyCreated(std::wstring& error_message)
+bool Camera::successfullyCreated(std::string &error_message)
 {
-       if (m_playernode == NULL)
-       {
-               error_message = L"Failed to create the player scene node";
-               return false;
-       }
-       if (m_headnode == NULL)
-       {
-               error_message = L"Failed to create the head scene node";
-               return false;
-       }
-       if (m_cameranode == NULL)
-       {
-               error_message = L"Failed to create the camera scene node";
-               return false;
-       }
-       if (m_wieldmgr == NULL)
-       {
-               error_message = L"Failed to create the wielded item scene manager";
-               return false;
-       }
-       if (m_wieldnode == NULL)
-       {
-               error_message = L"Failed to create the wielded item scene node";
-               return false;
+       if (!m_playernode) {
+               error_message = "Failed to create the player scene node";
+       } else if (!m_headnode) {
+               error_message = "Failed to create the head scene node";
+       } else if (!m_cameranode) {
+               error_message = "Failed to create the camera scene node";
+       } else if (!m_wieldmgr) {
+               error_message = "Failed to create the wielded item scene manager";
+       } else if (!m_wieldnode) {
+               error_message = "Failed to create the wielded item scene node";
+       } else {
+               error_message.clear();
        }
-       return true;
+       return error_message.empty();
 }
 
 // Returns the fractional part of x
@@ -270,7 +257,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
        {
                f32 oldy = old_player_position.Y;
                f32 newy = player_position.Y;
-               f32 t = exp(-10*frametime);
+               f32 t = exp(-23*frametime);
                player_position.Y = oldy * t + newy * (1-t);
        }