[Scummvm-git-logs] scummvm branch-3-0 -> 93ebdb1991f2f9bf77ae7628c863d95d51271d01
dreammaster
noreply at scummvm.org
Sat Dec 20 09:03:47 UTC 2025
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:
93ebdb1991 MM: MM1: Revert Use Graphics::Palette::createEGAPalette
Commit: 93ebdb1991f2f9bf77ae7628c863d95d51271d01
https://github.com/scummvm/scummvm/commit/93ebdb1991f2f9bf77ae7628c863d95d51271d01
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-12-20T19:59:15+11:00
Commit Message:
MM: MM1: Revert Use Graphics::Palette::createEGAPalette
This reverts commit 2bc022fb8c81c5dd0dfbc769e02c9752c151ee72.
Using the standard EGA palette caused the doorways in
enhanced mode to appear blue rather than brown
Changed paths:
NEWS.md
engines/mm/mm1/gfx/gfx.cpp
diff --git a/NEWS.md b/NEWS.md
index bd91375bce9..ea3b567575f 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -112,6 +112,7 @@ For a more comprehensive changelog of the latest experimental code, see:
- Fixed protection from elements spell.
- Added Text-to-Speech support.
- Fixed errors with M&M1 monster advancement in combat.
+ - Fixed doors color in M&M1 enhanced mode
Mohawk:
- Fixed popping noise in speech in some game releases (bug in the original).
diff --git a/engines/mm/mm1/gfx/gfx.cpp b/engines/mm/mm1/gfx/gfx.cpp
index 0a9a7a15bbf..4eec3eb329f 100644
--- a/engines/mm/mm1/gfx/gfx.cpp
+++ b/engines/mm/mm1/gfx/gfx.cpp
@@ -21,7 +21,6 @@
#include "common/system.h"
#include "common/debug.h"
-#include "graphics/palette.h"
#include "graphics/paletteman.h"
#include "graphics/screen.h"
#include "mm/mm1/gfx/gfx.h"
@@ -32,26 +31,38 @@ namespace Gfx {
byte EGA_INDEXES[EGA_PALETTE_COUNT];
+static const uint32 EGA_PALETTE[16] = {
+ 0x000000, 0x0000aa, 0x00aa00, 0x00aaaa,
+ 0xaa0000, 0xaa00aa, 0xaa5500, 0xaaaaaa,
+ 0x555555, 0x5555ff, 0x55ff55, 0x55ffff,
+ 0xff5555, 0xff55ff, 0xffff55, 0xffffff
+};
+
+
void GFX::setEgaPalette() {
- const Graphics::Palette ega = Graphics::Palette::createEGAPalette();
- g_system->getPaletteManager()->setPalette(ega);
+ byte pal[16 * 3];
+ byte *pDest = pal;
+
+ for (int i = 0; i < EGA_PALETTE_COUNT; ++i) {
+ *pDest++ = (EGA_PALETTE[i] >> 16) & 0xff;
+ *pDest++ = (EGA_PALETTE[i] >> 8) & 0xff;
+ *pDest++ = EGA_PALETTE[i] & 0xff;
+ EGA_INDEXES[i] = i;
+ }
+
+ g_system->getPaletteManager()->setPalette(pal, 0, 16);
uint32 c = 0xffffffff;
g_system->getPaletteManager()->setPalette((const byte *)&c, 255, 1);
// Set the EGA palette indexes to be themselves
- for (int i = 0; i < EGA_PALETTE_COUNT; ++i)
- EGA_INDEXES[i] = i;
}
void GFX::findPalette(const byte palette[256 * 3]) {
- const Graphics::Palette ega = Graphics::Palette::createEGAPalette();
- const byte *data = ega.data();
-
for (int col = 0; col < 16; ++col) {
- byte r = data[col * 3 + 2];
- byte g = data[col * 3 + 1];
- byte b = data[col * 3 + 0];
+ byte r = (EGA_PALETTE[col] >> 16) & 0xff;
+ byte g = (EGA_PALETTE[col] >> 8) & 0xff;
+ byte b = EGA_PALETTE[col] & 0xff;
int closestDiff = 0x7fffffff;
byte closest = 0;
const byte *pal = &palette[0];
More information about the Scummvm-git-logs
mailing list