diff options
author | Johannes Schickel | 2008-12-26 11:04:45 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-12-26 11:04:45 +0000 |
commit | 91de740d44710835f9b48f9f7ce787aeea6094df (patch) | |
tree | a1a11cfc5a62dd5dc9e9f38efdfe5ef9690e48ad /engines/kyra/kyra_hof.cpp | |
parent | fb14701b68d797d4133d6f657d6ca165953e30a3 (diff) | |
download | scummvm-rg350-91de740d44710835f9b48f9f7ce787aeea6094df.tar.gz scummvm-rg350-91de740d44710835f9b48f9f7ce787aeea6094df.tar.bz2 scummvm-rg350-91de740d44710835f9b48f9f7ce787aeea6094df.zip |
Implemented (some) main menu code for LoL.
svn-id: r35553
Diffstat (limited to 'engines/kyra/kyra_hof.cpp')
-rw-r--r-- | engines/kyra/kyra_hof.cpp | 63 |
1 files changed, 3 insertions, 60 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index efe3394885..316e341a14 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -34,6 +34,7 @@ #include "kyra/text_hof.h" #include "kyra/timer.h" #include "kyra/debugger.h" +#include "kyra/util.h" #include "common/system.h" #include "common/config-manager.h" @@ -888,8 +889,8 @@ char *KyraEngine_HoF::getTableString(int id, uint8 *buffer, int decode) { char *string = (char*)getTableEntry(buffer, id); if (decode && _flags.lang != Common::JA_JPN) { - decodeString1(string, _internStringBuf); - decodeString2(_internStringBuf, _internStringBuf); + Util::decodeString1(string, _internStringBuf); + Util::decodeString2(_internStringBuf, _internStringBuf); string = _internStringBuf; } @@ -903,64 +904,6 @@ const char *KyraEngine_HoF::getChapterString(int id) { return getTableString(id, _chapterBuffer, 1); } -int KyraEngine_HoF::decodeString1(const char *src, char *dst) { - static const uint8 decodeTable1[] = { - 0x20, 0x65, 0x74, 0x61, 0x69, 0x6E, 0x6F, 0x73, 0x72, 0x6C, 0x68, - 0x63, 0x64, 0x75, 0x70, 0x6D - }; - - static const uint8 decodeTable2[] = { - 0x74, 0x61, 0x73, 0x69, 0x6F, 0x20, 0x77, 0x62, 0x20, 0x72, 0x6E, - 0x73, 0x64, 0x61, 0x6C, 0x6D, 0x68, 0x20, 0x69, 0x65, 0x6F, 0x72, - 0x61, 0x73, 0x6E, 0x72, 0x74, 0x6C, 0x63, 0x20, 0x73, 0x79, 0x6E, - 0x73, 0x74, 0x63, 0x6C, 0x6F, 0x65, 0x72, 0x20, 0x64, 0x74, 0x67, - 0x65, 0x73, 0x69, 0x6F, 0x6E, 0x72, 0x20, 0x75, 0x66, 0x6D, 0x73, - 0x77, 0x20, 0x74, 0x65, 0x70, 0x2E, 0x69, 0x63, 0x61, 0x65, 0x20, - 0x6F, 0x69, 0x61, 0x64, 0x75, 0x72, 0x20, 0x6C, 0x61, 0x65, 0x69, - 0x79, 0x6F, 0x64, 0x65, 0x69, 0x61, 0x20, 0x6F, 0x74, 0x72, 0x75, - 0x65, 0x74, 0x6F, 0x61, 0x6B, 0x68, 0x6C, 0x72, 0x20, 0x65, 0x69, - 0x75, 0x2C, 0x2E, 0x6F, 0x61, 0x6E, 0x73, 0x72, 0x63, 0x74, 0x6C, - 0x61, 0x69, 0x6C, 0x65, 0x6F, 0x69, 0x72, 0x61, 0x74, 0x70, 0x65, - 0x61, 0x6F, 0x69, 0x70, 0x20, 0x62, 0x6D - }; - - int size = 0; - uint cChar = 0; - while ((cChar = *src++) != 0) { - if (cChar & 0x80) { - cChar &= 0x7F; - int index = (cChar & 0x78) >> 3; - *dst++ = decodeTable1[index]; - ++size; - assert(cChar < sizeof(decodeTable2)); - cChar = decodeTable2[cChar]; - } - - *dst++ = cChar; - ++size; - } - - *dst++ = 0; - return size; -} - -void KyraEngine_HoF::decodeString2(const char *src, char *dst) { - if (!src || !dst) - return; - - char out = 0; - while ((out = *src) != 0) { - if (*src == 0x1B) { - ++src; - out = *src + 0x7F; - } - *dst++ = out; - ++src; - } - - *dst = 0; -} - #pragma mark - void KyraEngine_HoF::showMessageFromCCode(int id, int16 palIndex, int) { |