[Scummvm-cvs-logs] SF.net SVN: scummvm:[53781] scummvm/trunk/engines/saga
h00ligan at users.sourceforge.net
h00ligan at users.sourceforge.net
Mon Oct 25 00:40:37 CEST 2010
Revision: 53781
http://scummvm.svn.sourceforge.net/scummvm/?rev=53781&view=rev
Author: h00ligan
Date: 2010-10-24 22:40:37 +0000 (Sun, 24 Oct 2010)
Log Message:
-----------
SAGA: fix SAGA_DEBUG; fix IHNM cutaway typo
Modified Paths:
--------------
scummvm/trunk/engines/saga/introproc_ihnm.cpp
scummvm/trunk/engines/saga/objectmap.cpp
scummvm/trunk/engines/saga/objectmap.h
scummvm/trunk/engines/saga/scene.cpp
Modified: scummvm/trunk/engines/saga/introproc_ihnm.cpp
===================================================================
--- scummvm/trunk/engines/saga/introproc_ihnm.cpp 2010-10-24 22:25:16 UTC (rev 53780)
+++ scummvm/trunk/engines/saga/introproc_ihnm.cpp 2010-10-24 22:40:37 UTC (rev 53781)
@@ -133,7 +133,7 @@
else
_vm->_resource->loadResource(resourceContext, RID_IHNMDEMO_INTRO_CUTAWAYS, resourceData);
- if (resourceData.empty() == 0) {
+ if (resourceData.empty()) {
error("Scene::IHNMStartProc() Can't load cutaway list");
}
Modified: scummvm/trunk/engines/saga/objectmap.cpp
===================================================================
--- scummvm/trunk/engines/saga/objectmap.cpp 2010-10-24 22:25:16 UTC (rev 53780)
+++ scummvm/trunk/engines/saga/objectmap.cpp 2010-10-24 22:40:37 UTC (rev 53781)
@@ -164,7 +164,6 @@
// Loads an object map resource ( objects ( clickareas ( points ) ) )
void ObjectMap::load(const ByteArray &resourceData) {
- uint i;
if (!_hitZoneList.empty()) {
error("ObjectMap::load _hitZoneList not empty");
@@ -182,8 +181,9 @@
_hitZoneList.resize(readS.readUint16());
- for (i = 0; i < _hitZoneList.size(); i++) {
- _hitZoneList[i].load(_vm, &readS, i, _vm->_scene->currentSceneNumber());
+ int idx = 0;
+ for (HitZoneArray::iterator i = _hitZoneList.begin(); i != _hitZoneList.end(); ++i) {
+ i->load(_vm, &readS, idx++, _vm->_scene->currentSceneNumber());
}
}
@@ -193,8 +193,7 @@
#ifdef SAGA_DEBUG
void ObjectMap::draw(const Point& testPoint, int color, int color2) {
- uint i;
- uint hitZoneIndex;
+ int hitZoneIndex;
char txtBuf[32];
Point pickPoint;
Point textPoint;
@@ -209,8 +208,8 @@
hitZoneIndex = hitTest(pickPoint);
- for (i = 0; i < _hitZoneList.size(); i++) {
- _hitZoneList[i].draw(_vm, (hitZoneIndex == i) ? color2 : color);
+ for (HitZoneArray::iterator i = _hitZoneList.begin(); i != _hitZoneList.end(); ++i) {
+ i->draw(_vm, (hitZoneIndex == i->getIndex()) ? color2 : color);
}
if (hitZoneIndex != -1) {
@@ -223,12 +222,11 @@
#endif
int ObjectMap::hitTest(const Point& testPoint) {
- uint i;
// Loop through all scene objects
- for (i = 0; i < _hitZoneList.size(); i++) {
- if (_hitZoneList[i].hitTest(testPoint)) {
- return i;
+ for (HitZoneArray::iterator i = _hitZoneList.begin(); i != _hitZoneList.end(); ++i) {
+ if (i->hitTest(testPoint)) {
+ return i->getIndex();
}
}
Modified: scummvm/trunk/engines/saga/objectmap.h
===================================================================
--- scummvm/trunk/engines/saga/objectmap.h 2010-10-24 22:25:16 UTC (rev 53780)
+++ scummvm/trunk/engines/saga/objectmap.h 2010-10-24 22:40:37 UTC (rev 53781)
@@ -38,6 +38,9 @@
public:
void load(SagaEngine *vm, MemoryReadStreamEndian *readStream, int index, int sceneNumber);
+ int getIndex() const {
+ return _index;
+ }
int getNameIndex() const {
return _nameIndex;
}
@@ -87,6 +90,7 @@
ClickAreas _clickAreas;
};
+typedef Common::Array<HitZone> HitZoneArray;
class ObjectMap {
public:
@@ -110,7 +114,7 @@
private:
SagaEngine *_vm;
- Common::Array<HitZone> _hitZoneList;
+ HitZoneArray _hitZoneList;
};
} // End of namespace Saga
Modified: scummvm/trunk/engines/saga/scene.cpp
===================================================================
--- scummvm/trunk/engines/saga/scene.cpp 2010-10-24 22:25:16 UTC (rev 53780)
+++ scummvm/trunk/engines/saga/scene.cpp 2010-10-24 22:40:37 UTC (rev 53781)
@@ -175,7 +175,6 @@
#define DUMP_SCENES_LEVEL 10
if (DUMP_SCENES_LEVEL <= gDebugLevel) {
- uint j;
int backUpDebugLevel = gDebugLevel;
SAGAResourceTypes *types;
int typesCount;
@@ -189,16 +188,16 @@
loadSceneResourceList(_sceneDescription.resourceListResourceId);
gDebugLevel = backUpDebugLevel;
debug(DUMP_SCENES_LEVEL, "Dump Scene: number %i, descriptor resourceId %i, resourceList resourceId %i", i, _sceneLUT[i], _sceneDescription.resourceListResourceId);
- debug(DUMP_SCENES_LEVEL, "\tresourceListCount %i", (int)_resourceListCount);
- for (j = 0; j < _resourceListCount; j++) {
- if (_resourceList[j].resourceType >= typesCount) {
- error("wrong resource type %i", _resourceList[j].resourceType);
+ debug(DUMP_SCENES_LEVEL, "\tresourceListCount %i", (int)_resourceList.size());
+ for (SceneResourceDataArray::iterator j = _resourceList.begin(); j != _resourceList.end(); ++j) {
+ if (j->resourceType >= typesCount) {
+ error("wrong resource type %i", j->resourceType);
}
- resType = types[_resourceList[j].resourceType];
+ resType = types[j->resourceType];
- debug(DUMP_SCENES_LEVEL, "\t%s resourceId %i", SAGAResourceTypesString[resType], _resourceList[j].resourceId);
+ debug(DUMP_SCENES_LEVEL, "\t%s resourceId %i", SAGAResourceTypesString[resType], j->resourceId);
}
- free(_resourceList);
+ _resourceList.clear();
}
}
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list