Make operator inline
This commit is contained in:
parent
f920ed7f97
commit
562131b53f
@ -425,10 +425,3 @@ void STKTexManager::checkThreadedLoadTextures(bool util_queue_empty)
|
||||
}
|
||||
#endif
|
||||
} // checkThreadedLoadTextures
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool STKTexManager::SmallestTexture::operator()
|
||||
(const video::ITexture* a, const video::ITexture* b) const
|
||||
{
|
||||
return a->getTextureSize() > b->getTextureSize();
|
||||
} // SmallestTexture::operator
|
||||
|
@ -57,8 +57,11 @@ private:
|
||||
class SmallestTexture
|
||||
{
|
||||
public:
|
||||
bool operator()(const irr::video::ITexture* a,
|
||||
const irr::video::ITexture* b) const;
|
||||
inline bool operator()(const irr::video::ITexture* a,
|
||||
const irr::video::ITexture* b) const
|
||||
{
|
||||
return a->getTextureSize() > b->getTextureSize();
|
||||
}
|
||||
};
|
||||
std::priority_queue<irr::video::ITexture*,
|
||||
std::vector<irr::video::ITexture*>, SmallestTexture>
|
||||
|
@ -33,7 +33,6 @@ void* ThreadedTexLoader::startRoutine(void *obj)
|
||||
{
|
||||
pthread_mutex_lock(&ttl->m_mutex);
|
||||
bool finished = ttl->finishedLoading();
|
||||
bool has_completed_tex = !ttl->m_completed_textures.empty();
|
||||
pthread_mutex_unlock(&ttl->m_mutex);
|
||||
if (finished)
|
||||
{
|
||||
@ -41,7 +40,8 @@ void* ThreadedTexLoader::startRoutine(void *obj)
|
||||
}
|
||||
pthread_mutex_lock(ttl->m_texture_queue_mutex);
|
||||
bool waiting = ttl->m_stktm->isThreadedLoadTexturesEmpty();
|
||||
ttl->m_last_queue_ready.setAtomic(has_completed_tex && waiting);
|
||||
ttl->m_last_queue_ready.setAtomic(!ttl->m_completed_textures.empty() &&
|
||||
waiting);
|
||||
while (waiting)
|
||||
{
|
||||
pthread_cond_wait(ttl->m_cond_request, ttl->m_texture_queue_mutex);
|
||||
|
Loading…
Reference in New Issue
Block a user