aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-07-17 10:31:43 +0200
committerThierry Crozat2018-01-22 23:54:41 +0000
commita8f62802cc189d656fcedacb8236d01f76753b59 (patch)
tree388e3a26fb02970f91e150787f661a8ef7048b4a
parent718cae659ca3acf3e9b2f795f88888d993752de3 (diff)
downloadscummvm-rg350-a8f62802cc189d656fcedacb8236d01f76753b59.tar.gz
scummvm-rg350-a8f62802cc189d656fcedacb8236d01f76753b59.tar.bz2
scummvm-rg350-a8f62802cc189d656fcedacb8236d01f76753b59.zip
SUPERNOVA: Extends Object Class
-rw-r--r--engines/supernova/msn_def.h7
-rw-r--r--engines/supernova/supernova.cpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/engines/supernova/msn_def.h b/engines/supernova/msn_def.h
index a0231aca2d..50c91aaf46 100644
--- a/engines/supernova/msn_def.h
+++ b/engines/supernova/msn_def.h
@@ -450,6 +450,7 @@ ObjectType &operator^=(ObjectType &a, ObjectType b);
struct Object {
static const char *const defaultDescription;
static const char *const takeMessage;
+ static const Object nullObject;
Object()
: _name("")
@@ -475,6 +476,12 @@ struct Object {
, _direction(direction)
{}
+ static void setObjectNull(Object *&obj) {
+ obj = const_cast<Object *>(&nullObject);
+ }
+ static bool isNullObject(Object *obj) {
+ return obj == &nullObject;
+ }
void setProperty(ObjectType type) {
_type |= type;
}
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index b11c66a831..26a6aa5ed8 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -67,6 +67,7 @@ const AudioInfo audioInfo[kAudioNumSamples] = {
const char *const Object::defaultDescription = "Es ist nichts Besonderes daran.";
const char *const Object::takeMessage = "Das mußt du erst nehmen.";
+const Object Object::nullObject = Object();
ObjectType operator|(ObjectType a, ObjectType b) {
return static_cast<ObjectType>(+a | +b);