[Scummvm-cvs-logs] SF.net SVN: scummvm:[44675] scummvm/trunk/engines/sci/gui/gui_picture.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Mon Oct 5 22:02:29 CEST 2009
Revision: 44675
http://scummvm.svn.sourceforge.net/scummvm/?rev=44675&view=rev
Author: m_kiewitz
Date: 2009-10-05 20:02:29 +0000 (Mon, 05 Oct 2009)
Log Message:
-----------
SCI/newgui: EGA picture drawing is now using EGA palette
Modified Paths:
--------------
scummvm/trunk/engines/sci/gui/gui_picture.cpp
Modified: scummvm/trunk/engines/sci/gui/gui_picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_picture.cpp 2009-10-05 19:46:38 UTC (rev 44674)
+++ scummvm/trunk/engines/sci/gui/gui_picture.cpp 2009-10-05 20:02:29 UTC (rev 44675)
@@ -295,8 +295,8 @@
byte pic_op;
byte pic_color = 0, pic_priority = 0x0F, pic_control = 0x0F;
int16 x = 0, y = 0, oldx, oldy;
- byte EGApalette = 0;
byte EGApalettes[PIC_EGAPALETTE_TOTALSIZE] = {0};
+ byte *EGApalette = &EGApalettes[_EGApaletteNo];
bool EGAmapping = false;
int curPos = 0;
uint16 size;
@@ -314,6 +314,9 @@
if (getSciVersion() >= SCI_VERSION_1_EGA)
sci1 = true;
+ if (!_s->resMan->isVGA())
+ EGAmapping = true;
+
for (i = 0; i < PIC_EGAPALETTE_TOTALSIZE; i += PIC_EGAPALETTE_SIZE)
memcpy(&EGApalettes[i], &vector_defaultEGApalette, sizeof(vector_defaultEGApalette));
@@ -323,7 +326,7 @@
switch (pic_op = data[curPos++]) {
case PIC_OP_SET_COLOR:
byte = data[curPos++];
- pic_color = EGAmapping ? EGApalettes[byte] : byte;
+ pic_color = EGAmapping ? EGApalette[byte] : byte;
break;
case PIC_OP_DISABLE_VISUAL:
pic_color = 0xFF;
@@ -466,7 +469,7 @@
break;
case PIC_OPX_SCI0_SET_PALETTE:
byte = data[curPos++];
- if (EGApalette >= PIC_EGAPALETTE_COUNT) {
+ if (byte >= PIC_EGAPALETTE_COUNT) {
error("picture trying to write to invalid palette %d", EGApalette);
}
byte *= PIC_EGAPALETTE_SIZE;
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