[Scummvm-cvs-logs] scummvm master -> 2f5e15d2e0b0fc158f7415ac9d99e30108c69932
Strangerke
Strangerke at scummvm.org
Tue Dec 24 18:31:43 CET 2013
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
28955963d4 HOPKINS: Fix bug #6456 - RTL not working.
2f5e15d2e0 TSAGE: R2R - change a use of checkAntiDelayCard() for consistency
Commit: 28955963d4bcd71e1ae829a3a6690e135b17c2c1
https://github.com/scummvm/scummvm/commit/28955963d4bcd71e1ae829a3a6690e135b17c2c1
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-12-24T09:24:48-08:00
Commit Message:
HOPKINS: Fix bug #6456 - RTL not working.
Changed paths:
engines/hopkins/graphics.cpp
engines/hopkins/hopkins.cpp
engines/hopkins/hopkins.h
engines/hopkins/objects.cpp
engines/hopkins/talk.cpp
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 05b8296..a64e81f 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -1781,7 +1781,7 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init
do {
int dataVal1 = _vm->_script->handleOpcode(ptr + 20 * dataOffset);
- if (_vm->shouldQuit())
+ if (dataVal1 == -1 || _vm->shouldQuit())
return;
if (dataVal1 == 2)
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index adf7580..f557723 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -1923,7 +1923,6 @@ void HopkinsEngine::bombExplosion() {
}
void HopkinsEngine::restoreSystem() {
- quitGame();
_events->refreshEvents();
}
@@ -2913,4 +2912,7 @@ bool HopkinsEngine::isUnderwaterSubScene() {
return (_globals->_curRoomNum >= 77) && (_globals->_curRoomNum <= 89);
}
+bool HopkinsEngine::shouldQuit() {
+ return getEventManager()->shouldQuit() || getEventManager()->shouldRTL();
+}
} // End of namespace Hopkins
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index b7c6a9b..7961607 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -168,6 +168,7 @@ public:
uint16 getVersion() const;
bool getIsDemo() const;
const Common::String &getTargetName() const;
+ bool shouldQuit();
int getRandomNumber(int maxNumber);
Common::String generateSaveName(int slotNumber);
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index f2f5475..347a6aa 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -2629,7 +2629,7 @@ void ObjectsManager::loadObjectIniFile() {
for (;;) {
int opcodeType = _vm->_script->handleOpcode(data + 20 * lastOpcodeResult);
- if (_vm->shouldQuit())
+ if (opcodeType == -1 || _vm->shouldQuit())
return;
if (opcodeType == 2)
diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp
index d218dd2..c80ea15 100644
--- a/engines/hopkins/talk.cpp
+++ b/engines/hopkins/talk.cpp
@@ -825,7 +825,7 @@ void TalkManager::handleAnswer(int zone, int verb) {
int lastOpcodeResult = 1;
do {
int opcodeType = _vm->_script->handleOpcode(ptr + 20 * lastOpcodeResult);
- if (_vm->shouldQuit())
+ if (opcodeType == -1 || _vm->shouldQuit())
return;
if (opcodeType == 2)
Commit: 2f5e15d2e0b0fc158f7415ac9d99e30108c69932
https://github.com/scummvm/scummvm/commit/2f5e15d2e0b0fc158f7415ac9d99e30108c69932
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-12-24T09:31:09-08:00
Commit Message:
TSAGE: R2R - change a use of checkAntiDelayCard() for consistency
Changed paths:
engines/tsage/ringworld2/ringworld2_scenes1.cpp
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index fb0fcd5..0025d0b 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -3374,7 +3374,8 @@ void Scene1337::Action4::signal() {
switch (_actionIndex++) {
case 0:
- if ((scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0) && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
+ if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0)
+ && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
if (scene->_cardsAvailableNumb < 0)
scene->shuffleCards();
scene->_animatedCard._card.setPosition(Common::Point(162, 95), 0);
@@ -3396,8 +3397,8 @@ void Scene1337::Action4::signal() {
}
break;
case 1:
- if ( ( scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.x)
- && ( scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.y) ) {
+ if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.x)
+ && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.y) ) {
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.postInit();
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card._moveDiff = Common::Point(30, 30);
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setVisage(1332);
@@ -3411,7 +3412,8 @@ 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) && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
+ if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0)
+ && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
if (scene->_cardsAvailableNumb < 0)
scene->shuffleCards();
scene->_animatedCard._card.setPosition(Common::Point(162, 95));
@@ -3431,8 +3433,8 @@ void Scene1337::Action4::signal() {
signal();
break;
case 2:
- if ( ( scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.x)
- && ( scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.y) ) {
+ if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.x)
+ && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.y) ) {
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.postInit();
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card._moveDiff = Common::Point(30, 30);
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setVisage(1332);
@@ -3446,7 +3448,8 @@ void Scene1337::Action4::signal() {
scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]);
scene->_animatedCard._card.hide();
- if ((scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._cardId == 0) && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
+ if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._cardId == 0)
+ && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
if (scene->_cardsAvailableNumb < 0)
scene->shuffleCards();
scene->_animatedCard._card.setPosition(Common::Point(162, 95));
@@ -3466,8 +3469,8 @@ void Scene1337::Action4::signal() {
signal();
break;
case 3:
- if ( ( scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.x)
- && ( scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.y) ) {
+ if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.x)
+ && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.y) ) {
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.postInit();
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card._moveDiff = Common::Point(30, 30);
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setVisage(1332);
@@ -3481,7 +3484,8 @@ void Scene1337::Action4::signal() {
scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]);
scene->_animatedCard._card.hide();
- if ((scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._cardId == 0) && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
+ if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._cardId == 0)
+ && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
if (scene->_cardsAvailableNumb < 0)
scene->shuffleCards();
scene->_animatedCard._card.setPosition(Common::Point(162, 95));
@@ -3501,8 +3505,8 @@ void Scene1337::Action4::signal() {
signal();
break;
case 4:
- if ( ( scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.x)
- && ( scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.y) ) {
+ if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.x)
+ && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.y) ) {
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.postInit();
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card._moveDiff = Common::Point(30, 30);
scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setVisage(1332);
@@ -5798,7 +5802,8 @@ void Scene1337::handlePlayer0() {
for (int i = 0; i <= 3; i++) {
if ((getStationCardId(_gameBoardSide[0]._handCard[i]._cardId) != -1)
- && (_gameBoardSide[2]._delayCard._cardId == 0) && isAttackPossible(2, _gameBoardSide[0]._handCard[i]._cardId)) {
+ && (_gameBoardSide[2]._delayCard._cardId == 0)
+ && isAttackPossible(2, _gameBoardSide[0]._handCard[i]._cardId)) {
playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[2]._delayCard);
return;
}
@@ -6361,7 +6366,10 @@ void Scene1337::handlePlayer2() {
// Check anti-delay card
if (_gameBoardSide[2]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
actionDisplay(1330, 42, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (!checkAntiDelayCard(_gameBoardSide[2]._delayCard._cardId, _selectedCard._cardId)) {
+ } else if (checkAntiDelayCard(_gameBoardSide[2]._delayCard._cardId, _selectedCard._cardId)) {
+ playAntiDelayCard(&_selectedCard, &_gameBoardSide[2]._delayCard);
+ return;
+ } else {
if (_gameBoardSide[2]._delayCard._cardId != 0) {
switch (_gameBoardSide[2]._delayCard._cardId) {
case 11:
@@ -6382,9 +6390,6 @@ void Scene1337::handlePlayer2() {
} else {
actionDisplay(1330, 41, 159, 10, 1, 200, 0, 7, 0, 154, 154);
}
- } else {
- playAntiDelayCard(&_selectedCard, &_gameBoardSide[2]._delayCard);
- return;
}
} else if ((getStationCardId(_selectedCard._cardId) == -1) && (isDelayCard(_selectedCard._cardId) == -1)) {
if (_selectedCard._cardId == 13) {
More information about the Scummvm-git-logs
mailing list