[Scummvm-git-logs] scummvm master -> a7b05751a0c39d5a20a85ca9de68ec50f79a5cba
sev-
noreply at scummvm.org
Fri Feb 27 19:04:56 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:
a7b05751a0 GRAPHICS: Move Hercules palettes to global graphics manager
Commit: a7b05751a0c39d5a20a85ca9de68ec50f79a5cba
https://github.com/scummvm/scummvm/commit/a7b05751a0c39d5a20a85ca9de68ec50f79a5cba
Author: 11-andy-11 (lecturatul2017 at gmail.com)
Date: 2026-02-27T20:04:48+01:00
Commit Message:
GRAPHICS: Move Hercules palettes to global graphics manager
Changed paths:
engines/scumm/palette.cpp
graphics/palette.cpp
graphics/palette.h
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index d3b163b6c23..50ca8fdb0c5 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -153,14 +153,6 @@ void ScummEngine::resetPalette(bool isBootUp) {
{ 0x00, 0x00, 0x00, 0x55, 0xFF, 0xFF, 0xFF, 0x55, 0xFF, 0xFF, 0xFF, 0xFF }
};
- static const byte tableHercAPalette[] = {
- 0x00, 0x00, 0x00, 0xAE, 0x69, 0x38
- };
-
- static const byte tableHercGPalette[] = {
- 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00
- };
-
// Palette based on Apple IIgs Technical Notes: IIgs 2523063 Master Color Values
// Rearranged to match C64 color positions
static const byte tableApple2gsPalette[] = {
@@ -195,9 +187,9 @@ void ScummEngine::resetPalette(bool isBootUp) {
_enableEGADithering = false;
if (_renderMode == Common::kRenderHercA) {
- setPaletteFromTable(tableHercAPalette, sizeof(tableHercAPalette) / 3);
+ setPaletteFromTable(Graphics::HGC_A_PALETTE, sizeof(Graphics::HGC_A_PALETTE) / 3);
} else if (_renderMode == Common::kRenderHercG) {
- setPaletteFromTable(tableHercGPalette, sizeof(tableHercGPalette) / 3);
+ setPaletteFromTable(Graphics::HGC_G_PALETTE, sizeof(Graphics::HGC_G_PALETTE) / 3);
} else if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderCGAComp) {
setPaletteFromTable(_cgaColors[cgaPalIndex * 2 + cgaPalIntensity], sizeof(_cgaColors[0]) / 3);
// Cursor palette
diff --git a/graphics/palette.cpp b/graphics/palette.cpp
index 575aade7f53..f30abca417f 100644
--- a/graphics/palette.cpp
+++ b/graphics/palette.cpp
@@ -31,6 +31,15 @@ static const byte EGA_PALETTE[16][3] = {
{ 0xff, 0xff, 0xff }
};
+// Amber
+const byte HGC_A_PALETTE[] = {
+ 0x00, 0x00, 0x00, 0xAE, 0x69, 0x38
+};
+
+// Green
+const byte HGC_G_PALETTE[] = {
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00
+};
Palette::Palette(uint size) : _data(nullptr), _size(size), _disposeAfterUse(DisposeAfterUse::YES) {
if (_size > 0) {
diff --git a/graphics/palette.h b/graphics/palette.h
index 6506d1cfb1e..f56bc02211b 100644
--- a/graphics/palette.h
+++ b/graphics/palette.h
@@ -42,6 +42,10 @@ enum ColorDistanceMethod {
constexpr int PALETTE_COUNT = 256;
constexpr int PALETTE_SIZE = (256 * 3);
+extern const byte HGC_A_PALETTE[6];
+extern const byte HGC_G_PALETTE[6];
+
+
/**
* @brief Simple class for handling a palette data.
*
@@ -52,6 +56,8 @@ constexpr int PALETTE_SIZE = (256 * 3);
* (transparency) value. Then the second color starts, and so on. So memory
* looks like this: R1-G1-B1-R2-G2-B2-R3-...
*/
+
+
class Palette {
byte *_data;
uint16 _size;
More information about the Scummvm-git-logs
mailing list