AGI: Fix bug #2825278.
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:
parent
ffc390e64c
commit
83053ecc27
2 changed files with 12 additions and 18 deletions
|
@ -227,19 +227,12 @@ uint8 *AgiLoader_v3::loadVolRes(AgiDir *agid) {
|
||||||
compBuffer = (uint8 *)calloc(1, agid->clen + 32);
|
compBuffer = (uint8 *)calloc(1, agid->clen + 32);
|
||||||
fp.read(compBuffer, agid->clen);
|
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
|
// do not decompress
|
||||||
data = compBuffer;
|
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 {
|
} else {
|
||||||
// it is compressed
|
// it is compressed
|
||||||
data = (uint8 *)calloc(1, agid->len + 32);
|
data = (uint8 *)calloc(1, agid->len + 32);
|
||||||
|
@ -309,7 +302,6 @@ int AgiLoader_v3::loadResource(int t, int n) {
|
||||||
unloadResource(rPICTURE, n);
|
unloadResource(rPICTURE, n);
|
||||||
data = loadVolRes(&_vm->_game.dirPic[n]);
|
data = loadVolRes(&_vm->_game.dirPic[n]);
|
||||||
if (data != NULL) {
|
if (data != NULL) {
|
||||||
data = _vm->_picture->convertV3Pic(data, _vm->_game.dirPic[n].len);
|
|
||||||
_vm->_game.pictures[n].rdata = data;
|
_vm->_game.pictures[n].rdata = data;
|
||||||
_vm->_game.dirPic[n].flags |= RES_LOADED;
|
_vm->_game.dirPic[n].flags |= RES_LOADED;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -476,7 +476,7 @@ void PictureMgr::plotPattern(int x, int y) {
|
||||||
|
|
||||||
// new purpose for temp16
|
// 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
|
pen_final_y += temp16; // the last row of this shape
|
||||||
temp16 = temp16 << 1;
|
temp16 = temp16 << 1;
|
||||||
pen_width = temp16; // width of shape?
|
pen_width = temp16; // width of shape?
|
||||||
|
@ -495,7 +495,7 @@ void PictureMgr::plotPattern(int x, int y) {
|
||||||
} else {
|
} else {
|
||||||
circleCond = ((_patCode & 0x10) != 0);
|
circleCond = ((_patCode & 0x10) != 0);
|
||||||
counterStep = 4;
|
counterStep = 4;
|
||||||
ditherCond = 0x02;
|
ditherCond = 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; pen_y < pen_final_y; pen_y++) {
|
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) {
|
for (counter = 0; counter <= pen_width; counter += counterStep) {
|
||||||
if (circleCond || ((binary_list[counter>>1] & circle_word) != 0)) {
|
if (circleCond || ((binary_list[counter>>1] & circle_word) != 0)) {
|
||||||
temp8 = t % 2;
|
if ((_patCode & 0x20) != 0) {
|
||||||
t = t >> 1;
|
temp8 = t % 2;
|
||||||
if (temp8 != 0)
|
t = t >> 1;
|
||||||
t = t ^ 0xB8;
|
if (temp8 != 0)
|
||||||
|
t = t ^ 0xB8;
|
||||||
|
}
|
||||||
|
|
||||||
// == box plot, != circle plot
|
// == box plot, != circle plot
|
||||||
if ((_patCode & 0x20) == 0 || (t & 0x03) == ditherCond)
|
if ((_patCode & 0x20) == 0 || (t & 0x03) == ditherCond)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue