aboutsummaryrefslogtreecommitdiff
path: root/engines/made/screen.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2008-04-21 18:46:57 +0000
committerFilippos Karapetis2008-04-21 18:46:57 +0000
commit169bf5ddba25a7ab63b405a48bccc449550a693e (patch)
treeced734bb1c66e6804afb5c84251dd919e634e2c6 /engines/made/screen.cpp
parent36bec1d5c8f3eb6f299817692558bd2d33ec7d9a (diff)
downloadscummvm-rg350-169bf5ddba25a7ab63b405a48bccc449550a693e.tar.gz
scummvm-rg350-169bf5ddba25a7ab63b405a48bccc449550a693e.tar.bz2
scummvm-rg350-169bf5ddba25a7ab63b405a48bccc449550a693e.zip
More code merge
svn-id: r31649
Diffstat (limited to 'engines/made/screen.cpp')
-rw-r--r--engines/made/screen.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp
index b6d66a1330..6c50069bc0 100644
--- a/engines/made/screen.cpp
+++ b/engines/made/screen.cpp
@@ -73,15 +73,14 @@ void Screen::drawSurface(Graphics::Surface *source, int x, int y) {
}
-void Screen::setRGBPalette(byte *palette, int start, int count) {
- byte colors[1024];
+void Screen::setRGBPalette(byte *palRGB, int start, int count) {
for (int i = 0; i < count; i++) {
- colors[i * 4 + 0] = palette[i * 3 + 0];
- colors[i * 4 + 1] = palette[i * 3 + 1];
- colors[i * 4 + 2] = palette[i * 3 + 2];
- colors[i * 4 + 3] = 0;
+ _palette[i * 4 + 0] = palRGB[i * 3 + 0];
+ _palette[i * 4 + 1] = palRGB[i * 3 + 1];
+ _palette[i * 4 + 2] = palRGB[i * 3 + 2];
+ _palette[i * 4 + 3] = 0;
}
- _vm->_system->setPalette(colors, start, count);
+ _vm->_system->setPalette(_palette, start, count);
}
uint16 Screen::updateChannel(uint16 channelIndex) {
@@ -251,13 +250,8 @@ uint16 Screen::drawFlex(uint16 flexIndex, int16 x, int16 y, uint16 flag1, uint16
// TODO: Palette stuff; palette should be set in showPage
byte *pal = flex->getPalette();
- if (pal) {
- for (int i = 0; i < 256; i++) {
- _palette[i * 4 + 0] = pal[i * 3 + 0];
- _palette[i * 4 + 1] = pal[i * 3 + 1];
- _palette[i * 4 + 2] = pal[i * 3 + 2];
- }
- _vm->_system->setPalette(_palette, 0, 256);
+ if (pal) {
+ setRGBPalette(pal);
}
_vm->_res->freeResource(flex);