aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-05-31 15:07:55 +0000
committerMax Horn2009-05-31 15:07:55 +0000
commit7140dda5e5e8af593c373a27340aea4f72d618c2 (patch)
tree7867dffa507b3219d841ef6222c81753b2c28a05 /engines
parent4441ca4b3e39ed1613c826f7b46b1e7076fcbe14 (diff)
downloadscummvm-rg350-7140dda5e5e8af593c373a27340aea4f72d618c2.tar.gz
scummvm-rg350-7140dda5e5e8af593c373a27340aea4f72d618c2.tar.bz2
scummvm-rg350-7140dda5e5e8af593c373a27340aea4f72d618c2.zip
MADE: cleanup
svn-id: r41070
Diffstat (limited to 'engines')
-rw-r--r--engines/made/resource.cpp5
-rw-r--r--engines/made/resource.h5
-rw-r--r--engines/made/scriptfuncs.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp
index b8742b1327..c7d15dae73 100644
--- a/engines/made/resource.cpp
+++ b/engines/made/resource.cpp
@@ -506,7 +506,7 @@ void ResourceReader::loadIndex(ResourceSlots *slots) {
}
void ResourceReader::freeResource(Resource *resource) {
- tossResourceFromCache(resource->slot);
+ tossResourceFromCache(resource->_slot);
}
bool ResourceReader::loadResource(ResourceSlot *slot, byte *&buffer, uint32 &size) {
@@ -525,8 +525,9 @@ bool ResourceReader::loadResource(ResourceSlot *slot, byte *&buffer, uint32 &siz
ResourceSlot *ResourceReader::getResourceSlot(uint32 resType, uint index) {
ResourceSlots *slots = _resSlots[resType];
+ assert(slots);
if (index >= 1 && index < slots->size()) {
- return &slots->operator[](index);
+ return &(*slots)[index];
} else {
return NULL;
}
diff --git a/engines/made/resource.h b/engines/made/resource.h
index a291268e60..8af111551c 100644
--- a/engines/made/resource.h
+++ b/engines/made/resource.h
@@ -56,9 +56,8 @@ struct ResourceSlot;
class Resource {
public:
- ResourceSlot *slot;
+ ResourceSlot *_slot;
virtual ~Resource();
- virtual void load(byte *buffer, int size) = 0;
};
class PictureResource : public Resource {
@@ -231,7 +230,7 @@ protected:
if (loadResource(slot, buffer, size)) {
res = new T();
- res->slot = slot;
+ res->_slot = slot;
res->load(buffer, size);
addResourceToCache(slot, res);
delete[] buffer;
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index c0373dfa0d..0f1e7b4512 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -637,7 +637,7 @@ int16 ScriptFunctions::sfGetSoundEnergy(int16 argc, int16 *argv) {
int result = 0;
if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle) && _vm->_soundEnergyArray) {
while (_vm->_soundEnergyIndex < _vm->_soundEnergyArray->size()) {
- SoundEnergyItem *soundEnergyItem = &_vm->_soundEnergyArray->operator[](_vm->_soundEnergyIndex);
+ SoundEnergyItem *soundEnergyItem = &(*_vm->_soundEnergyArray)[_vm->_soundEnergyIndex];
if (((_vm->_soundRate / 1000) * _vm->_mixer->getSoundElapsedTime(_audioStreamHandle)) < soundEnergyItem->position) {
result = soundEnergyItem->energy;
break;