SCI/newgui: SciGuiPicture - fix drawing of mirrored embedded cel-data in vectordata (fixes lsl5 scene)

svn-id: r45249
This commit is contained in:
Martin Kiewitz 2009-10-19 18:06:33 +00:00
parent 4d9d0411ea
commit 86c8bb6bbf
2 changed files with 9 additions and 2 deletions

View File

@ -464,7 +464,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) {
case PIC_OPX_EGA_MONO4:
break;
case PIC_OPX_EGA_EMBEDDED_VIEW:
vectorGetAbsCoords(data, curPos, x, y);
vectorGetAbsCoordsNoMirror(data, curPos, x, y);
size = READ_LE_UINT16(data + curPos); curPos += 2;
_priority = pic_priority; // set global priority so the cel gets drawn using current priority as well
drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y);
@ -493,7 +493,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) {
_palette->set(&palette, 2);
break;
case PIC_OPX_VGA_EMBEDDED_VIEW: // draw cel
vectorGetAbsCoords(data, curPos, x, y);
vectorGetAbsCoordsNoMirror(data, curPos, x, y);
size = READ_LE_UINT16(data + curPos); curPos += 2;
_priority = pic_priority; // set global priority so the cel gets drawn using current priority as well
drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y);
@ -539,6 +539,12 @@ void SciGuiPicture::vectorGetAbsCoords(byte *data, int &curPos, int16 &x, int16
if (_mirroredFlag) x = 319 - x;
}
void SciGuiPicture::vectorGetAbsCoordsNoMirror(byte *data, int &curPos, int16 &x, int16 &y) {
byte byte = data[curPos++];
x = data[curPos++] + ((byte & 0xF0) << 4);
y = data[curPos++] + ((byte & 0x0F) << 8);
}
void SciGuiPicture::vectorGetRelCoords(byte *data, int &curPos, int16 &x, int16 &y) {
byte byte = data[curPos++];
if (byte & 0x80) {

View File

@ -48,6 +48,7 @@ private:
void drawVectorData(byte *data, int size);
bool vectorIsNonOpcode(byte byte);
void vectorGetAbsCoords(byte *data, int &curPos, int16 &x, int16 &y);
void vectorGetAbsCoordsNoMirror(byte *data, int &curPos, int16 &x, int16 &y);
void vectorGetRelCoords(byte *data, int &curPos, int16 &x, int16 &y);
void vectorGetRelCoordsMed(byte *data, int &curPos, int16 &x, int16 &y);
void vectorGetPatternTexture(byte *data, int &curPos, int16 pattern_Code, int16 &pattern_Texture);