ASYLUM: Add command "dump_action". This currently just prints out a list of ALL available actionAreas within the current scene resource. The logic to print out a single actionArea will come once the getActionAreaById (or index) is implemented.

git-svn-id: http://asylumengine.googlecode.com/svn/trunk@307 0bfb4aae-4ea4-11de-8d8d-752d95cf3e3c
This commit is contained in:
Alex Bevilacqua 2009-08-13 13:57:52 +00:00 committed by Eugene Sandulenko
parent 11bbfc3cab
commit d6d90b7e3a
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 45 additions and 1 deletions

View File

@ -27,7 +27,6 @@
#include "asylum/asylum.h"
#include "asylum/console.h"
#include "asylum/scene.h"
#include "asylum/shared.h"
namespace Asylum {
@ -43,6 +42,7 @@ Console::Console(AsylumEngine *vm) : GUI::Debugger() {
DCmd_Register("scene", WRAP_METHOD(Console, cmdChangeScene));
DCmd_Register("flags", WRAP_METHOD(Console, cmdShowFlags));
DCmd_Register("toggle_flag", WRAP_METHOD(Console, cmdToggleFlag));
DCmd_Register("dump_action", WRAP_METHOD(Console, cmdDumpActionArea));
DVar_Register("showpolygons", &g_debugPolygons, DVAR_INT, 0);
DVar_Register("showbarriers", &g_debugBarriers, DVAR_INT, 0);
@ -51,6 +51,46 @@ Console::Console(AsylumEngine *vm) : GUI::Debugger() {
Console::~Console() {
}
bool Console::cmdDumpActionArea(int argc, const char **argv) {
if (argc == 2) {
// TODO Get an action area by index/id
} else {
for (uint32 i = 0; i < Shared.getScene()->getResources()->getWorldStats()->numActions; i++) {
ActionArea *a = &Shared.getScene()->getResources()->getWorldStats()->actions[i];
printActionAreaStats(a);
}
}
return true;
}
void Console::printActionAreaStats(ActionArea *a) {
DebugPrintf("id[%d] name[%s] field01[%d] field02[%d] field40[%d] field44[%d] flags[%d] \n"
"actionListIdx1[%d] actionListIdx2[%d] actionType[%d] field_7C[%d] polyIdx[%d]\n"
"field_84[%d] field_88[%d] soundResId[%d] field_90[%d] palette[%d] volume[%d]\n\n",
a->id,
a->name,
a->field01,
a->field02,
a->field_40,
a->field_44,
a->flags,
a->actionListIdx1,
a->actionListIdx2,
a->actionType,
//a->flagNums[10],
a->field_7C,
a->polyIdx,
a->field_84,
a->field_88,
a->soundResId,
a->field_90,
a->paletteValue,
//a->array[5],
a->volume);
}
bool Console::cmdShowFlags(int argc, const char **argv) {
for (int i = 0; i < 1512; i++) {
if (Shared.isGameFlagSet(i)) {

View File

@ -33,6 +33,7 @@
namespace Asylum {
class AsylumEngine;
struct ActionArea;
class Console : public GUI::Debugger {
public:
@ -45,6 +46,9 @@ private:
bool cmdChangeScene(int argc, const char **argv);
bool cmdShowFlags(int argc, const char **argv);
bool cmdToggleFlag(int argc, const char **argv);
bool cmdDumpActionArea(int argc, const char **argv);
void printActionAreaStats(ActionArea *a);
private:
AsylumEngine *_vm;