Remove infinitive loop if image failed to load
This commit is contained in:
parent
02ecb9f914
commit
34f416506e
@ -444,6 +444,8 @@ bool SPTexture::threadedLoad()
|
||||
std::shared_ptr<video::IImage> image = getTextureImage();
|
||||
if (!image)
|
||||
{
|
||||
m_width.store(2);
|
||||
m_height.store(2);
|
||||
return true;
|
||||
}
|
||||
std::shared_ptr<video::IImage> mask = getMask(image->getDimension());
|
||||
@ -642,12 +644,6 @@ void SPTexture::applyMask(video::IImage* texture, video::IImage* mask)
|
||||
}
|
||||
} // applyMask
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool SPTexture::initialized() const
|
||||
{
|
||||
return m_width.load() != 0 && m_height.load() != 0;
|
||||
} // initialized
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void SPTexture::generateQuickMipmap(std::shared_ptr<video::IImage> first_image,
|
||||
const std::vector<std::pair
|
||||
|
@ -183,7 +183,8 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
GLuint getOpenGLTextureName() const { return m_texture_name; }
|
||||
// ------------------------------------------------------------------------
|
||||
bool initialized() const;
|
||||
bool initialized() const
|
||||
{ return m_width.load() != 0 && m_height.load() != 0; }
|
||||
// ------------------------------------------------------------------------
|
||||
unsigned getWidth() const { return m_width.load(); }
|
||||
// ------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user