aboutsummaryrefslogtreecommitdiff
path: root/src/camera.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2015-03-27 20:24:04 -0400
committerShadowNinja <shadowninja@minetest.net>2015-03-27 20:24:04 -0400
commit30075467b84c79ff21736d6c447746caef07dcd0 (patch)
treecfdfe0ed15d488840e03597bca6c2320a8dec55e /src/camera.cpp
parent3d53c90d4b34563ef27bc38da211dab91b72d321 (diff)
downloadminetest-30075467b84c79ff21736d6c447746caef07dcd0.tar.gz
minetest-30075467b84c79ff21736d6c447746caef07dcd0.tar.bz2
minetest-30075467b84c79ff21736d6c447746caef07dcd0.zip
Change error_message from wstring to string
This removes a lot of narrow/wide conversions where a wide string was never used.
Diffstat (limited to 'src/camera.cpp')
-rw-r--r--src/camera.cpp38
1 files changed, 12 insertions, 26 deletions
diff --git a/src/camera.cpp b/src/camera.cpp
index 5200f71ba..111a4b241 100644
--- a/src/camera.cpp
+++ b/src/camera.cpp
@@ -119,34 +119,20 @@ 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";
}
- return true;
+ return error_message.empty();
}
// Returns the fractional part of x