aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/core.h
diff options
context:
space:
mode:
authorPaul Gilbert2011-04-14 21:39:53 +1000
committerPaul Gilbert2011-04-14 21:39:53 +1000
commit8a0495a5f37d35a66e4c4b6b702f32e68e404301 (patch)
tree398388f4c7109d4ac33150c851f1aeee5827b318 /engines/tsage/core.h
parentc679aa72c3623383a591ad30ebf36286c7ce47df (diff)
downloadscummvm-rg350-8a0495a5f37d35a66e4c4b6b702f32e68e404301.tar.gz
scummvm-rg350-8a0495a5f37d35a66e4c4b6b702f32e68e404301.tar.bz2
scummvm-rg350-8a0495a5f37d35a66e4c4b6b702f32e68e404301.zip
TSAGE: Added replacement hierarchy for palette modifier classes that better matches the original
Diffstat (limited to 'engines/tsage/core.h')
-rw-r--r--engines/tsage/core.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index 77923606d1..2e3e5365a9 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -317,10 +317,21 @@ public:
virtual void remove() = 0;
};
-class PaletteRotation : public PaletteModifier {
+class PaletteModifierCached: public PaletteModifier {
+public:
+ RGB8 _palette[256];
+ int _step;
+ int _percent;
+
+ PaletteModifierCached();
+
+ void setPalette(ScenePalette *palette, int step);
+ virtual Common::String getClassName() { return "PaletteModifierCached"; }
+ virtual void synchronise(Serialiser &s);
+};
+
+class PaletteRotation: public PaletteModifierCached {
public:
- bool _disabled;
- int _delayFrames;
int _delayCtr;
uint32 _frameNumber;
int _currIndex;
@@ -328,7 +339,6 @@ public:
int _end;
int _rotationMode;
int _duration;
- RGB8 _palette[256];
public:
PaletteRotation();
@@ -337,26 +347,24 @@ public:
virtual void signal();
virtual void remove();
- void setDisabled(bool v) { _disabled = v; }
+ void setStep(int step) { _step = step; }
void set(ScenePalette *palette, int start, int end, int rotationMode, int duration, Action *action);
- void setPalette(ScenePalette *palette, bool disabled);
bool decDuration();
void setDelay(int amount);
};
-/*--------------------------------------------------------------------------*/
-
-class PaletteUnknown : public PaletteModifier {
+class PaletteFader: public PaletteModifierCached {
public:
- int _step, _percent, _field12, _field14;
RGB8 _palette[256];
public:
- virtual Common::String getClassName() { return "PaletteUnknown"; }
+ virtual Common::String getClassName() { return "PaletteFader"; }
virtual void synchronise(Serialiser &s);
virtual void signal();
virtual void remove();
};
+/*--------------------------------------------------------------------------*/
+
enum FadeMode {FADEMODE_NONE = 0, FADEMODE_GRADUAL = 1, FADEMODE_IMMEDIATE = 2};
class ScenePalette : public SavedObject {
@@ -385,7 +393,7 @@ public:
void clearListeners();
void fade(const byte *adjustData, bool fullAdjust, int percent);
PaletteRotation *addRotation(int start, int end, int rotationMode, int duration = 0, Action *action = NULL);
- PaletteUnknown *addUnkPal(RGB8 *arrBufferRGB, int unkNumb, bool disabled, Action *action);
+ PaletteFader *addFader(RGB8 *arrBufferRGB, int palSize, int percent, Action *action);
static void changeBackground(const Rect &bounds, FadeMode fadeMode);