Continously keep the effects running by calling the Run() method in their classes Calls all the effects in the list (AllEffects) If the current effect isn't enabled, there will be no visible effects NULL. Loops while the game is open
| 200 | /// </summary> |
| 201 | /// <returns>NULL. Loops while the game is open</returns> |
| 202 | unsigned WINAPI EffectRunThread() { |
| 203 | while (!GameState::GameLoaded) |
| 204 | Sleep(5000); |
| 205 | |
| 206 | while (!GameState::GameClosing) { |
| 207 | // Iterate through all effects |
| 208 | for (auto it = GetAllEffects().begin(); it != GetAllEffects().end(); ++it) { |
| 209 | // Run/Update all effects |
| 210 | it->second->Run(); |
| 211 | } |
| 212 | |
| 213 | Sleep(10); |
| 214 | } |
| 215 | |
| 216 | return 0; |
| 217 | } |
| 218 | |
| 219 | /// <summary> |
| 220 | /// Object scaling effects need to be reapplied, because they are applied for each object separately |