diff options
author | Max Horn | 2011-12-26 01:36:29 +0100 |
---|---|---|
committer | Max Horn | 2011-12-26 01:41:56 +0100 |
commit | dbe5b50cd34362bc3a6743be6eac0e4840353a47 (patch) | |
tree | 8c97b6f91e43084495b8338fd42d9b248758197d /engines/dreamweb/vgafades.cpp | |
parent | 04a147921f1259e8874c7f9b723e8b3a8158f8c8 (diff) | |
download | scummvm-rg350-dbe5b50cd34362bc3a6743be6eac0e4840353a47.tar.gz scummvm-rg350-dbe5b50cd34362bc3a6743be6eac0e4840353a47.tar.bz2 scummvm-rg350-dbe5b50cd34362bc3a6743be6eac0e4840353a47.zip |
DREAMWEB: Port rollEm() to C++
Diffstat (limited to 'engines/dreamweb/vgafades.cpp')
-rw-r--r-- | engines/dreamweb/vgafades.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/engines/dreamweb/vgafades.cpp b/engines/dreamweb/vgafades.cpp index 80f5ce608a..23a8655fa1 100644 --- a/engines/dreamweb/vgafades.cpp +++ b/engines/dreamweb/vgafades.cpp @@ -281,8 +281,53 @@ void DreamBase::dumpCurrent() { engine->setPalette(pal, 128, 128); } -void DreamGenContext::rollEndCredits2() { +void DreamBase::rollEndCredits2() { rollEm(); } +void DreamBase::rollEm() { + // Note: This function is very similar to rollEndCredits() in sprite.cpp + + multiGet(mapStore(), 25, 20, 160, 160); + + const uint8 *string = getTextInFile1(49); + const int linespacing = data.word(kLinespacing); + + for (int i = 0; i < 80; ++i) { + // Output the text, initially with an offset of 10 pixels, + // then move it up one pixel until we shifted it by a complete + // line of text. + for (int j = 0; j < linespacing; ++j) { + vSync(); + multiPut(mapStore(), 25, 20, 160, 160); + vSync(); + + // Output up to 18 lines of text + uint16 y = 10 - j; + const uint8 *tmp_str = string; + for (int k = 0; k < 18; ++k) { + DreamBase::printDirect(&tmp_str, 25, &y, 160 + 1, true); + y += linespacing; + } + + vSync(); + multiDump(25, 20, 160, 160); + + if (data.byte(kLasthardkey) == 1) + return; + } + + // Skip to the next text line + byte c; + do { + c = *string++; + } while (c != ':' && c != 0); + + if (data.byte(kLasthardkey) == 1) + return; + } + + hangOne(120); +} + } // End of namespace DreamGen |