From 5ab404f5bae87b6aac031232259ead2b3cf6386b Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 8 Dec 2011 00:08:25 +0100 Subject: DREAMWEB: Reduce code duplication --- engines/dreamweb/stubs.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 637df6019a..839665dd67 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -3245,20 +3245,14 @@ void DreamGenContext::runIntroSeq() { do { vSync(); - if (data.byte(kLasthardkey) == 1) { - getRidOfTempText(); - clearBeforeLoad(); - return; // "earlyendrun" - } + if (data.byte(kLasthardkey) == 1) + break; spriteUpdate(); vSync(); - if (data.byte(kLasthardkey) == 1) { - getRidOfTempText(); - clearBeforeLoad(); - return; // "earlyendrun" - } + if (data.byte(kLasthardkey) == 1) + break; delEverything(); printSprites(); @@ -3267,23 +3261,23 @@ void DreamGenContext::runIntroSeq() { useTimedText(); vSync(); - if (data.byte(kLasthardkey) == 1) { - getRidOfTempText(); - clearBeforeLoad(); - return; // "earlyendrun" - } + if (data.byte(kLasthardkey) == 1) + break; dumpMap(); dumpTimedText(); vSync(); - if (data.byte(kLasthardkey) == 1) { - getRidOfTempText(); - clearBeforeLoad(); - return; // "earlyendrun" - } + if (data.byte(kLasthardkey) == 1) + break; + + } while (data.byte(kGetback) != 1); - } while (data.byte(kGetback) != 1); + + if (data.byte(kLasthardkey) == 1) { + getRidOfTempText(); + clearBeforeLoad(); + } // These were not called in this program arc // in the original code.. Bug? -- cgit v1.2.3