diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/io/packet_peer.cpp | 2 | ||||
| -rw-r--r-- | core/os/os.h | 2 | ||||
| -rw-r--r-- | core/script_language.cpp | 16 | ||||
| -rw-r--r-- | core/script_language.h | 2 | ||||
| -rw-r--r-- | core/variant_call.cpp | 14 |
5 files changed, 27 insertions, 9 deletions
diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index 6cb3daa7ac..973a2ec9a5 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -243,7 +243,7 @@ int PacketPeerStream::get_max_packet_size() const { void PacketPeerStream::set_stream_peer(const Ref<StreamPeer> &p_peer) { - ERR_FAIL_COND(p_peer.is_null()); + //ERR_FAIL_COND(p_peer.is_null()); if (p_peer.ptr() != peer.ptr()) { ring_buffer.advance_read(ring_buffer.data_left()); // reset the ring buffer diff --git a/core/os/os.h b/core/os/os.h index bc3fad302a..e53980a8fe 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -76,7 +76,7 @@ public: bool fullscreen; bool resizable; float get_aspect() const { return (float)width/(float)height; } - VideoMode(int p_width=1280,int p_height=720,bool p_fullscreen=false, bool p_resizable = true) {width=p_width; height=p_height; fullscreen=p_fullscreen; resizable = p_resizable; } + VideoMode(int p_width=1024,int p_height=600,bool p_fullscreen=false, bool p_resizable = true) {width=p_width; height=p_height; fullscreen=p_fullscreen; resizable = p_resizable; } }; protected: friend class Main; diff --git a/core/script_language.cpp b/core/script_language.cpp index 2ce3844ba3..0eac39e7d1 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -92,6 +92,22 @@ void ScriptServer::init_languages() { } } +void ScriptInstance::get_property_state(List<Pair<StringName, Variant> > &state) { + + List<PropertyInfo> pinfo; + get_property_list(&pinfo); + for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { + + if (E->get().usage&PROPERTY_USAGE_STORAGE) { + Pair<StringName,Variant> p; + p.first=E->get().name; + if (get(p.first,p.second)) + state.push_back(p); + } + } +} + + Variant ScriptInstance::call(const StringName& p_method,VARIANT_ARG_DECLARE) { VARIANT_ARGPTRS; diff --git a/core/script_language.h b/core/script_language.h index 3138c88e8e..7e278b8555 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -113,6 +113,8 @@ public: virtual void get_property_list(List<PropertyInfo> *p_properties) const=0; virtual Variant::Type get_property_type(const StringName& p_name,bool *r_is_valid=NULL) const=0; + virtual void get_property_state(List<Pair<StringName,Variant> > &state); + virtual void get_method_list(List<MethodInfo> *p_list) const=0; virtual bool has_method(const StringName& p_method) const=0; virtual Variant call(const StringName& p_method,VARIANT_ARG_LIST); diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 90f868c866..78814c83e2 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1451,7 +1451,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(RAW_ARRAY,INT,ByteArray,size,varray()); ADDFUNC2(RAW_ARRAY,NIL,ByteArray,set,INT,"idx",INT,"byte",varray()); - ADDFUNC1(RAW_ARRAY,INT,ByteArray,get,INT,"idx",varray()); + //ADDFUNC1(RAW_ARRAY,INT,ByteArray,get,INT,"idx",varray()); ADDFUNC1(RAW_ARRAY,NIL,ByteArray,push_back,INT,"byte",varray()); ADDFUNC1(RAW_ARRAY,NIL,ByteArray,resize,INT,"idx",varray()); @@ -1461,37 +1461,37 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(INT_ARRAY,INT,IntArray,size,varray()); ADDFUNC2(INT_ARRAY,NIL,IntArray,set,INT,"idx",INT,"integer",varray()); - ADDFUNC1(INT_ARRAY,INT,IntArray,get,INT,"idx",varray()); + //ADDFUNC1(INT_ARRAY,INT,IntArray,get,INT,"idx",varray()); ADDFUNC1(INT_ARRAY,NIL,IntArray,push_back,INT,"integer",varray()); ADDFUNC1(INT_ARRAY,NIL,IntArray,resize,INT,"idx",varray()); ADDFUNC0(REAL_ARRAY,INT,RealArray,size,varray()); ADDFUNC2(REAL_ARRAY,NIL,RealArray,set,INT,"idx",REAL,"value",varray()); - ADDFUNC1(REAL_ARRAY,REAL,RealArray,get,INT,"idx",varray()); + //ADDFUNC1(REAL_ARRAY,REAL,RealArray,get,INT,"idx",varray()); ADDFUNC1(REAL_ARRAY,NIL,RealArray,push_back,REAL,"value",varray()); ADDFUNC1(REAL_ARRAY,NIL,RealArray,resize,INT,"idx",varray()); ADDFUNC0(STRING_ARRAY,INT,StringArray,size,varray()); ADDFUNC2(STRING_ARRAY,NIL,StringArray,set,INT,"idx",STRING,"string",varray()); - ADDFUNC1(STRING_ARRAY,STRING,StringArray,get,INT,"idx",varray()); + //ADDFUNC1(STRING_ARRAY,STRING,StringArray,get,INT,"idx",varray()); ADDFUNC1(STRING_ARRAY,NIL,StringArray,push_back,STRING,"string",varray()); ADDFUNC1(STRING_ARRAY,NIL,StringArray,resize,INT,"idx",varray()); ADDFUNC0(VECTOR2_ARRAY,INT,Vector2Array,size,varray()); ADDFUNC2(VECTOR2_ARRAY,NIL,Vector2Array,set,INT,"idx",VECTOR2,"vector2",varray()); - ADDFUNC1(VECTOR2_ARRAY,VECTOR2,Vector2Array,get,INT,"idx",varray()); + //ADDFUNC1(VECTOR2_ARRAY,VECTOR2,Vector2Array,get,INT,"idx",varray()); ADDFUNC1(VECTOR2_ARRAY,NIL,Vector2Array,push_back,VECTOR2,"vector2",varray()); ADDFUNC1(VECTOR2_ARRAY,NIL,Vector2Array,resize,INT,"idx",varray()); ADDFUNC0(VECTOR3_ARRAY,INT,Vector3Array,size,varray()); ADDFUNC2(VECTOR3_ARRAY,NIL,Vector3Array,set,INT,"idx",VECTOR3,"vector3",varray()); - ADDFUNC1(VECTOR3_ARRAY,VECTOR3,Vector3Array,get,INT,"idx",varray()); + //ADDFUNC1(VECTOR3_ARRAY,VECTOR3,Vector3Array,get,INT,"idx",varray()); ADDFUNC1(VECTOR3_ARRAY,NIL,Vector3Array,push_back,VECTOR3,"vector3",varray()); ADDFUNC1(VECTOR3_ARRAY,NIL,Vector3Array,resize,INT,"idx",varray()); ADDFUNC0(COLOR_ARRAY,INT,ColorArray,size,varray()); ADDFUNC2(COLOR_ARRAY,NIL,ColorArray,set,INT,"idx",COLOR,"color",varray()); - ADDFUNC1(COLOR_ARRAY,COLOR,ColorArray,get,INT,"idx",varray()); + //ADDFUNC1(COLOR_ARRAY,COLOR,ColorArray,get,INT,"idx",varray()); ADDFUNC1(COLOR_ARRAY,NIL,ColorArray,push_back,COLOR,"color",varray()); ADDFUNC1(COLOR_ARRAY,NIL,ColorArray,resize,INT,"idx",varray()); |