aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2013-02-11 00:36:43 +0100
committerStrangerke2013-02-11 00:36:43 +0100
commit425830af878061967b4a8c4dbe41e8d146877d3f (patch)
treefc7d5c9b0137f216574d11a3a6ae5a39c647ae0b /engines
parent705d00470a092da515e12e1f5c192d3ed36a0b42 (diff)
downloadscummvm-rg350-425830af878061967b4a8c4dbe41e8d146877d3f.tar.gz
scummvm-rg350-425830af878061967b4a8c4dbe41e8d146877d3f.tar.bz2
scummvm-rg350-425830af878061967b4a8c4dbe41e8d146877d3f.zip
HOPKINS: Some renaming and refactoring in ComputerManager and FontManager
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/computer.cpp11
-rw-r--r--engines/hopkins/font.cpp43
2 files changed, 23 insertions, 31 deletions
diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp
index 12ac40e6d8..6a4459857e 100644
--- a/engines/hopkins/computer.cpp
+++ b/engines/hopkins/computer.cpp
@@ -706,8 +706,7 @@ void ComputerManager::displayLives() {
* Main function for breakout game
*/
void ComputerManager::playBreakout() {
- int v1 = 0;
-
+ int lastBreakoutEvent = 0;
while (!_vm->shouldQuit()) {
while (!_vm->shouldQuit()) {
// Set up the racket and ball
@@ -747,10 +746,10 @@ void ComputerManager::playBreakout() {
if (_padPositionX > 282)
_padPositionX = 282;
_vm->_objectsManager.setSpriteX(0, _padPositionX);
- v1 = moveBall();
+ lastBreakoutEvent = moveBall();
_vm->_eventsManager.VBL();
- } while (!_vm->shouldQuit() && !v1);
- if (v1 != 1)
+ } while (!_vm->shouldQuit() && !lastBreakoutEvent);
+ if (lastBreakoutEvent != 1)
break;
_vm->_graphicsManager.fateOutBreakout();
--_breakoutLives;
@@ -778,7 +777,7 @@ void ComputerManager::playBreakout() {
loadHiscore();
newLevel();
}
- if (v1 != 2)
+ if (lastBreakoutEvent != 2)
return;
_vm->_graphicsManager.fateOutBreakout();
newLevel();
diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp
index b9ee2d886f..679847174c 100644
--- a/engines/hopkins/font.cpp
+++ b/engines/hopkins/font.cpp
@@ -140,7 +140,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
Common::String file;
Common::File f;
- int v73 = xp;
+ int textPosX = xp;
if (idx < 0)
error("Bad number for text");
_fontFixedWidth = 11;
@@ -259,7 +259,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
if (v17 < 0)
v17 = -v17;
_text[idx]._pos.x = 320 - v17;
- v73 = _vm->_eventsManager._startPos.x + 320 - v17;
+ textPosX = _vm->_eventsManager._startPos.x + 320 - v17;
lineCount = 1;
// CHECKME: textLength should be always positive...
if (textLength + 1 > 0) {
@@ -289,7 +289,6 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
break;
}
}
- int v20 = lineCount;
// WORKAROUND: Perhaps due to the usage of ScummVM strings here, recalculate what the
// actual length of the line to be copied will be. Otherwise, you can see artifacts,
@@ -298,7 +297,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
while (actualSize < lineSize && _tempText[v65 + actualSize])
++actualSize;
- _text[idx]._lines[v20] = Common::String((const char *)_tempText + v65, actualSize);
+ _text[idx]._lines[lineCount] = Common::String((const char *)_tempText + v65, actualSize);
_textSortArray[lineCount++] = lineSize;
v65 += lineSize;
@@ -320,8 +319,8 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
}
}
for (int i = 0; i <= 19; i++) {
- for (int v25 = i + 1; v25 != i; v25 = (v25 + 1) % 20) {
- if (_textSortArray[i] < _textSortArray[v25])
+ for (int j = i + 1; j != i; j = (j + 1) % 20) {
+ if (_textSortArray[i] < _textSortArray[j])
_textSortArray[i] = 0;
}
};
@@ -336,33 +335,27 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
for (i = xp - _vm->_eventsManager._startPos.x; _vm->_globals._boxWidth + i > 638 && i > -2 && _text[idx]._textType; i -= 2)
;
_text[idx]._pos.x = i;
- v73 = _vm->_eventsManager._startPos.x + i;
+ textPosX = _vm->_eventsManager._startPos.x + i;
} else {
if (_vm->_globals.nbrligne == (SCREEN_WIDTH - 1)) {
- while (_vm->_globals._boxWidth + v73 > 638 && v73 > -2)
- v73 -= 2;
+ while (_vm->_globals._boxWidth + textPosX > 638 && textPosX > -2)
+ textPosX -= 2;
}
if (_vm->_globals.nbrligne == (SCREEN_WIDTH * 2)) {
- while (_vm->_globals._boxWidth + v73 > 1278 && v73 > -2)
- v73 -= 2;
+ while (_vm->_globals._boxWidth + textPosX > 1278 && textPosX > -2)
+ textPosX -= 2;
}
- _text[idx]._pos.x = v73;
+ _text[idx]._pos.x = textPosX;
}
}
- int posX = v73;
+ int posX = textPosX;
int posY = yp;
int saveWidth = _vm->_globals._boxWidth + 10;
int saveHeight = (_fontFixedHeight + 1) * lineCount + 12;
if (_text[idx]._textType == 6) {
- int v27 = saveWidth / 2;
- if (v27 < 0)
- v27 = -v27;
- _text[idx]._pos.x = 315 - v27;
- int v28 = _vm->_eventsManager._startPos.x + 315 - v27;
- v73 = _vm->_eventsManager._startPos.x + 315 - v27;
- _text[idx]._pos.y = 50;
- posY = 50;
- posX = v28;
+ _text[idx]._pos.x = 315 - abs(saveWidth / 2);
+ textPosX = posX = _vm->_eventsManager._startPos.x + _text[idx]._pos.x;
+ _text[idx]._pos.y = posY = 50;
}
int textType = _text[idx]._textType;
if (textType == 1 || textType == 3 || textType == 5 || textType == 6) {
@@ -382,11 +375,11 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
_vm->_graphicsManager.drawVerticalLine(_vm->_graphicsManager._vesaBuffer, saveWidth + posX, posY, saveHeight, (byte)-2);
}
_text[idx]._lineCount = lineCount;
- int v71 = posY + 5;
+ int textPosY = posY + 5;
for (int lineNum = 0; lineNum < lineCount; ++lineNum) {
- displayText(v73 + 5, v71, _text[idx]._lines[lineNum], _text[idx]._color);
- v71 += _fontFixedHeight + 1;
+ displayText(textPosX + 5, textPosY, _text[idx]._lines[lineNum], _text[idx]._color);
+ textPosY += _fontFixedHeight + 1;
}
int blockWidth = saveWidth + 1;