aboutsummaryrefslogtreecommitdiff
path: root/engines/adl/hires1.cpp
diff options
context:
space:
mode:
authorWalter van Niftrik2016-02-29 16:50:24 +0100
committerWalter van Niftrik2016-03-09 10:03:13 +0100
commitba54955bffec15ed95aa1ca1ec955aecaa315478 (patch)
treebef5045606854df11ac257158d1feea8abc14484 /engines/adl/hires1.cpp
parent9928e51bd73985f48c8378308a278fff433eaae1 (diff)
downloadscummvm-rg350-ba54955bffec15ed95aa1ca1ec955aecaa315478.tar.gz
scummvm-rg350-ba54955bffec15ed95aa1ca1ec955aecaa315478.tar.bz2
scummvm-rg350-ba54955bffec15ed95aa1ca1ec955aecaa315478.zip
ADL: Add loading from launcher
Diffstat (limited to 'engines/adl/hires1.cpp')
-rw-r--r--engines/adl/hires1.cpp60
1 files changed, 36 insertions, 24 deletions
diff --git a/engines/adl/hires1.cpp b/engines/adl/hires1.cpp
index 45a011ad63..ba6f19a8e4 100644
--- a/engines/adl/hires1.cpp
+++ b/engines/adl/hires1.cpp
@@ -136,6 +136,8 @@ void HiRes1Engine::runIntro() {
file.seek(IDI_HR1_OFS_GAME_OR_HELP);
str = readString(file);
+ bool instructions = false;
+
while (1) {
_display->printString(str);
Common::String s = _display->inputString();
@@ -146,28 +148,47 @@ void HiRes1Engine::runIntro() {
if (s.empty())
continue;
- if ((byte)s[0] == ('I' | 0x80))
+ if (s[0] == APPLECHAR('I')) {
+ instructions = true;
break;
- else if ((byte)s[0] == ('G' | 0x80))
- return;
+ } else if (s[0] == APPLECHAR('G')) {
+ break;
+ }
};
- _display->setMode(Display::kModeText);
- file.seek(IDI_HR1_OFS_INTRO_TEXT);
+ if (instructions) {
+ _display->setMode(Display::kModeText);
+ file.seek(IDI_HR1_OFS_INTRO_TEXT);
- const uint pages[] = { 6, 6, 4, 5, 8, 7, 0 };
+ const uint pages[] = { 6, 6, 4, 5, 8, 7, 0 };
- uint page = 0;
- while (pages[page] != 0) {
- _display->home();
- printStrings(file, pages[page++]);
- _display->inputString();
+ uint page = 0;
+ while (pages[page] != 0) {
+ _display->home();
+ printStrings(file, pages[page++]);
+ _display->inputString();
- if (g_engine->shouldQuit())
- return;
+ if (g_engine->shouldQuit())
+ return;
- file.seek(9, SEEK_CUR);
+ file.seek(9, SEEK_CUR);
+ }
}
+
+ _display->printASCIIString("\r");
+
+ file.close();
+
+ _display->setMode(Display::kModeMixed);
+
+ if (!file.open("ADVENTURE"))
+ error("Failed to open file");
+
+ // Title screen shown during loading
+ file.seek(0x1800);
+ _display->loadFrameBuffer(file);
+ _display->decodeFrameBuffer();
+ _display->delay(2000);
}
void HiRes1Engine::drawPic(Common::ReadStream &stream, Common::Point pos) {
@@ -278,8 +299,7 @@ void HiRes1Engine::restartGame() {
}
void HiRes1Engine::runGame() {
- runIntro();
- _display->printASCIIString("\r");
+ _display->setMode(Display::kModeMixed);
Common::File f;
@@ -291,8 +311,6 @@ void HiRes1Engine::runGame() {
f.close();
- initState();
-
if (!f.open("ADVENTURE"))
error("Failed to open file");
@@ -345,12 +363,6 @@ void HiRes1Engine::runGame() {
_lineArt.push_back(lineArt);
}
- // Title screen shown during loading
- f.seek(0x1800);
- _display->loadFrameBuffer(f);
- _display->decodeFrameBuffer();
- _display->delay(2000);
-
f.seek(0x3800);
_parser->loadVerbs(f);