[Scummvm-cvs-logs] scummvm master -> 92fac11c5feb21e16d8a7b895cc14ec4f3173d46
fuzzie
fuzzie at fuzzie.org
Sat Feb 19 23:09:02 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
92fac11c5f MOHAWK: Update LBPaletteItem for RGB palettes.
Commit: 92fac11c5feb21e16d8a7b895cc14ec4f3173d46
https://github.com/scummvm/scummvm/commit/92fac11c5feb21e16d8a7b895cc14ec4f3173d46
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-02-19T14:12:53-08:00
Commit Message:
MOHAWK: Update LBPaletteItem for RGB palettes.
Changed paths:
engines/mohawk/livingbooks.cpp
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 45c430e..29d2822 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -2988,8 +2988,13 @@ void LBPaletteItem::readData(uint16 type, uint16 size, Common::SeekableSubReadSt
if (_drawStart + _drawCount > 256)
error("encountered palette trying to set more than 256 colors");
assert(size == 8 + _drawCount * 4);
- _palette = new byte[_drawCount * 4];
- stream->read(_palette, _drawCount * 4);
+ _palette = new byte[_drawCount * 3];
+ for (uint i = 0; i < _drawCount; i++) {
+ _palette[i*3 + 0] = stream->readByte();
+ _palette[i*3 + 1] = stream->readByte();
+ _palette[i*3 + 2] = stream->readByte();
+ stream->readByte();
+ }
}
break;
@@ -3027,7 +3032,7 @@ void LBPaletteItem::update() {
// TODO: actual fading-in
if (_visible && _globalVisible) {
- _vm->_system->getPaletteManager()->setPalette(_palette + _drawStart * 4, _drawStart, _drawCount);
+ _vm->_system->getPaletteManager()->setPalette(_palette + _drawStart * 3, _drawStart, _drawCount);
_vm->_needsRedraw = true;
}
}
More information about the Scummvm-git-logs
mailing list