![]() |
SAGE
A Simple Academic Game Engine
|
A thread class for loading images and sounds. More...
#include <SageLoadingThread.h>

Public Member Functions | |
| CLoadingThread (CSpriteRenderer *, CMediaList< t >, bool *) | |
| Constructor. | |
| CLoadingThread (CSound *, CMediaList< t >, bool *) | |
| Constructor. | |
| void | operator() () |
| The thread code. | |
Protected Attributes | |
| CMediaList< t > | m_cMediaList |
| Media list. | |
| CSpriteRenderer * | m_pRenderer = nullptr |
| Pointer to a sprite renderer. | |
| CSound * | m_pAudio = nullptr |
| Pointer to an audio player. | |
| bool * | m_pFinished = nullptr |
| Pointer to a flag to set when finished. | |
A thread class for loading images and sounds.
| t | Enumerated type for images or sounds. |
| Sage::CLoadingThread< t >::CLoadingThread | ( | CSpriteRenderer * | pRenderer, |
| CMediaList< t > | m, | ||
| bool * | pFlag ) |
Sprite loading thread constructor. Saves a pointer to a sprite renderer in m_pRenderer, which indicates that we will be loading images. Also saves a media list in m_cMediaList. Sets m_pFinished to point to a boolean variable that will be set to true when the thread is finished.
| t | Enumerated type for images. |
| pRenderer | Pointer to a sprite renderer. |
| m | A media descriptor list. |
| pFlag | Pointer to a flag to set when finished. |
| Sage::CLoadingThread< t >::CLoadingThread | ( | CSound * | pAudio, |
| CMediaList< t > | m, | ||
| bool * | pFlag ) |
Audio loading thread constructor. Saves a pointer to an audio player in m_pAudio, which indicates that we will be loading audio. Also saves a media list in m_cMediaList. Sets m_pFinished to point to a boolean variable that will be set to true when the thread is finished.
| t | Enumerated type for sounds. |
| pAudio | Pointer to an audio player. |
| m | A media descriptor list. |
| pFlag | Pointer to a flag to set when finished. |
| void Sage::CLoadingThread< t >::operator() | ( | ) |
The thread body. Loads the media in the task list. Assumes that if m_pRenderer is not null, then we are loading images, otherwise we are loading audio. If m_pFinished is not null, then the boolean variable that it points to will be set to false when the thread starts and true when it is finished.