Browse Source

Added PowerState casting operator to Variant

Without it Godot does not build with PTRCALL_ENABLED
Karroffel 8 years ago
parent
commit
15838f3702
2 changed files with 7 additions and 0 deletions
  1. 5 0
      core/variant.cpp
  2. 2 0
      core/variant.h

+ 5 - 0
core/variant.cpp

@@ -2178,6 +2178,11 @@ Variant::operator IP_Address() const {
 	return IP_Address( operator String() );
 	return IP_Address( operator String() );
 }
 }
 
 
+Variant::operator PowerState() const
+{
+	return (PowerState) operator int();
+}
+
 Variant::Variant(bool p_bool) {
 Variant::Variant(bool p_bool) {
 
 
 	type=BOOL;
 	type=BOOL;

+ 2 - 0
core/variant.h

@@ -45,6 +45,7 @@
 #include "path_db.h"
 #include "path_db.h"
 #include "simple_type.h"
 #include "simple_type.h"
 #include "os/input_event.h"
 #include "os/input_event.h"
+#include "os/power.h"
 #include "color.h"
 #include "color.h"
 #include "face3.h"
 #include "face3.h"
 #include "ref_ptr.h"
 #include "ref_ptr.h"
@@ -254,6 +255,7 @@ public:
 	operator Orientation() const;
 	operator Orientation() const;
 
 
 	operator IP_Address() const;
 	operator IP_Address() const;
+	operator PowerState() const;
 
 
 
 
 	Variant(bool p_bool);
 	Variant(bool p_bool);