diff options
Diffstat (limited to 'src/graphics')
-rw-r--r-- | src/graphics/core/device.h | 3 | ||||
-rw-r--r-- | src/graphics/engine/engine.cpp | 7 | ||||
-rw-r--r-- | src/graphics/opengl/gldevice.cpp | 16 | ||||
-rw-r--r-- | src/graphics/opengl/gldevice.h | 4 |
4 files changed, 10 insertions, 20 deletions
diff --git a/src/graphics/core/device.h b/src/graphics/core/device.h index a3d0208..9eb6f6d 100644 --- a/src/graphics/core/device.h +++ b/src/graphics/core/device.h @@ -286,9 +286,6 @@ public: //! Destroys the device, releasing every acquired resource virtual void Destroy() = 0; - //! Returns the last encountered error - virtual std::string GetError() = 0; - //! Begins drawing the 3D scene virtual void BeginScene() = 0; //! Ends drawing the 3D scene diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 5988949..3187dde 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -2113,8 +2113,7 @@ Gfx::Texture Gfx::CEngine::CreateTexture(const std::string& texName, const Gfx:: if (! img.Load(m_app->GetDataFilePath(m_texPath, texName))) { std::string error = img.GetError(); - GetLogger()->Error("Couldn't load texture '%s': %s\n", texName.c_str(), error.c_str()); - GetLogger()->Error("Blacklisting texture '%s'\n", texName.c_str()); + GetLogger()->Error("Couldn't load texture '%s': %s, blacklisting\n", texName.c_str(), error.c_str()); m_texBlacklist.insert(texName); return Gfx::Texture(); // invalid texture } @@ -2123,9 +2122,7 @@ Gfx::Texture Gfx::CEngine::CreateTexture(const std::string& texName, const Gfx:: if (! tex.Valid()) { - std::string error = m_device->GetError(); - GetLogger()->Error("Couldn't load texture '%s': %s\n", texName.c_str(), error.c_str()); - GetLogger()->Error("Blacklisting texture '%s'\n", texName.c_str()); + GetLogger()->Error("Couldn't load texture '%s', blacklisting\n", texName.c_str()); m_texBlacklist.insert(texName); return tex; } diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp index 3526b13..7221421 100644 --- a/src/graphics/opengl/gldevice.cpp +++ b/src/graphics/opengl/gldevice.cpp @@ -20,6 +20,7 @@ #include "common/config.h" #include "common/image.h" +#include "common/logger.h" #include "math/geometry.h" @@ -80,13 +81,10 @@ void Gfx::CGLDevice::DebugHook() glColor3i(0, 0, 0); } -std::string Gfx::CGLDevice::GetError() -{ - return m_error; -} - bool Gfx::CGLDevice::Create() { + GetLogger()->Info("Creating CDevice\n"); + #if defined(USE_GLEW) static bool glewInited = false; @@ -96,13 +94,13 @@ bool Gfx::CGLDevice::Create() if (glewInit() != GLEW_OK) { - m_error = "GLEW initialization failed"; + GetLogger()->Error("GLEW initialization failed\n"); return false; } if ( (! GLEW_ARB_multitexture) || (! GLEW_EXT_texture_env_combine) || (! GLEW_EXT_secondary_color) ) { - m_error = "GLEW reports required extensions not supported"; + GetLogger()->Error("GLEW reports required extensions not supported\n"); return false; } } @@ -142,6 +140,8 @@ bool Gfx::CGLDevice::Create() m_texturesEnabled = std::vector<bool> (maxTextures, false); m_textureStageParams = std::vector<Gfx::TextureStageParams>(maxTextures, Gfx::TextureStageParams()); + GetLogger()->Info("CDevice created successfully\n"); + return true; } @@ -385,7 +385,7 @@ Gfx::Texture Gfx::CGLDevice::CreateTexture(CImage *image, const Gfx::TextureCrea ImageData *data = image->GetData(); if (data == NULL) { - m_error = "Invalid texture data"; + GetLogger()->Error("Invalid texture data\n"); return Gfx::Texture(); // invalid texture } diff --git a/src/graphics/opengl/gldevice.h b/src/graphics/opengl/gldevice.h index 3daea8a..b59af1c 100644 --- a/src/graphics/opengl/gldevice.h +++ b/src/graphics/opengl/gldevice.h @@ -78,8 +78,6 @@ public: virtual void DebugHook(); - virtual std::string GetError(); - virtual bool Create(); virtual void Destroy(); @@ -169,8 +167,6 @@ private: private: //! Current config Gfx::GLDeviceConfig m_config; - //! Last encountered error - std::string m_error; //! Current world matrix Math::Matrix m_worldMat; |