diff options
Diffstat (limited to 'engines/wintermute')
-rw-r--r-- | engines/wintermute/base/base_file_manager.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/base/base_keyboard_state.cpp | 101 | ||||
-rw-r--r-- | engines/wintermute/base/base_keyboard_state.h | 2 | ||||
-rw-r--r-- | engines/wintermute/base/base_script_holder.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/base/file/base_file.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/base/gfx/base_surface.cpp | 5 | ||||
-rw-r--r-- | engines/wintermute/debugger.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/detection_tables.h | 29 | ||||
-rw-r--r-- | engines/wintermute/utils/convert_utf.cpp | 6 | ||||
-rw-r--r-- | engines/wintermute/utils/convert_utf.h | 3 |
10 files changed, 111 insertions, 43 deletions
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp index 58684b66a0..05830ffcd8 100644 --- a/engines/wintermute/base/base_file_manager.cpp +++ b/engines/wintermute/base/base_file_manager.cpp @@ -227,7 +227,7 @@ bool BaseFileManager::registerPackages() { // Again, make the parent's name all lowercase to avoid any case // issues. - Common::String parentName = fileIt->getParent().getName(); + Common::String parentName = it->getName(); parentName.toLowercase(); // Avoid registering all the language files diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp index 0babc07586..f672c83d39 100644 --- a/engines/wintermute/base/base_keyboard_state.cpp +++ b/engines/wintermute/base/base_keyboard_state.cpp @@ -262,41 +262,92 @@ bool BaseKeyboardState::isCurrentPrintable() const { } ////////////////////////////////////////////////////////////////////////// +enum VKeyCodes { + kVkReturn = 13, + + kVkEscape = 27, + + kVkSpace = 32, + kVkEnd = 35, + kVkHome = 36, + kVkLeft = 37, + kVkUp = 38, + kVkRight = 39, + kVkDown = 40, + + kVkF1 = 112, + kVkF2 = 113, + kVkF3 = 114, + kVkF4 = 115, + kVkF5 = 116, + kVkF6 = 117, + kVkF7 = 118, + kVkF8 = 119, + kVkF9 = 120, + kVkF10 = 121, + kVkF11 = 122, + kVkF12 = 123 + +}; + +////////////////////////////////////////////////////////////////////////// uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) { + // todo if (event->type != Common::EVENT_KEYDOWN) { return 0; } switch (event->kbd.keycode) { + case Common::KEYCODE_RETURN: case Common::KEYCODE_KP_ENTER: - return Common::KEYCODE_RETURN; + return kVkReturn; + case Common::KEYCODE_ESCAPE: + return kVkEscape; + case Common::KEYCODE_SPACE: + return kVkSpace; + case Common::KEYCODE_END: + return kVkEnd; + case Common::KEYCODE_HOME: + return kVkHome; + case Common::KEYCODE_LEFT: + return kVkLeft; + case Common::KEYCODE_RIGHT: + return kVkRight; + case Common::KEYCODE_UP: + return kVkUp; + case Common::KEYCODE_DOWN: + return kVkDown; + case Common::KEYCODE_F1: + return kVkF1; + case Common::KEYCODE_F2: + return kVkF2; + case Common::KEYCODE_F3: + return kVkF3; + case Common::KEYCODE_F4: + return kVkF4; + case Common::KEYCODE_F5: + return kVkF5; + case Common::KEYCODE_F6: + return kVkF6; + case Common::KEYCODE_F7: + return kVkF7; + case Common::KEYCODE_F8: + return kVkF8; + case Common::KEYCODE_F9: + return kVkF9; + case Common::KEYCODE_F10: + return kVkF10; + case Common::KEYCODE_F11: + return kVkF11; + case Common::KEYCODE_F12: + return kVkF12; default: - return (uint32)event->kbd.ascii; + warning("Key not handled: %d '%c'", event->kbd.keycode, event->kbd.keycode); + return event->kbd.keycode; + break; } -} -enum VKeyCodes { - kVkEscape = 27, - kVkSpace = 32, - kVkHome = 36, - kVkLeft = 37, - kVkUp = 38, - kVkRight = 39, - kVkDown = 40, - - kVkF1 = 112, - kVkF2 = 113, - kVkF3 = 114, - kVkF4 = 115, - kVkF5 = 116, - kVkF6 = 117, - kVkF7 = 118, - kVkF8 = 119, - kVkF9 = 120, - kVkF10 = 121, - kVkF11 = 122, - kVkF12 = 123 -}; +} ////////////////////////////////////////////////////////////////////////// Common::KeyCode BaseKeyboardState::vKeyToKeyCode(uint32 vkey) { diff --git a/engines/wintermute/base/base_keyboard_state.h b/engines/wintermute/base/base_keyboard_state.h index c74bd5b0f7..32680b34c1 100644 --- a/engines/wintermute/base/base_keyboard_state.h +++ b/engines/wintermute/base/base_keyboard_state.h @@ -67,7 +67,7 @@ private: bool _currentControl; uint8 *_keyStates; - uint32 keyCodeToVKey(Common::Event *event); + uint32 keyCodeToVKey(Common::Event *event); //TODO, add more mappings Common::KeyCode vKeyToKeyCode(uint32 vkey); //TODO, reimplement using ScummVM-backend }; diff --git a/engines/wintermute/base/base_script_holder.cpp b/engines/wintermute/base/base_script_holder.cpp index 8383657239..5b1c961479 100644 --- a/engines/wintermute/base/base_script_holder.cpp +++ b/engines/wintermute/base/base_script_holder.cpp @@ -302,7 +302,7 @@ bool BaseScriptHolder::addScript(const char *filename) { for (uint32 i = 0; i < _scripts.size(); i++) { if (scumm_stricmp(_scripts[i]->_filename, filename) == 0) { if (_scripts[i]->_state != SCRIPT_FINISHED) { - BaseEngine::LOG(0, "BaseScriptHolder::AddScript - trying to add script '%s' mutiple times (obj: '%s')", filename, getName()); + BaseEngine::LOG(0, "BaseScriptHolder::AddScript - trying to add script '%s' multiple times (obj: '%s')", filename, getName()); return STATUS_OK; } } diff --git a/engines/wintermute/base/file/base_file.cpp b/engines/wintermute/base/file/base_file.cpp index 2927c908e2..4589721e7e 100644 --- a/engines/wintermute/base/file/base_file.cpp +++ b/engines/wintermute/base/file/base_file.cpp @@ -57,7 +57,7 @@ bool BaseFile::isEOF() { Common::SeekableReadStream *BaseFile::getMemStream() { uint32 oldPos = getPos(); seek(0); - byte *data = new byte[getSize()]; + byte *data = (byte *)malloc(getSize()); read(data, getSize()); seek(oldPos); Common::MemoryReadStream *memStream = new Common::MemoryReadStream(data, getSize(), DisposeAfterUse::YES); diff --git a/engines/wintermute/base/gfx/base_surface.cpp b/engines/wintermute/base/gfx/base_surface.cpp index f8b96b5baf..3aa500b224 100644 --- a/engines/wintermute/base/gfx/base_surface.cpp +++ b/engines/wintermute/base/gfx/base_surface.cpp @@ -75,11 +75,6 @@ bool BaseSurface::displayHalfTrans(int x, int y, Rect32 rect) { } ////////////////////////////////////////////////////////////////////////// -bool BaseSurface::displayTransform(int x, int y, Rect32 rect, Rect32 newRect, const Graphics::TransformStruct &transform) { - return displayTransform(x, y, rect, newRect, transform); -} - -////////////////////////////////////////////////////////////////////////// bool BaseSurface::create(int width, int height) { return STATUS_FAILED; } diff --git a/engines/wintermute/debugger.cpp b/engines/wintermute/debugger.cpp index a313314a8b..5b617d9db9 100644 --- a/engines/wintermute/debugger.cpp +++ b/engines/wintermute/debugger.cpp @@ -42,7 +42,7 @@ bool Console::Cmd_ShowFps(int argc, const char **argv) { if (Common::String(argv[1]) == "true") { _engineRef->_game->setShowFPS(true); } else if (Common::String(argv[1]) == "false") { - _engineRef->_game->setShowFPS(false);; + _engineRef->_game->setShowFPS(false); } } return true; diff --git a/engines/wintermute/detection_tables.h b/engines/wintermute/detection_tables.h index 4e3320159a..25a01766e4 100644 --- a/engines/wintermute/detection_tables.h +++ b/engines/wintermute/detection_tables.h @@ -140,9 +140,18 @@ static const WMEGameDescription gameDescriptions[] = { // Five Lethal Demons WME_WINENTRY("5ld", "", WME_ENTRY1s("data.dcp", "1037a77cbd001e0644898addc022322c", 15407750), Common::EN_ANY, ADGF_UNSTABLE, LATEST_VERSION), - // Five Magical Amulets + // Five Magical Amulets (Czech) WME_WINENTRY("5ma", "", - WME_ENTRY1s("data.dcp", "0134e92bcd5fd2837df3971087e96067", 163316498), Common::EN_ANY, ADGF_UNSTABLE, WME_1_7_0), + WME_ENTRY2s("czech.dcp", "7b2515a8ceb955c72bc14f0f1fca869e", 184, + "data.dcp", "0134e92bcd5fd2837df3971087e96067", 163316498), Common::CZ_CZE, ADGF_UNSTABLE, WME_1_7_0), + // Five Magical Amulets (English) + WME_WINENTRY("5ma", "", + WME_ENTRY2s("english.dcp", "2f97bca09260ba23b645da9f0855ce7f", 893681, + "data.dcp", "0134e92bcd5fd2837df3971087e96067", 163316498), Common::EN_ANY, ADGF_UNSTABLE, WME_1_7_0), + // Five Magical Amulets (Polish) + WME_WINENTRY("5ma", "", + WME_ENTRY2s("polish.dcp", "bb877d48795471a17f25b0b5109100d1", 1132197, + "data.dcp", "0134e92bcd5fd2837df3971087e96067", 163316498), Common::PL_POL, ADGF_UNSTABLE, WME_1_7_0), // Actual Destination WME_WINENTRY("actualdest", "", WME_ENTRY1s("data.dcp", "6926f44b26f21ceb1d840eaab9aeb510", 9081740), Common::EN_ANY, ADGF_UNSTABLE, LATEST_VERSION), @@ -334,6 +343,22 @@ static const WMEGameDescription gameDescriptions[] = { // Oknytt WME_WINENTRY("oknytt", "Version 1.0", WME_ENTRY1s("data.dcp", "6456cf8f429905c83f07509f9da536dd", 109502959), Common::EN_ANY, ADGF_UNSTABLE, LATEST_VERSION), + // Oknytt (Version 1.13 English) (These are detected along with d_sounds.dcp to avoid mass-detecting in the languages-subfolder.) + WME_WINENTRY("oknytt", "Version 1.13", + WME_ENTRY2s("english.dcp", "d2afd722c78cfe66b7d4250d11f6ae16", 293274135, + "d_sounds.dcp", "7d04dff8ca11174486bd4b7a80fdcabb", 154943401), Common::EN_ANY, ADGF_UNSTABLE, LATEST_VERSION), + // Oknytt (Version 1.13 German) + WME_WINENTRY("oknytt", "Version 1.13", + WME_ENTRY2s("german.dcp", "0fc6401d8d76b04f6da49206ecafa0dc", 304292574, + "d_sounds.dcp", "7d04dff8ca11174486bd4b7a80fdcabb", 154943401), Common::DE_DEU, ADGF_UNSTABLE, LATEST_VERSION), + // Oknytt (Version 1.13 Russian) + WME_WINENTRY("oknytt", "Version 1.13", + WME_ENTRY2s("russian.dcp", "dd24a1c0b36a82e2b02fb6c1050d4aad", 362681669, + "d_sounds.dcp", "7d04dff8ca11174486bd4b7a80fdcabb", 154943401), Common::RU_RUS, ADGF_UNSTABLE, LATEST_VERSION), + // Oknytt (Version 1.13 Spanish) + WME_WINENTRY("oknytt", "Version 1.13", + WME_ENTRY2s("spanish.dcp", "10c46152cb29581671f3b6b7c229c957", 319406572, + "d_sounds.dcp", "7d04dff8ca11174486bd4b7a80fdcabb", 154943401), Common::ES_ESP, ADGF_UNSTABLE, LATEST_VERSION), // Night Train Demo WME_WINENTRY("nighttrain", "", WME_ENTRY1s("data.dcp", "5a027ef84b083a730c9a4c85ec1d3a32", 131760816), Common::EN_ANY, ADGF_UNSTABLE | ADGF_DEMO, LATEST_VERSION), diff --git a/engines/wintermute/utils/convert_utf.cpp b/engines/wintermute/utils/convert_utf.cpp index 7ebc011d01..cdb48103d0 100644 --- a/engines/wintermute/utils/convert_utf.cpp +++ b/engines/wintermute/utils/convert_utf.cpp @@ -55,8 +55,6 @@ static const UTF32 halfMask = 0x3FFUL; #define UNI_SUR_HIGH_END (UTF32)0xDBFF #define UNI_SUR_LOW_START (UTF32)0xDC00 #define UNI_SUR_LOW_END (UTF32)0xDFFF -#define false 0 -#define true 1 /* --------------------------------------------------------------------- */ @@ -311,7 +309,7 @@ ConversionResult ConvertUTF16toUTF8( * definition of UTF-8 goes up to 4-byte sequences. */ -static Boolean isLegalUTF8(const UTF8 *source, int length) { +static bool isLegalUTF8(const UTF8 *source, int length) { UTF8 a; const UTF8 *srcptr = source + length; switch (length) { @@ -356,7 +354,7 @@ static Boolean isLegalUTF8(const UTF8 *source, int length) { * Exported function to return whether a UTF-8 sequence is legal or not. * This is not used here; it's just exported. */ -Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { +bool isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { int length = trailingBytesForUTF8[*source] + 1; if (source + length > sourceEnd) { return false; diff --git a/engines/wintermute/utils/convert_utf.h b/engines/wintermute/utils/convert_utf.h index a5f34456f5..d2e54f4af4 100644 --- a/engines/wintermute/utils/convert_utf.h +++ b/engines/wintermute/utils/convert_utf.h @@ -96,7 +96,6 @@ namespace Wintermute { typedef uint32 UTF32; /* at least 32 bits */ typedef uint16 UTF16; /* at least 16 bits */ typedef uint8 UTF8; /* typically 8 bits */ -typedef uint8 Boolean; /* 0 or 1 */ /* Some fundamental constants */ #define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD @@ -141,7 +140,7 @@ ConversionResult ConvertUTF32toUTF16( const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags); -Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); +bool isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); } // End of namespace Wintermute |