aboutsummaryrefslogtreecommitdiff
path: root/scumm/smush/smush_player.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2005-10-13 23:27:11 +0000
committerEugene Sandulenko2005-10-13 23:27:11 +0000
commit2b47cbb4b5d57114210c79ded18aaacd0c681405 (patch)
tree21e9fb8b03905378b8b92e9aecdcd769616b43ac /scumm/smush/smush_player.cpp
parentbd4340f21abe19c05d6b5a3d8cd95fa6b0e3502a (diff)
downloadscummvm-rg350-2b47cbb4b5d57114210c79ded18aaacd0c681405.tar.gz
scummvm-rg350-2b47cbb4b5d57114210c79ded18aaacd0c681405.tar.bz2
scummvm-rg350-2b47cbb4b5d57114210c79ded18aaacd0c681405.zip
Workaround for bug #1310846 "DIG: Text bug in intro". Proper fix maybe
will be never needed not to mention that it will require to add much logic to code which will be used just once just for single release of the game. (and if somebody will have patience to watch intro to the end) svn-id: r19070
Diffstat (limited to 'scumm/smush/smush_player.cpp')
-rw-r--r--scumm/smush/smush_player.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index efaca21590..b16cc2a2a8 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -600,6 +600,48 @@ void SmushPlayer::handleTextResource(Chunk &b) {
}
}
+ // HACK. This is to prevent bug #1310846. In updated Win95 dig
+ // there is such line:
+ //
+ // ^f01^c001LEAD TESTER
+ // Chris Purvis
+ // ^f01
+ // ^f01^c001WINDOWS COMPATIBILITY
+ // Chip Hinnenberg
+ // ^f01^c001WINDOWS TESTING
+ // Jim Davison
+ // Lynn Selk
+ //
+ // i.e. formatting exists not in the first line only
+ // We just strip that off and assume that neither font
+ // nor font color was altered. Proper fix would be to feed
+ // drawString() with each line sequentally
+ char *string3 = NULL, *sptr2;
+ const char *sptr;
+
+ if (strchr(str, '^')) {
+ string3 = (char *)malloc(strlen(str) + 1);
+
+ for (sptr = str, sptr2 = string3; *sptr;) {
+ if (*sptr == '^') {
+ switch (sptr[1]) {
+ case 'f':
+ sptr += 4;
+ break;
+ case 'c':
+ sptr += 5;
+ break;
+ default:
+ error("invalid escape code in text string");
+ }
+ } else {
+ *sptr2++ = *sptr++;
+ }
+ }
+ *sptr2++ = *sptr++; // copy zero character
+ str = string3;
+ }
+
assert(sf != NULL);
sf->setColor(color);
@@ -643,6 +685,9 @@ void SmushPlayer::handleTextResource(Chunk &b) {
if (string != NULL) {
free (string);
}
+ if (string3 != NULL) {
+ free (string3);
+ }
}
const char *SmushPlayer::getString(int id) {