mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 09:19:55 +00:00
39 lines
715 B
C++
39 lines
715 B
C++
#include "unrefqueue.hpp"
|
|
|
|
//#include <osg/Timer>
|
|
|
|
//#include <components/debug/debuglog.hpp>
|
|
|
|
namespace SceneUtil
|
|
{
|
|
void UnrefWorkItem::doWork()
|
|
{
|
|
mObjects.clear();
|
|
}
|
|
|
|
UnrefQueue::UnrefQueue()
|
|
{
|
|
mWorkItem = new UnrefWorkItem;
|
|
}
|
|
|
|
void UnrefQueue::push(const osg::Referenced *obj)
|
|
{
|
|
mWorkItem->mObjects.emplace_back(obj);
|
|
}
|
|
|
|
void UnrefQueue::flush(SceneUtil::WorkQueue *workQueue)
|
|
{
|
|
if (mWorkItem->mObjects.empty())
|
|
return;
|
|
|
|
workQueue->addWorkItem(mWorkItem, true);
|
|
|
|
mWorkItem = new UnrefWorkItem;
|
|
}
|
|
|
|
unsigned int UnrefQueue::getNumItems() const
|
|
{
|
|
return mWorkItem->mObjects.size();
|
|
}
|
|
|
|
}
|