aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2012-12-02 22:33:35 +1100
committerPaul Gilbert2012-12-02 22:33:35 +1100
commit542d7fd068d0718b3e74c21251c4d28680f50b84 (patch)
tree5b56475049615b7bf4a25c189399b55258a72e3b /engines
parent3841a0d0068498e23895a565c441bda62d65dc03 (diff)
downloadscummvm-rg350-542d7fd068d0718b3e74c21251c4d28680f50b84.tar.gz
scummvm-rg350-542d7fd068d0718b3e74c21251c4d28680f50b84.tar.bz2
scummvm-rg350-542d7fd068d0718b3e74c21251c4d28680f50b84.zip
HOPKINS: Bugfixes for quitting in the Windows demo version
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/hopkins.cpp26
-rw-r--r--engines/hopkins/menu.cpp3
2 files changed, 18 insertions, 11 deletions
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index d4d5411054..b0487c1cfc 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -195,13 +195,17 @@ LABEL_18:
if (_globals.SORTIE == -1) {
_globals.PERSO = _globals.dos_free2(_globals.PERSO);
REST_SYSTEM();
+ return false;
}
}
- while (1) {
- while (1) {
- while (1) {
- while (1) {
- while (1) {
+ for (;;) {
+ for (;;) {
+ for (;;) {
+ for (;;) {
+ for (;;) {
+ if (g_system->getEventManager()->shouldQuit())
+ return false;
+
if (_globals.SORTIE == 300)
goto LABEL_18;
if (_globals.SORTIE != 1)
@@ -2656,7 +2660,7 @@ void HopkinsEngine::Charge_Credits() {
_globals.Credit[idxLines]._actvFl = true;
_globals.Credit[idxLines]._linePosY = _globals.Credit_y + idxLines * _globals.Credit_step;
int idxBuf = 0;
- while (1) {
+ for (;;) {
byte curChar = curPtr[idxBuf + 3];
if (curChar == '%' || curChar == 10)
break;
@@ -2690,7 +2694,7 @@ void HopkinsEngine::CREDIT_AFFICHE(int startPosY, byte *buffer, char colour) {
byte *bufPtr = buffer;
int strWidth = 0;
byte curChar;
- while (1) {
+ for (;;) {
curChar = *bufPtr++;
if (!curChar)
break;
@@ -2716,7 +2720,7 @@ void HopkinsEngine::CREDIT_AFFICHE(int startPosY, byte *buffer, char colour) {
_globals.Credit_by1 = endPosY;
bufPtr = buffer;
- while (1) {
+ for (;;) {
curChar = *bufPtr++;
if (!curChar)
break;
@@ -2807,7 +2811,7 @@ void HopkinsEngine::BTOCEAN() {
_globals.OCEAN_SENS = 7;
_globals.SORTIE = 1;
int oldX = _objectsManager.XSPR(0);
- while (1) {
+ for (;;) {
if (_globals.vitesse == 1)
oldX -= 2;
else if (_globals.vitesse == 2)
@@ -2839,7 +2843,7 @@ LABEL_22:
_globals.OCEAN_SENS = 3;
_globals.SORTIE = 2;
int oldX = _objectsManager.XSPR(0);
- while (1) {
+ for (;;) {
if (_globals.vitesse == 1)
oldX += 2;
else if (_globals.vitesse == 2)
@@ -2945,7 +2949,7 @@ LABEL_72:
LABEL_91:
if (_globals.OCEAN_SENS == 7) {
int oldX = _objectsManager.XSPR(0);
- while (1) {
+ for (;;) {
if (_globals.vitesse == 1)
oldX -= 2;
else if (_globals.vitesse == 2)
diff --git a/engines/hopkins/menu.cpp b/engines/hopkins/menu.cpp
index 7f7e3803cc..18484580e7 100644
--- a/engines/hopkins/menu.cpp
+++ b/engines/hopkins/menu.cpp
@@ -52,6 +52,9 @@ int MenuManager::MENU() {
int frame2Index;
int frame1Index;
+ if (g_system->getEventManager()->shouldQuit())
+ return -1;
+
result = 0;
while (!g_system->getEventManager()->shouldQuit()) {
_vm->_globals.FORET = false;