[Scummvm-git-logs] scummvm master -> b001e98a21788fd2b6d211371f622bac0f820f32
sev-
noreply at scummvm.org
Sun Apr 19 23:54:49 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
b001e98a21 AVALANCHE: Added an outro for quit option for Lord Avalot d'Argent
Commit: b001e98a21788fd2b6d211371f622bac0f820f32
https://github.com/scummvm/scummvm/commit/b001e98a21788fd2b6d211371f622bac0f820f32
Author: Yeng Her (119150603+YengHer919 at users.noreply.github.com)
Date: 2026-04-20T01:54:46+02:00
Commit Message:
AVALANCHE: Added an outro for quit option for Lord Avalot d'Argent
Co-authored-by: Yeng <yeng at gmail.com>
Co-authored-by: Eugene Sandulenko <sev at scummvm.org>
Changed paths:
A engines/avalanche/outro.cpp
A engines/avalanche/outro.h
engines/avalanche/avalanche.cpp
engines/avalanche/avalanche.h
engines/avalanche/avalot.cpp
engines/avalanche/graphics.cpp
engines/avalanche/graphics.h
engines/avalanche/module.mk
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index de6543cd284..eaf022f5df2 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -29,6 +29,7 @@
#include "common/system.h"
#include "graphics/thumbnail.h"
+#include "avalanche/outro.h"
#include "avalanche/avalanche.h"
#include "avalanche/intro.h"
@@ -57,6 +58,7 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
_help = nullptr;
_highscore = nullptr;
_intro = nullptr;
+ _outro = nullptr;
initVariables();
}
@@ -81,6 +83,7 @@ AvalancheEngine::~AvalancheEngine() {
delete _help;
delete _highscore;
delete _intro;
+ delete _outro;
for (int i = 0; i < 31; i++) {
for (int j = 0; j < 2; j++) {
@@ -167,6 +170,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
_help = new Help(this);
_highscore = new HighScore(this);
_intro = new Intro(this);
+ _outro = new Outro(this);
_graphics->init();
_dialogs->init();
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index d22c90128f1..bd07eeaef11 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -63,6 +63,8 @@ namespace Avalanche {
struct AvalancheGameDescription;
class Intro;
+class Outro;
+
static const int kSavegameVersion = 2;
enum Pitch {
@@ -92,6 +94,7 @@ public:
Help *_help;
HighScore *_highscore;
Intro *_intro;
+ Outro *_outro;
AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd);
~AvalancheEngine() override;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index faa44c8cb6f..d5977df067f 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -27,6 +27,7 @@
/* AVALOT The kernel of the program. */
#include "avalanche/avalanche.h"
+#include "avalanche/outro.h"
#include "common/random.h"
#include "common/system.h"
@@ -249,8 +250,7 @@ void AvalancheEngine::runAvalot() {
if (delay <= 55)
_system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight).
};
-
- _closing->exitGame();
+ _outro->run();
}
void AvalancheEngine::init() {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 98b8fcc6cbb..431133a0baa 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -28,6 +28,7 @@
#include "avalanche/graphics.h"
#include "common/system.h"
+#include "common/random.h"
#include "engines/util.h"
#include "graphics/paletteman.h"
#include "math/utils.h"
@@ -990,6 +991,53 @@ void GraphicManager::drawWinningPic() {
file.close();
}
+void GraphicManager::drawQuittingPic() {
+ // Nag screen text "joke".
+ static const char *nouns[] = {
+ "sackbut", "harpsichord", "camel", "conscience", "ice-cream", "serf",
+ "abacus", "castle", "carrots", "megaphone", "manticore", "drawbridge"
+ };
+
+ static const char *verbs[] = {
+ "haunt", "daunt", "tickle", "gobble", "erase", "provoke", "surprise",
+ "ignore", "stare at", "shriek at", "frighten", "quieten"
+ };
+
+ Common::String result = Common::String(nouns[_vm->_rnd->getRandomNumber(11)]) + " will " + Common::String(verbs[_vm->_rnd->getRandomNumber(11)]) + " you.";
+
+ Common::File file;
+ Common::Path filename("text3.scr");
+
+ if (!file.open(filename))
+ error("AVALANCHE: Timer: File not found: %s", filename.toString(Common::Path::kNativeSeparator).c_str());
+
+ uint32 fileSize = file.size();
+ byte *buffer = new byte[fileSize];
+ file.read(buffer, fileSize);
+ file.close();
+
+ // Write the joke string at position 1628 (from source code)
+ // Side note: I added 2 because there was no space between the first word of the joke and last letter of the original file
+ // Each cell is 2 bytes: char, attribute
+ for (uint i = 0; i < result.size(); i++) {
+ buffer[1628 * 2 + i * 2 + 2] = (byte)result[i];
+ // skip attribute byte
+ }
+
+ // The text3.scr file is DOS text-mode screen dump, 80 x 24
+ for (int i = 0; i < 24; i++) {
+ for (int j = 0; j < 80; j++) {
+ byte pixel = buffer[(i * 80 + j) * 2];
+ byte colorByte = buffer[(i * 80 + j) * 2 + 1];
+
+ for (int row = 0; row < 8; row++) {
+ byte rowPixel = _vm->_font[pixel][row];
+ drawChar(rowPixel, 8 * j, 8 * i + row, (Color)colorByte);
+ }
+ }
+ }
+}
+
void GraphicManager::clearAlso() {
_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
@@ -1173,6 +1221,7 @@ void GraphicManager::drawChar(byte ander, int x, int y, Color color) {
*(byte *)_surface.getBasePtr(x + 7 - bit, y) = color;
}
}
+
void GraphicManager::refreshScreen() {
// These cycles are for doubling the screen height.
for (uint16 y = 0; y < _screen.h / 2; y++) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 14af068a3e3..e7c68c81976 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -95,6 +95,13 @@ public:
// Used in winning()
void drawWinningPic();
+ /*
+ * Used in quitting(), the parameter is to accept different numbers (representing different scenarios). I put it here to
+ * preserve some of the multi-purpose functionality of the original function.
+ */
+
+ void drawQuittingPic();
+
// Ghostroom's functions:
void ghostDrawMonster(byte ***picture, uint16 destX, int16 destY, MonsterType type);
Graphics::Surface ghostLoadPicture(Common::File &file, Common::Point &coord);
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 34be1a18705..3a1c8259bcc 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -18,6 +18,7 @@ MODULE_OBJS = \
mainmenu.o \
metaengine.o \
nim.o \
+ outro.o \
parser.o \
sequence.o \
shootemup.o \
diff --git a/engines/avalanche/outro.cpp b/engines/avalanche/outro.cpp
new file mode 100644
index 00000000000..14634f65fb1
--- /dev/null
+++ b/engines/avalanche/outro.cpp
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike: Mark and Thomas Thurman.
+ */
+
+#include "graphics/cursorman.h"
+#include "common/system.h"
+
+#include "avalanche/avalanche.h"
+#include "avalanche/graphics.h"
+#include "avalanche/enums.h"
+#include "avalanche/outro.h"
+
+namespace Avalanche {
+
+ Outro::Outro(AvalancheEngine *vm) : _vm(vm) {
+ }
+
+ void Outro::run() {
+ CursorMan.showMouse(false);
+ _vm->_graphics->blackOutScreen();
+ _vm->_graphics->drawQuittingPic();
+ _vm->_graphics->refreshScreen();
+
+ // Wait 5 seconds or keypress/click
+ uint32 startTime = g_system->getMillis();
+ Common::Event event;
+ while (!_vm->shouldQuit()) {
+ if (g_system->getMillis() - startTime >= 5000)
+ return;
+ while (_vm->getEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_KEYDOWN:
+ case Common::EVENT_LBUTTONDOWN:
+ CursorMan.showMouse(true);
+ return;
+ default:
+ break;
+ }
+ }
+ g_system->delayMillis(10);
+ }
+
+ CursorMan.showMouse(true);
+ }
+}
diff --git a/engines/avalanche/outro.h b/engines/avalanche/outro.h
new file mode 100644
index 00000000000..5021e559fc9
--- /dev/null
+++ b/engines/avalanche/outro.h
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/*
+ * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike: Mark and Thomas Thurman.
+ */
+
+#ifndef AVALANCHE_OUTRO_H
+#define AVALANCHE_OUTRO_H
+
+namespace Avalanche {
+
+ class AvalancheEngine;
+
+ class Outro {
+ public:
+ Outro(AvalancheEngine *vm);
+ virtual ~Outro() {}
+ void run();
+
+ private:
+ AvalancheEngine *_vm;
+ };
+
+} // End of namespace Avalanche
+
+#endif // AVALANCHE_OUTRO_H
More information about the Scummvm-git-logs
mailing list