aboutsummaryrefslogtreecommitdiff
path: root/gui/debugger.h
diff options
context:
space:
mode:
authorJohannes Schickel2014-05-27 02:04:08 +0200
committerJohannes Schickel2014-05-27 02:04:08 +0200
commit8b7672b64cc179660a4e1706db114b3b6b7073f7 (patch)
treec93e2c5758e545466c5624eb0e2b3099c9984a1e /gui/debugger.h
parent96a901d1fb809a67a9067cd5bf7938a1148de47b (diff)
downloadscummvm-rg350-8b7672b64cc179660a4e1706db114b3b6b7073f7.tar.gz
scummvm-rg350-8b7672b64cc179660a4e1706db114b3b6b7073f7.tar.bz2
scummvm-rg350-8b7672b64cc179660a4e1706db114b3b6b7073f7.zip
ALL: Introduce typesafe Debugger::registerVar functions.
This also adds a FIXME to SCI which registered an enum type as int...
Diffstat (limited to 'gui/debugger.h')
-rw-r--r--gui/debugger.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/gui/debugger.h b/gui/debugger.h
index 319fa68dae..8c7481b61f 100644
--- a/gui/debugger.h
+++ b/gui/debugger.h
@@ -96,7 +96,7 @@ protected:
int arraySize;
};
-
+private:
/**
* Register a variable with the debugger. This allows the user to read and modify
* this variable.
@@ -104,10 +104,30 @@ protected:
* @param variable pointer to the actual storage of the variable
* @param type the type of the variable (byte, int, bool, ...)
* @paral arraySize for type DVAR_INTARRAY this specifies the size of the array
- *
- * @todo replace this single method by type safe variants.
*/
void registerVar(const Common::String &varname, void *variable, VarType type, int arraySize);
+
+protected:
+ void registerVar(const Common::String &varname, byte *variable) {
+ registerVar(varname, variable, DVAR_BYTE, 0);
+ }
+
+ void registerVar(const Common::String &varname, int *variable) {
+ registerVar(varname, variable, DVAR_INT, 0);
+ }
+
+ void registerVar(const Common::String &varname, bool *variable) {
+ registerVar(varname, variable, DVAR_BOOL, 0);
+ }
+
+ void registerVar(const Common::String &varname, int32 **variable, int arraySize) {
+ registerVar(varname, variable, DVAR_INTARRAY, arraySize);
+ }
+
+ void registerVar(const Common::String &varname, Common::String *variable) {
+ registerVar(varname, variable, DVAR_STRING, 0);
+ }
+
void registerCmd(const Common::String &cmdname, Debuglet *debuglet);