aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mads/animation.cpp4
-rw-r--r--engines/mads/nebular/menu_nebular.cpp41
-rw-r--r--engines/mads/palette.cpp7
-rw-r--r--engines/tsage/debugger.cpp6
-rw-r--r--engines/tsage/debugger.h4
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp121
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.h6
7 files changed, 106 insertions, 83 deletions
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp
index 9b2c097004..ace505839c 100644
--- a/engines/mads/animation.cpp
+++ b/engines/mads/animation.cpp
@@ -242,7 +242,7 @@ void Animation::load(MSurface &backSurface, DepthSurface &depthSurface,
for (int i = 0; i < _header._frameEntriesCount; i++) {
AnimFrameEntry rec;
- rec.load(frameStream, flags & ANIMFLAG_LOAD_BACKGROUND);
+ rec.load(frameStream, _header._bgType == ANIMBG_INTERFACE);
_frameEntries.push_back(rec);
}
@@ -255,7 +255,7 @@ void Animation::load(MSurface &backSurface, DepthSurface &depthSurface,
// Chunk 4: Misc Data
Common::SeekableReadStream *miscStream = madsPack.getItemStream(streamIndex++);
- if (flags & ANIMFLAG_LOAD_BACKGROUND) {
+ if (_header._bgType == ANIMBG_INTERFACE) {
for (int i = 0; i < _header._miscEntriesCount; ++i) {
AnimUIEntry rec;
rec.load(miscStream);
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index 4f9493ade5..1fbf96dcd5 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -833,12 +833,13 @@ void AnimationView::load() {
}
void AnimationView::display() {
+ Scene &scene = _vm->_game->_scene;
_vm->_palette->initPalette();
Common::fill(&_vm->_palette->_cyclingPalette[0], &_vm->_palette->_cyclingPalette[PALETTE_SIZE], 0);
_vm->_palette->resetGamePalette(1, 8);
- _vm->_game->_scene._spriteSlots.reset();
- _vm->_game->_scene._paletteCycles.clear();
+ scene._spriteSlots.reset();
+ scene._paletteCycles.clear();
MenuView::display();
}
@@ -855,30 +856,43 @@ bool AnimationView::onEvent(Common::Event &event) {
}
void AnimationView::doFrame() {
-// Scene &scene = _vm->_game->_scene;
+ Scene &scene = _vm->_game->_scene;
- // TODO: Or when current animation is finished
- if (_resourceIndex == -1) {
- if (++_resourceIndex == (int)_resources.size())
+ if (_resourceIndex == -1 || _currentAnimation->freeFlag()) {
+ if (++_resourceIndex == (int)_resources.size()) {
scriptDone();
- else
+ } else {
+ scene._frameStartTime = 0;
loadNextResource();
+ }
+ }
+
+ if (_currentAnimation) {
+ ++scene._frameStartTime;
+ _currentAnimation->update();
+ _redrawFlag = true;
}
}
void AnimationView::loadNextResource() {
Scene &scene = _vm->_game->_scene;
+ Palette &palette = *_vm->_palette;
ResourceEntry &resEntry = _resources[_resourceIndex];
if (resEntry._bgFlag)
- _vm->_palette->resetGamePalette(1, 8);
+ palette.resetGamePalette(1, 8);
+ // Load the new animation
delete _currentAnimation;
_currentAnimation = Animation::init(_vm, &scene);
_currentAnimation->load(scene._backgroundSurface, scene._depthSurface,
- resEntry._resourceName, resEntry._bgFlag ? 0x100 : 0,
+ resEntry._resourceName, resEntry._bgFlag ? ANIMFLAG_LOAD_BACKGROUND : 0,
nullptr, _sceneInfo);
+ // Signal for a screen refresh
+ scene._spriteSlots.fullRefresh();
+ palette.setFullPalette(palette._mainPalette);
+
// If a sound driver has been specified, then load the correct one
if (!_currentAnimation->_header._soundName.empty()) {
const char *chP = strchr(_currentAnimation->_header._soundName.c_str(), '.');
@@ -903,6 +917,7 @@ void AnimationView::loadNextResource() {
_vm->_audio->setSoundGroup(dsrName);
// Initial frames scan loop
+ /*
bool foundFrame = false;
for (int frameCtr = 0; frameCtr < (int)_currentAnimation->_frameEntries.size(); ++frameCtr) {
int spritesIdx = _currentAnimation->_spriteListIndexes[_manualFrameNumber];
@@ -917,7 +932,11 @@ void AnimationView::loadNextResource() {
}
}
if (!foundFrame)
- _hasManual = false;
+ */
+ _hasManual = false;
+
+ // Start the new animation
+ _currentAnimation->startAnimation(0);
}
void AnimationView::scriptDone() {
@@ -935,7 +954,7 @@ void AnimationView::processLines() {
char c;
while (!_script.eos()) {
// Get in next line
- _currentLine.empty();
+ _currentLine.clear();
while (!_script.eos() && (c = _script.readByte()) != '\n') {
if (c != '\r')
_currentLine += c;
diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp
index eedbf36ddd..c098e23bf9 100644
--- a/engines/mads/palette.cpp
+++ b/engines/mads/palette.cpp
@@ -143,7 +143,7 @@ int PaletteUsage::process(Common::Array<RGB6> &palette, uint flags) {
for (uint palIndex = 0; palIndex < palette.size(); ++palIndex) {
bool changed = false;
- int newPalIndex = -1;
+ int newPalIndex = 0xFF;
int v1 = palRange[palIndex]._v2;
if (palette[v1]._flags & 8) {
@@ -229,7 +229,10 @@ int PaletteUsage::process(Common::Array<RGB6> &palette, uint flags) {
// In at least scene 318, when the doctor knocks you with the blackjack,
// the changed flag can be false
//assert(changed);
- assert(newPalIndex != -1);
+
+ // CHECKME: When pressing on F1 in the first screen, newPalIndex is set to 0xFF at this point
+ // which is a valid value for the index. Maybe a better check would be "< 256" ?
+ //assert(newPalIndex != -1);
int var52 = (noUsageFlag && palette[palIndex]._u2) ? 2 : 0;
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index b647807f8a..a38796717a 100644
--- a/engines/tsage/debugger.cpp
+++ b/engines/tsage/debugger.cpp
@@ -42,7 +42,7 @@ Debugger::Debugger() : GUI::Debugger() {
registerCmd("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject));
registerCmd("hotspots", WRAP_METHOD(Debugger, Cmd_Hotspots));
registerCmd("sound", WRAP_METHOD(Debugger, Cmd_Sound));
- registerCmd("setdebug", WRAP_METHOD(Debugger, Cmd_SetDebug));
+ registerCmd("setdebug", WRAP_METHOD(Debugger, Cmd_SetOutpostAlphaDebug));
}
static int strToInt(const char *s) {
@@ -344,7 +344,7 @@ bool Debugger::Cmd_Sound(int argc, const char **argv) {
/**
* Activate internal debugger, when available
*/
-bool Debugger::Cmd_SetDebug(int argc, const char **argv) {
+bool Debugger::Cmd_SetOutpostAlphaDebug(int argc, const char **argv) {
debugPrintf("Not available in this game\n");
return true;
}
@@ -720,7 +720,7 @@ bool Ringworld2Debugger::Cmd_MoveObject(int argc, const char **argv) {
/**
* Activate internal debugger, when available
*/
-bool Ringworld2Debugger::Cmd_SetDebug(int argc, const char **argv) {
+bool Ringworld2Debugger::Cmd_SetOutpostAlphaDebug(int argc, const char **argv) {
if (argc != 1) {
debugPrintf("Usage: %s\n", argv[0]);
return true;
diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h
index 610f45de64..b0f4c665dd 100644
--- a/engines/tsage/debugger.h
+++ b/engines/tsage/debugger.h
@@ -45,7 +45,7 @@ protected:
bool Cmd_Sound(int argc, const char **argv);
virtual bool Cmd_ListObjects(int argc, const char **argv) = 0;
virtual bool Cmd_MoveObject(int argc, const char **argv) = 0;
- virtual bool Cmd_SetDebug(int argc, const char **argv);
+ virtual bool Cmd_SetOutpostAlphaDebug(int argc, const char **argv);
};
class DemoDebugger : public Debugger {
@@ -70,7 +70,7 @@ class Ringworld2Debugger : public Debugger {
protected:
virtual bool Cmd_ListObjects(int argc, const char **argv);
virtual bool Cmd_MoveObject(int argc, const char **argv);
- virtual bool Cmd_SetDebug(int argc, const char **argv);
+ virtual bool Cmd_SetOutpostAlphaDebug(int argc, const char **argv);
};
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index ac1bea49b2..e29f336698 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -2268,8 +2268,8 @@ Scene1337::Scene1337() {
_shuffleEndedFl = false;
_currentPlayerNumb = 0;
- _actionIdx1 = 0;
- _actionIdx2 = 0;
+ _actionPlayerIdx = 0;
+ _actionVictimIdx = 0;
_showPlayerTurn = false;
_displayHelpFl = false;
_winnerId = -1;
@@ -2320,8 +2320,8 @@ void Scene1337::synchronize(Serializer &s) {
s.syncAsSint16LE(_currentDiscardIndex);
s.syncAsSint16LE(_cardsAvailableNumb);
s.syncAsSint16LE(_currentPlayerNumb);
- s.syncAsSint16LE(_actionIdx1);
- s.syncAsSint16LE(_actionIdx2);
+ s.syncAsSint16LE(_actionPlayerIdx);
+ s.syncAsSint16LE(_actionVictimIdx);
s.syncAsSint16LE(_winnerId);
s.syncAsSint16LE(_instructionsWaitCount);
s.syncAsSint16LE(_cursorCurRes);
@@ -2524,7 +2524,7 @@ void Scene1337::Action1::signal() {
scene->_gameBoardSide[0]._outpostStation[1]._card.remove();
scene->_stockPile.setup(1332, 5, 1);
- scene->_stockPile.setPosition(Common::Point(165, 95));
+ scene->_stockPile.setPosition(Common::Point(162, 95));
scene->_stockPile.setPriority(110);
scene->_stockPile._effect = EFFECT_SHADED;
scene->_stockPile.show();
@@ -3478,7 +3478,7 @@ void Scene1337::Action4::signal() {
scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]);
scene->_animatedCard._card.hide();
- if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0)
+ if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._cardId == 0)
&& (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
if (scene->_cardsAvailableNumb < 0)
scene->shuffleCards();
@@ -3732,6 +3732,7 @@ void Scene1337::Action7::signal() {
}
}
+// Remove a delay card
void Scene1337::Action8::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
@@ -3841,7 +3842,7 @@ void Scene1337::Action10::signal() {
bool found = false;
int indexFound = -1;
- switch (scene->_actionIdx1) {
+ switch (scene->_actionPlayerIdx) {
case 0:
for (indexFound = 0; indexFound < 3; indexFound++) {
if (scene->_gameBoardSide[0]._handCard[indexFound]._cardId == 29) {
@@ -3881,13 +3882,13 @@ void Scene1337::Action10::signal() {
bool found2 = false;
if (found) {
- switch (scene->_actionIdx1) {
+ switch (scene->_actionPlayerIdx) {
case 0:
- scene->subC51A0(&scene->_gameBoardSide[0]._handCard[indexFound], scene->_actionCard3);
+ scene->playInterceptorCard(&scene->_gameBoardSide[0]._handCard[indexFound], scene->_actionCard3);
found2 = true;
break;
case 1:
- scene->subC51A0(&scene->_gameBoardSide[1]._handCard[indexFound], scene->_actionCard3);
+ scene->playInterceptorCard(&scene->_gameBoardSide[1]._handCard[indexFound], scene->_actionCard3);
found2 = true;
break;
case 2:
@@ -3895,12 +3896,12 @@ void Scene1337::Action10::signal() {
if (MessageDialog::show(USE_INTERCEPTOR, NO_MSG, YES_MSG) == 0)
scene->subC4CEC();
else {
- scene->subC51A0(&scene->_gameBoardSide[2]._handCard[indexFound], scene->_actionCard3);
+ scene->playInterceptorCard(&scene->_gameBoardSide[2]._handCard[indexFound], scene->_actionCard3);
found2 = true;
}
break;
case 3:
- scene->subC51A0(&scene->_gameBoardSide[3]._handCard[indexFound], scene->_actionCard3);
+ scene->playInterceptorCard(&scene->_gameBoardSide[3]._handCard[indexFound], scene->_actionCard3);
found2 = true;
break;
default:
@@ -3911,7 +3912,7 @@ void Scene1337::Action10::signal() {
if (!found2)
break;
- if (scene->_actionIdx1 == 2) {
+ if (scene->_actionPlayerIdx == 2) {
int j = 0;
for (int i = 0; i <= 7; i++) {
if (scene->_gameBoardSide[2]._outpostStation[i]._cardId != 0)
@@ -3975,7 +3976,7 @@ void Scene1337::Action10::signal() {
}
}
-// Use trick (card #25 - thieft ?) and pick a card from the opponent
+// Use Thief card (#25) and pick a card from the opponent
void Scene1337::Action11::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
@@ -3988,7 +3989,7 @@ void Scene1337::Action11::signal() {
scene->_actionCard2->_card.fixPriority(170);
scene->_actionCard2->_cardId = 25;
- if (scene->_actionIdx1 == 2) {
+ if (scene->_actionPlayerIdx == 2) {
scene->_animatedCard._card.setPosition(scene->_actionCard2->_stationPos, 0);
scene->setCursorData(5, 1, 4);
} else {
@@ -4012,7 +4013,7 @@ void Scene1337::Action11::signal() {
int i = -1;
- switch (scene->_actionIdx2) {
+ switch (scene->_actionVictimIdx) {
case 0:
for (i = 0; i <= 3; i++) {
if (scene->_gameBoardSide[0]._handCard[i]._cardId == 27) {
@@ -4021,12 +4022,12 @@ void Scene1337::Action11::signal() {
}
}
- if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) {
+ if ((found) && (scene->getFreeHandCard(scene->_actionPlayerIdx) != -1)) {
scene->_actionCard1 = &scene->_gameBoardSide[0]._handCard[i];
scene->_actionCard2 = &scene->_gameBoardSide[0]._emptyStationPos;
- if (scene->_actionIdx1 != 0) {
- int tmpVal = scene->getFreeHandCard(scene->_actionIdx1);
- scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal];
+ if (scene->_actionPlayerIdx != 0) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionPlayerIdx);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionPlayerIdx]._handCard[tmpVal];
}
scene->_actionItem.setAction(&scene->_action12);
noAction = false;
@@ -4040,12 +4041,12 @@ void Scene1337::Action11::signal() {
}
}
- if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) {
+ if ((found) && (scene->getFreeHandCard(scene->_actionPlayerIdx) != -1)) {
scene->_actionCard1 = &scene->_gameBoardSide[1]._handCard[i];
scene->_actionCard2 = &scene->_gameBoardSide[1]._emptyStationPos;
- if (scene->_actionIdx1 != 1) {
- int tmpVal = scene->getFreeHandCard(scene->_actionIdx1);
- scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal];
+ if (scene->_actionPlayerIdx != 1) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionPlayerIdx);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionPlayerIdx]._handCard[tmpVal];
}
scene->_actionItem.setAction(&scene->_action12);
noAction = false;
@@ -4059,7 +4060,7 @@ void Scene1337::Action11::signal() {
}
}
- if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) {
+ if ((found) && (scene->getFreeHandCard(scene->_actionPlayerIdx) != -1)) {
scene->subC4CD2();
if (MessageDialog::show(USE_DOUBLE_AGENT, NO_MSG, YES_MSG) == 0)
scene->subC4CEC();
@@ -4067,9 +4068,9 @@ void Scene1337::Action11::signal() {
scene->subC4CEC();
scene->_actionCard1 = &scene->_gameBoardSide[2]._handCard[i];
scene->_actionCard2 = &scene->_gameBoardSide[2]._emptyStationPos;
- if (scene->_actionIdx1 != 2) {
- int tmpVal = scene->getFreeHandCard(scene->_actionIdx1);
- scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal];
+ if (scene->_actionPlayerIdx != 2) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionPlayerIdx);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionPlayerIdx]._handCard[tmpVal];
}
scene->_actionItem.setAction(&scene->_action12);
noAction = false;
@@ -4084,12 +4085,12 @@ void Scene1337::Action11::signal() {
}
}
- if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) {
+ if ((found) && (scene->getFreeHandCard(scene->_actionPlayerIdx) != -1)) {
scene->_actionCard1 = &scene->_gameBoardSide[3]._handCard[i];
scene->_actionCard2 = &scene->_gameBoardSide[3]._emptyStationPos;
- if (scene->_actionIdx1 != 3) {
- int tmpVal = scene->getFreeHandCard(scene->_actionIdx1);
- scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal];
+ if (scene->_actionPlayerIdx != 3) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionPlayerIdx);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionPlayerIdx]._handCard[tmpVal];
}
scene->_actionItem.setAction(&scene->_action12);
noAction = false;
@@ -4102,11 +4103,11 @@ void Scene1337::Action11::signal() {
if (!noAction)
return;
- if (scene->_actionIdx1 == 2) {
+ if (scene->_actionPlayerIdx == 2) {
int count = 0;
- if (scene->_actionIdx2 != 2) {
+ if (scene->_actionVictimIdx != 2) {
for (i = 0; i <= 3; i++) {
- if (scene->_gameBoardSide[scene->_actionIdx2]._handCard[i]._cardId == 0)
+ if (scene->_gameBoardSide[scene->_actionVictimIdx]._handCard[i]._cardId != 0)
++count;
}
}
@@ -4116,7 +4117,7 @@ void Scene1337::Action11::signal() {
found = false;
while (!found) {
- switch (scene->_actionIdx2) {
+ switch (scene->_actionVictimIdx) {
case 0:
scene->actionDisplay(1330, 131, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
@@ -4141,10 +4142,10 @@ void Scene1337::Action11::signal() {
found = false;
- if (scene->_actionIdx2 != 2) {
+ if (scene->_actionVictimIdx != 2) {
for (i = 0; i <= 3; i++) {
- if (scene->_gameBoardSide[scene->_actionIdx2]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[scene->_actionIdx2]._handCard[i]._cardId != 0)) {
- scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[i];
+ if (scene->_gameBoardSide[scene->_actionVictimIdx]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[scene->_actionVictimIdx]._handCard[i]._cardId != 0)) {
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionVictimIdx]._handCard[i];
found = true;
break;
}
@@ -4153,9 +4154,9 @@ void Scene1337::Action11::signal() {
} // while
scene->_displayHelpFl = true;
scene->subC4CEC();
- } else if (scene->_actionIdx2 != 2) {
- int tmpVal = scene->getFreeHandCard(scene->_actionIdx2);
- scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[tmpVal];
+ } else if (scene->_actionVictimIdx != 2) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionVictimIdx);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionVictimIdx]._handCard[tmpVal];
}
}
@@ -4179,7 +4180,7 @@ void Scene1337::Action11::signal() {
break;
case 2:
scene->_animatedCard._card.hide();
- switch (scene->_actionIdx1) {
+ switch (scene->_actionPlayerIdx) {
case 0:
scene->_actionCard1->_card.setFrame2(2);
scene->_actionCard1->_card.show();
@@ -4231,10 +4232,10 @@ void Scene1337::Action12::signal() {
scene->_animatedCard._card.hide();
scene->setAnimationInfo(scene->_actionCard2);
scene->_aSound1.play(58);
- if (scene->_actionIdx2 == 2) {
+ if (scene->_actionVictimIdx == 2) {
int count = 0;
int i = -1;
- switch (scene->_actionIdx1) {
+ switch (scene->_actionPlayerIdx) {
case 0:
for (i = 0; i <= 3; i++) {
if (scene->_gameBoardSide[0]._handCard[i]._cardId != 0)
@@ -4264,7 +4265,7 @@ void Scene1337::Action12::signal() {
bool found = false;
while (!found) {
- switch (scene->_actionIdx1) {
+ switch (scene->_actionPlayerIdx) {
case 0:
scene->actionDisplay(1330, 131, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
@@ -4287,7 +4288,7 @@ void Scene1337::Action12::signal() {
scene->_selectedCard._stationPos = event.mousePos;
- if (scene->_actionIdx1 == 0) {
+ if (scene->_actionPlayerIdx == 0) {
for (i = 0; i <= 3; i++) {
if (scene->_gameBoardSide[0]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[0]._handCard[i]._cardId != 0)) {
found = true;
@@ -4297,7 +4298,7 @@ void Scene1337::Action12::signal() {
}
}
- if (scene->_actionIdx1 == 3) {
+ if (scene->_actionPlayerIdx == 3) {
for (i = 0; i <= 3; i++) {
if (scene->_gameBoardSide[3]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[3]._handCard[i]._cardId != 0)) {
found = true;
@@ -4307,7 +4308,7 @@ void Scene1337::Action12::signal() {
}
}
- if (scene->_actionIdx1 == 1) {
+ if (scene->_actionPlayerIdx == 1) {
for (i = 0; i <= 3; i++) {
if (scene->_gameBoardSide[1]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[1]._handCard[i]._cardId != 0)) {
found = true;
@@ -4318,8 +4319,8 @@ void Scene1337::Action12::signal() {
}
}
scene->subC4CEC();
- } else if (scene->_actionIdx1 != 1) {
- switch (scene->_actionIdx1) {
+ } else if (scene->_actionPlayerIdx != 1) {
+ switch (scene->_actionPlayerIdx) {
case 0:
scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[scene->getFreeHandCard(0)];
break;
@@ -4354,7 +4355,7 @@ void Scene1337::Action12::signal() {
break;
case 3:
scene->_animatedCard._card.hide();
- switch (scene->_actionIdx2) {
+ switch (scene->_actionVictimIdx) {
case 0:
scene->_actionCard1->_card.setFrame2(2);
scene->_actionCard1->_card.show();
@@ -4379,6 +4380,7 @@ void Scene1337::Action12::signal() {
}
}
+// Handle the animations of the interceptor card
void Scene1337::Action13::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
@@ -4943,8 +4945,8 @@ void Scene1337::handlePlayer01Discard(int playerId) {
}
void Scene1337::playThieftCard(int playerId, Card *card, int victimId) {
- _actionIdx1 = playerId;
- _actionIdx2 = victimId;
+ _actionPlayerIdx = playerId;
+ _actionVictimIdx = victimId;
int randIndx;
@@ -5110,7 +5112,7 @@ void Scene1337::playCounterTrickCard(Card *card, int playerId) {
_actionCard1 = card;
_actionCard2 = getStationCard(playerId);
_actionCard3 = &_gameBoardSide[playerId]._emptyStationPos;
- _actionIdx1 = playerId;
+ _actionPlayerIdx = playerId;
_actionItem.setAction(&_action10);
handleNextTurn();
}
@@ -5135,7 +5137,8 @@ void Scene1337::subC4CEC() {
}
}
-void Scene1337::subC51A0(Card *subObj1, Card *subObj2) {
+// Play Interceptor card
+void Scene1337::playInterceptorCard(Card *subObj1, Card *subObj2) {
_actionCard1 = subObj1;
_actionCard2 = subObj2;
@@ -6271,7 +6274,6 @@ void Scene1337::handlePlayer2() {
//warning("_selectedCard._field0 = handcard->_field0;");
_selectedCard._card._updateStartFrame = handcard->_card._updateStartFrame;
_selectedCard._card._walkStartFrame = handcard->_card._walkStartFrame;
- // _field2E is named _field3C in R2R
_selectedCard._card._oldPosition = handcard->_card._oldPosition;
_selectedCard._card._percent = handcard->_card._percent;
_selectedCard._card._priority = handcard->_card._priority;
@@ -6287,7 +6289,6 @@ void Scene1337::handlePlayer2() {
_selectedCard._card._animateMode = handcard->_card._animateMode;
_selectedCard._card._frame = handcard->_card._frame;
_selectedCard._card._endFrame = handcard->_card._endFrame;
- // _field68 is named _field76 in R2R
_selectedCard._card._loopCount = handcard->_card._loopCount;
_selectedCard._card._frameChange = handcard->_card._frameChange;
_selectedCard._card._numFrames = handcard->_card._numFrames;
@@ -6724,7 +6725,7 @@ void Scene1337::setCursorData(int resNum, int rlbNum, int frameNum) {
void Scene1337::subD18F5() {
if (R2_GLOBALS._v57709 == 0)
// The original restores a copy of the default cursor (the hand), which isn't possible with our implementation
- // We reload of that cursor instead.
+ // We reload that cursor instead.
setCursorData(5, 1, 4);
++R2_GLOBALS._v57709;
@@ -6749,7 +6750,7 @@ void Scene1337::subD1940(bool flag) {
}
void Scene1337::subD1975(int arg1, int arg2) {
- warning("STUBBED lvl2 Scene1337::subD1975()");
+ // No implementation required in ScummVM: Mouse handling with tons of caching
}
void Scene1337::OptionsDialog::show() {
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h
index 91c4b88391..6c24a4e989 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.h
@@ -312,8 +312,8 @@ public:
int _availableCardsPile[100];
int _cardsAvailableNumb;
int _currentPlayerNumb;
- int _actionIdx1;
- int _actionIdx2;
+ int _actionPlayerIdx;
+ int _actionVictimIdx;
int _winnerId;
int _instructionsWaitCount;
int _cursorCurRes;
@@ -372,7 +372,7 @@ public:
void discardCard(Card *card);
void subC4CD2();
void subC4CEC();
- void subC51A0(Card *subObj1, Card *subObj2);
+ void playInterceptorCard(Card *subObj1, Card *subObj2);
void displayDialog(int dialogNumb);
void subPostInit();
void displayInstructions();