summaryrefslogtreecommitdiff
path: root/modules/dlscript/dl_script.h
diff options
context:
space:
mode:
authorKarroffel <therzog@mail.de>2017-04-04 19:38:46 +0200
committerKarroffel <therzog@mail.de>2017-04-04 23:02:46 +0200
commit6c49fe9c62b3401323a6497447679fdfded6f116 (patch)
tree8ba50859dedf9ef940d37ccd132234a20abb7818 /modules/dlscript/dl_script.h
parent46bc14e66fe90430f1d74cdab6cca6acb5b2a3f6 (diff)
[DLScript] added variant constructor and a function to get userdata of a script
The godot_dlinstance_get_userdata() function can be used to get the DLScript userdata pointer of any object that has a DLScript attached to it. This is particularly useful and even required for language bindings to work properly. This also fixes non-tool builds.
Diffstat (limited to 'modules/dlscript/dl_script.h')
-rw-r--r--modules/dlscript/dl_script.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/dlscript/dl_script.h b/modules/dlscript/dl_script.h
index 18af85382a..497208c832 100644
--- a/modules/dlscript/dl_script.h
+++ b/modules/dlscript/dl_script.h
@@ -241,6 +241,8 @@ class DLInstance : public ScriptInstance {
public:
_FORCE_INLINE_ Object *get_owner() { return owner; }
+ _FORCE_INLINE_ void *get_userdata() { return userdata; }
+
virtual bool set(const StringName &p_name, const Variant &p_value);
virtual bool get(const StringName &p_name, Variant &r_ret) const;
virtual void get_property_list(List<PropertyInfo> *p_properties) const;