Improved Image error on construction handling

Former-commit-id: 5b40aab103d90bb29baedf65d481b2495717af8d
This commit is contained in:
Lynix 2015-01-07 21:03:57 +01:00
parent 904319ee90
commit 586aac534b
1 changed files with 2 additions and 8 deletions

View File

@ -4,6 +4,7 @@
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <cmath>
@ -44,15 +45,8 @@ m_sharedImage(&emptyImage)
NzImage::NzImage(nzImageType type, nzPixelFormat format, unsigned int width, unsigned int height, unsigned int depth, nzUInt8 levelCount) :
m_sharedImage(&emptyImage)
{
NzErrorFlags flags(nzErrorFlag_ThrowException);
Create(type, format, width, height, depth, levelCount);
#ifdef NAZARA_DEBUG
if (!m_sharedImage)
{
NazaraError("Failed to create image");
throw std::runtime_error("Constructor failed");
}
#endif
}
NzImage::NzImage(const NzImage& image) :