[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.154.2.1,2.154.2.2 charset.h,2.47.2.1,2.47.2.2
kirben
kirben at users.sourceforge.net
Mon Nov 7 16:59:48 CET 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16545/scumm
Modified Files:
Tag: branch-0-8-0
charset.cpp charset.h
Log Message:
Back port charset fixes for HE games.
Back port charset fixes for Korean hacks.
Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.154.2.1
retrieving revision 2.154.2.2
diff -u -d -r2.154.2.1 -r2.154.2.2
--- charset.cpp 18 Oct 2005 02:11:21 -0000 2.154.2.1
+++ charset.cpp 8 Nov 2005 00:58:44 -0000 2.154.2.2
@@ -298,50 +298,49 @@
int code = (_vm->_heversion >= 80) ? 127 : 64;
while ((chr = text[pos++]) != 0) {
- if (_vm->_heversion >= 72 && chr == code) {
- chr = text[pos++];
- if (chr == 84) { // Strings of speech offset/size
- while (chr != code)
- chr = text[pos++];
- continue;
- }
- if (chr == 119) // 'Wait'
- break;
- if (chr == 104|| chr == 110) // 'Newline'
- break;
- } else if (chr == '@')
- continue;
if (chr == '\n' || chr == '\r')
break;
- if (chr == 254 || chr == 255) {
- //process in LE
- if (chr == 254 && checkKSCode(text[pos], chr) && _vm->_useCJKMode) {
- goto loc_avoid_ks_fe;
- }
- chr = text[pos++];
- if (chr == 3) // 'WAIT'
- break;
- if (chr == 8) { // 'Verb on next line'
- if (arg == 1)
+ if (_vm->_heversion >= 72) {
+ if (chr == code) {
+ chr = text[pos++];
+ if (chr == 84 || chr == 116) { // Strings of speech offset/size
+ while (chr != code)
+ chr = text[pos++];
+ continue;
+ }
+ if (chr == 119) // 'Wait'
+ break;
+ if (chr == 104|| chr == 110) // 'Newline'
break;
- while (text[pos++] == ' ')
- ;
- continue;
- }
- if (chr == 10 || chr == 21 || chr == 12 || chr == 13) {
- pos += 2;
- continue;
}
- if (chr == 9 || chr == 1 || chr == 2) // 'Newline'
- break;
- if (chr == 14) {
- int set = text[pos] | (text[pos + 1] << 8);
- pos += 2;
- setCurID(set);
+ } else {
+ if (chr == '@')
continue;
+ if (chr == 255 || (_vm->_version <= 6 && chr == 254)) {
+ chr = text[pos++];
+ if (chr == 3) // 'WAIT'
+ break;
+ if (chr == 8) { // 'Verb on next line'
+ if (arg == 1)
+ break;
+ while (text[pos++] == ' ')
+ ;
+ continue;
+ }
+ if (chr == 10 || chr == 21 || chr == 12 || chr == 13) {
+ pos += 2;
+ continue;
+ }
+ if (chr == 9 || chr == 1 || chr == 2) // 'Newline'
+ break;
+ if (chr == 14) {
+ int set = text[pos] | (text[pos + 1] << 8);
+ pos += 2;
+ setCurID(set);
+ continue;
+ }
}
}
-loc_avoid_ks_fe:
if ((chr & 0x80) && _vm->_useCJKMode) {
pos++;
width += _vm->_2byteWidth;
@@ -363,62 +362,60 @@
int code = (_vm->_heversion >= 80) ? 127 : 64;
while ((chr = str[pos++]) != 0) {
- if (_vm->_heversion >= 72 && chr == code) {
- chr = str[pos++];
- if (chr == 84) { // Strings of speech offset/size
- while (chr != code)
- chr = str[pos++];
- continue;
- }
- if (chr == 119) // 'Wait'
- break;
- if (chr == 110) { // 'Newline'
- curw = 1;
- continue;
- }
- if (chr == 104) // 'Don't terminate with \n'
- break;
- } else if (chr == '@')
- continue;
- if (chr == 254 || chr == 255) {
- //process in LE
- if (chr == 254 && checkKSCode(str[pos], chr) && _vm->_useCJKMode) {
- goto loc_avoid_ks_fe;
- }
- chr = str[pos++];
- if (chr == 3) // 'Wait'
- break;
- if (chr == 8) { // 'Verb on next line'
- if (a == 1) {
+ if (_vm->_heversion >= 72) {
+ if (chr == code) {
+ chr = str[pos++];
+ if (chr == 84 || chr == 116) { // Strings of speech offset/size
+ while (chr != code)
+ chr = str[pos++];
+ continue;
+ }
+ if (chr == 119) // 'Wait'
+ break;
+ if (chr == 110) { // 'Newline'
curw = 1;
- } else {
- while (str[pos] == ' ')
- str[pos++] = '@';
+ continue;
}
- continue;
- }
- if (chr == 10 || chr == 21 || chr == 12 || chr == 13) {
- pos += 2;
- continue;
- }
- if (chr == 1) { // 'Newline'
- curw = 1;
- continue;
+ if (chr == 104) // 'Don't terminate with \n'
+ break;
}
- if (chr == 2) // 'Don't terminate with \n'
- break;
- if (chr == 14) {
- int set = str[pos] | (str[pos + 1] << 8);
- pos += 2;
- setCurID(set);
+ } else {
+ if (chr == '@')
continue;
+ if (chr == 255 || (_vm->_version <= 6 && chr == 254)) {
+ chr = str[pos++];
+ if (chr == 3) // 'Wait'
+ break;
+ if (chr == 8) { // 'Verb on next line'
+ if (a == 1) {
+ curw = 1;
+ } else {
+ while (str[pos] == ' ')
+ str[pos++] = '@';
+ }
+ continue;
+ }
+ if (chr == 10 || chr == 21 || chr == 12 || chr == 13) {
+ pos += 2;
+ continue;
+ }
+ if (chr == 1) { // 'Newline'
+ curw = 1;
+ continue;
+ }
+ if (chr == 2) // 'Don't terminate with \n'
+ break;
+ if (chr == 14) {
+ int set = str[pos] | (str[pos + 1] << 8);
+ pos += 2;
+ setCurID(set);
+ continue;
+ }
}
}
-
if (chr == ' ')
lastspace = pos - 1;
-loc_avoid_ks_fe:
if ((chr & 0x80) && _vm->_useCJKMode) {
pos++;
curw += _vm->_2byteWidth;
@@ -1429,7 +1426,7 @@
if (type >= 8) {
byte imagePalette[256];
memset(imagePalette, 0, sizeof(imagePalette));
- memcpy(imagePalette, _vm->_charsetColorMap, 16);
+ memcpy(imagePalette, _vm->_charsetColorMap, 4);
Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, imagePalette);
} else {
Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen);
Index: charset.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.h,v
retrieving revision 2.47.2.1
retrieving revision 2.47.2.2
diff -u -d -r2.47.2.1 -r2.47.2.2
--- charset.h 18 Oct 2005 02:11:21 -0000 2.47.2.1
+++ charset.h 8 Nov 2005 00:58:46 -0000 2.47.2.2
@@ -31,18 +31,6 @@
class NutRenderer;
struct VirtScreen;
-static inline bool checkKSCode(byte hi, byte lo) {
- //hi : xx
- //lo : yy
- if ((0xA1 > lo) || (0xFE < lo)) {
- return false;
- }
- if ((hi >= 0xB0) && (hi <= 0xC8)) {
- return true;
- }
- return false;
-}
-
static inline bool checkSJISCode(byte c) {
if ((c > 0x84 && c < 0x88) || (c > 0x9f && c < 0xe0) || (c > 0xea /* && c <= 0xff */))
return false;
More information about the Scummvm-git-logs
mailing list