diff options
author | Strangerke | 2013-10-01 07:29:15 +0200 |
---|---|---|
committer | Strangerke | 2013-10-01 07:29:15 +0200 |
commit | bc4a8f8671470a063e13f7b079b337d673207ffa (patch) | |
tree | 5741020756447d0cbdd5b3afbb8916d454f91b22 /engines/avalanche | |
parent | 15acaa1a77b5f6cba5829d5274d3ffe99fa56fbb (diff) | |
download | scummvm-rg350-bc4a8f8671470a063e13f7b079b337d673207ffa.tar.gz scummvm-rg350-bc4a8f8671470a063e13f7b079b337d673207ffa.tar.bz2 scummvm-rg350-bc4a8f8671470a063e13f7b079b337d673207ffa.zip |
AVALANCHE: _scrollNum is now a C index
Diffstat (limited to 'engines/avalanche')
-rw-r--r-- | engines/avalanche/dialogs.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index 43b85cf92d..a07b0c611d 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -409,9 +409,9 @@ void Dialogs::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) { void Dialogs::drawScroll(DialogFunctionType modeFunc) { int16 lx = 0; - int16 ly = (_scrollNum) * 6; + int16 ly = (_scrollNum + 1) * 6; int16 ex; - for (int i = 0; i < _scrollNum; i++) { + for (int i = 0; i <= _scrollNum; i++) { ex = _scroll[i].size() * 8; if (lx < ex) lx = ex; @@ -452,7 +452,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) { iconIndent = 53; } - for (int i = 0; i < _scrollNum; i++) { + for (int i = 0; i <= _scrollNum; i++) { if (!_scroll[i].empty()) switch (_scroll[i][_scroll[i].size() - 1]) { case kControlCenter: @@ -499,8 +499,8 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) { CursorMan.showMouse(false); int16 xl = 0; - int16 yl = _scrollNum * 5; - for (int i = 0; i < _scrollNum; i++) { + int16 yl = (_scrollNum + 1) * 5; + for (int i = 0; i <= _scrollNum; i++) { uint16 textWidth = _scroll[i].size() * 8; if (textWidth > xl) xl = textWidth; @@ -530,7 +530,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) { // Draw the text of the bubble. The centering of the text was improved here compared to Pascal's settextjustify(). // The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used characters instead. // It's almost the same, only notable differences are '?', '!', etc. - for (int i = 0; i < _scrollNum; i++) { + for (int i = 0; i <= _scrollNum; i++) { int16 x = xc + _vm->_talkX - _scroll[i].size() / 2 * 8; bool offset = _scroll[i].size() % 2; _vm->_graphics->drawScrollText(_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_talkFontColor); @@ -549,7 +549,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) { } void Dialogs::reset() { - _scrollNum = 1; + _scrollNum = 0; for (int i = 0; i < 15; i++) { if (!_scroll[i].empty()) _scroll[i].clear(); @@ -612,7 +612,7 @@ void Dialogs::callDialogDriver() { setReadyLight(0); _scReturn = false; bool mouthnext = false; - bool call_spriterun = true; // Only call sprite_run the FIRST time. + bool callSpriteRun = true; // Only call sprite_run the FIRST time. switch (_vm->_buffer[_vm->_bufSize - 1]) { case kControlToBuffer: @@ -641,12 +641,12 @@ void Dialogs::callDialogDriver() { } else { switch (_vm->_buffer[i]) { case kControlParagraph: - if ((_scrollNum == 1) && (_scroll[0].empty())) + if ((_scrollNum == 0) && (_scroll[0].empty())) break; - if (call_spriterun) + if (callSpriteRun) _vm->spriteRun(); - call_spriterun = false; + callSpriteRun = false; drawScroll(&Avalanche::Dialogs::scrollModeNormal); @@ -659,12 +659,12 @@ void Dialogs::callDialogDriver() { _vm->_scrollBells++; break; // #7 = "Bel" case kControlSpeechBubble: - if ((_scrollNum == 1) && (_scroll[0].empty())) + if ((_scrollNum == 0) && (_scroll[0].empty())) break; - if (call_spriterun) + if (callSpriteRun) _vm->spriteRun(); - call_spriterun = false; + callSpriteRun = false; if (_param == 0) setBubbleStateNatural(); @@ -756,12 +756,12 @@ void Dialogs::callDialogDriver() { _scrollNum++; break; case kControlQuestion: - if (call_spriterun) + if (callSpriteRun) _vm->spriteRun(); - call_spriterun = false; + callSpriteRun = false; - _scroll[_scrollNum] = kControlQuestion; _scrollNum++; + _scroll[_scrollNum] = kControlQuestion; drawScroll(&Avalanche::Dialogs::scrollModeDialogue); reset(); @@ -771,14 +771,14 @@ void Dialogs::callDialogDriver() { break; case kControlInsertSpaces: for (int j = 0; j < 9; j++) - _scroll[_scrollNum - 1] += ' '; + _scroll[_scrollNum] += ' '; break; default: // Add new char. - if (_scroll[_scrollNum - 1].size() == 50) { - solidify(_scrollNum - 1); + if (_scroll[_scrollNum].size() == 50) { + solidify(_scrollNum); _scrollNum++; } - _scroll[_scrollNum - 1] += _vm->_buffer[i]; + _scroll[_scrollNum] += _vm->_buffer[i]; break; } } |