summaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gd_script.cpp')
-rw-r--r--modules/gdscript/gd_script.cpp104
1 files changed, 1 insertions, 103 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index 476fca6382..cf6529d5ae 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -28,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "gd_script.h"
+
#include "gd_compiler.h"
#include "global_constants.h"
#include "io/file_access_encrypted.h"
@@ -42,11 +43,6 @@ GDNativeClass::GDNativeClass(const StringName &p_name) {
name = p_name;
}
-/*void GDNativeClass::call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount){
-
-
-}*/
-
bool GDNativeClass::_get(const StringName &p_name, Variant &r_ret) const {
bool ok;
@@ -183,7 +179,6 @@ Variant GDScript::_new(const Variant **p_args, int p_argcount, Variant::CallErro
bool GDScript::can_instance() const {
- //return valid; //any script in GDscript can instance
return valid || (!tool && !ScriptServer::is_scripting_enabled());
}
@@ -218,49 +213,6 @@ void GDScript::_placeholder_erased(PlaceHolderScriptInstance *p_placeholder) {
placeholders.erase(p_placeholder);
}
-
-/*
-void GDScript::_update_placeholder(PlaceHolderScriptInstance *p_placeholder) {
-
-
- List<PropertyInfo> plist;
- GDScript *scr=this;
-
- Map<StringName,Variant> default_values;
- while(scr) {
-
- Vector<_GDScriptMemberSort> msort;
- for(Map<StringName,PropertyInfo>::Element *E=scr->member_info.front();E;E=E->next()) {
-
- _GDScriptMemberSort ms;
- ERR_CONTINUE(!scr->member_indices.has(E->key()));
- ms.index=scr->member_indices[E->key()].index;
- ms.name=E->key();
-
- msort.push_back(ms);
-
- }
-
- msort.sort();
- msort.invert();
- for(int i=0;i<msort.size();i++) {
-
- plist.push_front(scr->member_info[msort[i].name]);
- if (scr->member_default_values.has(msort[i].name))
- default_values[msort[i].name]=scr->member_default_values[msort[i].name];
- else {
- Variant::CallError err;
- default_values[msort[i].name]=Variant::construct(scr->member_info[msort[i].name].type,NULL,0,err);
- }
- }
-
- scr=scr->_base;
- }
-
-
- p_placeholder->update(plist,default_values);
-
-}*/
#endif
void GDScript::get_script_method_list(List<MethodInfo> *p_list) const {
@@ -428,7 +380,6 @@ void GDScript::set_source_code(const String &p_code) {
source = p_code;
#ifdef TOOLS_ENABLED
source_changed_cache = true;
-//print_line("SC CHANGED "+get_path());
#endif
}
@@ -655,12 +606,6 @@ Error GDScript::reload(bool p_keep_state) {
_set_subclass_path(E->get(), path);
}
-#ifdef TOOLS_ENABLED
-/*for (Set<PlaceHolderScriptInstance*>::Element *E=placeholders.front();E;E=E->next()) {
-
- _update_placeholder(E->get());
- }*/
-#endif
return OK;
}
@@ -1141,53 +1086,10 @@ void GDInstance::get_property_list(List<PropertyInfo> *p_properties) const {
props.push_front(sptr->member_info[msort[i].name]);
}
-#if 0
- if (sptr->member_functions.has("_get_property_list")) {
-
- Variant::CallError err;
- GDFunction *f = const_cast<GDFunction*>(sptr->member_functions["_get_property_list"]);
- Variant plv = f->call(const_cast<GDInstance*>(this),NULL,0,err);
-
- if (plv.get_type()!=Variant::ARRAY) {
-
- ERR_PRINT("_get_property_list: expected array returned");
- } else {
-
- Array pl=plv;
-
- for(int i=0;i<pl.size();i++) {
-
- Dictionary p = pl[i];
- PropertyInfo pinfo;
- if (!p.has("name")) {
- ERR_PRINT("_get_property_list: expected 'name' key of type string.")
- continue;
- }
- if (!p.has("type")) {
- ERR_PRINT("_get_property_list: expected 'type' key of type integer.")
- continue;
- }
- pinfo.name=p["name"];
- pinfo.type=Variant::Type(int(p["type"]));
- if (p.has("hint"))
- pinfo.hint=PropertyHint(int(p["hint"]));
- if (p.has("hint_string"))
- pinfo.hint_string=p["hint_string"];
- if (p.has("usage"))
- pinfo.usage=p["usage"];
-
-
- props.push_back(pinfo);
- }
- }
- }
-#endif
sptr = sptr->_base;
}
- //props.invert();
-
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
p_properties->push_back(E->get());
@@ -1390,10 +1292,6 @@ GDInstance::~GDInstance() {
}
/************* SCRIPT LANGUAGE **************/
-/************* SCRIPT LANGUAGE **************/
-/************* SCRIPT LANGUAGE **************/
-/************* SCRIPT LANGUAGE **************/
-/************* SCRIPT LANGUAGE **************/
GDScriptLanguage *GDScriptLanguage::singleton = NULL;