From d503838fd65db483a764d550cc6cce32984f6381 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 26 Dec 2011 03:15:47 +0200 Subject: DREAMWEB: Moved the two rollEndCredits functions together in print.cpp and renamed them to rollEndCreditsGameWon and rollEndCreditsGameLost --- engines/dreamweb/print.cpp | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) (limited to 'engines/dreamweb/print.cpp') 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 -- cgit v1.2.3