Bug #2825278: "AGI: KQ4: Swimming on land". Our drawing code was
not picture perfect, and thus priority screen was trashed by one
of Fills, i.e. the color leaked and took whole screen.

svn-id: r49743
This commit is contained in:
Eugene Sandulenko 2010-06-15 10:31:39 +00:00
parent ffc390e64c
commit 83053ecc27
2 changed files with 12 additions and 18 deletions

View file

@ -227,19 +227,12 @@ uint8 *AgiLoader_v3::loadVolRes(AgiDir *agid) {
compBuffer = (uint8 *)calloc(1, agid->clen + 32);
fp.read(compBuffer, agid->clen);
if (x[2] & 0x80 || agid->len == agid->clen) {
if (x[2] & 0x80) { // compressed pic
data = _vm->_picture->convertV3Pic(compBuffer, agid->clen);
free(compBuffer);
} else if (agid->len == agid->clen) {
// do not decompress
data = compBuffer;
#if 0
// CM: added to avoid problems in
// convert_v2_v3_pic() when clen > len
// e.g. Sierra demo 4, first picture
// (Tue Mar 16 13:13:43 EST 1999)
agid->len = agid->clen;
// Now removed to fix Gold Rush! in demo4
#endif
} else {
// it is compressed
data = (uint8 *)calloc(1, agid->len + 32);
@ -309,7 +302,6 @@ int AgiLoader_v3::loadResource(int t, int n) {
unloadResource(rPICTURE, n);
data = loadVolRes(&_vm->_game.dirPic[n]);
if (data != NULL) {
data = _vm->_picture->convertV3Pic(data, _vm->_game.dirPic[n].len);
_vm->_game.pictures[n].rdata = data;
_vm->_game.dirPic[n].flags |= RES_LOADED;
} else {

View file

@ -476,7 +476,7 @@ void PictureMgr::plotPattern(int x, int y) {
// new purpose for temp16
temp16 =( pen_size<<1) +1; // pen size
temp16 = (pen_size << 1) + 1; // pen size
pen_final_y += temp16; // the last row of this shape
temp16 = temp16 << 1;
pen_width = temp16; // width of shape?
@ -495,7 +495,7 @@ void PictureMgr::plotPattern(int x, int y) {
} else {
circleCond = ((_patCode & 0x10) != 0);
counterStep = 4;
ditherCond = 0x02;
ditherCond = 0x01;
}
for (; pen_y < pen_final_y; pen_y++) {
@ -503,10 +503,12 @@ void PictureMgr::plotPattern(int x, int y) {
for (counter = 0; counter <= pen_width; counter += counterStep) {
if (circleCond || ((binary_list[counter>>1] & circle_word) != 0)) {
temp8 = t % 2;
t = t >> 1;
if (temp8 != 0)
t = t ^ 0xB8;
if ((_patCode & 0x20) != 0) {
temp8 = t % 2;
t = t >> 1;
if (temp8 != 0)
t = t ^ 0xB8;
}
// == box plot, != circle plot
if ((_patCode & 0x20) == 0 || (t & 0x03) == ditherCond)