From dfe04491c1d8ecb45f4952af96c9d73e9e654a32 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 21 Jan 2015 01:29:22 +0100 Subject: JANITORIAL: Remove unnecessary semicolons --- engines/wintermute/debugger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute') 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; -- cgit v1.2.3 From 6ca8d22fb100f2b3f3549b8785801ffd470135b9 Mon Sep 17 00:00:00 2001 From: jammm Date: Sun, 22 Feb 2015 02:02:41 +0530 Subject: WINTERMUTE: Fixed parentFolder name check when testing for "language"/"languages", Fix bug #6655 (Dead City - hotspot text issue) Fixed Wintermute incorretly parsing folder names with trailing \ (Windows-only issue) It seems that calling getParent returns trailing '\' which is absent on POSIX based file systems but not on Windows. This causes Wintermute to load outline_red2.font from russian.dcp, which is not desired. This is fixed by calling it->getName() directly, which returns the folder name (without the trailing '\'). --- engines/wintermute/base/base_file_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute') 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 -- cgit v1.2.3 From 320139760cf4e964f5cc7ce8d71938377e293ec9 Mon Sep 17 00:00:00 2001 From: jammm Date: Mon, 23 Feb 2015 23:37:04 +0530 Subject: WINTERMUTE: Add mappings for VKeyCodes->ScummVM KeyCodes Fix bug #6654 (white chamber - some keys don't work) Wintermute games on ScummVM used ScummVM keycodes for keyboard mapping, whereas the game scripts only accepted Windows VKeyCodes. Therefore an initial set of mappings are added and the debug room is now loading properly, when HOME is pressed (Rest of the keys need to be tested in-game) --- engines/wintermute/base/base_keyboard_state.cpp | 101 ++++++++++++++++++------ engines/wintermute/base/base_keyboard_state.h | 2 +- 2 files changed, 77 insertions(+), 26 deletions(-) (limited to 'engines/wintermute') 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 @@ -261,42 +261,93 @@ bool BaseKeyboardState::isCurrentPrintable() const { return _currentPrintable; } +////////////////////////////////////////////////////////////////////////// +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 }; -- cgit v1.2.3 From d07de8ca70d0eb430d328f2b0fa5154f67f72c1a Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 12 Jul 2015 18:50:12 +0200 Subject: WINTERMUTE: Fix typo --- engines/wintermute/base/base_script_holder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute') 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; } } -- cgit v1.2.3 From c37997aaf8a1db2b60690032fe16e7f41048a8ac Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 24 Oct 2015 22:18:27 +0200 Subject: WINTERMUTE: Remove unused function It calls itself, and is declared pure virtual. Thanks salty-horse. --- engines/wintermute/base/gfx/base_surface.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'engines/wintermute') 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 @@ -74,11 +74,6 @@ bool BaseSurface::displayHalfTrans(int x, int y, Rect32 rect) { return STATUS_FAILED; } -////////////////////////////////////////////////////////////////////////// -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; -- cgit v1.2.3 From b8caa07ddb2e31cdebbbc012adbf11f721a2fd3a Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 4 Nov 2015 21:19:42 +0100 Subject: WINTERMUTE: Fix mismatched free/delete Valgrind warning The memory stream class uses free() to free memory, so we have to use malloc(), not new, to allocate it. --- engines/wintermute/base/file/base_file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute') 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); -- cgit v1.2.3 From e85cf8d54ddf6f55d47c1257538356e074bc4c19 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 7 Nov 2015 14:41:45 +0100 Subject: WINTERMUTE: C++'ify code --- engines/wintermute/utils/convert_utf.cpp | 6 ++---- engines/wintermute/utils/convert_utf.h | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'engines/wintermute') 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 -- cgit v1.2.3 From 7292c476794dbbe85d50e90bb8ad3b85dabab703 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sun, 8 Nov 2015 16:54:07 +0100 Subject: WINTERMUTE: Adjust detection of Five Magical Amulets This should add proper detection of the Czech/English/Polish versions of Five Magical Amulets --- engines/wintermute/detection_tables.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'engines/wintermute') diff --git a/engines/wintermute/detection_tables.h b/engines/wintermute/detection_tables.h index 4e3320159a..a03513010b 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), -- cgit v1.2.3 From 30b6682130e5aefe1e019eb37c0cd25b5831d225 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sun, 8 Nov 2015 17:14:17 +0100 Subject: WINTERMUTE: Add detection for Oknytt v.1.13 Beware that the language-overriding breaks if english.dcp still exists in the same folder as d_sounds.dcp --- engines/wintermute/detection_tables.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engines/wintermute') diff --git a/engines/wintermute/detection_tables.h b/engines/wintermute/detection_tables.h index a03513010b..25a01766e4 100644 --- a/engines/wintermute/detection_tables.h +++ b/engines/wintermute/detection_tables.h @@ -343,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), -- cgit v1.2.3