[Scummvm-cvs-logs] SF.net SVN: scummvm:[54711] scummvm/trunk/engines/mohawk
fuzzie at users.sourceforge.net
fuzzie at users.sourceforge.net
Wed Dec 1 19:22:21 CET 2010
Revision: 54711
http://scummvm.svn.sourceforge.net/scummvm/?rev=54711&view=rev
Author: fuzzie
Date: 2010-12-01 18:22:21 +0000 (Wed, 01 Dec 2010)
Log Message:
-----------
MOHAWK: fix LBPaletteItem
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/livingbooks.cpp
scummvm/trunk/engines/mohawk/livingbooks.h
Modified: scummvm/trunk/engines/mohawk/livingbooks.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.cpp 2010-12-01 18:22:05 UTC (rev 54710)
+++ scummvm/trunk/engines/mohawk/livingbooks.cpp 2010-12-01 18:22:21 UTC (rev 54711)
@@ -2085,45 +2085,27 @@
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) {
Modified: scummvm/trunk/engines/mohawk/livingbooks.h
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.h 2010-12-01 18:22:05 UTC (rev 54710)
+++ scummvm/trunk/engines/mohawk/livingbooks.h 2010-12-01 18:22:21 UTC (rev 54711)
@@ -324,11 +324,11 @@
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 {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list