[Scummvm-git-logs] scummvm master -> ae7efb3d771c42247be40bfe9301623c3d000e82
sluicebox
noreply at scummvm.org
Fri Dec 13 20:00:19 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d2a4416fa0 AGI: PREAGI: Clear screen after MICKEY logo
ae7efb3d77 AGI: PREAGI: Fix MICKEY intro flash on CGA and Hercules
Commit: d2a4416fa0beacdfcd95b6398caa6897f2c086b6
https://github.com/scummvm/scummvm/commit/d2a4416fa0beacdfcd95b6398caa6897f2c086b6
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-12-13T11:58:20-08:00
Commit Message:
AGI: PREAGI: Clear screen after MICKEY logo
Changed paths:
engines/agi/preagi/mickey.cpp
engines/agi/preagi/mickey.h
diff --git a/engines/agi/preagi/mickey.cpp b/engines/agi/preagi/mickey.cpp
index edd64aead8b..49d5ad9bc15 100644
--- a/engines/agi/preagi/mickey.cpp
+++ b/engines/agi/preagi/mickey.cpp
@@ -890,7 +890,7 @@ static const byte BCGColorMappingCGAToEGA[4] = {
0, 11, 13, 15
};
-void MickeyEngine::drawLogo() {
+bool MickeyEngine::drawLogo() {
const int width = 80;
const int height = 85 * 2;
const byte *BCGColorMapping = BCGColorMappingCGAToEGA;
@@ -901,16 +901,18 @@ void MickeyEngine::drawLogo() {
// read logos.bcg
Common::File infile;
- if (!infile.open(IDS_MSA_PATH_LOGO))
- return;
+ if (!infile.open(IDS_MSA_PATH_LOGO)) {
+ warning("%s: file not found", IDS_MSA_PATH_LOGO);
+ return false;
+ }
uint32 fileBufferSize = infile.size();
+ if (fileBufferSize < (width * height / 4)) {
+ warning("%s: truncated file: %d", IDS_MSA_PATH_LOGO, fileBufferSize);
+ return false;
+ }
byte *fileBuffer = new byte[fileBufferSize];
infile.read(fileBuffer, fileBufferSize);
- infile.close();
-
- if (fileBufferSize < (width * height / 4))
- error("logos.bcg: unexpected end of file");
// Show BCG picture
// It's basically uncompressed CGA 4-color data (4 pixels per byte)
@@ -934,6 +936,7 @@ void MickeyEngine::drawLogo() {
_gfx->copyDisplayToScreen();
delete[] fileBuffer;
+ return true;
}
void MickeyEngine::animate() {
@@ -1362,8 +1365,10 @@ void MickeyEngine::inventory() {
void MickeyEngine::intro() {
// Draw Sierra logo
- drawLogo(); // Original does not even show this, so we skip it too
- waitAnyKey(); // Not in the original, but needed so that the logo is visible
+ if (drawLogo()) { // Original does not show the logo, we do if available
+ waitAnyKey(); // Not in the original, but needed so that the logo is visible
+ _gfx->clearDisplay(0); // Logo is larger than picture area, clear entire screen
+ }
// draw title picture
_gameStateMickey.iRoom = IDI_MSA_PIC_TITLE;
diff --git a/engines/agi/preagi/mickey.h b/engines/agi/preagi/mickey.h
index f4e881a510b..906a42c6b11 100644
--- a/engines/agi/preagi/mickey.h
+++ b/engines/agi/preagi/mickey.h
@@ -721,7 +721,7 @@ protected:
void playSound(ENUM_MSA_SOUND);
void drawRoomAnimation();
void drawRoom();
- void drawLogo();
+ bool drawLogo();
void animate();
void printRoomDesc();
bool loadGame();
Commit: ae7efb3d771c42247be40bfe9301623c3d000e82
https://github.com/scummvm/scummvm/commit/ae7efb3d771c42247be40bfe9301623c3d000e82
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-12-13T11:59:04-08:00
Commit Message:
AGI: PREAGI: Fix MICKEY intro flash on CGA and Hercules
Changed paths:
engines/agi/preagi/mickey.cpp
engines/agi/preagi/preagi.cpp
engines/agi/preagi/preagi.h
diff --git a/engines/agi/preagi/mickey.cpp b/engines/agi/preagi/mickey.cpp
index 49d5ad9bc15..6cbf34ad543 100644
--- a/engines/agi/preagi/mickey.cpp
+++ b/engines/agi/preagi/mickey.cpp
@@ -1414,7 +1414,7 @@ void MickeyEngine::intro() {
playSound(IDI_MSA_SND_PRESS_BLUE);
//Set screen to white
- _gfx->clearDisplay(15);
+ _gfx->clearDisplay(getWhite());
_gfx->updateScreen();
_system->delayMillis(IDI_MSA_ANIM_DELAY);
diff --git a/engines/agi/preagi/preagi.cpp b/engines/agi/preagi/preagi.cpp
index 688cf349d11..49778448320 100644
--- a/engines/agi/preagi/preagi.cpp
+++ b/engines/agi/preagi/preagi.cpp
@@ -99,6 +99,18 @@ void PreAgiEngine::clearGfxScreen(int attr) {
_gfx->drawDisplayRect(0, 0, DISPLAY_DEFAULT_WIDTH - 1, IDI_MAX_ROW_PIC * 8 - 1, (attr & 0xF0) / 0x10);
}
+byte PreAgiEngine::getWhite() const {
+ switch (_renderMode) {
+ case Common::kRenderCGA:
+ return 3;
+ case Common::kRenderHercA:
+ case Common::kRenderHercG:
+ return 1;
+ default:
+ return 15;
+ }
+}
+
// String functions
void PreAgiEngine::drawStr(int row, int col, int attr, const char *buffer) {
diff --git a/engines/agi/preagi/preagi.h b/engines/agi/preagi/preagi.h
index 29aaa9a14fb..bf2653bf6d9 100644
--- a/engines/agi/preagi/preagi.h
+++ b/engines/agi/preagi/preagi.h
@@ -82,6 +82,7 @@ protected:
void clearScreen(int attr, bool overrideDefault = true);
void clearGfxScreen(int attr);
void setDefaultTextColor(int attr) { _defaultColor = attr; }
+ byte getWhite() const;
// Keyboard
int getSelection(SelectionTypes type);
More information about the Scummvm-git-logs
mailing list