aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorMatthew Hoops2011-07-20 09:27:39 -0400
committerMatthew Hoops2011-07-20 09:27:39 -0400
commitad293b249e74dd1cfbdbd721d02145efbdaf9eca (patch)
treee568d96f6d7f64c5e58b4c7cd1c4fda7e649bfc7 /engines/lure
parentd7411acc2b1c7702280dbff1c3e1bafee528184b (diff)
parente25e85fbb047fef895ede97c3c2c73451631052c (diff)
downloadscummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.gz
scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.bz2
scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/debugger.cpp14
-rw-r--r--engines/lure/disk.cpp3
-rw-r--r--engines/lure/hotspots.cpp3
-rw-r--r--engines/lure/memory.cpp8
-rw-r--r--engines/lure/res_struct.h2
-rw-r--r--engines/lure/sound.cpp2
6 files changed, 22 insertions, 10 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/disk.cpp b/engines/lure/disk.cpp
index 9212508be0..552da73f18 100644
--- a/engines/lure/disk.cpp
+++ b/engines/lure/disk.cpp
@@ -98,7 +98,6 @@ void Disk::openFile(uint8 fileNum) {
error("Could not open %s", sFilename);
char buffer[7];
- uint32 bytesRead;
// If it's the support file, then move to the correct language area
@@ -130,7 +129,7 @@ void Disk::openFile(uint8 fileNum) {
// Validate the header
- bytesRead = _fileHandle->read(buffer, 6);
+ _fileHandle->read(buffer, 6);
buffer[6] = '\0';
if (strcmp(buffer, HEADER_IDENT_STRING) != 0)
error("The file %s was not a valid VGA file", sFilename);
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index 97fbaa72ae..f38bac6e12 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -763,7 +763,7 @@ void Hotspot::showMessage(uint16 messageId, uint16 destCharacterId) {
MemoryBlock *data = res.messagesData();
Hotspot *hotspot;
uint8 *msgData = (uint8 *) data->data();
- uint16 v2, idVal;
+ uint16 idVal;
messageId &= 0x7fff;
// Skip through header to find table for given character
@@ -781,7 +781,6 @@ void Hotspot::showMessage(uint16 messageId, uint16 destCharacterId) {
// Scan through secondary list
uint16 *v = (uint16 *) (msgData + READ_LE_UINT16(msgData + idx + sizeof(uint16)));
- v2 = 0;
while ((idVal = READ_LE_UINT16(v)) != 0xffff) {
++v;
if (READ_LE_UINT16(v) == messageId) break;
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;
diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp
index cf28e0bb74..85b86a8400 100644
--- a/engines/lure/sound.cpp
+++ b/engines/lure/sound.cpp
@@ -31,7 +31,9 @@
#include "common/endian.h"
#include "audio/midiparser.h"
+namespace Common {
DECLARE_SINGLETON(Lure::SoundManager);
+}
namespace Lure {