[Scummvm-cvs-logs] SF.net SVN: scummvm: [25506] scummvm/trunk/engines/agos
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Mon Feb 12 05:18:20 CET 2007
Revision: 25506
http://scummvm.svn.sourceforge.net/scummvm/?rev=25506&view=rev
Author: kirben
Date: 2007-02-11 20:18:19 -0800 (Sun, 11 Feb 2007)
Log Message:
-----------
Add Quietust's patch to fix subtitles glitches in Amiga AGA/CD32 versions of Simon the Sorcerer 1.
Modified Paths:
--------------
scummvm/trunk/engines/agos/charset.cpp
scummvm/trunk/engines/agos/res_ami.cpp
scummvm/trunk/engines/agos/string.cpp
Modified: scummvm/trunk/engines/agos/charset.cpp
===================================================================
--- scummvm/trunk/engines/agos/charset.cpp 2007-02-12 03:59:29 UTC (rev 25505)
+++ scummvm/trunk/engines/agos/charset.cpp 2007-02-12 04:18:19 UTC (rev 25506)
@@ -305,64 +305,59 @@
dst_org = dst;
int delta = 0;
while ((chr = *txt++) != 0) {
- int tmp = chr;
+ int img_width = 1;
if (chr == 10) {
dst += width * 10;
dst_org = dst;
delta = 0;
- } else if ((tmp -= '!') < 0) {
- delta += 6;
- if (delta > 8) {
- delta -= 8;
- dst_org++;
- }
+ } else if ((signed char)(chr -= '!') < 0) {
+ img_width = 7;
} else {
const byte *img = simon_agaFont + chr * 41;
- int img_width = img[40];
- int mdelta = 8 - delta;
+ img_width = img[40];
byte *cur_dst = dst_org;
for (int row = 0; row < 10; row++) {
int col = color;
for (int plane = 0; plane < 3; plane++) {
chr = img[plane] >> delta;
if (chr) {
- if (col & 1) *(cur_dst + charsize * 0) |= chr;
- if (col & 2) *(cur_dst + charsize * 1) |= chr;
- if (col & 4) *(cur_dst + charsize * 2) |= chr;
- if (col & 8) *(cur_dst + charsize * 3) |= chr;
+ if (col & 1) cur_dst[charsize * 0] |= chr;
+ if (col & 2) cur_dst[charsize * 1] |= chr;
+ if (col & 4) cur_dst[charsize * 2] |= chr;
+ if (col & 8) cur_dst[charsize * 3] |= chr;
}
- chr = img[plane] << mdelta;
- if ((mdelta >= img_width) && (chr)) {
- if (col & 1) *(cur_dst + charsize * 0 + 1) |= chr;
- if (col & 2) *(cur_dst + charsize * 1 + 1) |= chr;
- if (col & 4) *(cur_dst + charsize * 2 + 1) |= chr;
- if (col & 8) *(cur_dst + charsize * 3 + 1) |= chr;
+ chr = img[plane] << (8 - delta);
+ if (((8 - delta) < img_width) && (chr)) {
+ if (col & 1) cur_dst[charsize * 0 + 1] |= chr;
+ if (col & 2) cur_dst[charsize * 1 + 1] |= chr;
+ if (col & 4) cur_dst[charsize * 2 + 1] |= chr;
+ if (col & 8) cur_dst[charsize * 3 + 1] |= chr;
}
col++;
}
chr = img[3] >> delta;
if (chr) {
- *(cur_dst + charsize * 0) |= chr;
- *(cur_dst + charsize * 1) |= chr;
- *(cur_dst + charsize * 2) |= chr;
- *(cur_dst + charsize * 3) |= chr;
+ cur_dst[charsize * 0] |= chr;
+ cur_dst[charsize * 1] |= chr;
+ cur_dst[charsize * 2] |= chr;
+ cur_dst[charsize * 3] |= chr;
}
- chr = img[3] << mdelta;
- if ((mdelta >= img_width) && (chr)) {
- *(cur_dst + charsize * 0 + 1) |= chr;
- *(cur_dst + charsize * 1 + 1) |= chr;
- *(cur_dst + charsize * 2 + 1) |= chr;
- *(cur_dst + charsize * 3 + 1) |= chr;
+ chr = img[3] << (8 - delta);
+ if (((8 - delta) < img_width) && (chr)) {
+ cur_dst[charsize * 0 + 1] |= chr;
+ cur_dst[charsize * 1 + 1] |= chr;
+ cur_dst[charsize * 2 + 1] |= chr;
+ cur_dst[charsize * 3 + 1] |= chr;
}
cur_dst += width;
img += 4;
}
- delta += img_width - 1;
- if (delta > 8) {
- delta -= 8;
- dst_org++;
- }
}
+ delta += img_width - 1;
+ if (delta >= 8) {
+ delta -= 8;
+ dst_org++;
+ }
}
}
Modified: scummvm/trunk/engines/agos/res_ami.cpp
===================================================================
--- scummvm/trunk/engines/agos/res_ami.cpp 2007-02-12 03:59:29 UTC (rev 25505)
+++ scummvm/trunk/engines/agos/res_ami.cpp 2007-02-12 04:18:19 UTC (rev 25506)
@@ -75,6 +75,21 @@
}
}
+static void bitplanetochunkytext(uint16 *w, uint8 colorDepth, uint8 *&dst) {
+ for (int j = 0; j < 16; j++) {
+ byte color = 0;
+ for (int p = 0; p < colorDepth; ++p) {
+ if (w[p] & 0x8000) {
+ color |= 1 << p;
+ }
+ w[p] <<= 1;
+ }
+ if (color)
+ color |= 0xC0;
+ *dst++ = color;
+ }
+}
+
static void convertcompressedclip(const byte *src, byte *dst, uint8 colorDepth, int height, int width) {
const byte *plane[kMaxColorDepth];
byte *uncptr[kMaxColorDepth];
@@ -143,7 +158,11 @@
for (j = 0; j < colorDepth; ++j) {
w[j] = READ_BE_UINT16(src + j * length * 2);
}
- bitplanetochunky(w, colorDepth, dst);
+ if (state->palette == 0xC0) {
+ bitplanetochunkytext(w, colorDepth, dst);
+ } else {
+ bitplanetochunky(w, colorDepth, dst);
+ }
src += 2;
} else {
for (j = 0; j < colorDepth; ++j) {
Modified: scummvm/trunk/engines/agos/string.cpp
===================================================================
--- scummvm/trunk/engines/agos/string.cpp 2007-02-12 03:59:29 UTC (rev 25505)
+++ scummvm/trunk/engines/agos/string.cpp 2007-02-12 04:18:19 UTC (rev 25506)
@@ -465,6 +465,7 @@
renderString(1, color, width, height, convertedString);
} else {
if (getPlatform() == Common::kPlatformAmiga) {
+ color = color * 3 + 1;
renderStringAmiga(vgaSpriteId, color, width, height, convertedString);
} else {
color = color * 3 + 192;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list