aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins
diff options
context:
space:
mode:
authorStrangerke2013-04-10 15:15:31 +0200
committerStrangerke2013-04-10 15:15:31 +0200
commit2709ac9fcbbf0f7ac37a1f8a0c3ec6b81a63f059 (patch)
tree87b36b3a96b3c6e437aa716d36e0e8a1bca3a829 /engines/hopkins
parentc09e0c26eced6d65b54a922de93f102d4a064360 (diff)
downloadscummvm-rg350-2709ac9fcbbf0f7ac37a1f8a0c3ec6b81a63f059.tar.gz
scummvm-rg350-2709ac9fcbbf0f7ac37a1f8a0c3ec6b81a63f059.tar.bz2
scummvm-rg350-2709ac9fcbbf0f7ac37a1f8a0c3ec6b81a63f059.zip
HOPKINS: Reduce verbosity of displaySprite()
Diffstat (limited to 'engines/hopkins')
-rw-r--r--engines/hopkins/objects.cpp58
1 files changed, 28 insertions, 30 deletions
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 9c1d7bc4e9..6afde0fb26 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -527,39 +527,37 @@ void ObjectsManager::displaySprite() {
// Loop to draw any on-screen text
for (int idx = 0; idx <= 10; ++idx) {
- if (_vm->_fontMan->_text[idx]._textOnFl) {
- if ((_vm->_fontMan->_text[idx]._textType < 2) || (_vm->_fontMan->_text[idx]._textType > 3))
- _vm->_fontMan->box(idx,
- _vm->_fontMan->_text[idx]._messageId, _vm->_fontMan->_text[idx]._filename,
- _vm->_events->_startPos.x + _vm->_fontMan->_text[idx]._pos.x, _vm->_fontMan->_text[idx]._pos.y);
+ Hopkins::TxtItem *curTxt = &_vm->_fontMan->_text[idx];
+ if (curTxt->_textOnFl) {
+ Hopkins::TxtItemList *curTxtList = &_vm->_fontMan->_textList[idx];
+ if ((curTxt->_textType < 2) || (curTxt->_textType > 3))
+ _vm->_fontMan->box(idx, curTxt->_messageId, curTxt->_filename, _vm->_events->_startPos.x + curTxt->_pos.x, curTxt->_pos.y);
else
- _vm->_fontMan->box(idx,
- _vm->_fontMan->_text[idx]._messageId, _vm->_fontMan->_text[idx]._filename,
- _vm->_fontMan->_text[idx]._pos.x, _vm->_fontMan->_text[idx]._pos.y);
- _vm->_fontMan->_textList[idx]._enabledFl = true;
+ _vm->_fontMan->box(idx, curTxt->_messageId, curTxt->_filename, curTxt->_pos.x, curTxt->_pos.y);
+ curTxtList->_enabledFl = true;
- if ((_vm->_fontMan->_text[idx]._textType < 2) || (_vm->_fontMan->_text[idx]._textType > 3))
- _vm->_fontMan->_textList[idx]._pos.x = _vm->_events->_startPos.x + _vm->_fontMan->_text[idx]._pos.x;
+ if ((curTxt->_textType < 2) || (curTxt->_textType > 3))
+ curTxtList->_pos.x = _vm->_events->_startPos.x + curTxt->_pos.x;
else
- _vm->_fontMan->_textList[idx]._pos.x = _vm->_fontMan->_text[idx]._pos.x;
-
- _vm->_fontMan->_textList[idx]._pos.y = _vm->_fontMan->_text[idx]._pos.y;
- _vm->_fontMan->_textList[idx]._width = _vm->_fontMan->_text[idx]._width;
- _vm->_fontMan->_textList[idx]._height = _vm->_fontMan->_text[idx]._height;
-
- if (_vm->_fontMan->_textList[idx]._pos.x < _vm->_graphicsMan->_minX)
- _vm->_fontMan->_textList[idx]._pos.x = _vm->_graphicsMan->_minX - 1;
- if (_vm->_fontMan->_textList[idx]._pos.y < _vm->_graphicsMan->_minY)
- _vm->_fontMan->_textList[idx]._pos.y = _vm->_graphicsMan->_minY - 1;
-
- int posX = _vm->_fontMan->_textList[idx]._pos.x;
- if (_vm->_fontMan->_textList[idx]._width + posX > _vm->_graphicsMan->_maxX)
- _vm->_fontMan->_textList[idx]._width = _vm->_graphicsMan->_maxX - posX;
- int posY = _vm->_fontMan->_textList[idx]._pos.y;
- if (_vm->_fontMan->_textList[idx]._height + posY > _vm->_graphicsMan->_maxY)
- _vm->_fontMan->_textList[idx]._height = _vm->_graphicsMan->_maxY - posY;
- if (_vm->_fontMan->_textList[idx]._width <= 0 || _vm->_fontMan->_textList[idx]._height <= 0)
- _vm->_fontMan->_textList[idx]._enabledFl = false;
+ curTxtList->_pos.x = curTxt->_pos.x;
+
+ curTxtList->_pos.y = curTxt->_pos.y;
+ curTxtList->_width = curTxt->_width;
+ curTxtList->_height = curTxt->_height;
+
+ if (curTxtList->_pos.x < _vm->_graphicsMan->_minX)
+ curTxtList->_pos.x = _vm->_graphicsMan->_minX - 1;
+ if (curTxtList->_pos.y < _vm->_graphicsMan->_minY)
+ curTxtList->_pos.y = _vm->_graphicsMan->_minY - 1;
+
+ int posX = curTxtList->_pos.x;
+ if (curTxtList->_width + posX > _vm->_graphicsMan->_maxX)
+ curTxtList->_width = _vm->_graphicsMan->_maxX - posX;
+ int posY = curTxtList->_pos.y;
+ if (curTxtList->_height + posY > _vm->_graphicsMan->_maxY)
+ curTxtList->_height = _vm->_graphicsMan->_maxY - posY;
+ if (curTxtList->_width <= 0 || curTxtList->_height <= 0)
+ curTxtList->_enabledFl = false;
}
}