aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/palette32.h
diff options
context:
space:
mode:
authorColin Snover2017-10-05 20:53:27 -0500
committerColin Snover2017-10-06 22:10:50 -0500
commit5cffa3891f48d64154f00571c8127ef2c601d6d5 (patch)
tree56b8b94e67819ee70c8aa1a4054cc993ebff83c0 /engines/sci/graphics/palette32.h
parentf037d4df1680aecefac2ffb240547385a74971d0 (diff)
downloadscummvm-rg350-5cffa3891f48d64154f00571c8127ef2c601d6d5.tar.gz
scummvm-rg350-5cffa3891f48d64154f00571c8127ef2c601d6d5.tar.bz2
scummvm-rg350-5cffa3891f48d64154f00571c8127ef2c601d6d5.zip
SCI32: Clean up GfxPalette32
* Replace raw pointers with smart pointers * Use references instead of const pointers where appropriate * Tweak initialisation * Tweak palette copies to the stack
Diffstat (limited to 'engines/sci/graphics/palette32.h')
-rw-r--r--engines/sci/graphics/palette32.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/sci/graphics/palette32.h b/engines/sci/graphics/palette32.h
index b8ba85eb4a..2d00b86501 100644
--- a/engines/sci/graphics/palette32.h
+++ b/engines/sci/graphics/palette32.h
@@ -23,6 +23,8 @@
#ifndef SCI_GRAPHICS_PALETTE32_H
#define SCI_GRAPHICS_PALETTE32_H
+#include "common/ptr.h"
+
namespace Sci {
#pragma mark HunkPalette
@@ -233,7 +235,6 @@ struct PalCycler {
class GfxPalette32 {
public:
GfxPalette32(ResourceManager *resMan);
- ~GfxPalette32();
void saveLoadWithSerializer(Common::Serializer &s);
@@ -440,13 +441,13 @@ private:
* operation. If this palette is not specified, `_sourcePalette` is used
* instead.
*/
- Palette *_varyStartPalette;
+ Common::ScopedPtr<Palette> _varyStartPalette;
/**
* An optional palette used to provide target colors for a palette vary
* operation.
*/
- Palette *_varyTargetPalette;
+ Common::ScopedPtr<Palette> _varyTargetPalette;
/**
* The minimum palette index that has been varied from the source palette.
@@ -553,7 +554,8 @@ private:
kNumCyclers = 10
};
- PalCycler *_cyclers[kNumCyclers];
+ typedef Common::ScopedPtr<PalCycler> PalCyclerOwner;
+ PalCyclerOwner _cyclers[kNumCyclers];
/**
* Updates the `currentCycle` of the given `cycler` by `speed` entries.
@@ -564,8 +566,8 @@ private:
* The cycle map is used to detect overlapping cyclers, and to avoid
* remapping to palette entries that are being cycled.
*
- * According to SCI engine code, when two cyclers overlap, a fatal error has
- * occurred and the engine will display an error and then exit.
+ * According to SSCI, when two cyclers overlap, a fatal error has occurred
+ * and the engine will display an error and then exit.
*
* The color remapping system avoids attempts to remap to palette entries
* that are cycling because they won't be the expected color once the cycler