aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorPaul Gilbert2011-11-17 22:04:10 +1100
committerPaul Gilbert2011-11-17 22:04:10 +1100
commit4c3c8f8ce3403f67d683959b947b8eb560c55bae (patch)
treeb6e55161d2e28bdfc3ecdfc6b549c4f4bd2a8e12 /engines/tsage
parent718e314601f84fd6b7d43b32fe05668ec28aed21 (diff)
downloadscummvm-rg350-4c3c8f8ce3403f67d683959b947b8eb560c55bae.tar.gz
scummvm-rg350-4c3c8f8ce3403f67d683959b947b8eb560c55bae.tar.bz2
scummvm-rg350-4c3c8f8ce3403f67d683959b947b8eb560c55bae.zip
TSAGE: Added new properties and stubs needed for new R2RW functionality
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/converse.cpp27
-rw-r--r--engines/tsage/converse.h7
-rw-r--r--engines/tsage/core.cpp30
-rw-r--r--engines/tsage/core.h3
-rw-r--r--engines/tsage/sound.h2
-rw-r--r--engines/tsage/user_interface.cpp6
-rw-r--r--engines/tsage/user_interface.h1
7 files changed, 63 insertions, 13 deletions
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index 31a689b80c..b98f6f609d 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -551,6 +551,9 @@ void Obj44::synchronize(Serializer &s) {
for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx)
_list[idx].synchronize(s);
s.syncAsUint32LE(_speakerOffset);
+
+ if (g_vm->getGameID() == GType_Ringworld2)
+ s.syncAsSint16LE(_mode);
}
/*--------------------------------------------------------------------------*/
@@ -581,6 +584,11 @@ void StripManager::start(int stripNum, EventHandler *owner, StripCallback *callb
owner->setAction(this, owner);
}
+void StripManager::start3(int stripNum, EventHandler *owner, byte *lookupList) {
+ _lookupList = lookupList;
+ start(stripNum, owner, NULL);
+}
+
void StripManager::reset() {
_actionIndex = 0;
_delayFrames = 0;
@@ -703,7 +711,12 @@ void StripManager::signal() {
return;
} else if (_obj44Index == 10000) {
// Reached end of strip
+ EventHandler *endHandler = _endHandler;
remove();
+
+ if ((g_vm->getGameID() == GType_Ringworld2) && endHandler)
+ endHandler->signal();
+
return;
}
@@ -714,7 +727,19 @@ void StripManager::signal() {
load();
Obj44 &obj44 = _obj44List[_obj44Index];
- _field2E8 = obj44._id;
+
+ if (g_vm->getGameID() != GType_Ringworld2) {
+ _field2E8 = obj44._id;
+ } else {
+ if (obj44._id)
+ _field2E8 = obj44._id;
+
+ switch (obj44._mode) {
+ case 1:
+ break;
+ }
+ }
+
Common::StringArray choiceList;
// Build up a list of script entries
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index f82c07a7dd..db05913e08 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -185,6 +185,9 @@ public:
int _field2[OBJ44_LIST_SIZE];
Obj0A _list[OBJ44_LIST_SIZE];
uint _speakerOffset;
+
+ // Return to Ringworld specific field
+ int _mode;
public:
void load(const byte *dataP);
virtual void synchronize(Serializer &s);
@@ -215,6 +218,9 @@ public:
Common::Array<byte> _script;
StripProc _onBegin;
StripProc _onEnd;
+
+ // Ringworld 2 specific fields
+ byte *_lookupList;
public:
StripManager();
virtual ~StripManager();
@@ -225,6 +231,7 @@ public:
virtual void process(Event &event);
void start(int stripNum, EventHandler *owner, StripCallback *callback = NULL);
+ void start3(int stripNum, EventHandler *owner, byte *lookupList);
void setCallback(StripCallback *callback) { _callbackObject = callback; }
void setColors(int stdColor, int highlightColor) { _choiceDialog.setColors(stdColor, highlightColor); }
void setFontNumber(int fontNum) { _choiceDialog.setFontNumber(fontNum); }
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 5a43a3b6c0..679fb59ef9 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -1061,6 +1061,8 @@ PaletteRotation::PaletteRotation() : PaletteModifierCached() {
_percent = 0;
_delayCtr = 0;
_frameNumber = g_globals->_events.getFrameNumber();
+ _idxChange = 1;
+ _countdown = 0;
}
void PaletteRotation::synchronize(Serializer &s) {
@@ -1074,9 +1076,19 @@ void PaletteRotation::synchronize(Serializer &s) {
s.syncAsSint32LE(_rotationMode);
s.syncAsSint32LE(_duration);
s.syncBytes(&_palette[0], 256 * 3);
+
+ if (g_vm->getGameID() == GType_Ringworld2) {
+ s.syncAsSint16LE(_idxChange);
+ s.syncAsSint16LE(_countdown);
+ }
}
void PaletteRotation::signal() {
+ if (_countdown > 0) {
+ --_countdown;
+ return;
+ }
+
if (_delayCtr) {
uint32 frameNumber = g_globals->_events.getFrameNumber();
@@ -1098,21 +1110,24 @@ void PaletteRotation::signal() {
bool flag = true;
switch (_rotationMode) {
case -1:
- if (--_currIndex < _start) {
+ _currIndex -= _idxChange;
+ if (_currIndex < _start) {
flag = decDuration();
if (flag)
_currIndex = _end - 1;
}
break;
case 1:
- if (++_currIndex >= _end) {
+ _currIndex += _idxChange;
+ if (_currIndex >= _end) {
flag = decDuration();
if (flag)
_currIndex = _start;
}
break;
case 2:
- if (++_currIndex >= _end) {
+ _currIndex += _idxChange;
+ if (_currIndex >= _end) {
flag = decDuration();
if (flag) {
_currIndex = _end - 2;
@@ -1121,7 +1136,8 @@ void PaletteRotation::signal() {
}
break;
case 3:
- if (--_currIndex < _start) {
+ _currIndex -= _idxChange;
+ if (_currIndex < _start) {
flag = decDuration();
if (flag) {
_currIndex = _start + 1;
@@ -1144,7 +1160,9 @@ void PaletteRotation::signal() {
void PaletteRotation::remove() {
Action *action = _action;
- g_system->getPaletteManager()->setPalette((const byte *)&_palette[_start * 3], _start, _end - _start);
+
+ if (_idxChange)
+ g_system->getPaletteManager()->setPalette((const byte *)&_palette[_start * 3], _start, _end - _start);
_scenePalette->_listeners.remove(this);
@@ -2961,6 +2979,7 @@ Player::Player(): SceneObject() {
// Return to Ringworld specific fields
_characterIndex = 0;
_oldSceneNumber = 0;
+ _fieldBC = 0;
for (int i = 0; i < MAX_CHARACTERS; ++i) {
_characterScene[i] = 0;
@@ -3064,6 +3083,7 @@ void Player::synchronize(Serializer &s) {
if (g_vm->getGameID() == GType_Ringworld2) {
s.syncAsSint16LE(_characterIndex);
s.syncAsSint16LE(_oldSceneNumber);
+ s.syncAsSint16LE(_fieldBC);
for (int i = 0; i < MAX_CHARACTERS; ++i) {
s.syncAsSint16LE(_characterScene[i]);
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index 95ff1c145c..b2b491ce46 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -322,6 +322,8 @@ public:
int _end;
int _rotationMode;
int _duration;
+ int _idxChange;
+ int _countdown;
public:
PaletteRotation();
@@ -630,6 +632,7 @@ public:
// Return to Ringworld specific fields
int _characterIndex;
int _oldSceneNumber;
+ int _fieldBC;
int _characterScene[MAX_CHARACTERS];
Common::Point _characterPos[MAX_CHARACTERS];
int _characterStrip[MAX_CHARACTERS];
diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h
index f4286565b0..c7b07e2cc3 100644
--- a/engines/tsage/sound.h
+++ b/engines/tsage/sound.h
@@ -419,7 +419,7 @@ public:
Sound _sound;
void setFile(const Common::String &filename) {}
- void play(int soundNum, EventHandler *endAction) {}
+ bool play(int soundNum, EventHandler *endAction) { return false; }
void stop() {}
void proc1() {}
bool isPlaying() const { return false; }
diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp
index 807e788cb9..ef4eb29028 100644
--- a/engines/tsage/user_interface.cpp
+++ b/engines/tsage/user_interface.cpp
@@ -286,7 +286,6 @@ UIElements::UIElements(): UICollection() {
else
_cursorVisage.setVisage(1, 5);
g_saver->addLoadNotifier(&UIElements::loadNotifierProc);
- _characterIndex = 0;
}
void UIElements::synchronize(Serializer &s) {
@@ -314,9 +313,6 @@ void UIElements::synchronize(Serializer &s) {
s.syncAsSint16LE(itemId);
}
}
-
- if (g_vm->getGameID() == GType_Ringworld2)
- s.syncAsSint16LE(_characterIndex);
}
void UIElements::process(Event &event) {
@@ -427,7 +423,7 @@ void UIElements::setup(const Common::Point &pt) {
break;
case GType_Ringworld2:
// Set up the character display
- _character.setup(1, 5, _characterIndex, 285, 11, 255);
+ _character.setup(1, 5, R2_GLOBALS._player._characterIndex, 285, 11, 255);
add(&_character);
break;
default:
diff --git a/engines/tsage/user_interface.h b/engines/tsage/user_interface.h
index 94a2444e39..0fbfc5a00f 100644
--- a/engines/tsage/user_interface.h
+++ b/engines/tsage/user_interface.h
@@ -129,7 +129,6 @@ public:
Common::Array<int> _itemList;
Visage _cursorVisage;
UIElement _character;
- int _characterIndex;
UIElements();
virtual Common::String getClassName() { return "UIElements"; }