aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/disk_ns.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-08-09 18:02:37 +0000
committerNicola Mettifogo2007-08-09 18:02:37 +0000
commitaa1175ed134d107077c6cff5e62ae4e6c1e735f6 (patch)
treed3f39902602e631f4e828e7461d6fc5f08298ac3 /engines/parallaction/disk_ns.cpp
parentf200150590de533059d2fdd4fd6497a4ed96da32 (diff)
downloadscummvm-rg350-aa1175ed134d107077c6cff5e62ae4e6c1e735f6.tar.gz
scummvm-rg350-aa1175ed134d107077c6cff5e62ae4e6c1e735f6.tar.bz2
scummvm-rg350-aa1175ed134d107077c6cff5e62ae4e6c1e735f6.zip
Encapsulated palette stuff into a new Palette object and got rid of a lot of #defines. This should ease handling of palettes in different versions of the engine.
svn-id: r28509
Diffstat (limited to 'engines/parallaction/disk_ns.cpp')
-rw-r--r--engines/parallaction/disk_ns.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp
index c111525011..6506ddd2ac 100644
--- a/engines/parallaction/disk_ns.cpp
+++ b/engines/parallaction/disk_ns.cpp
@@ -564,7 +564,15 @@ void DosDisk_ns::parseDepths(Common::SeekableReadStream &stream) {
void DosDisk_ns::parseBackground(Common::SeekableReadStream &stream) {
- stream.read(_vm->_gfx->_palette, BASE_PALETTE_SIZE);
+ byte tmp[3];
+
+ for (uint i = 0; i < 32; i++) {
+ tmp[0] = stream.readByte();
+ tmp[1] = stream.readByte();
+ tmp[2] = stream.readByte();
+ _vm->_gfx->_palette.setEntry(i, tmp[0], tmp[1], tmp[2]);
+ }
+
_vm->_gfx->setPalette(_vm->_gfx->_palette);
parseDepths(stream);
@@ -1189,8 +1197,18 @@ void AmigaDisk_ns::loadBackground(const char *name) {
BackgroundDecoder decoder(*s, *surf, pal, _vm->_gfx->_palettefx);
decoder.decode();
- for (uint32 i = 0; i < BASE_PALETTE_COLORS * 3; i++)
- _vm->_gfx->_palette[i] = pal[i] >> 2;
+ byte *p = pal;
+ for (uint i = 0; i < 32; i++) {
+ byte r = *p >> 2;
+ p++;
+ byte g = *p >> 2;
+ p++;
+ byte b = *p >> 2;
+ p++;
+ _vm->_gfx->_palette.setEntry(i, r, g, b);
+
+ }
+
free(pal);
_vm->_gfx->setPalette(_vm->_gfx->_palette);
_vm->_gfx->setBackground(surf);