xoreos
0.0.5
|
#include <animationthread.h>
Classes | |
struct | PoolModel |
Public Member Functions | |
AnimationThread () | |
void | pause () |
void | resume () |
void | registerModel (Model *model) |
Add a model to the processing pool. More... | |
void | unregisterModel (Model *model) |
Remove a model from the processing pool. More... | |
void | flush () |
Apply changes to position and geometry of all models in the processing pool. More... | |
Public Member Functions inherited from Common::Thread | |
Thread () | |
virtual | ~Thread () |
bool | createThread (const UString &name="") |
bool | destroyThread () |
Private Types | |
typedef std::list< PoolModel > | ModelList |
typedef std::queue< Model * > | ModelQueue |
Private Member Functions | |
void | threadMethod () |
void | registerModelInternal (Model *model) |
void | unregisterModelInternal (Model *model) |
uint8 | getNumIterationsToSkip (Model *model) const |
Private Attributes | |
ModelList | _models |
ModelQueue | _registerQueue |
boost::atomic< bool > | _paused |
boost::atomic< bool > | _flushing |
Common::Semaphore | _modelsSem |
Semaphore protecting access to the model list. More... | |
Common::Semaphore | _registerSem |
Semaphore protecting access to the registration queue. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Common::Thread | |
boost::atomic< bool > | _killThread |
Definition at line 44 of file animationthread.h.
|
private |
Definition at line 67 of file animationthread.h.
|
private |
Definition at line 68 of file animationthread.h.
Graphics::Aurora::AnimationThread::AnimationThread | ( | ) |
Definition at line 46 of file animationthread.cpp.
void Graphics::Aurora::AnimationThread::flush | ( | ) |
Apply changes to position and geometry of all models in the processing pool.
Definition at line 83 of file animationthread.cpp.
References _flushing, _models, _modelsSem, Common::Semaphore::lock(), and Common::Semaphore::unlock().
Referenced by Graphics::GraphicsManager::renderWorld(), and Graphics::GraphicsManager::renderWorldShader().
Definition at line 176 of file animationthread.cpp.
References CameraMan, and Graphics::Aurora::Model::getPosition().
Referenced by threadMethod().
void Graphics::Aurora::AnimationThread::pause | ( | ) |
Definition at line 53 of file animationthread.cpp.
References _modelsSem, _paused, Common::Semaphore::lock(), and Common::Semaphore::unlock().
Referenced by Graphics::GraphicsManager::deinit(), and Graphics::GraphicsManager::pauseAnimations().
void Graphics::Aurora::AnimationThread::registerModel | ( | Model * | model | ) |
Add a model to the processing pool.
Definition at line 63 of file animationthread.cpp.
References _paused, _registerQueue, _registerSem, Common::Semaphore::lock(), registerModelInternal(), and Common::Semaphore::unlock().
Referenced by Graphics::GraphicsManager::registerAnimatedModel().
|
private |
Definition at line 158 of file animationthread.cpp.
References _models.
Referenced by registerModel(), and threadMethod().
void Graphics::Aurora::AnimationThread::resume | ( | ) |
Definition at line 59 of file animationthread.cpp.
References _paused.
Referenced by Graphics::GraphicsManager::resumeAnimations().
|
privatevirtual |
Implements Common::Thread.
Definition at line 97 of file animationthread.cpp.
References _flushing, Common::Thread::_killThread, _models, _modelsSem, _paused, _registerQueue, _registerSem, EventMan, getNumIterationsToSkip(), Common::Semaphore::lock(), Common::Semaphore::lockTry(), registerModelInternal(), and Common::Semaphore::unlock().
void Graphics::Aurora::AnimationThread::unregisterModel | ( | Model * | model | ) |
Remove a model from the processing pool.
Definition at line 73 of file animationthread.cpp.
References _modelsSem, _paused, Common::Semaphore::lock(), Common::Semaphore::unlock(), and unregisterModelInternal().
Referenced by Graphics::GraphicsManager::unregisterAnimatedModel().
|
private |
Definition at line 166 of file animationthread.cpp.
References _models.
Referenced by unregisterModel().
|
private |
Definition at line 74 of file animationthread.h.
Referenced by flush(), and threadMethod().
|
private |
Definition at line 70 of file animationthread.h.
Referenced by flush(), registerModelInternal(), threadMethod(), and unregisterModelInternal().
|
private |
Semaphore protecting access to the model list.
Definition at line 76 of file animationthread.h.
Referenced by flush(), pause(), threadMethod(), and unregisterModel().
|
private |
Definition at line 73 of file animationthread.h.
Referenced by pause(), registerModel(), resume(), threadMethod(), and unregisterModel().
|
private |
Definition at line 71 of file animationthread.h.
Referenced by registerModel(), and threadMethod().
|
private |
Semaphore protecting access to the registration queue.
Definition at line 77 of file animationthread.h.
Referenced by registerModel(), and threadMethod().