Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit ae734dc

Browse files
committed
Add destructors to PrimitiveMan and PostProcessMan
1 parent 18923a9 commit ae734dc

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

Managers/PostProcessMan.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ namespace RTE {
4848
return 0;
4949
}
5050

51+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
52+
53+
void PostProcessMan::Destroy() {
54+
ClearScreenPostEffects();
55+
ClearScenePostEffects();
56+
Clear();
57+
destroy_bitmap(m_TempEffectBitmap_16);
58+
destroy_bitmap(m_TempEffectBitmap_32);
59+
destroy_bitmap(m_TempEffectBitmap_64);
60+
destroy_bitmap(m_TempEffectBitmap_128);
61+
destroy_bitmap(m_TempEffectBitmap_256);
62+
destroy_bitmap(m_TempEffectBitmap_512);
63+
}
64+
5165
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5266

5367
void PostProcessMan::RegisterPostEffect(const Vector &effectPos, BITMAP *effect, size_t hash, int strength, float angle) {

Managers/PostProcessMan.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ namespace RTE {
5858
#pragma endregion
5959

6060
#pragma region Destruction
61+
/// <summary>
62+
/// Destructor method used to clean up a PostProcessMan object before deletion from system memory.
63+
/// </summary>
64+
~PostProcessMan() { Destroy(); }
65+
66+
/// <summary>
67+
/// Destroys and resets (through Clear()) the PostProcessMan object.
68+
/// </summary>
69+
void Destroy();
70+
6171
/// <summary>
6272
/// Clears the list of registered post-processing screen effects and glow boxes.
6373
/// </summary>

Managers/PrimitiveMan.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ namespace RTE {
2525
#pragma endregion
2626

2727
#pragma region Destruction
28+
/// <summary>
29+
/// Destructor method used to clean up a PrimitiveMan object before deletion from system memory.
30+
/// </summary>
31+
~PrimitiveMan() { ClearPrimitivesList(); }
32+
2833
/// <summary>
2934
/// Delete all scheduled primitives, called on every FrameMan sim update.
3035
/// </summary>

0 commit comments

Comments
 (0)