aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAlyssa Milburn2010-12-01 18:22:21 +0000
committerAlyssa Milburn2010-12-01 18:22:21 +0000
commit1b27de3829024e25496145c0c29473f4921d85ac (patch)
tree5f0083f27d2c63f22d6dd99114360552e8fdcf17 /engines
parenta62500db1e596107990649a2843ec77fc9075358 (diff)
downloadscummvm-rg350-1b27de3829024e25496145c0c29473f4921d85ac.tar.gz
scummvm-rg350-1b27de3829024e25496145c0c29473f4921d85ac.tar.bz2
scummvm-rg350-1b27de3829024e25496145c0c29473f4921d85ac.zip
MOHAWK: fix LBPaletteItem
svn-id: r54711
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/livingbooks.cpp34
-rw-r--r--engines/mohawk/livingbooks.h6
2 files changed, 11 insertions, 29 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index c00b22123c..062216fe5b 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -2085,45 +2085,27 @@ LBPaletteItem::LBPaletteItem(MohawkEngine_LivingBooks *vm, Common::Rect rect) :
void LBPaletteItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream) {
switch (type) {
- case 0x72:
+ case kLBPaletteXData:
{
- assert(size == 4 + 256 * 4);
- // TODO
+ assert(size == 8 + 255 * 4);
_start = stream->readUint16();
_count = stream->readUint16();
- stream->read(_palette, 256 * 4);
+ _drawStart = stream->readUint16();
+ _drawCount = stream->readUint16();
+ stream->read(_palette, 255 * 4);
}
break;
- case 0x75:
- assert(size == 0);
- debug(2, "LBPaletteItem: 0x75");
- // TODO
- break;
-
default:
LBItem::readData(type, size, stream);
}
}
-void LBPaletteItem::startPhase(uint phase) {
- //if (_phase != phase)
- // return;
-
- /*printf("palette: start %d, count %d\n", _start, _count);
- byte *localpal = _palette;
- for (unsigned int i = 0; i < 256 * 4; i++) {
- printf("%02x ", *localpal++);
- }
- printf("\n");*/
-
- // TODO: huh?
- if (_start != 1)
+void LBPaletteItem::draw() {
+ if (!_visible)
return;
- // TODO
- //_vm->_system->setPalette(_start - 1, _count - (_start - 1), _palette + (_start * 4));
- _vm->_system->setPalette(_palette + _start * 4, 0, 256 - _start);
+ _vm->_system->setPalette(_palette + _drawStart * 4, _drawStart, _drawCount);
}
LBLiveTextItem::LBLiveTextItem(MohawkEngine_LivingBooks *vm, Common::Rect rect) : LBItem(vm, rect) {
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 387853f64b..6421471496 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -324,11 +324,11 @@ public:
void readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream);
- void startPhase(uint phase);
+ void draw();
protected:
- uint16 _start, _count;
- byte _palette[256 * 4];
+ uint16 _start, _count, _drawStart, _drawCount;
+ byte _palette[255 * 4];
};
struct LiveTextWord {