aboutsummaryrefslogtreecommitdiff
path: root/engines/m4
diff options
context:
space:
mode:
authorMax Horn2011-02-07 17:52:38 +0000
committerMax Horn2011-02-07 17:52:38 +0000
commitab039812e7d0a0202317c61a2cb64874e4d0c410 (patch)
treec3069b36ba6e18068fa343416acf485e2d0728e4 /engines/m4
parent8981fa3f164aa8f397df2af8b85d6edfa4bdd883 (diff)
downloadscummvm-rg350-ab039812e7d0a0202317c61a2cb64874e4d0c410.tar.gz
scummvm-rg350-ab039812e7d0a0202317c61a2cb64874e4d0c410.tar.bz2
scummvm-rg350-ab039812e7d0a0202317c61a2cb64874e4d0c410.zip
COMMON: OSystem now has a PaletteManager
svn-id: r55806
Diffstat (limited to 'engines/m4')
-rw-r--r--engines/m4/graphics.cpp16
-rw-r--r--engines/m4/woodscript.cpp2
2 files changed, 9 insertions, 9 deletions
diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp
index 7aa86d6173..a651510d10 100644
--- a/engines/m4/graphics.cpp
+++ b/engines/m4/graphics.cpp
@@ -1031,17 +1031,17 @@ Palette::Palette(MadsM4Engine *vm) : _vm(vm) {
}
void Palette::setPalette(const byte *colors, uint start, uint num) {
- g_system->setPalette(colors, start, num);
+ g_system->getPaletteManager()->setPalette(colors, start, num);
reset();
}
void Palette::setPalette(const RGB8 *colors, uint start, uint num) {
- g_system->setPalette((const byte *)colors, start, num);
+ g_system->getPaletteManager()->setPalette((const byte *)colors, start, num);
reset();
}
void Palette::grabPalette(byte *colors, uint start, uint num) {
- g_system->grabPalette(colors, start, num);
+ g_system->getPaletteManager()->grabPalette(colors, start, num);
}
void Palette::setEntry(uint index, uint8 r, uint8 g, uint8 b) {
@@ -1050,7 +1050,7 @@ void Palette::setEntry(uint index, uint8 r, uint8 g, uint8 b) {
c.g = g;
c.b = b;
c.u = 255;
- g_system->setPalette((const byte *)&c, index, 1);
+ g_system->getPaletteManager()->setPalette((const byte *)&c, index, 1);
}
uint8 Palette::palIndexFromRgb(byte r, byte g, byte b, RGB8 *paletteData) {
@@ -1060,7 +1060,7 @@ uint8 Palette::palIndexFromRgb(byte r, byte g, byte b, RGB8 *paletteData) {
int Rdiff, Gdiff, Bdiff;
if (paletteData == NULL) {
- g_system->grabPalette((byte *)palData, 0, 256);
+ g_system->getPaletteManager()->grabPalette((byte *)palData, 0, 256);
paletteData = &palData[0];
}
@@ -1080,7 +1080,7 @@ uint8 Palette::palIndexFromRgb(byte r, byte g, byte b, RGB8 *paletteData) {
void Palette::reset() {
RGB8 palData[256];
- g_system->grabPalette((byte *)palData, 0, 256);
+ g_system->getPaletteManager()->grabPalette((byte *)palData, 0, 256);
BLACK = palIndexFromRgb(0, 0, 0, palData);
BLUE = palIndexFromRgb(0, 0, 255, palData);
@@ -1260,7 +1260,7 @@ void Palette::addRange(RGBList *list) {
RGB8 *data = list->data();
byte *palIndexes = list->palIndexes();
RGB8 palData[256];
- g_system->grabPalette((byte *)&palData[0], 0, 256);
+ g_system->getPaletteManager()->grabPalette((byte *)&palData[0], 0, 256);
bool paletteChanged = false;
for (int colIndex = 0; colIndex < list->size(); ++colIndex) {
@@ -1300,7 +1300,7 @@ void Palette::addRange(RGBList *list) {
}
if (paletteChanged) {
- g_system->setPalette((byte *)&palData[0], 0, 256);
+ g_system->getPaletteManager()->setPalette((byte *)&palData[0], 0, 256);
reset();
}
}
diff --git a/engines/m4/woodscript.cpp b/engines/m4/woodscript.cpp
index 4928e0af8d..f45e8fa8a2 100644
--- a/engines/m4/woodscript.cpp
+++ b/engines/m4/woodscript.cpp
@@ -322,7 +322,7 @@ void WoodScript::update() {
{
// FIXME: This should be done when a new palette is set
byte palette[1024];
- g_system->grabPalette(palette, 0, 256);
+ g_system->getPaletteManager()->grabPalette(palette, 0, 256);
for (int i = 0; i < 256; i++) {
_mainPalette[i].r = palette[i * 4 + 0];
_mainPalette[i].g = palette[i * 4 + 1];