aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/display.cpp
diff options
context:
space:
mode:
authorstrangerke2011-02-20 11:32:00 +0100
committerstrangerke2011-02-20 11:32:00 +0100
commit93f25b73be2b6aca7d5ea0321c8aba5252e86d54 (patch)
treed8fd9f24f137a1aaa7cd9e6ee5fcfd1cb759cc2f /engines/hugo/display.cpp
parentae88f41596b1331496db4dce30e84d5948244518 (diff)
downloadscummvm-rg350-93f25b73be2b6aca7d5ea0321c8aba5252e86d54.tar.gz
scummvm-rg350-93f25b73be2b6aca7d5ea0321c8aba5252e86d54.tar.bz2
scummvm-rg350-93f25b73be2b6aca7d5ea0321c8aba5252e86d54.zip
HUGO/TOOLS: reorder things in HUGO.DAT, move from RGBA to RGB
Diffstat (limited to 'engines/hugo/display.cpp')
-rw-r--r--engines/hugo/display.cpp43
1 files changed, 9 insertions, 34 deletions
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index da821c5d3a..0210eb8f04 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -130,26 +130,12 @@ viewdib_t &Screen::getGUIBuffer() {
*/
void Screen::createPal() {
debugC(1, kDebugDisplay, "createPal");
-
- byte pal[3 * 256];
- for (uint i = 0; i < _paletteSize; ++i) {
- pal[3 * i + 0] = _mainPalette[4 * i + 0];
- pal[3 * i + 1] = _mainPalette[4 * i + 1];
- pal[3 * i + 2] = _mainPalette[4 * i + 2];
- }
-
- g_system->getPaletteManager()->setPalette(pal, 0, _paletteSize / 4);
+ g_system->getPaletteManager()->setPalette(_mainPalette, 0, _paletteSize / 3);
}
void Screen::setCursorPal() {
- byte pal[3 * 256];
- for (uint i = 0; i < _paletteSize; ++i) {
- pal[3 * i + 0] = _curPalette[4 * i + 0];
- pal[3 * i + 1] = _curPalette[4 * i + 1];
- pal[3 * i + 2] = _curPalette[4 * i + 2];
- }
-
- CursorMan.replaceCursorPalette(pal, 0, _paletteSize / 4);
+ debugC(1, kDebugDisplay, "setCursorPal");
+ CursorMan.replaceCursorPalette(_curPalette, 0, _paletteSize / 3);
}
/**
@@ -205,14 +191,11 @@ void Screen::displayRect(const int16 x, const int16 y, const int16 dx, const int
void Screen::remapPal(const uint16 oldIndex, const uint16 newIndex) {
debugC(1, kDebugDisplay, "Remap_pal(%d, %d)", oldIndex, newIndex);
- byte pal[3];
+ _curPalette[3 * oldIndex + 0] = _mainPalette[newIndex * 3 + 0];
+ _curPalette[3 * oldIndex + 1] = _mainPalette[newIndex * 3 + 1];
+ _curPalette[3 * oldIndex + 2] = _mainPalette[newIndex * 3 + 2];
- pal[0] = _curPalette[4 * oldIndex + 0] = _mainPalette[newIndex * 4 + 0];
- pal[1] = _curPalette[4 * oldIndex + 1] = _mainPalette[newIndex * 4 + 1];
- pal[2] = _curPalette[4 * oldIndex + 2] = _mainPalette[newIndex * 4 + 2];
- //pal[3] = _curPalette[4 * oldIndex + 3] = _mainPalette[newIndex * 4 + 3];
-
- g_system->getPaletteManager()->setPalette(pal, oldIndex, 1);
+ g_system->getPaletteManager()->setPalette(_curPalette, oldIndex, 1);
}
/**
@@ -231,17 +214,9 @@ void Screen::savePal(Common::WriteStream *f) const {
void Screen::restorePal(Common::ReadStream *f) {
debugC(1, kDebugDisplay, "restorePal()");
- byte pal[3];
-
- for (int i = 0; i < _paletteSize; i++)
+ for (int i = 0; i < _paletteSize; i++) {
_curPalette[i] = f->readByte();
-
- for (int i = 0; i < _paletteSize / 4; i++) {
- pal[0] = _curPalette[i * 4 + 0];
- pal[1] = _curPalette[i * 4 + 1];
- pal[2] = _curPalette[i * 4 + 2];
- //pal[3] = _curPalette[i * 4 + 3];
- g_system->getPaletteManager()->setPalette(pal, i, 1);
+ g_system->getPaletteManager()->setPalette(_curPalette, i, 1);
}
}