aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/print.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-26 03:15:47 +0200
committerFilippos Karapetis2011-12-26 03:15:47 +0200
commitd503838fd65db483a764d550cc6cce32984f6381 (patch)
tree0c74268df8db8865982facb7c9bf7ba6e761843a /engines/dreamweb/print.cpp
parent9a89f8884c0da0ee7c979d6df19969713fa16bf5 (diff)
downloadscummvm-rg350-d503838fd65db483a764d550cc6cce32984f6381.tar.gz
scummvm-rg350-d503838fd65db483a764d550cc6cce32984f6381.tar.bz2
scummvm-rg350-d503838fd65db483a764d550cc6cce32984f6381.zip
DREAMWEB: Moved the two rollEndCredits functions together in print.cpp and renamed them to rollEndCreditsGameWon and rollEndCreditsGameLost
Diffstat (limited to 'engines/dreamweb/print.cpp')
-rw-r--r--engines/dreamweb/print.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp
index 0fd596ceac..0191aa8860 100644
--- a/engines/dreamweb/print.cpp
+++ b/engines/dreamweb/print.cpp
@@ -263,4 +263,91 @@ const char *DreamBase::monPrint(const char *string) {
return iterator;
}
+void DreamBase::rollEndCreditsGameWon() {
+ playChannel0(16, 255);
+ data.byte(kVolume) = 7;
+ data.byte(kVolumeto) = 0;
+ data.byte(kVolumedirection) = (byte)-1;
+
+ multiGet(mapStore(), 75, 20, 160, 160);
+
+ const uint8 *string = getTextInFile1(3);
+ const int linespacing = data.word(kLinespacing);
+
+ for (int i = 0; i < 254; ++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(), 75, 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, 75, &y, 160 + 1, true);
+ y += linespacing;
+ }
+
+ vSync();
+ multiDump(75, 20, 160, 160);
+ }
+
+ // Skip to the next text line
+ byte c;
+ do {
+ c = *string++;
+ } while (c != ':' && c != 0);
+ }
+
+ hangOn(100);
+ panelToMap();
+ fadeScreenUpHalf();
+}
+
+void DreamBase::rollEndCreditsGameLost() {
+ 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