aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorJonathan Gray2003-04-10 11:34:51 +0000
committerJonathan Gray2003-04-10 11:34:51 +0000
commit136b4c32b63354bd6478b7e393addfba2547b566 (patch)
tree048fb3e24eba1f34ad879a2fe9d361eb527444c6 /scumm
parent8595e9de42dc76d2ae4f28719ee78866d783ae72 (diff)
downloadscummvm-rg350-136b4c32b63354bd6478b7e393addfba2547b566.tar.gz
scummvm-rg350-136b4c32b63354bd6478b7e393addfba2547b566.tar.bz2
scummvm-rg350-136b4c32b63354bd6478b7e393addfba2547b566.zip
blocked ega games now look like they should thanks to aquadran
svn-id: r6955
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp89
1 files changed, 56 insertions, 33 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 019a959dd8..dfd84cc8fa 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -999,7 +999,7 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h,
if (!zplane_list[i])
continue;
- if (_vm->_features & GF_AFTER_V3) // GF_OLD256 or GF_AFTER_V3 ?
+ if (_vm->_features & GF_OLD256)
offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 4);
else if (_vm->_features & GF_SMALL_HEADER)
offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 2);
@@ -1035,49 +1035,71 @@ next_iter:
} while (--numstrip);
}
-
void Gdi::decodeStripEGA(byte *dst, byte *src, int height) {
- byte data, color = 0, color2 = 0;
- int run = 1;
- byte *t_dst = dst;
- int t_height = height;
-
- for (int x = 0; x < 4; x++) {
- height = t_height;
- dst = t_dst + x * 2;
- do {
- if (--run == 0) {
- data = *src++;
- if (data & 0x80) {
- run = data & 0x3f;
- if (data & 0x40) {
- data = *src++;
- color = _vm->_shadowPalette[data >> 4];
- color2 = _vm->_shadowPalette[data & 0x0f];
+ byte color = 0;
+ int run = 0, x = 0, y = 0;
+
+ while(x < 8){
+ color = *src++;
+
+ if(color >= 0x80) {
+ run = color & 0x3f;
+
+ if(color & 0x40) {
+ color = *src++;
+
+ if(run == 0) {
+ run = *src++;
+ }
+
+ for(int z = 0; z < run; z++) {
+
+ if(z & 1) {
+ *(dst + y * _vm->_realWidth + x) = color & 0xf;
} else {
- color = 0xff;
+ *(dst + y * _vm->_realWidth + x) = color >> 4;
+ }
+
+ y++;
+ if(y >= height){
+ y = 0;
+ x++;
}
- } else {
- run = data >> 4;
- color = _vm->_shadowPalette[data & 0x0f];
- color2 = color;
}
- if (run == 0) {
+ } else{
+ if(run == 0) {
run = *src++;
}
+
+ for(int z = 0; z < run; z++) {
+ *(dst + y * _vm->_realWidth + x) = *(dst + y * _vm->_realWidth + x - 1);
+ y++;
+ if(y >= height){
+ y = 0;
+ x++;
+ }
+ }
}
- if (color != 0xff) {
- *dst = color;
- *(dst + 1) = color2;
- dst += _vm->_realWidth;
+ } else if(color < 0x80){
+ run = color >> 4;
+ if(run == 0) {
+ run = *src++;
+ }
+
+ for(int z = 0; z < run; z++) {
+ *(dst + y * _vm->_realWidth + x) = color & 0xf;
+ y++;
+
+ if(y >= height){
+ y = 0;
+ x++;
+ }
}
- } while (--height);
- dst = t_dst;
+ }
}
}
bool Gdi::decompressBitmap(byte *bgbak_ptr, byte *smap_ptr, int numLinesToProcess) {
- byte code = *smap_ptr++;
assert(numLinesToProcess);
if ((_vm->_gameId == GID_MONKEY_EGA) || (_vm->_gameId == GID_LOOM)) {
@@ -1085,6 +1107,8 @@ bool Gdi::decompressBitmap(byte *bgbak_ptr, byte *smap_ptr, int numLinesToProces
return false;
}
+ byte code = *smap_ptr++;
+
if (_vm->_features & GF_AMIGA)
_palette_mod = 16;
else
@@ -3613,4 +3637,3 @@ void Scumm::drawBomp(BompDrawData *bd, int decode_mode, int mask) {
break;
}
}
-