aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/vgafades.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-25 16:58:58 -0800
committerFilippos Karapetis2011-12-25 16:58:58 -0800
commit9a89f8884c0da0ee7c979d6df19969713fa16bf5 (patch)
treeab7b16fe71afdf8351905f0325f60e8609dfc6e2 /engines/dreamweb/vgafades.cpp
parent7945a0fbb0ee3ec89d2b4e51d130f47b9717bfd3 (diff)
parenta4643a0484fe1f54a2cc60ad146cf459012bd0f1 (diff)
downloadscummvm-rg350-9a89f8884c0da0ee7c979d6df19969713fa16bf5.tar.gz
scummvm-rg350-9a89f8884c0da0ee7c979d6df19969713fa16bf5.tar.bz2
scummvm-rg350-9a89f8884c0da0ee7c979d6df19969713fa16bf5.zip
Merge pull request #153 from fingolfin/dreamweb-cleanup
Dreamweb: Port rollEm() to C++, remove dead code
Diffstat (limited to 'engines/dreamweb/vgafades.cpp')
-rw-r--r--engines/dreamweb/vgafades.cpp47
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