RCS file: /cvsroot/scummvm/scummvm/README,v
retrieving revision 1.108
diff -u -r1.108 README
|
|
|
393 | 393 | es - Spanish |
394 | 394 | jp - Japanese |
395 | 395 | zh - Chinese |
396 | | ko - Korean |
| 396 | kr - Korean |
397 | 397 | hb - Hebrew |
398 | 398 | |
399 | 399 | Graphics filters: |
RCS file: /cvsroot/scummvm/scummvm/scumm.dsp,v
retrieving revision 1.41
diff -u -r1.41 scumm.dsp
|
|
|
207 | 207 | # End Group |
208 | 208 | |
209 | 209 | # Begin Source File |
210 | 210 | |
211 | 211 | |
212 | 212 | |
| 213 | SOURCE=.\scumm\2byte_charset.cpp |
213 | 214 | |
| 215 | # End Source File |
214 | 216 | |
+# Begin Source File
+
SOURCE=.\scumm\actor.cpp
# End Source File
# Begin Source File
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.101
diff -u -r1.101 gameDetector.cpp
|
|
|
56 | 56 | "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,advmame3x,tv2x,dotmatrix)\n" |
57 | 57 | "\t-e<mode> - set music engine (see README for details)\n" |
58 | 58 | "\t-a - specify game is amiga version\n" |
59 | | "\t-q<lang> - specify language (en,de,fr,it,pt,es,jp,zh,ko,hb)\n" |
| 59 | "\t-q<lang> - specify language (en,de,fr,it,pt,es,jp,zh,kr,hb)\n" |
60 | 60 | "\n" |
61 | 61 | "\t-c<num> - use cdrom <num> for cd audio\n" |
62 | 62 | "\t-m<num> - set music volume to <num> (0-255)\n" |
… |
… |
|
117 | 117 | {"es", "Spanish", ES_ESP}, |
118 | 118 | {"jp", "Japanese", JA_JPN}, |
119 | 119 | {"zh", "Chinese (Taiwan)", ZH_TWN}, |
120 | | {"ko", "Korean", KO_KOR}, |
| 120 | {"kr", "Korean", KO_KOR}, |
121 | 121 | {"hb", "Hebrew", HB_HEB}, |
122 | 122 | {0, 0, 0} |
123 | 123 | }; |
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.35
diff -u -r2.35 charset.cpp
|
|
|
23 | 23 | #include "scumm.h" |
24 | 24 | #include "nut_renderer.h" |
25 | 25 | |
| 26 | bool _2byte_pos_hack; |
| 27 | |
26 | 28 | CharsetRenderer::CharsetRenderer(Scumm *vm) { |
27 | 29 | |
28 | 30 | _nextLeft = 0; |
… |
… |
|
79 | 81 | |
80 | 82 | // do spacing for variable width old-style font |
81 | 83 | int CharsetRendererClassic::getCharWidth(byte chr) { |
| 84 | if(chr >= 0x80 && _CJKMode) |
| 85 | return 6; |
82 | 86 | int spacing = 0; |
83 | 87 | |
84 | 88 | int offs = READ_LE_UINT32(_fontPtr + chr * 4 + 4); |
… |
… |
|
628 | 632 | int offsX, offsY; |
629 | 633 | int d; |
630 | 634 | VirtScreen *vs; |
| 635 | int is2byte = 0; |
631 | 636 | |
632 | 637 | _vm->checkRange(_vm->_maxCharsets - 1, 1, _curId, "Printing with bad charset %d"); |
633 | 638 | |
… |
… |
|
640 | 645 | _bpp = *_fontPtr; |
641 | 646 | _vm->_charsetColorMap[1] = _color; |
642 | 647 | |
643 | | uint32 charOffs = READ_LE_UINT32(_fontPtr + chr * 4 + 4); |
| 648 | is2byte = (chr >= 0x80 && _CJKMode) ? 1 : 0; |
| 649 | |
| 650 | uint32 charOffs = READ_LE_UINT32(_fontPtr + (is2byte ? 0x0f : chr) * 4 + 4); //HACK! |
644 | 651 | |
645 | 652 | if (!charOffs) |
646 | 653 | return; |
… |
… |
|
649 | 656 | |
650 | 657 | _charPtr = _fontPtr + charOffs; |
651 | 658 | |
652 | | width = _charPtr[0]; |
| 659 | if(is2byte) width = _charPtr[0] - 1; else width = _charPtr[0]; //HACK!!! |
653 | 660 | height = _charPtr[1]; |
654 | 661 | if (_firstChar) { |
655 | 662 | _str.left = 0; |
… |
… |
|
721 | 728 | dst = _vm->getResourceAddress(rtBuffer, vs->number + 5) |
722 | 729 | + vs->xstart + drawTop * _vm->_screenWidth + _left; |
723 | 730 | |
724 | | drawBits(vs, dst, mask, drawTop, width, height); |
| 731 | if(is2byte) |
| 732 | draw2byte(vs, dst, mask, drawTop, chr); |
| 733 | else |
| 734 | drawBits(vs, dst, mask, drawTop, width, height); |
725 | 735 | |
726 | 736 | int h = height; |
727 | 737 | do { |
… |
… |
|
730 | 740 | dst += _vm->_screenWidth; |
731 | 741 | } while (--h); |
732 | 742 | } else { |
733 | | drawBits(vs, dst, mask, drawTop, width, height); |
| 743 | if(is2byte) |
| 744 | draw2byte(vs, dst, mask, drawTop, chr); |
| 745 | else |
| 746 | drawBits(vs, dst, mask, drawTop, width, height); |
734 | 747 | } |
735 | 748 | |
736 | 749 | _left += width; |
… |
… |
|
844 | 857 | int width = _current->getCharWidth(chr); |
845 | 858 | int height = _current->getCharHeight(chr); |
846 | 859 | |
| 860 | if(chr >= 256 && _CJKMode) |
| 861 | width = 16; |
| 862 | |
847 | 863 | _hasMask = true; |
848 | | _current->drawChar((char)chr, _left, _top, _color, !_ignoreCharsetMask); |
| 864 | if(chr >= 256 && _CJKMode) |
| 865 | _current->draw2byte(chr, _left, _top + (_2byte_pos_hack ? 6 : 0), _color, !_ignoreCharsetMask); |
| 866 | else |
| 867 | _current->drawChar((char)chr, _left, _top, _color, !_ignoreCharsetMask); |
849 | 868 | _vm->updateDirtyRect(0, _left, _left + width, _top, _top + height, 0); |
850 | 869 | |
851 | 870 | _left += width; |
… |
… |
|
854 | 873 | |
855 | 874 | if (_top + height > _str.bottom) |
856 | 875 | _str.bottom = _top + height; |
| 876 | |
| 877 | _2byte_pos_hack = false; |
857 | 878 | } |
858 | 879 | |
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.h,v
retrieving revision 2.17
diff -u -r2.17 charset.h
|
|
|
90 | 90 | byte *_charPtr; |
91 | 91 | |
92 | 92 | int getCharWidth(byte chr); |
| 93 | void draw2byte(VirtScreen *vs, byte *dst, byte *mask, int drawTop, int idx); |
93 | 94 | void drawBits(VirtScreen *vs, byte *dst, byte *mask, int drawTop, int width, int height); |
94 | 95 | |
95 | 96 | public: |
RCS file: /cvsroot/scummvm/scummvm/scumm/module.mk,v
retrieving revision 1.18
diff -u -r1.18 module.mk
|
|
|
1 | 1 | MODULE := scumm |
2 | 2 | |
3 | 3 | SCUMM_OBJS = \ |
| 4 | scumm/2byte_charset.o \ |
4 | 5 | scumm/actor.o \ |
5 | 6 | scumm/akos.o \ |
6 | 7 | scumm/base-costume.o \ |
RCS file: /cvsroot/scummvm/scummvm/scumm/nut_renderer.cpp,v
retrieving revision 1.24
diff -u -r1.24 nut_renderer.cpp
|
|
|
133 | 133 | return 0; |
134 | 134 | } |
135 | 135 | |
136 | | return READ_LE_UINT16(_dataSrc + _offsets[c] + 6); |
| 136 | if(c & 0x80 && _CJKMode) |
| 137 | return 8; |
| 138 | else |
| 139 | return READ_LE_UINT16(_dataSrc + _offsets[c] + 6) + 2; |
137 | 140 | } |
138 | 141 | |
139 | 142 | int32 NutRenderer::getCharHeight(byte c) { |
… |
… |
|
143 | 146 | return 0; |
144 | 147 | } |
145 | 148 | |
146 | | return READ_LE_UINT16(_dataSrc + _offsets[c] + 8); |
| 149 | if(c & 0x80 && _CJKMode) |
| 150 | return 16; |
| 151 | else |
| 152 | return READ_LE_UINT16(_dataSrc + _offsets[c] + 8); |
147 | 153 | } |
148 | 154 | |
149 | 155 | int32 NutRenderer::getStringWidth(const byte *string) { |
RCS file: /cvsroot/scummvm/scummvm/scumm/nut_renderer.h,v
retrieving revision 1.7
diff -u -r1.7 nut_renderer.h
|
|
|
41 | 41 | ~NutRenderer(); |
42 | 42 | |
43 | 43 | bool loadFont(const char *filename, const char *dir); |
| 44 | void draw2byte(int c, int32 x, int32 y, byte color, bool useMask); |
44 | 45 | void drawChar(byte c, int32 x, int32 y, byte color, bool useMask); |
45 | 46 | // void drawString(const char *string, int32 x, int32 y, byte color, int32 mode); |
46 | 47 | int32 getCharWidth(byte c); |
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.175
diff -u -r2.175 script_v8.cpp
|
|
|
599 | 599 | if (c != 0 && c != 0xFF) { |
600 | 600 | _charset->_left = _charset->_nextLeft; |
601 | 601 | _charset->_top = _charset->_nextTop; |
602 | | _charset->printChar(c); |
| 602 | if(c >= 0x80 && _CJKMode) |
| 603 | _charset->printChar(c + (*buf++ * 256)); |
| 604 | else |
| 605 | _charset->printChar(c); |
603 | 606 | _charset->_nextLeft = _charset->_left; |
604 | 607 | _charset->_nextTop = _charset->_top; |
605 | 608 | } |
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.232
diff -u -r1.232 scumm.h
|
|
|
1069 | 1069 | |
1070 | 1070 | void loadLanguageBundle(); |
1071 | 1071 | public: |
| 1072 | bool checkCJKLanguage(); |
1072 | 1073 | void translateText(const byte *text, byte *trans_buff); // Used by class ScummDialog |
1073 | 1074 | protected: |
1074 | 1075 | |
… |
… |
|
1202 | 1203 | |
1203 | 1204 | // This is a constant lookup table of reverse bit masks |
1204 | 1205 | extern const byte revBitMask[8]; |
| 1206 | |
| 1207 | //nasty hacks |
| 1208 | extern bool _CJKMode; |
| 1209 | extern int _gid; |
| 1210 | extern char *_2byte; |
| 1211 | extern int _2byte_height; |
| 1212 | extern int _2byte_width; |
| 1213 | extern bool _2byte_pos_hack; |
1205 | 1214 | |
1206 | 1215 | /* Direction conversion functions (between old dir and new dir format) */ |
1207 | 1216 | int newDirToOldDir(int dir); |
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.199
diff -u -r2.199 scummvm.cpp
|
|
|
56 | 56 | Scumm *g_scumm = 0; |
57 | 57 | ScummDebugger *g_debugger; |
58 | 58 | |
| 59 | int _gid; |
| 60 | char *_2byte; |
| 61 | int _2byte_width; |
| 62 | int _2byte_height; |
| 63 | bool _CJKMode; |
| 64 | |
59 | 65 | extern NewGui *g_gui; |
60 | 66 | extern uint16 _debugLevel; |
61 | 67 | |
… |
… |
|
634 | 640 | _saveLoadCompatible = false; |
635 | 641 | } |
636 | 642 | loadLanguageBundle(); |
| 643 | |
| 644 | // Load CJK font |
| 645 | if((_gameId == GID_DIG || _gameId == GID_CMI) && checkCJKLanguage()) { |
| 646 | _gid = _gameId; |
| 647 | File _fp; |
| 648 | char _fontFile[16]; |
| 649 | _CJKMode = true; |
| 650 | switch(_language) { |
| 651 | case KO_KOR: |
| 652 | strcpy(_fontFile, "korean.fnt"); |
| 653 | break; |
| 654 | case JA_JPN: |
| 655 | strcpy(_fontFile, (_gameId == GID_DIG) ? "kanji16.fnt" : "japanese.fnt"); |
| 656 | break; |
| 657 | case ZH_TWN: |
| 658 | if(_gameId == GID_CMI) |
| 659 | strcpy(_fontFile, "chinese.fnt"); |
| 660 | else |
| 661 | _CJKMode = false; |
| 662 | break; |
| 663 | } |
| 664 | if(_CJKMode && _fp.open(_fontFile, getGameDataPath(), 1)) { |
| 665 | debug(2, "Loading CJK Font"); |
| 666 | _fp.seek(2,SEEK_CUR); |
| 667 | _2byte_width = _fp.readByte(); //FIXME: is this correct? |
| 668 | _2byte_height = _fp.readByte(); |
| 669 | |
| 670 | int numChar = 0; |
| 671 | switch(_language) { |
| 672 | case KO_KOR: |
| 673 | numChar = 2350; |
| 674 | break; |
| 675 | case JA_JPN: |
| 676 | numChar = (_gameId == GID_DIG) ? 1 : 1; //FIXME |
| 677 | break; |
| 678 | case ZH_TWN: |
| 679 | numChar = 1; //FIXME |
| 680 | break; |
| 681 | } |
| 682 | _2byte = new char[2 * _2byte_height * numChar]; |
| 683 | _fp.read(_2byte, 2 * _2byte_height * numChar); |
| 684 | _fp.close(); |
| 685 | } |
| 686 | } |
| 687 | |
637 | 688 | _audioNames = NULL; |
638 | 689 | } |
639 | 690 | |
… |
… |
|
641 | 692 | { |
642 | 693 | delete [] _actors; |
643 | 694 | |
| 695 | delete _2byte; |
644 | 696 | delete _charset; |
645 | 697 | delete _pauseDialog; |
646 | 698 | delete _optionsDialog; |
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.127
diff -u -r1.127 string.cpp
|
|
|
241 | 241 | if (c != 0xFF) { |
242 | 242 | _charset->_left = _charset->_nextLeft; |
243 | 243 | _charset->_top = _charset->_nextTop; |
| 244 | if(c & 0x80 && _CJKMode) { |
| 245 | c += *buffer++ * 256; |
| 246 | if(_gameId == GID_CMI) |
| 247 | _2byte_pos_hack = true; //HACK: ¿µ¹®°úÀÇ yÁÂÇ¥°¡ ¸ÂÁö ¾Ê´Ù. |
| 248 | } |
244 | 249 | if (_features & GF_AFTER_V2 || _features & GF_AFTER_V3) { |
245 | 250 | _charset->printChar(c); |
246 | 251 | } else if (_features & GF_AFTER_V6) { |
… |
… |
|
371 | 376 | if (c != 0 && c != 0xFF) { |
372 | 377 | _charset->_left = _charset->_nextLeft; |
373 | 378 | _charset->_top = _charset->_nextTop; |
374 | | _charset->printChar(c); |
| 379 | if(c & 0x80 && _CJKMode) |
| 380 | _charset->printChar(c + ((*buf++) * 256)); |
| 381 | else |
| 382 | _charset->printChar(c); |
375 | 383 | _charset->_nextLeft = _charset->_left; |
376 | 384 | _charset->_nextTop = _charset->_top; |
377 | 385 | } |
… |
… |
|
477 | 485 | if (_string[a].no_talk_anim == 0) |
478 | 486 | _charset->_blitAlso = true; |
479 | 487 | } |
480 | | _charset->printChar(chr); |
| 488 | if(chr >= 0x80 && _CJKMode) { |
| 489 | if(_gameId == GID_CMI) |
| 490 | _2byte_pos_hack = true; |
| 491 | _charset->printChar(chr + (buf[i++] * 256)); |
| 492 | } |
| 493 | else |
| 494 | _charset->printChar(chr); |
481 | 495 | _charset->_blitAlso = false; |
482 | 496 | } |
483 | 497 | } |
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_font.cpp,v
retrieving revision 1.2
diff -u -r1.2 smush_font.cpp
|
|
|
105 | 105 | } |
106 | 106 | |
107 | 107 | int SmushFont::getCharWidth(byte v) { |
| 108 | if(v >= 0x80 && _CJKMode) |
| 109 | return get2byteCharWidth(); |
| 110 | |
108 | 111 | if(v >= _nbChars) |
109 | 112 | error("invalid character in SmushFont::charWidth : %d (%d)", v, _nbChars); |
110 | 113 | |
… |
… |
|
112 | 115 | } |
113 | 116 | |
114 | 117 | int SmushFont::getCharHeight(byte v) { |
| 118 | if(v >= 0x80 && _CJKMode) |
| 119 | return get2byteCharHeight(); |
| 120 | |
115 | 121 | if(v >= _nbChars) |
116 | 122 | error("invalid character in SmushFont::charHeight : %d (%d)", v, _nbChars); |
117 | 123 | |
… |
… |
|
243 | 249 | } |
244 | 250 | |
245 | 251 | void SmushFont::drawSubstring(char *str, byte *buffer, int dst_width, int x, int y) { |
246 | | for(int i = 0; str[i] != 0; i++) |
247 | | x += drawChar(buffer, dst_width, x, y, str[i]); |
| 252 | for(int i = 0; str[i] != 0; i++) { |
| 253 | if((byte)str[i] >= 0x80 && _CJKMode) { |
| 254 | x += draw2byte(buffer, dst_width, x, y, str[i], str[i+1]); |
| 255 | i++; |
| 256 | } else |
| 257 | x += drawChar(buffer, dst_width, x, y, str[i]); |
| 258 | } |
248 | 259 | } |
249 | 260 | |
250 | 261 | void SmushFont::drawStringAbsolute(char *str, byte *buffer, int dst_width, int x, int y) { |
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_font.h,v
retrieving revision 1.2
diff -u -r1.2 smush_font.h
|
|
|
46 | 46 | |
47 | 47 | protected: |
48 | 48 | |
| 49 | int get2byteCharWidth(); |
| 50 | int get2byteCharHeight(); |
49 | 51 | int getCharWidth(byte c); |
50 | 52 | int getStringWidth(char *str); |
51 | 53 | int getCharHeight(byte c); |
52 | 54 | int getStringHeight(char *str); |
| 55 | int draw2byte(byte *buffer, int dst_width, int x, int y, byte fst, byte snd); |
53 | 56 | int drawChar(byte *buffer, int dst_width, int x, int y, byte chr); |
54 | 57 | void drawSubstring(char *str, byte *buffer, int dst_width, int x, int y); |
55 | 58 | void decodeCodec(byte *dst, byte *src, int length); |