diff options
author | Eugene Sandulenko | 2016-07-09 13:16:48 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | a8498f41a0c890870e053024abac0506152729a7 (patch) | |
tree | 25e9685ad848fda3ba6986762023d161b85affb8 /engines/director/lingo/lingo.cpp | |
parent | 82f78708e78254a6a5c80e1265724b75594e2389 (diff) | |
download | scummvm-rg350-a8498f41a0c890870e053024abac0506152729a7.tar.gz scummvm-rg350-a8498f41a0c890870e053024abac0506152729a7.tar.bz2 scummvm-rg350-a8498f41a0c890870e053024abac0506152729a7.zip |
DIRECTOR: Lingo: Made & and && work with any type
Diffstat (limited to 'engines/director/lingo/lingo.cpp')
-rw-r--r-- | engines/director/lingo/lingo.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index b24c55b57d..fec6b645ea 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -210,4 +210,26 @@ float Datum::toFloat() { return u.f; } +Common::String *Datum::toString() { + Common::String *s = new Common::String; + switch (type) { + case INT: + s->format("%d", u.i); + break; + case FLOAT: + s->format("%f", u.f); + break; + case STRING: + delete s; + s = u.s; + default: + warning("Incorrect operation toInt() for type: %d", type); + } + + u.s = s; + type = STRING; + + return u.s; +} + } // End of namespace Director |