diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 11 | ||||
-rw-r--r-- | core/bind/core_bind.h | 3 | ||||
-rw-r--r-- | core/command_queue_mt.h | 126 | ||||
-rw-r--r-- | core/dictionary.cpp | 14 | ||||
-rw-r--r-- | core/dictionary.h | 1 | ||||
-rw-r--r-- | core/dvector.h | 13 | ||||
-rw-r--r-- | core/global_constants.cpp | 14 | ||||
-rw-r--r-- | core/input_map.cpp | 48 | ||||
-rw-r--r-- | core/io/LICENSE-InfoZip.txt | 60 | ||||
-rw-r--r-- | core/io/LICENSE-MiniZip.txt | 32 | ||||
-rw-r--r-- | core/io/ioapi.c | 2 | ||||
-rw-r--r-- | core/io/ioapi.h | 2 | ||||
-rw-r--r-- | core/io/resource_loader.cpp | 6 | ||||
-rw-r--r-- | core/io/unzip.c | 2 | ||||
-rw-r--r-- | core/io/unzip.h | 2 | ||||
-rw-r--r-- | core/io/zip.c | 2 | ||||
-rw-r--r-- | core/io/zip.h | 2 | ||||
-rw-r--r-- | core/object.cpp | 7 | ||||
-rw-r--r-- | core/object.h | 1 | ||||
-rw-r--r-- | core/os/os.cpp | 8 | ||||
-rw-r--r-- | core/os/os.h | 3 | ||||
-rw-r--r-- | core/variant_call.cpp | 11 |
22 files changed, 335 insertions, 35 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index addc26525e..31c0c0e208 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -436,6 +436,15 @@ Error _OS::set_thread_name(const String& p_name) { return Thread::set_name(p_name); }; +void _OS::set_use_vsync(bool p_enable) { + OS::get_singleton()->set_use_vsync(p_enable); +} + +bool _OS::is_vsnc_enabled() const { + + return OS::get_singleton()->is_vsnc_enabled(); +} + /* enum Weekday { @@ -1110,6 +1119,8 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_thread_name","name"),&_OS::set_thread_name); + ObjectTypeDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync); + ObjectTypeDB::bind_method(_MD("is_vsnc_enabled"),&_OS::is_vsnc_enabled); BIND_CONSTANT( DAY_SUNDAY ); BIND_CONSTANT( DAY_MONDAY ); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index af89536c45..441927940d 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -282,6 +282,9 @@ public: Error set_thread_name(const String& p_name); + void set_use_vsync(bool p_enable); + bool is_vsnc_enabled() const; + static _OS *get_singleton() { return singleton; } _OS(); diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h index b1e0066c35..409543bf25 100644 --- a/core/command_queue_mt.h +++ b/core/command_queue_mt.h @@ -152,6 +152,23 @@ class CommandQueueMT { virtual void call() { (instance->*method)(p1,p2,p3,p4,p5,p6,p7); } }; + template<class T,class M,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class P8> + struct Command8 : public CommandBase { + + T*instance; + M method; + typename GetSimpleTypeT<P1>::type_t p1; + typename GetSimpleTypeT<P2>::type_t p2; + typename GetSimpleTypeT<P3>::type_t p3; + typename GetSimpleTypeT<P4>::type_t p4; + typename GetSimpleTypeT<P5>::type_t p5; + typename GetSimpleTypeT<P6>::type_t p6; + typename GetSimpleTypeT<P7>::type_t p7; + typename GetSimpleTypeT<P8>::type_t p8; + + virtual void call() { (instance->*method)(p1,p2,p3,p4,p5,p6,p7,p8); } + }; + /* comands that return */ template<class T,class M,class R> @@ -270,6 +287,25 @@ class CommandQueueMT { virtual void call() { *ret = (instance->*method)(p1,p2,p3,p4,p5,p6,p7); sync->sem->post(); sync->in_use=false; ; } }; + template<class T,class M,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class P8,class R> + struct CommandRet8 : public CommandBase { + + T*instance; + M method; + typename GetSimpleTypeT<P1>::type_t p1; + typename GetSimpleTypeT<P2>::type_t p2; + typename GetSimpleTypeT<P3>::type_t p3; + typename GetSimpleTypeT<P4>::type_t p4; + typename GetSimpleTypeT<P5>::type_t p5; + typename GetSimpleTypeT<P6>::type_t p6; + typename GetSimpleTypeT<P7>::type_t p7; + typename GetSimpleTypeT<P8>::type_t p8; + R* ret; + SyncSemaphore *sync; + + virtual void call() { *ret = (instance->*method)(p1,p2,p3,p4,p5,p6,p7,p8); sync->sem->post(); sync->in_use=false; ; } + }; + /** commands that don't return but sync */ /* comands that return */ @@ -390,6 +426,25 @@ class CommandQueueMT { virtual void call() { (instance->*method)(p1,p2,p3,p4,p5,p6,p7); sync->sem->post(); sync->in_use=false; ; } }; + template<class T,class M,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class P8> + struct CommandSync8 : public CommandBase { + + T*instance; + M method; + typename GetSimpleTypeT<P1>::type_t p1; + typename GetSimpleTypeT<P2>::type_t p2; + typename GetSimpleTypeT<P3>::type_t p3; + typename GetSimpleTypeT<P4>::type_t p4; + typename GetSimpleTypeT<P5>::type_t p5; + typename GetSimpleTypeT<P6>::type_t p6; + typename GetSimpleTypeT<P7>::type_t p7; + typename GetSimpleTypeT<P8>::type_t p8; + + SyncSemaphore *sync; + + virtual void call() { (instance->*method)(p1,p2,p3,p4,p5,p6,p7,p8); sync->sem->post(); sync->in_use=false; ; } + }; + /***** BASE *******/ enum { @@ -639,6 +694,27 @@ public: if (sync) sync->post(); } + + template<class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7,class P8> + void push( T * p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8 ) { + + Command8<T,M,P1,P2,P3,P4,P5,P6,P7,P8> * cmd = allocate_and_lock< Command8<T,M,P1,P2,P3,P4,P5,P6,P7,P8> >(); + + cmd->instance=p_instance; + cmd->method=p_method; + cmd->p1=p1; + cmd->p2=p2; + cmd->p3=p3; + cmd->p4=p4; + cmd->p5=p5; + cmd->p6=p6; + cmd->p7=p7; + cmd->p8=p8; + + unlock(); + + if (sync) sync->post(); + } /*** PUSH AND RET COMMANDS ***/ @@ -806,6 +882,31 @@ public: ss->sem->wait(); } + template<class T, class M, class P1, class P2, class P3, class P4, class P5, class P6,class P7,class P8,class R> + void push_and_ret( T * p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6,P7 p7,P8 p8, R* r_ret ) { + + CommandRet8<T,M,P1,P2,P3,P4,P5,P6,P7,P8,R> * cmd = allocate_and_lock< CommandRet8<T,M,P1,P2,P3,P4,P5,P6,P7,P8,R> >(); + + cmd->instance=p_instance; + cmd->method=p_method; + cmd->p1=p1; + cmd->p2=p2; + cmd->p3=p3; + cmd->p4=p4; + cmd->p5=p5; + cmd->p6=p6; + cmd->p7=p7; + cmd->p8=p8; + cmd->ret=r_ret; + SyncSemaphore *ss=_alloc_sync_sem(); + cmd->sync=ss; + + unlock(); + + if (sync) sync->post(); + ss->sem->wait(); + } + template<class T, class M> void push_and_sync( T * p_instance, M p_method) { @@ -971,6 +1072,31 @@ public: ss->sem->wait(); } + template<class T, class M, class P1, class P2, class P3, class P4, class P5, class P6,class P7,class P8> + void push_and_sync( T * p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6,P7 p7,P8 p8) { + + CommandSync8<T,M,P1,P2,P3,P4,P5,P6,P7,P8> * cmd = allocate_and_lock< CommandSync8<T,M,P1,P2,P3,P4,P5,P6,P7,P8> >(); + + cmd->instance=p_instance; + cmd->method=p_method; + cmd->p1=p1; + cmd->p2=p2; + cmd->p3=p3; + cmd->p4=p4; + cmd->p5=p5; + cmd->p6=p6; + cmd->p7=p7; + cmd->p8=p8; + + SyncSemaphore *ss=_alloc_sync_sem(); + cmd->sync=ss; + + unlock(); + + if (sync) sync->post(); + ss->sem->wait(); + } + void wait_and_flush_one() { ERR_FAIL_COND(!sync); sync->wait(); diff --git a/core/dictionary.cpp b/core/dictionary.cpp index 75c8531251..6204a87054 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -199,6 +199,18 @@ Array Dictionary::keys() const { } +Array Dictionary::values() const { + + Array varr; + varr.resize(size()); + const Variant *key=NULL; + int i=0; + while((key=next(key))){ + varr[i++] = _p->variant_map[*key]; + } + return varr; +} + const Variant* Dictionary::next(const Variant* p_key) const { return _p->variant_map.next(p_key); @@ -250,5 +262,3 @@ Dictionary::~Dictionary() { _unref(); } - - diff --git a/core/dictionary.h b/core/dictionary.h index c854e95ee6..ae79fab9c3 100644 --- a/core/dictionary.h +++ b/core/dictionary.h @@ -81,6 +81,7 @@ public: const Variant* next(const Variant* p_key=NULL) const; Array keys() const; + Array values() const; Dictionary(const Dictionary& p_from); Dictionary(bool p_shared=false); diff --git a/core/dvector.h b/core/dvector.h index fbb1fc4824..a5519ed604 100644 --- a/core/dvector.h +++ b/core/dvector.h @@ -285,6 +285,7 @@ public: Error resize(int p_size); + void invert(); void operator=(const DVector& p_dvector) { reference(p_dvector); } DVector() {} @@ -424,6 +425,18 @@ Error DVector<T>::resize(int p_size) { return OK; } +template<class T> +void DVector<T>::invert() { + T temp; + Write w = write(); + int s = size(); + int half_s = s/2; + for(int i=0;i<half_s;i++) { + temp = w[i]; + w[i] = w[s-i-1]; + w[s-i-1] = temp; + } +} #endif diff --git a/core/global_constants.cpp b/core/global_constants.cpp index 3cf4ff8f83..63764383ff 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -478,7 +478,21 @@ static _GlobalConstant _global_constants[]={ BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORAGE ), BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_EDITOR ), BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_NETWORK ), + + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_EDITOR_HELPER ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_CHECKABLE ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_CHECKED ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_INTERNATIONALIZED ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_BUNDLE ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_CATEGORY ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORE_IF_NONZERO ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORE_IF_NONONE ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_NO_INSTANCE_STATE ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_RESTART_IF_CHANGED ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_DEFAULT ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_DEFAULT_INTL ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_NOEDITOR ), BIND_GLOBAL_CONSTANT( METHOD_FLAG_NORMAL ), BIND_GLOBAL_CONSTANT( METHOD_FLAG_EDITOR ), diff --git a/core/input_map.cpp b/core/input_map.cpp index c266220541..08ee8138a3 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -327,56 +327,56 @@ void InputMap::load_default() { InputEvent key; key.type=InputEvent::KEY; - add_action("input/ui_accept"); + add_action("ui_accept"); key.key.scancode=KEY_RETURN; - action_add_event("input/ui_accept",key); + action_add_event("ui_accept",key); key.key.scancode=KEY_ENTER; - action_add_event("input/ui_accept",key); + action_add_event("ui_accept",key); key.key.scancode=KEY_SPACE; - action_add_event("input/ui_accept",key); + action_add_event("ui_accept",key); - add_action("input/ui_select"); + add_action("ui_select"); key.key.scancode=KEY_SPACE; - action_add_event("input/ui_select",key); + action_add_event("ui_select",key); - add_action("input/ui_cancel"); + add_action("ui_cancel"); key.key.scancode=KEY_ESCAPE; - action_add_event("input/ui_cancel",key); + action_add_event("ui_cancel",key); - add_action("input/ui_focus_next"); + add_action("ui_focus_next"); key.key.scancode=KEY_TAB; - action_add_event("input/ui_focus_next",key); + action_add_event("ui_focus_next",key); - add_action("input/ui_focus_prev"); + add_action("ui_focus_prev"); key.key.scancode=KEY_TAB; key.key.mod.shift=true; - action_add_event("input/ui_focus_prev",key); + action_add_event("ui_focus_prev",key); key.key.mod.shift=false; - add_action("input/ui_left"); + add_action("ui_left"); key.key.scancode=KEY_LEFT; - action_add_event("input/ui_left",key); + action_add_event("ui_left",key); - add_action("input/ui_right"); + add_action("ui_right"); key.key.scancode=KEY_RIGHT; - action_add_event("input/ui_right",key); + action_add_event("ui_right",key); - add_action("input/ui_up"); + add_action("ui_up"); key.key.scancode=KEY_UP; - action_add_event("input/ui_up",key); + action_add_event("ui_up",key); - add_action("input/ui_down"); + add_action("ui_down"); key.key.scancode=KEY_DOWN; - action_add_event("input/ui_down",key); + action_add_event("ui_down",key); - add_action("input/ui_page_up"); + add_action("ui_page_up"); key.key.scancode=KEY_PAGEUP; - action_add_event("input/ui_page_up",key); + action_add_event("ui_page_up",key); - add_action("input/ui_page_down"); + add_action("ui_page_down"); key.key.scancode=KEY_PAGEDOWN; - action_add_event("input/ui_page_down",key); + action_add_event("ui_page_down",key); // set("display/orientation", "landscape"); diff --git a/core/io/LICENSE-InfoZip.txt b/core/io/LICENSE-InfoZip.txt new file mode 100644 index 0000000000..bcfe47e978 --- /dev/null +++ b/core/io/LICENSE-InfoZip.txt @@ -0,0 +1,60 @@ +This is version 2007-Mar-4 of the Info-ZIP license. +The definitive version of this document should be available at +ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely and +a copy at http://www.info-zip.org/pub/infozip/license.html. + + +Copyright (c) 1990-2007 Info-ZIP. All rights reserved. + +For the purposes of this copyright and license, "Info-ZIP" is defined as +the following set of individuals: + + Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, + Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth, + Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, + David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko, + Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, + Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda, + Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren, + Rich Wales, Mike White. + +This software is provided "as is," without warranty of any kind, express +or implied. In no event shall Info-ZIP or its contributors be held liable +for any direct, indirect, incidental, special or consequential damages +arising out of the use of or inability to use this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the above disclaimer and the following restrictions: + + 1. Redistributions of source code (in whole or in part) must retain + the above copyright notice, definition, disclaimer, and this list + of conditions. + + 2. Redistributions in binary form (compiled executables and libraries) + must reproduce the above copyright notice, definition, disclaimer, + and this list of conditions in documentation and/or other materials + provided with the distribution. The sole exception to this condition + is redistribution of a standard UnZipSFX binary (including SFXWiz) as + part of a self-extracting archive; that is permitted without inclusion + of this license, as long as the normal SFX banner has not been removed + from the binary or disabled. + + 3. Altered versions--including, but not limited to, ports to new operating + systems, existing ports with new graphical interfaces, versions with + modified or added functionality, and dynamic, shared, or static library + versions not from Info-ZIP--must be plainly marked as such and must not + be misrepresented as being the original source or, if binaries, + compiled from the original source. Such altered versions also must not + be misrepresented as being Info-ZIP releases--including, but not + limited to, labeling of the altered versions with the names "Info-ZIP" + (or any variation thereof, including, but not limited to, different + capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the + explicit permission of Info-ZIP. Such altered versions are further + prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP + e-mail addresses or the Info-ZIP URL(s), such as to imply Info-ZIP + will provide support for the altered versions. + + 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," + "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its + own source and binary releases. diff --git a/core/io/LICENSE-MiniZip.txt b/core/io/LICENSE-MiniZip.txt new file mode 100644 index 0000000000..0e8950f86f --- /dev/null +++ b/core/io/LICENSE-MiniZip.txt @@ -0,0 +1,32 @@ +Credits + + Gilles Vollant - Original MiniZip author + Even Rouault - ZIP64 unzip Support + Daniel Borca - BZip Compression method support in unzip + Mathias Svensson - ZIP64 zip support + Mathias Svensson - BZip Compression method support in zip + + This version has been modified for Godot Engine + + +License +---------------------------------------------------------------------------- + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +---------------------------------------------------------------------------- diff --git a/core/io/ioapi.c b/core/io/ioapi.c index 8818199f0b..d6063a5fe6 100644 --- a/core/io/ioapi.c +++ b/core/io/ioapi.c @@ -6,7 +6,7 @@ Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - For more info read MiniZip_info.txt + For more info read LICENSE-MiniZip.txt */ diff --git a/core/io/ioapi.h b/core/io/ioapi.h index 24bf612617..cb6cb7e766 100644 --- a/core/io/ioapi.h +++ b/core/io/ioapi.h @@ -5,7 +5,7 @@ Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - For more info read MiniZip_info.txt + For more info read LICENSE-MiniZip.txt Changes diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index b547dc0e85..1bb80e74eb 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -319,7 +319,11 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_ if (OS::get_singleton()->is_stdout_verbose()) print_line("load resource: "+local_path+" (cached)"); - return RES( ResourceCache::get(local_path ) ); + Ref<Resource> res_cached = ResourceCache::get(local_path); + Ref<ResourceInteractiveLoaderDefault> ril = Ref<ResourceInteractiveLoaderDefault>(memnew(ResourceInteractiveLoaderDefault)); + + ril->resource = res_cached; + return ril; } if (OS::get_singleton()->is_stdout_verbose()) diff --git a/core/io/unzip.c b/core/io/unzip.c index b438021ad7..78672677f9 100644 --- a/core/io/unzip.c +++ b/core/io/unzip.c @@ -10,7 +10,7 @@ Modifications for Zip64 support on both zip and unzip Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - For more info read MiniZip_info.txt + For more info read LICENSE-MiniZip.txt ------------------------------------------------------------------------------------ diff --git a/core/io/unzip.h b/core/io/unzip.h index cb3d239eac..f67c3b2fa8 100644 --- a/core/io/unzip.h +++ b/core/io/unzip.h @@ -10,7 +10,7 @@ Modifications for Zip64 support on both zip and unzip Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - For more info read MiniZip_info.txt + For more info read LICENSE-MiniZip.txt --------------------------------------------------------------------------------- diff --git a/core/io/zip.c b/core/io/zip.c index c4ab93ab81..44c79195d9 100644 --- a/core/io/zip.c +++ b/core/io/zip.c @@ -7,7 +7,7 @@ Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - For more info read MiniZip_info.txt + For more info read LICENSE-MiniZip.txt Changes Oct-2009 - Mathias Svensson - Remove old C style function prototypes diff --git a/core/io/zip.h b/core/io/zip.h index 85f93568c9..37478b34c0 100644 --- a/core/io/zip.h +++ b/core/io/zip.h @@ -6,7 +6,7 @@ Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - For more info read MiniZip_info.txt + For more info read LICENSE-MiniZip.txt --------------------------------------------------------------------------- diff --git a/core/object.cpp b/core/object.cpp index bedab63281..34d6d8487a 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1401,6 +1401,13 @@ bool Object::has_persistent_signal_connections() const { return false; } +void Object::get_signals_connected_to_this(List<Connection> *p_connections) const { + + for (const List<Connection>::Element *E=connections.front();E;E=E->next()) { + p_connections->push_back(E->get()); + } +} + Error Object::connect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method,const Vector<Variant>& p_binds,uint32_t p_flags) { diff --git a/core/object.h b/core/object.h index e886aa3459..9359f4d4b2 100644 --- a/core/object.h +++ b/core/object.h @@ -605,6 +605,7 @@ public: void get_signal_connection_list(const StringName& p_signal,List<Connection> *p_connections) const; void get_all_signal_connections(List<Connection> *p_connections) const; bool has_persistent_signal_connections() const; + void get_signals_connected_to_this(List<Connection> *p_connections) const; Error connect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method,const Vector<Variant>& p_binds=Vector<Variant>(),uint32_t p_flags=0); void disconnect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method); diff --git a/core/os/os.cpp b/core/os/os.cpp index 4daf41e68e..e501bc2eb5 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -539,6 +539,14 @@ String OS::get_joy_guid(int p_device) const { void OS::set_context(int p_context) { } +void OS::set_use_vsync(bool p_enable) { + +} + +bool OS::is_vsnc_enabled() const{ + + return true; +} OS::OS() { last_error=NULL; diff --git a/core/os/os.h b/core/os/os.h index a1047bd48f..c291d09250 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -420,6 +420,9 @@ public: virtual void set_context(int p_context); + virtual void set_use_vsync(bool p_enable); + virtual bool is_vsnc_enabled() const; + bool is_hidpi_allowed() const { return _allow_hidpi; } OS(); virtual ~OS(); diff --git a/core/variant_call.cpp b/core/variant_call.cpp index f5dcd75691..d427a80541 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -262,7 +262,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM0R(String,basename); VCALL_LOCALMEM1R(String,plus_file); VCALL_LOCALMEM1R(String,ord_at); - //VCALL_LOCALMEM2R(String,erase); + VCALL_LOCALMEM2(String,erase); VCALL_LOCALMEM0R(String,hash); VCALL_LOCALMEM0R(String,md5_text); VCALL_LOCALMEM0R(String,md5_buffer); @@ -339,6 +339,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM1R(Vector2,reflect); VCALL_LOCALMEM0R(Vector2,angle); // VCALL_LOCALMEM1R(Vector2,cross); + VCALL_LOCALMEM0R(Vector2,abs); VCALL_LOCALMEM0R(Rect2,get_area); VCALL_LOCALMEM1R(Rect2,intersects); @@ -445,6 +446,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM1(Dictionary,erase); VCALL_LOCALMEM0R(Dictionary,hash); VCALL_LOCALMEM0R(Dictionary,keys); + VCALL_LOCALMEM0R(Dictionary,values); VCALL_LOCALMEM1R(Dictionary,parse_json); VCALL_LOCALMEM0R(Dictionary,to_json); @@ -1284,7 +1286,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(STRING,STRING,String,basename,varray()); ADDFUNC1(STRING,STRING,String,plus_file,STRING,"file",varray()); ADDFUNC1(STRING,STRING,String,ord_at,INT,"at",varray()); -// ADDFUNC2(STRING,String,erase,INT,INT,varray()); + ADDFUNC2(STRING,NIL,String,erase,INT,"pos",INT,"chars", varray()); ADDFUNC0(STRING,INT,String,hash,varray()); ADDFUNC0(STRING,STRING,String,md5_text,varray()); ADDFUNC0(STRING,RAW_ARRAY,String,md5_buffer,varray()); @@ -1335,6 +1337,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(VECTOR2,VECTOR2,Vector2,slide,VECTOR2,"vec",varray()); ADDFUNC1(VECTOR2,VECTOR2,Vector2,reflect,VECTOR2,"vec",varray()); //ADDFUNC1(VECTOR2,REAL,Vector2,cross,VECTOR2,"with",varray()); + ADDFUNC0(VECTOR2,VECTOR2,Vector2,abs,varray()); ADDFUNC0(RECT2,REAL,Rect2,get_area,varray()); ADDFUNC1(RECT2,BOOL,Rect2,intersects,RECT2,"b",varray()); @@ -1434,6 +1437,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(DICTIONARY,NIL,Dictionary,erase,NIL,"value",varray()); ADDFUNC0(DICTIONARY,INT,Dictionary,hash,varray()); ADDFUNC0(DICTIONARY,ARRAY,Dictionary,keys,varray()); + ADDFUNC0(DICTIONARY,ARRAY,Dictionary,values,varray()); ADDFUNC1(DICTIONARY,INT,Dictionary,parse_json,STRING,"json",varray()); ADDFUNC0(DICTIONARY,STRING,Dictionary,to_json,varray()); @@ -1659,6 +1663,9 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl _VariantCall::constant_data[Variant::IMAGE].value["FORMAT_ATC_ALPHA_INTERPOLATED"]=Image::FORMAT_ATC_ALPHA_INTERPOLATED; _VariantCall::constant_data[Variant::IMAGE].value["FORMAT_CUSTOM"]=Image::FORMAT_CUSTOM; + _VariantCall::constant_data[Variant::IMAGE].value["INTERPOLATE_NEAREST"]=Image::INTERPOLATE_NEAREST; + _VariantCall::constant_data[Variant::IMAGE].value["INTERPOLATE_BILINEAR"]=Image::INTERPOLATE_BILINEAR; + _VariantCall::constant_data[Variant::IMAGE].value["INTERPOLATE_CUBIC"]=Image::INTERPOLATE_CUBIC; } void unregister_variant_methods() { |