aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2017-01-25 01:03:28 +0100
committerEugene Sandulenko2017-01-25 22:42:27 +0100
commit46ead907840c271fc4563fc54b54273d28874aae (patch)
treee3456dedc018b7d6aef7870d392af3e61cfdf69f
parenta8a142cfe4521bae210cc4a7c7b4891030d1de39 (diff)
downloadscummvm-rg350-46ead907840c271fc4563fc54b54273d28874aae.tar.gz
scummvm-rg350-46ead907840c271fc4563fc54b54273d28874aae.tar.bz2
scummvm-rg350-46ead907840c271fc4563fc54b54273d28874aae.zip
CRYO: Move inventory debug hack to debugger
-rw-r--r--engines/cryo/debugger.cpp17
-rw-r--r--engines/cryo/debugger.h1
-rw-r--r--engines/cryo/eden.cpp10
-rw-r--r--engines/cryo/eden.h11
4 files changed, 26 insertions, 13 deletions
diff --git a/engines/cryo/debugger.cpp b/engines/cryo/debugger.cpp
index 11a3fb9ec2..f19c616b72 100644
--- a/engines/cryo/debugger.cpp
+++ b/engines/cryo/debugger.cpp
@@ -28,6 +28,7 @@ namespace Cryo {
Debugger::Debugger(CryoEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("showHotspots", WRAP_METHOD(Debugger, Cmd_ShowHotspots));
+ registerCmd("fullInventory", WRAP_METHOD(Debugger, Cmd_FullInventory));
}
/**
@@ -44,4 +45,20 @@ bool Debugger::Cmd_ShowHotspots(int argc, const char **argv) {
return false;
}
+bool Debugger::Cmd_FullInventory(int argc, const char **argv) {
+ if (argc != 1) {
+ debugPrintf("Usage: %s\n", argv[0]);
+ return true;
+ }
+
+ for (int i = 0; i < MAX_OBJECTS; i++) {
+ object_t *object = _vm->_game->getObjectPtr(i);
+ object->_flags |= ObjectFlags::ofFlag1;
+ object->_count++;
+ }
+
+ _vm->_game->showObjects();
+
+ return false;
+}
} // End of namespace Cryo
diff --git a/engines/cryo/debugger.h b/engines/cryo/debugger.h
index bb3ad808ff..ee765128ce 100644
--- a/engines/cryo/debugger.h
+++ b/engines/cryo/debugger.h
@@ -40,6 +40,7 @@ public:
protected:
bool Cmd_ShowHotspots(int argc, const char **argv);
+ bool Cmd_FullInventory(int argc, const char **argv);
};
} // End of namespace Cryo
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index 3b608b5eed..f1fb22f225 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -6828,18 +6828,12 @@ void EdenGame::countObjects() {
byte total = 0;
for (int i = 0; i < MAX_OBJECTS; i++) {
int16 count = _objects[i]._count;
-#ifdef EDEN_DEBUG
- count = 1;
- goto show_all_objects;
-#endif
if (count == 0)
continue;
+
if (_objects[i]._flags & ObjectFlags::ofInHands)
count--;
-#ifdef EDEN_DEBUG
-show_all_objects:
- ;
-#endif
+
if (count) {
total += count;
while (count--)
diff --git a/engines/cryo/eden.h b/engines/cryo/eden.h
index 651b9cd880..6bd5f93382 100644
--- a/engines/cryo/eden.h
+++ b/engines/cryo/eden.h
@@ -44,10 +44,12 @@ private:
CryoEngine *_vm;
public:
- void run();
-
EdenGame(CryoEngine *vm);
+ void run();
+ object_t *getObjectPtr(int16 id);
+ void showObjects();
+
private:
void removeConsole();
void scroll();
@@ -336,9 +338,7 @@ private:
void endCharacterSpeech();
void fademusicup();
void fademusica0(int16 delay);
- object_t *getObjectPtr(int16 id);
void countObjects();
- void showObjects();
void winObject(int16 id);
void loseObject(int16 id);
void lostObject();
@@ -550,6 +550,8 @@ private:
uint8 _cursor[40 * 40];
uint8 *_cursorCenter;
+ byte _ownObjects[128];
+
private:
int16 _scrollPos;
int16 _oldScrollPos;
@@ -694,7 +696,6 @@ private:
byte *_musSequencePtr;
bool _musicEnabledFlag;
uint16 *_currentObjectLocation;
- byte _ownObjects[128];
bool byte_31D64;
bool _noPalette;