diff options
author | Strangerke | 2011-06-29 16:15:41 +0200 |
---|---|---|
committer | Strangerke | 2011-06-29 16:15:41 +0200 |
commit | b0c9c9122fc678074aba30068e5b36d347208e65 (patch) | |
tree | 79a99db08ec985f2e5f1e216823b1104d5b753fb /engines/lure | |
parent | f2f3124246a77036f843dee2d83ad28084234ebc (diff) | |
parent | c32a3ea0d30336771bab460ecccb58c4614e6294 (diff) | |
download | scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.gz scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.bz2 scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.zip |
Merge branch 'master' of github.com:scummvm/scummvm into soltys_wip2
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/debugger.cpp | 14 | ||||
-rw-r--r-- | engines/lure/detection.cpp | 35 | ||||
-rw-r--r-- | engines/lure/memory.cpp | 8 | ||||
-rw-r--r-- | engines/lure/res_struct.h | 2 |
4 files changed, 27 insertions, 32 deletions
diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp index 68410875f7..ef4a22f73a 100644 --- a/engines/lure/debugger.cpp +++ b/engines/lure/debugger.cpp @@ -549,14 +549,19 @@ bool Debugger::cmd_showAnim(int argc, const char **argv) { } bool Debugger::cmd_saveStrings(int argc, const char **argv) { - StringData &strings = StringData::getReference(); - char buffer[32768]; - if (argc != 2) { DebugPrintf("strings <stringId>\n"); return true; } + StringData &strings = StringData::getReference(); + + char *buffer = (char *)malloc(32768); + if (!buffer) { + DebugPrintf("Cannot allocate strings buffer\n"); + return true; + } + uint16 id = strToInt(argv[1]); strings.getString(id, buffer, NULL, NULL); DebugPrintf("%s\n", buffer); @@ -577,6 +582,9 @@ bool Debugger::cmd_saveStrings(int argc, const char **argv) { DebugPrintf("Done\n"); */ + + free(buffer); + return true; } diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index ced0be0cfb..081625863d 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -175,34 +175,17 @@ static const LureGameDescription gameDescriptions[] = { } // End of namespace Lure -static const ADParams detectionParams = { - // Pointer to ADGameDescription or its superset structure - (const byte *)Lure::gameDescriptions, - // Size of that superset structure - sizeof(Lure::LureGameDescription), - // Number of bytes to compute MD5 sum for - 1024, - // List of all engine targets - lureGames, - // Structure for autoupgrading obsolete targets - 0, - // Name of single gameid (optional) - "lure", - // List of files for file-based fallback detection (optional) - 0, - // Flags - kADFlagUseExtraAsHint, - // Additional GUI options (for every game} - Common::GUIO_NOSPEECH, - // Maximum directory depth - 1, - // List of directory globs - 0 -}; - class LureMetaEngine : public AdvancedMetaEngine { public: - LureMetaEngine() : AdvancedMetaEngine(detectionParams) {} + LureMetaEngine() : AdvancedMetaEngine(Lure::gameDescriptions, sizeof(Lure::LureGameDescription), lureGames) { + _md5Bytes = 1024; + _singleid = "lure"; + + // Use kADFlagUseExtraAsHint to distinguish between EGA and VGA versions + // of italian Lure when their datafiles sit in the same directory. + _flags = kADFlagUseExtraAsHint; + _guioptions = Common::GUIO_NOSPEECH; + } virtual const char *getName() const { return "Lure"; diff --git a/engines/lure/memory.cpp b/engines/lure/memory.cpp index c5c28fa8bc..137a8f6bee 100644 --- a/engines/lure/memory.cpp +++ b/engines/lure/memory.cpp @@ -93,8 +93,12 @@ void MemoryBlock::copyFrom(const byte *src, uint32 srcPos, uint32 destPos, uint3 void MemoryBlock::reallocate(uint32 size1) { _size = size1; - _data = (byte *) realloc(_data, size1); - if (!_data) error ("Failed reallocating memory block"); + + byte *tmp = (byte *) realloc(_data, size1); + if (!tmp) + error ("[MemoryBlock::reallocate] Failed reallocating memory block"); + + _data = tmp; } } // End of namespace Lure diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index 49b6ef78ba..8d6c557297 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -470,7 +470,7 @@ public: bool isEmpty() const { return _actions.begin() == _actions.end(); } void clear() { _actions.clear(); } CurrentActionEntry &top() { return **_actions.begin(); } - CurrentActionEntry &bottom() { + CurrentActionEntry &bottom() { ActionsList::iterator i = _actions.end(); --i; return **i; |