WINTERMUTE: Add debuggerToString

This commit is contained in:
Tobia Tesan 2013-07-02 02:37:56 +02:00
parent cd5d60e44c
commit 4e9b113f3f
18 changed files with 43 additions and 1 deletions

View File

@ -1134,4 +1134,7 @@ bool AdEntity::setSprite(const char *filename) {
}
}
Common::String AdEntity::debuggerToString() const {
return Common::String::format("%p: Entity \"%s\"; (X,Y): (%d, %d), rotate(%d): %f deg, scale(%d): (%f, %f)%%", (const void *)this, getName(), _posX, _posY, _rotatable, _rotate, _zoomable, _scaleX, _scaleY);
}
} // End of namespace Wintermute

View File

@ -60,6 +60,7 @@ public:
virtual bool scSetProperty(const char *name, ScValue *value) override;
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
virtual const char *scToString() override;
Common::String debuggerToString() const override;
private:
int32 _walkToX;
int32 _walkToY;

View File

@ -2280,4 +2280,7 @@ bool AdGame::onScriptShutdown(ScScript *script) {
return STATUS_OK;
}
Common::String AdGame::debuggerToString() const {
return Common::String::format("%p: Game \"%s\"", (const void *)this, getName());
}
} // End of namespace Wintermute

View File

@ -130,6 +130,7 @@ public:
virtual bool scSetProperty(const char *name, ScValue *value) override;
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
bool validMouse();
Common::String debuggerToString() const override;
private:
virtual bool externalCall(ScScript *script, ScStack *stack, ScStack *thisStack, char *name) override;

View File

@ -2998,4 +2998,9 @@ bool AdScene::getRegionObjects(AdRegion *region, BaseArray<AdObject *> &objects,
return STATUS_OK;
}
Common::String AdScene::debuggerToString() const {
return Common::String::format("%p: Scene \"%s\", paralax: %d, autoscroll: %d", (const void *)this, getName(), _paralaxScrolling, _autoScroll);
}
} // End of namespace Wintermute

View File

@ -160,7 +160,7 @@ public:
virtual bool scSetProperty(const char *name, ScValue *value) override;
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
virtual const char *scToString() override;
virtual Common::String debuggerToString() const override;
private:
bool persistState(bool saving = true);

View File

@ -764,4 +764,7 @@ const char *BaseFrame::scToString() {
return "[frame]";
}
Common::String BaseFrame::debuggerToString() const {
return Common::String::format("%p: Frame \"%s\": #subframes %d ", (const void *)this, getName(), _subframes.size());
}
} // End of namespace Wintermute

View File

@ -65,6 +65,8 @@ public:
virtual bool scSetProperty(const char *name, ScValue *value) override;
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
virtual const char *scToString() override;
virtual Common::String debuggerToString() const override;
private:
bool _keyframe;
bool _editorExpanded;

View File

@ -532,4 +532,7 @@ bool BaseRegion::mimic(BaseRegion *region, float scale, int x, int y) {
return createRegion() ? STATUS_OK : STATUS_FAILED;
}
Common::String BaseRegion::debuggerToString() const {
return Common::String::format("%p: Region \"%s\": Rect (top, right, bottom, left): (%d, %d, %d, %d), active: %d ", (const void *)this, getName(), _rect.top, _rect.right, _rect.bottom, _rect.left, _active);
}
} // End of namespace Wintermute

View File

@ -59,6 +59,8 @@ public:
virtual bool scSetProperty(const char *name, ScValue *value) override;
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
virtual const char *scToString() override;
virtual Common::String debuggerToString() const override;
private:
float _lastMimicScale;
int32 _lastMimicX;

View File

@ -188,4 +188,9 @@ ScScript *BaseScriptable::invokeMethodThread(const char *methodName) {
return nullptr;
}
Common::String BaseScriptable::debuggerToString() const {
return Common::String::format("%p: BaseScriptable %s", (const void *)this, getName());
}
} // End of namespace Wintermute

View File

@ -63,6 +63,7 @@ public:
virtual void scSetBool(bool val);
virtual int scCompare(BaseScriptable *val);
virtual void scDebuggerDesc(char *buf, int bufSize);
virtual Common::String debuggerToString() const;
int32 _refCount;
ScValue *_scValue;
ScValue *_scProp;

View File

@ -826,4 +826,7 @@ bool BaseSprite::killAllSounds() {
return STATUS_OK;
}
Common::String BaseSprite::debuggerToString() const {
return Common::String::format("%p: Sprite \"%s\"", (const void *)this, getName());
}
} // End of namespace Wintermute

View File

@ -69,6 +69,7 @@ public:
virtual bool scSetProperty(const char *name, ScValue *value) override;
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
virtual const char *scToString() override;
Common::String debuggerToString() const override;
private:
BaseObject *_owner;
bool _canBreak;

View File

@ -673,4 +673,8 @@ bool BaseSubFrame::setSurfaceSimple() {
}
}
Common::String BaseSubFrame::debuggerToString() const {
return Common::String::format("%p: BaseSubFrame \"%s\" - Mirror:(%d, %d), Hotspot:(%d, %d), ", (const void *)this, getName(), _mirrorX, _mirrorY, _hotspotX, _hotspotY);
}
} // End of namespace Wintermute

View File

@ -86,6 +86,7 @@ public:
virtual bool scSetProperty(const char *name, ScValue *value);
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
Common::String debuggerToString() const override;
};

View File

@ -96,4 +96,7 @@ int BaseViewport::getHeight() const {
return _rect.bottom - _rect.top;
}
Common::String BaseViewport::debuggerToString() const {
return Common::String::format("%p: BaseViewport: (top, right, bottom, left): (%d, %d, %d, %d)", (const void *)this, _rect.top, _rect.right, _rect.bottom, _rect.left);
}
} // End of namespace Wintermute

View File

@ -48,6 +48,7 @@ public:
BaseObject *_mainObject;
BaseViewport(BaseGame *inGame = nullptr);
virtual ~BaseViewport();
virtual Common::String debuggerToString() const override;
private:
Rect32 _rect;
};