Add fix for Zak256/Indy3 actor masks. Thanks jah! Excellent work.
Let's hope someone will fix Loom actor masks soon... :) svn-id: r3976
This commit is contained in:
parent
72663cdcf4
commit
1df77c2002
3 changed files with 65 additions and 22 deletions
73
gfx.cpp
73
gfx.cpp
|
@ -338,9 +338,10 @@ void Scumm::initBGBuffers()
|
||||||
byte *room;
|
byte *room;
|
||||||
|
|
||||||
room = getResourceAddress(rtRoom, _roomResource);
|
room = getResourceAddress(rtRoom, _roomResource);
|
||||||
|
if (_features & GF_OLD256) {
|
||||||
if (_features & GF_SMALL_HEADER) {
|
gdi._numZBuffer = 2;
|
||||||
gdi._numZBuffer = 1;
|
} else if (_features & GF_SMALL_HEADER) {
|
||||||
|
gdi._numZBuffer = 1; // ENDER
|
||||||
} else {
|
} else {
|
||||||
ptr = findResource(MKID('RMIH'), findResource(MKID('RMIM'), room));
|
ptr = findResource(MKID('RMIH'), findResource(MKID('RMIM'), room));
|
||||||
gdi._numZBuffer = READ_LE_UINT16(ptr + 8) + 1;
|
gdi._numZBuffer = READ_LE_UINT16(ptr + 8) + 1;
|
||||||
|
@ -642,7 +643,8 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen * vs, int x, int y, int h,
|
||||||
int numzbuf;
|
int numzbuf;
|
||||||
int sx;
|
int sx;
|
||||||
|
|
||||||
CHECK_HEAP if (_vm->_features & GF_SMALL_HEADER)
|
CHECK_HEAP;
|
||||||
|
if (_vm->_features & GF_SMALL_HEADER)
|
||||||
smap_ptr = _smap_ptr = ptr;
|
smap_ptr = _smap_ptr = ptr;
|
||||||
else
|
else
|
||||||
smap_ptr = findResource(MKID('SMAP'), ptr);
|
smap_ptr = findResource(MKID('SMAP'), ptr);
|
||||||
|
@ -651,8 +653,21 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen * vs, int x, int y, int h,
|
||||||
|
|
||||||
numzbuf = _disable_zbuffer ? 0 : _numZBuffer;
|
numzbuf = _disable_zbuffer ? 0 : _numZBuffer;
|
||||||
|
|
||||||
for (i = 1; i < numzbuf; i++) {
|
if (_vm->_features & GF_OLD256) {
|
||||||
zplane_list[i] = findResource(zplane_tags[i], ptr);
|
/* this is really ugly, FIXME */
|
||||||
|
if (ptr[-2] == 'B' && ptr[-1] == 'M' &&
|
||||||
|
READ_LE_UINT32(ptr - 6) > (READ_LE_UINT32(ptr) + 10)) {
|
||||||
|
zplane_list[1] = smap_ptr + READ_LE_UINT32(ptr);
|
||||||
|
} else if (ptr[-4] == 'O' && ptr[-3] == 'I' &&
|
||||||
|
READ_LE_UINT32(ptr - 8) > READ_LE_UINT32(ptr) + 12) {
|
||||||
|
zplane_list[1] = smap_ptr + READ_LE_UINT32(ptr);
|
||||||
|
} else {
|
||||||
|
zplane_list[1] = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 1; i < numzbuf; i++) {
|
||||||
|
zplane_list[i] = findResource(zplane_tags[i], ptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bottom = y + h;
|
bottom = y + h;
|
||||||
|
@ -673,7 +688,8 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen * vs, int x, int y, int h,
|
||||||
else
|
else
|
||||||
_smap_ptr = smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 8);
|
_smap_ptr = smap_ptr + READ_LE_UINT32(smap_ptr + stripnr * 4 + 8);
|
||||||
|
|
||||||
CHECK_HEAP sx = x;
|
CHECK_HEAP;
|
||||||
|
sx = x;
|
||||||
if (vs->scrollable)
|
if (vs->scrollable)
|
||||||
sx -= vs->xstart >> 3;
|
sx -= vs->xstart >> 3;
|
||||||
|
|
||||||
|
@ -697,7 +713,8 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen * vs, int x, int y, int h,
|
||||||
where_draw_ptr = _bgbak_ptr;
|
where_draw_ptr = _bgbak_ptr;
|
||||||
decompressBitmap();
|
decompressBitmap();
|
||||||
|
|
||||||
CHECK_HEAP if (twobufs) {
|
CHECK_HEAP;
|
||||||
|
if (twobufs) {
|
||||||
_bgbak_ptr = where_draw_ptr;
|
_bgbak_ptr = where_draw_ptr;
|
||||||
|
|
||||||
if (_vm->hasCharsetMask(sx << 3, y, (sx + 1) << 3, bottom)) {
|
if (_vm->hasCharsetMask(sx << 3, y, (sx + 1) << 3, bottom)) {
|
||||||
|
@ -712,9 +729,9 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen * vs, int x, int y, int h,
|
||||||
blit(_backbuff_ptr, _bgbak_ptr, 8, h);
|
blit(_backbuff_ptr, _bgbak_ptr, 8, h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CHECK_HEAP if (flag & dbDrawMaskOnBoth) {
|
CHECK_HEAP;
|
||||||
_z_plane_ptr =
|
if (flag & dbDrawMaskOnBoth) {
|
||||||
zplane_list[1] + READ_LE_UINT16(zplane_list[1] + stripnr * 2 + 8);
|
_z_plane_ptr = zplane_list[1] + READ_LE_UINT16(zplane_list[1] + stripnr * 2 + 8);
|
||||||
_mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * 40 + x;
|
_mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * 40 + x;
|
||||||
if (_useOrDecompress && flag & dbAllowMaskOr)
|
if (_useOrDecompress && flag & dbAllowMaskOr)
|
||||||
decompressMaskImgOr();
|
decompressMaskImgOr();
|
||||||
|
@ -723,18 +740,36 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen * vs, int x, int y, int h,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 1; i < numzbuf; i++) {
|
for (i = 1; i < numzbuf; i++) {
|
||||||
|
uint16 offs;
|
||||||
|
|
||||||
if (!zplane_list[i])
|
if (!zplane_list[i])
|
||||||
continue;
|
continue;
|
||||||
_z_plane_ptr =
|
|
||||||
zplane_list[i] + READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 8);
|
if (_vm->_features & GF_SMALL_HEADER)
|
||||||
_mask_ptr_dest =
|
offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 4);
|
||||||
_vm->getResourceAddress(rtBuffer, 9) + y * 40 + x + _imgBufOffs[i];
|
|
||||||
if (_useOrDecompress && flag & dbAllowMaskOr)
|
|
||||||
decompressMaskImgOr();
|
|
||||||
else
|
else
|
||||||
decompressMaskImg();
|
offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 8);
|
||||||
|
|
||||||
|
_mask_ptr_dest = _vm->getResourceAddress(rtBuffer, 9) + y * 40 + x + _imgBufOffs[i];
|
||||||
|
|
||||||
|
if (offs) {
|
||||||
|
_z_plane_ptr = zplane_list[i] + offs;
|
||||||
|
|
||||||
|
if (_useOrDecompress && flag & dbAllowMaskOr)
|
||||||
|
decompressMaskImgOr();
|
||||||
|
else
|
||||||
|
decompressMaskImg();
|
||||||
|
} else {
|
||||||
|
if (_useOrDecompress && flag & dbAllowMaskOr)
|
||||||
|
; /* nothing */
|
||||||
|
else
|
||||||
|
for (int h = 0; h < _numLinesToProcess; h++)
|
||||||
|
_mask_ptr_dest[h * 40] = 0;
|
||||||
|
/* needs better abstraction, FIXME */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CHECK_HEAP x++;
|
CHECK_HEAP;
|
||||||
|
x++;
|
||||||
stripnr++;
|
stripnr++;
|
||||||
} while (--numstrip);
|
} while (--numstrip);
|
||||||
}
|
}
|
||||||
|
|
7
gui.cpp
7
gui.cpp
|
@ -184,6 +184,9 @@ void Gui::drawWidget(const GuiWidget * w)
|
||||||
sprintf(text, "%s %d", string_map_table_custom[w->_string_number],
|
sprintf(text, "%s %d", string_map_table_custom[w->_string_number],
|
||||||
_gui_variables[w->_string_number]);
|
_gui_variables[w->_string_number]);
|
||||||
break;
|
break;
|
||||||
|
case GUI_SCROLLTEXT:
|
||||||
|
sprintf(text, "%s", _gui_scroller);
|
||||||
|
break;
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
case GUI_KEYTEXT:
|
case GUI_KEYTEXT:
|
||||||
strcpy(text,
|
strcpy(text,
|
||||||
|
@ -409,10 +412,10 @@ const GuiWidget keys_dialog[] = {
|
||||||
|
|
||||||
const GuiWidget about_dialog[] = {
|
const GuiWidget about_dialog[] = {
|
||||||
{GUI_STAT, 0xFF, GWF_DEFAULT, 30, 20, 260, 120, 0, 0},
|
{GUI_STAT, 0xFF, GWF_DEFAULT, 30, 20, 260, 120, 0, 0},
|
||||||
// {GUI_CUSTOMTEXT, 0x01, 0, 30 + 95, 20 + 10, 100, 15, 0, }, .. pocketscummvm
|
|
||||||
{GUI_CUSTOMTEXT, 0x01, 0, 30 + 68, 20 + 10 + 15 + 5, 160, 15, 0, 9}, // Build
|
{GUI_CUSTOMTEXT, 0x01, 0, 30 + 68, 20 + 10 + 15 + 5, 160, 15, 0, 9}, // Build
|
||||||
{GUI_CUSTOMTEXT, 0x01, 0, 30 + 10, 20 + 10 + 15 + 5 + 15, 230, 15, 0, 10}, // ScummVM Url
|
{GUI_CUSTOMTEXT, 0x01, 0, 30 + 10, 20 + 10 + 15 + 5 + 15, 230, 15, 0, 10}, // ScummVM Url
|
||||||
{GUI_CUSTOMTEXT, 0x01, 0, 30 + 75, 20 + 10 + 15 + 5 + 15 + 15 + 15, 150, 15, 0, 11}, // Lucasarts
|
{GUI_CUSTOMTEXT, 0x01, 0, 30 + 75, 20 + 10 + 15 + 5 + 15 + 15 + 15, 150, 15, 0, 11}, // Lucasarts
|
||||||
|
{GUI_SCROLLTEXT, 0x01, 0, 30 + 95, 20 + 10, 100, 15, 0},
|
||||||
{GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + 113, 20 + 96, 54, 16, 40, 9},
|
{GUI_RESTEXT, 0x01, GWF_BUTTON, 30 + 113, 20 + 96, 54, 16, 40, 9},
|
||||||
{0, 0, 0, 0, 0, 0, 0, 0, 0}
|
{0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
@ -819,6 +822,8 @@ void Gui::init(Scumm *s)
|
||||||
_textcolorhi = 15;
|
_textcolorhi = 15;
|
||||||
_shadowcolor = 0;
|
_shadowcolor = 0;
|
||||||
_s = s;
|
_s = s;
|
||||||
|
|
||||||
|
strcpy(_gui_scroller, "Brought to you by:");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::loop()
|
void Gui::loop()
|
||||||
|
|
5
gui.h
5
gui.h
|
@ -34,7 +34,8 @@ enum {
|
||||||
GUI_CUSTOMTEXT = 4,
|
GUI_CUSTOMTEXT = 4,
|
||||||
GUI_VARTEXT = 5,
|
GUI_VARTEXT = 5,
|
||||||
GUI_ACTIONTEXT = 6,
|
GUI_ACTIONTEXT = 6,
|
||||||
GUI_KEYTEXT = 7
|
GUI_KEYTEXT = 7,
|
||||||
|
GUI_SCROLLTEXT = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -114,6 +115,8 @@ public:
|
||||||
void queryMessage(const char *msg, const char *alts);
|
void queryMessage(const char *msg, const char *alts);
|
||||||
byte getDefaultColor(int color);
|
byte getDefaultColor(int color);
|
||||||
|
|
||||||
|
char _gui_scroller[255];
|
||||||
|
|
||||||
// Dialogs
|
// Dialogs
|
||||||
void saveLoadDialog();
|
void saveLoadDialog();
|
||||||
void pause();
|
void pause();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue