diff options
407 files changed, 2572 insertions, 2080 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index fe2be260d7..657f527a51 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -431,7 +431,7 @@ String _OS::get_latin_keyboard_variant() const { String _OS::get_model_name() const { - return OS::get_singleton()->get_model_name(); + return OS::get_singleton()->get_model_name(); } @@ -996,11 +996,12 @@ void _OS::_bind_methods() { ClassDB::bind_method(_MD("set_clipboard","clipboard"),&_OS::set_clipboard); ClassDB::bind_method(_MD("get_clipboard"),&_OS::get_clipboard); - ClassDB::bind_method(_MD("set_video_mode","size","fullscreen","resizable","screen"),&_OS::set_video_mode,DEFVAL(0)); - ClassDB::bind_method(_MD("get_video_mode_size","screen"),&_OS::get_video_mode,DEFVAL(0)); - ClassDB::bind_method(_MD("is_video_mode_fullscreen","screen"),&_OS::is_video_mode_fullscreen,DEFVAL(0)); - ClassDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0)); - ClassDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0)); + //will not delete for now, just unexpose + //ClassDB::bind_method(_MD("set_video_mode","size","fullscreen","resizable","screen"),&_OS::set_video_mode,DEFVAL(0)); + //ClassDB::bind_method(_MD("get_video_mode_size","screen"),&_OS::get_video_mode,DEFVAL(0)); + //ClassDB::bind_method(_MD("is_video_mode_fullscreen","screen"),&_OS::is_video_mode_fullscreen,DEFVAL(0)); + //ClassDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0)); + //ClassDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0)); ClassDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count); @@ -1830,9 +1831,9 @@ Error _Directory::open(const String& p_path) { return OK; } -bool _Directory::list_dir_begin() { +Error _Directory::list_dir_begin() { - ERR_FAIL_COND_V(!d,false); + ERR_FAIL_COND_V(!d,ERR_UNCONFIGURED); return d->list_dir_begin(); } @@ -1863,6 +1864,10 @@ String _Directory::get_drive(int p_drive){ ERR_FAIL_COND_V(!d,""); return d->get_drive(p_drive); } +int _Directory::get_current_drive() { + ERR_FAIL_COND_V(!d,0); + return d->get_current_drive(); +} Error _Directory::change_dir(String p_dir){ @@ -1971,13 +1976,14 @@ void _Directory::_bind_methods() { ClassDB::bind_method(_MD("list_dir_end"),&_Directory::list_dir_end); ClassDB::bind_method(_MD("get_drive_count"),&_Directory::get_drive_count); ClassDB::bind_method(_MD("get_drive","idx"),&_Directory::get_drive); + ClassDB::bind_method(_MD("get_current_drive"),&_Directory::get_current_drive); ClassDB::bind_method(_MD("change_dir:Error","todir"),&_Directory::change_dir); ClassDB::bind_method(_MD("get_current_dir"),&_Directory::get_current_dir); ClassDB::bind_method(_MD("make_dir:Error","path"),&_Directory::make_dir); ClassDB::bind_method(_MD("make_dir_recursive:Error","path"),&_Directory::make_dir_recursive); ClassDB::bind_method(_MD("file_exists","path"),&_Directory::file_exists); ClassDB::bind_method(_MD("dir_exists","path"),&_Directory::dir_exists); -// ClassDB::bind_method(_MD("get_modified_time","file"),&_Directory::get_modified_time); + //ClassDB::bind_method(_MD("get_modified_time","file"),&_Directory::get_modified_time); ClassDB::bind_method(_MD("get_space_left"),&_Directory::get_space_left); ClassDB::bind_method(_MD("copy:Error","from","to"),&_Directory::copy); ClassDB::bind_method(_MD("rename:Error","from","to"),&_Directory::rename); @@ -2507,22 +2513,22 @@ void _ClassDB::_bind_methods() { ClassDB::bind_method(_MD("can_instance","class"),&_ClassDB::can_instance); ClassDB::bind_method(_MD("instance","class"),&_ClassDB::instance); - ClassDB::bind_method(_MD("has_signal","class","signal"),&_ClassDB::has_signal); - ClassDB::bind_method(_MD("get_signal","class","signal"),&_ClassDB::get_signal); - ClassDB::bind_method(_MD("get_signal_list","class","no_inheritance"),&_ClassDB::get_signal_list,DEFVAL(false)); + ClassDB::bind_method(_MD("class_has_signal","class","signal"),&_ClassDB::has_signal); + ClassDB::bind_method(_MD("class_get_signal","class","signal"),&_ClassDB::get_signal); + ClassDB::bind_method(_MD("class_get_signal_list","class","no_inheritance"),&_ClassDB::get_signal_list,DEFVAL(false)); - ClassDB::bind_method(_MD("get_property_list","class","no_inheritance"),&_ClassDB::get_property_list,DEFVAL(false)); + ClassDB::bind_method(_MD("class_get_property_list","class","no_inheritance"),&_ClassDB::get_property_list,DEFVAL(false)); - ClassDB::bind_method(_MD("has_method","class","method","no_inheritance"),&_ClassDB::has_method,DEFVAL(false)); + ClassDB::bind_method(_MD("class_has_method","class","method","no_inheritance"),&_ClassDB::has_method,DEFVAL(false)); - ClassDB::bind_method(_MD("get_method_list","class","no_inheritance"),&_ClassDB::get_method_list,DEFVAL(false)); + ClassDB::bind_method(_MD("class_get_method_list","class","no_inheritance"),&_ClassDB::get_method_list,DEFVAL(false)); - ClassDB::bind_method(_MD("get_integer_constant_list","class","no_inheritance"),&_ClassDB::get_integer_constant_list,DEFVAL(false)); + ClassDB::bind_method(_MD("class_get_integer_constant_list","class","no_inheritance"),&_ClassDB::get_integer_constant_list,DEFVAL(false)); - ClassDB::bind_method(_MD("has_integer_constant","class","name"),&_ClassDB::has_integer_constant); - ClassDB::bind_method(_MD("get_integer_constant","class","name"),&_ClassDB::get_integer_constant); + ClassDB::bind_method(_MD("class_has_integer_constant","class","name"),&_ClassDB::has_integer_constant); + ClassDB::bind_method(_MD("class_get_integer_constant","class","name"),&_ClassDB::get_integer_constant); - ClassDB::bind_method(_MD("get_category","class"),&_ClassDB::get_category); + ClassDB::bind_method(_MD("class_get_category","class"),&_ClassDB::get_category); ClassDB::bind_method(_MD("is_class_enabled","class"),&_ClassDB::is_class_enabled); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 0774492f66..f10714720f 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -456,7 +456,7 @@ public: Error open(const String& p_path); - bool list_dir_begin(); ///< This starts dir listing + Error list_dir_begin(); ///< This starts dir listing String get_next(); bool current_is_dir() const; @@ -464,6 +464,7 @@ public: int get_drive_count(); String get_drive(int p_drive); + int get_current_drive(); Error change_dir(String p_dir); ///< can be relative or absolute, return false on success String get_current_dir(); ///< return current dir location diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp index 71f810422a..1e3a51fede 100644 --- a/core/compressed_translation.cpp +++ b/core/compressed_translation.cpp @@ -467,7 +467,7 @@ StringName PHashTranslation::get_message(const StringName& p_src_text) const { //print_line("Hash: "+itos(p)); if (p==0xFFFFFFFF) { -// print_line("GETMSG: Nothing!"); + //print_line("GETMSG: Nothing!"); return StringName(); //nothing } @@ -489,7 +489,7 @@ StringName PHashTranslation::get_message(const StringName& p_src_text) const { //print_line("bucket pos: "+itos(idx)); if (idx==-1) { -// print_line("GETMSG: Not in Bucket!"); + //print_line("GETMSG: Not in Bucket!"); return StringName(); } @@ -497,8 +497,8 @@ StringName PHashTranslation::get_message(const StringName& p_src_text) const { String rstr; rstr.parse_utf8(&sptr[ bucket.elem[idx].str_offset ], bucket.elem[idx].uncomp_size ); -// print_line("Uncompressed, size: "+itos(bucket.elem[idx].comp_size)); -// print_line("Return: "+rstr); + //print_line("Uncompressed, size: "+itos(bucket.elem[idx].comp_size)); + //print_line("Return: "+rstr); return rstr; } else { @@ -508,8 +508,8 @@ StringName PHashTranslation::get_message(const StringName& p_src_text) const { smaz_decompress(&sptr[ bucket.elem[idx].str_offset ], bucket.elem[idx].comp_size,uncomp.ptr(),bucket.elem[idx].uncomp_size ); String rstr; rstr.parse_utf8(uncomp.get_data()); -// print_line("Compressed, size: "+itos(bucket.elem[idx].comp_size)); -// print_line("Return: "+rstr); + //print_line("Compressed, size: "+itos(bucket.elem[idx].comp_size)); + //print_line("Return: "+rstr); return rstr; } diff --git a/core/globals.cpp b/core/globals.cpp index 28fabac302..a4c24a6cc8 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -329,7 +329,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { String candidate = d->get_current_dir(); String current_dir = d->get_current_dir(); - String exec_name = OS::get_singleton()->get_executable_path().get_file().basename(); + String exec_name = OS::get_singleton()->get_executable_path().get_file().get_basename(); bool found = false; bool first_time=true; @@ -1011,7 +1011,7 @@ GlobalConfig::GlobalConfig() { GLOBAL_DEF("input/ui_page_down",va); input_presets.push_back("input/ui_page_down"); -// GLOBAL_DEF("display/handheld/orientation", "landscape"); + //GLOBAL_DEF("display/handheld/orientation", "landscape"); custom_prop_info["display/handheld/orientation"]=PropertyInfo(Variant::STRING,"display/handheld/orientation",PROPERTY_HINT_ENUM,"landscape,portrait,reverse_landscape,reverse_portrait,sensor_landscape,sensor_portrait,sensor"); diff --git a/core/hash_map.h b/core/hash_map.h index fba12b55ec..0d55206935 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -61,7 +61,7 @@ public: static _FORCE_INLINE_ uint32_t hash(const uint8_t p_int) { return p_int; } static _FORCE_INLINE_ uint32_t hash(const int8_t p_int) { return (uint32_t)p_int; } static _FORCE_INLINE_ uint32_t hash(const wchar_t p_wchar) { return (uint32_t)p_wchar; } -// static _FORCE_INLINE_ uint32_t hash(const void* p_ptr) { return uint32_t(uint64_t(p_ptr))*(0x9e3779b1L); } + //static _FORCE_INLINE_ uint32_t hash(const void* p_ptr) { return uint32_t(uint64_t(p_ptr))*(0x9e3779b1L); } }; /** diff --git a/core/image.cpp b/core/image.cpp index 174c840c23..d769e6a0b3 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -363,7 +363,7 @@ void Image::convert( Format p_new_format ){ Image new_img(width,height,0,p_new_format); -// int len=data.size(); + //int len=data.size(); PoolVector<uint8_t>::Read r = data.read(); PoolVector<uint8_t>::Write w = new_img.data.write(); @@ -414,7 +414,7 @@ void Image::convert( Format p_new_format ){ bool gen_mipmaps=mipmaps; -// mipmaps=false; + //mipmaps=false; *this=new_img; @@ -1240,7 +1240,7 @@ void Image::create( const char ** p_xpm ) { uint8_t col_r; uint8_t col_g; uint8_t col_b; -// uint8_t col_a=255; + //uint8_t col_a=255; for (int i=0;i<6;i++) { diff --git a/core/input_map.cpp b/core/input_map.cpp index 0379131dd3..bcae630c76 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -324,7 +324,7 @@ void InputMap::load_default() { key.key.scancode=KEY_PAGEDOWN; action_add_event("ui_page_down",key); -// set("display/handheld/orientation", "landscape"); + //set("display/handheld/orientation", "landscape"); } diff --git a/core/io/file_access_buffered_fa.h b/core/io/file_access_buffered_fa.h index 884d40a266..000c2b45f3 100644 --- a/core/io/file_access_buffered_fa.h +++ b/core/io/file_access_buffered_fa.h @@ -127,10 +127,11 @@ public: set_error(OK); }; -// static void make_default() { - - //FileAccess::create_func = FileAccessBufferedFA<T>::create; -// }; + /* + static void make_default() { + FileAccess::create_func = FileAccessBufferedFA<T>::create; + }; + */ virtual uint64_t _get_modified_time(const String& p_file) { diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp index a9dbf56c15..32eb003228 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -68,7 +68,7 @@ FileAccess* FileAccessMemory::create() { bool FileAccessMemory::file_exists(const String& p_name) { String name = fix_path(p_name); -// name = DirAccess::normalize_path(name); + //name = DirAccess::normalize_path(name); return files && (files->find(name) != NULL); } @@ -87,7 +87,7 @@ Error FileAccessMemory::_open(const String& p_path, int p_mode_flags) { ERR_FAIL_COND_V(!files, ERR_FILE_NOT_FOUND); String name = fix_path(p_path); -// name = DirAccess::normalize_path(name); + //name = DirAccess::normalize_path(name); Map<String, Vector<uint8_t> >::Element* E = files->find(name); ERR_FAIL_COND_V(!E, ERR_FILE_NOT_FOUND); diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index 19076b57be..7bf750f6e1 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -206,7 +206,7 @@ Error FileAccessNetworkClient::connect(const String& p_host,int p_port,const Str } DEBUG_PRINT("IP: "+String(ip)+" port "+itos(p_port)); - Error err = client->connect(ip,p_port); + Error err = client->connect_to_host(ip,p_port); ERR_FAIL_COND_V(err,err); while(client->get_status()==StreamPeerTCP::STATUS_CONNECTING) { //DEBUG_PRINT("trying to connect...."); @@ -325,7 +325,7 @@ Error FileAccessNetwork::_open(const String& p_path, int p_mode_flags) { last_page=-1; last_page_buff=NULL; -// buffers.clear(); + //buffers.clear(); nc->unlock_mutex(); DEBUG_PRINT("OPEN POST"); DEBUG_TIME("open_post"); @@ -437,7 +437,7 @@ int FileAccessNetwork::get_buffer(uint8_t *p_dst, int p_length) const{ p_length=total_size-pos; } -// FileAccessNetworkClient *nc = FileAccessNetworkClient::singleton; + //FileAccessNetworkClient *nc = FileAccessNetworkClient::singleton; uint8_t *buff=last_page_buff; diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 7e3a6d1fa0..d63539a7a5 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -340,7 +340,7 @@ FileAccessPack::~FileAccessPack() { ////////////////////////////////////////////////////////////////////////////////// -bool DirAccessPack::list_dir_begin() { +Error DirAccessPack::list_dir_begin() { list_dirs.clear(); @@ -356,7 +356,7 @@ bool DirAccessPack::list_dir_begin() { list_files.push_back(E->get()); } - return true; + return OK; } String DirAccessPack::get_next(){ diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index 83340a662b..0a1320e57b 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -209,7 +209,7 @@ class DirAccessPack : public DirAccess { public: - virtual bool list_dir_begin(); + virtual Error list_dir_begin(); virtual String get_next(); virtual bool current_is_dir() const; virtual bool current_is_hidden() const; diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index c4439f2599..87f07cb7b1 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -165,7 +165,7 @@ unzFile ZipArchive::get_file_handle(String p_file) const { bool ZipArchive::try_open_pack(const String& p_name) { //printf("opening zip pack %ls, %i, %i\n", p_name.c_str(), p_name.extension().nocasecmp_to("zip"), p_name.extension().nocasecmp_to("pcz")); - if (p_name.extension().nocasecmp_to("zip") != 0 && p_name.extension().nocasecmp_to("pcz") != 0) + if (p_name.get_extension().nocasecmp_to("zip") != 0 && p_name.get_extension().nocasecmp_to("pcz") != 0) return false; zlib_filefunc_def io; diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 5e57f55f87..63c8abbbad 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -33,7 +33,7 @@ void HTTPClient::set_ip_type(IP::Type p_type) { ip_type = p_type; } -Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl,bool p_verify_host){ +Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl,bool p_verify_host){ close(); tcp_connection->set_ip_type(ip_type); @@ -57,7 +57,7 @@ Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl,bool p_ve if (conn_host.is_valid_ip_address()) { //is ip - Error err = tcp_connection->connect(IP_Address(conn_host),p_port); + Error err = tcp_connection->connect_to_host(IP_Address(conn_host),p_port); if (err) { status=STATUS_CANT_CONNECT; return err; @@ -232,7 +232,7 @@ Error HTTPClient::get_response_headers(List<String> *r_response) { void HTTPClient::close(){ if (tcp_connection->get_status()!=StreamPeerTCP::STATUS_NONE) - tcp_connection->disconnect(); + tcp_connection->disconnect_from_host(); connection.unref(); status=STATUS_DISCONNECTED; @@ -267,7 +267,7 @@ Error HTTPClient::poll(){ case IP::RESOLVER_STATUS_DONE: { IP_Address host = IP::get_singleton()->get_resolve_item_address(resolving); - Error err = tcp_connection->connect(host,conn_port); + Error err = tcp_connection->connect_to_host(host,conn_port); IP::get_singleton()->erase_resolve_item(resolving); resolving=IP::RESOLVER_INVALID_ID; if (err) { @@ -300,7 +300,7 @@ Error HTTPClient::poll(){ case StreamPeerTCP::STATUS_CONNECTED: { if (ssl) { Ref<StreamPeerSSL> ssl = StreamPeerSSL::create(); - Error err = ssl->connect(tcp_connection,true,ssl_verify_host?conn_host:String()); + Error err = ssl->connect_to_stream(tcp_connection,true,ssl_verify_host?conn_host:String()); if (err!=OK) { close(); status=STATUS_SSL_HANDSHAKE_ERROR; @@ -640,7 +640,7 @@ Error HTTPClient::_get_http_data(uint8_t* p_buffer, int p_bytes,int &r_received) void HTTPClient::_bind_methods() { ClassDB::bind_method(_MD("set_ip_type","ip_type"),&HTTPClient::set_ip_type); - ClassDB::bind_method(_MD("connect:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true)); + ClassDB::bind_method(_MD("connect_to_host:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect_to_host,DEFVAL(false),DEFVAL(true)); ClassDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection); ClassDB::bind_method(_MD("get_connection:StreamPeer"),&HTTPClient::get_connection); ClassDB::bind_method(_MD("request_raw","method","url","headers","body"),&HTTPClient::request_raw); diff --git a/core/io/http_client.h b/core/io/http_client.h index c6f96db1d6..496d22530b 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -167,7 +167,7 @@ public: void set_ip_type(IP::Type p_type); //Error connect_and_get(const String& p_url,bool p_verify_host=true); //connects to a full url and perform request - Error connect(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true); + Error connect_to_host(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true); void set_connection(const Ref<StreamPeer>& p_connection); Ref<StreamPeer> get_connection() const; diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index d4d10e2126..2b01e865f4 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -36,7 +36,7 @@ bool ImageFormatLoader::recognize(const String& p_extension) const { get_recognized_extensions(&extensions); for (List<String>::Element *E=extensions.front();E;E=E->next()) { - if (E->get().nocasecmp_to(p_extension.extension())==0) + if (E->get().nocasecmp_to(p_extension.get_extension())==0) return true; } @@ -56,7 +56,7 @@ Error ImageLoader::load_image(String p_file,Image *p_image, FileAccess *p_custom } } - String extension = p_file.extension(); + String extension = p_file.get_extension(); for (int i=0;i<loader_count;i++) { diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 91d1fc5f98..9fec807bfb 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -36,7 +36,7 @@ String PacketPeerUDP::_get_packet_ip() const { return get_packet_address(); } -Error PacketPeerUDP::_set_send_address(const String& p_address, int p_port) { +Error PacketPeerUDP::_set_dest_address(const String& p_address, int p_port) { IP_Address ip; if (p_address.is_valid_ip_address()) { @@ -47,7 +47,7 @@ Error PacketPeerUDP::_set_send_address(const String& p_address, int p_port) { return ERR_CANT_RESOLVE; } - set_send_address(ip,p_port); + set_dest_address(ip,p_port); return OK; } @@ -66,7 +66,7 @@ void PacketPeerUDP::_bind_methods() { ClassDB::bind_method(_MD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip); //ClassDB::bind_method(_MD("get_packet_address"),&PacketPeerUDP::_get_packet_address); ClassDB::bind_method(_MD("get_packet_port"),&PacketPeerUDP::get_packet_port); - ClassDB::bind_method(_MD("set_send_address","host","port"),&PacketPeerUDP::_set_send_address); + ClassDB::bind_method(_MD("set_dest_address","host","port"),&PacketPeerUDP::_set_dest_address); } diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h index 17a2817f34..17952b4ac1 100644 --- a/core/io/packet_peer_udp.h +++ b/core/io/packet_peer_udp.h @@ -45,7 +45,7 @@ protected: String _get_packet_ip() const; - virtual Error _set_send_address(const String& p_address,int p_port); + virtual Error _set_dest_address(const String& p_address,int p_port); public: @@ -56,7 +56,7 @@ public: virtual bool is_listening() const=0; virtual IP_Address get_packet_address() const=0; virtual int get_packet_port() const=0; - virtual void set_send_address(const IP_Address& p_address,int p_port)=0; + virtual void set_dest_address(const IP_Address& p_address,int p_port)=0; static Ref<PacketPeerUDP> create_ref(); diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index c093b087b8..4af3503434 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -1059,7 +1059,7 @@ Ref<ResourceInteractiveLoader> ResourceFormatLoaderBinary::load_interactive(cons Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary ); ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); + //ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); ria->open(f); @@ -1114,7 +1114,7 @@ Error ResourceFormatLoaderBinary::load_import_metadata(const String &p_path, Ref Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary ); ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); + //ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); ria->recognize(f); if(ria->error!=OK) return ERR_FILE_UNRECOGNIZED; @@ -1159,14 +1159,14 @@ void ResourceFormatLoaderBinary::get_dependencies(const String& p_path,List<Stri Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary ); ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); + //ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); ria->get_dependencies(f,p_dependencies,p_add_types); } Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path,const Map<String,String>& p_map) { -// Error error=OK; + //Error error=OK; FileAccess *f=FileAccess::open(p_path,FileAccess::READ); @@ -1250,7 +1250,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path,const ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; ria->remaps=p_map; - // ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); + //ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); ria->open(f); err = ria->poll(); @@ -1384,7 +1384,7 @@ String ResourceFormatLoaderBinary::get_resource_type(const String &p_path) const Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary ); ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); + //ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); String r = ria->recognize(f); return r; @@ -1708,8 +1708,10 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, for(List<Variant>::Element *E=keys.front();E;E=E->next()) { - //if (!_check_type(dict[E->get()])) - // continue; + /* + if (!_check_type(dict[E->get()])) + continue; + */ write_variant(E->get()); write_variant(d[E->get()]); @@ -2150,7 +2152,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ } Vector<uint64_t> ofs_table; -// int saved_idx=0; + //int saved_idx=0; //now actually save the resources for(List<ResourceData>::Element *E=resources.front();E;E=E->next()) { diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index cc3c8ce006..354efaa83f 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -55,7 +55,7 @@ bool ResourceFormatLoader::recognize(const String& p_extension) const { get_recognized_extensions(&extensions); for (List<String>::Element *E=extensions.front();E;E=E->next()) { - if (E->get().nocasecmp_to(p_extension.extension())==0) + if (E->get().nocasecmp_to(p_extension.get_extension())==0) return true; } @@ -182,7 +182,7 @@ RES ResourceLoader::load(const String &p_path, const String& p_type_hint, bool p if (OS::get_singleton()->is_stdout_verbose()) print_line("load resource: "+remapped_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); bool found=false; for (int i=0;i<loader_count;i++) { @@ -230,7 +230,7 @@ Ref<ResourceImportMetadata> ResourceLoader::load_import_metadata(const String &p else local_path = GlobalConfig::get_singleton()->localize_path(p_path); - String extension=p_path.extension(); + String extension=p_path.get_extension(); Ref<ResourceImportMetadata> ret; for (int i=0;i<loader_count;i++) { @@ -331,7 +331,7 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_ String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); bool found=false; for (int i=0;i<loader_count;i++) { @@ -385,14 +385,16 @@ void ResourceLoader::get_dependencies(const String& p_path, List<String> *p_depe String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); for (int i=0;i<loader_count;i++) { if (!loader[i]->recognize(extension)) continue; - //if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint)) - // continue; + /* + if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint)) + continue; + */ loader[i]->get_dependencies(remapped_path,p_dependencies,p_add_types); @@ -410,14 +412,16 @@ Error ResourceLoader::rename_dependencies(const String &p_path,const Map<String, String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); for (int i=0;i<loader_count;i++) { if (!loader[i]->recognize(extension)) continue; - //if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint)) - // continue; + /* + if (p_type_hint!="" && !loader[i]->handles_type(p_type_hint)) + continue; + */ return loader[i]->rename_dependencies(p_path,p_map); @@ -449,7 +453,7 @@ String ResourceLoader::get_resource_type(const String &p_path) { local_path = GlobalConfig::get_singleton()->localize_path(p_path); String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); for (int i=0;i<loader_count;i++) { diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 9081adaa8f..222d3e6bc0 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -40,7 +40,7 @@ ResourceSavedCallback ResourceSaver::save_callback=0; Error ResourceSaver::save(const String &p_path,const RES& p_resource,uint32_t p_flags) { - String extension=p_path.extension(); + String extension=p_path.get_extension(); Error err=ERR_FILE_UNRECOGNIZED; for (int i=0;i<saver_count;i++) { @@ -54,7 +54,7 @@ Error ResourceSaver::save(const String &p_path,const RES& p_resource,uint32_t p_ for (List<String>::Element *E=extensions.front();E;E=E->next()) { - if (E->get().nocasecmp_to(extension.extension())==0) + if (E->get().nocasecmp_to(extension.get_extension())==0) recognized=true; } diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index aab42a2989..fc535e94b0 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -57,10 +57,10 @@ bool StreamPeerSSL::is_available() { void StreamPeerSSL::_bind_methods() { - ClassDB::bind_method(_MD("accept:Error","stream:StreamPeer"),&StreamPeerSSL::accept); - ClassDB::bind_method(_MD("connect:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect,DEFVAL(false),DEFVAL(String())); + ClassDB::bind_method(_MD("accept_stream:Error","stream:StreamPeer"),&StreamPeerSSL::accept_stream); + ClassDB::bind_method(_MD("connect_to_stream:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect_to_stream,DEFVAL(false),DEFVAL(String())); ClassDB::bind_method(_MD("get_status"),&StreamPeerSSL::get_status); - ClassDB::bind_method(_MD("disconnect"),&StreamPeerSSL::disconnect); + ClassDB::bind_method(_MD("disconnect_from_stream"),&StreamPeerSSL::disconnect_from_stream); BIND_CONSTANT( STATUS_DISCONNECTED ); BIND_CONSTANT( STATUS_CONNECTED ); BIND_CONSTANT( STATUS_ERROR_NO_CERTIFICATE ); diff --git a/core/io/stream_peer_ssl.h b/core/io/stream_peer_ssl.h index 8675433a30..9aafac874d 100644 --- a/core/io/stream_peer_ssl.h +++ b/core/io/stream_peer_ssl.h @@ -57,11 +57,11 @@ public: STATUS_ERROR_HOSTNAME_MISMATCH }; - virtual Error accept(Ref<StreamPeer> p_base)=0; - virtual Error connect(Ref<StreamPeer> p_base,bool p_validate_certs=false,const String& p_for_hostname=String())=0; + virtual Error accept_stream(Ref<StreamPeer> p_base)=0; + virtual Error connect_to_stream(Ref<StreamPeer> p_base,bool p_validate_certs=false,const String& p_for_hostname=String())=0; virtual Status get_status() const=0; - virtual void disconnect()=0; + virtual void disconnect_from_stream()=0; static StreamPeerSSL* create(); diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp index 2218057cf7..0a59c32995 100644 --- a/core/io/stream_peer_tcp.cpp +++ b/core/io/stream_peer_tcp.cpp @@ -41,24 +41,24 @@ Error StreamPeerTCP::_connect(const String& p_address,int p_port) { return ERR_CANT_RESOLVE; } - connect(ip,p_port); + connect_to_host(ip,p_port); return OK; } void StreamPeerTCP::set_ip_type(IP::Type p_type) { - disconnect(); + disconnect_from_host(); ip_type = p_type; } void StreamPeerTCP::_bind_methods() { ClassDB::bind_method(_MD("set_ip_type","ip_type"),&StreamPeerTCP::set_ip_type); - ClassDB::bind_method(_MD("connect","host","port"),&StreamPeerTCP::_connect); - ClassDB::bind_method(_MD("is_connected"),&StreamPeerTCP::is_connected); + ClassDB::bind_method(_MD("connect_to_host","host","port"),&StreamPeerTCP::_connect); + ClassDB::bind_method(_MD("is_connected_to_host"),&StreamPeerTCP::is_connected_to_host); ClassDB::bind_method(_MD("get_status"),&StreamPeerTCP::get_status); ClassDB::bind_method(_MD("get_connected_host"),&StreamPeerTCP::get_connected_host); ClassDB::bind_method(_MD("get_connected_port"),&StreamPeerTCP::get_connected_port); - ClassDB::bind_method(_MD("disconnect"),&StreamPeerTCP::disconnect); + ClassDB::bind_method(_MD("disconnect_from_host"),&StreamPeerTCP::disconnect_from_host); BIND_CONSTANT( STATUS_NONE ); BIND_CONSTANT( STATUS_CONNECTING ); diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h index 8f6dfaf3f8..2b25f31739 100644 --- a/core/io/stream_peer_tcp.h +++ b/core/io/stream_peer_tcp.h @@ -60,13 +60,13 @@ protected: public: virtual void set_ip_type(IP::Type p_type); - virtual Error connect(const IP_Address& p_host, uint16_t p_port)=0; + virtual Error connect_to_host(const IP_Address& p_host, uint16_t p_port)=0; //read/write from streampeer - virtual bool is_connected() const=0; + virtual bool is_connected_to_host() const=0; virtual Status get_status() const=0; - virtual void disconnect()=0; + virtual void disconnect_from_host()=0; virtual IP_Address get_connected_host() const=0; virtual uint16_t get_connected_port() const=0; virtual void set_nodelay(bool p_enabled)=0; diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 8c4c1c8180..bee38e037f 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -204,7 +204,7 @@ bool TranslationLoaderPO::handles_type(const String& p_type) const{ String TranslationLoaderPO::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="po") + if (p_path.get_extension().to_lower()=="po") return "Translation"; return ""; } diff --git a/core/io/zip.c b/core/io/zip.c index 44c79195d9..27a3d3cdc1 100644 --- a/core/io/zip.c +++ b/core/io/zip.c @@ -855,7 +855,7 @@ extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* gl ziinit.z_filefunc.zseek32_file = NULL; ziinit.z_filefunc.ztell32_file = NULL; if (pzlib_filefunc64_32_def==NULL) { -// fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64); + //fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64); } else ziinit.z_filefunc = *pzlib_filefunc64_32_def; diff --git a/core/map.h b/core/map.h index af35fec332..9448389169 100644 --- a/core/map.h +++ b/core/map.h @@ -149,7 +149,7 @@ private: #ifdef GLOBALNIL_DISABLED memdelete_allocator<Element,A>(_nil); #endif -// memdelete_allocator<Element,A>(_root); + //memdelete_allocator<Element,A>(_root); } }; diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp index b888b6b56c..e2526f5134 100644 --- a/core/math/bsp_tree.cpp +++ b/core/math/bsp_tree.cpp @@ -390,8 +390,10 @@ static int _bsp_create_node(const Face3 *p_faces,const Vector<int>& p_indices,Ve const Face3& f=p_faces[ indices[i] ]; - //if (f.get_plane().is_almost_like(divisor_plane)) - // continue; + /* + if (f.get_plane().is_almost_like(divisor_plane)) + continue; + */ int over_count=0; int under_count=0; @@ -546,7 +548,7 @@ BSP_Tree::BSP_Tree(const Variant& p_variant) { error_radius = d["error"]; aabb = d["aabb"]; -// int node_count = src_nodes.size(); + //int node_count = src_nodes.size(); nodes.resize(src_nodes.size()/3); PoolVector<int>::Read r = src_nodes.read(); diff --git a/core/math/geometry.h b/core/math/geometry.h index 9800e5513c..d5b3a3068c 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -750,9 +750,7 @@ public: return Vector<Vector3>(); //empty } -// long count = 0; long previous = polygon.size() - 1; - Vector<Vector3> clipped; for (int index = 0; index < polygon.size(); index++) { diff --git a/core/math/math_2d.h b/core/math/math_2d.h index 7896299c24..a24c4266ee 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -154,7 +154,7 @@ struct Vector2 { Vector2 floor() const; Vector2 snapped(const Vector2& p_by) const; - real_t get_aspect() const { return width/height; } + real_t aspect() const { return width/height; } operator String() const { return String::num(x)+", "+String::num(y); } diff --git a/core/math/octree.h b/core/math/octree.h index 1a41413a76..483ba1d510 100644 --- a/core/math/octree.h +++ b/core/math/octree.h @@ -130,8 +130,10 @@ private: ~Octant() { - //for (int i=0;i<8;i++) - // memdelete_notnull(children[i]); + /* + for (int i=0;i<8;i++) + memdelete_notnull(children[i]); + */ } }; @@ -250,8 +252,10 @@ private: E->get().eA=p_A->pair_list.push_back(&E->get()); E->get().eB=p_B->pair_list.push_back(&E->get()); -// if (pair_callback) -// pair_callback(pair_callback_userdata,p_A->userdata,p_B->userdata); + /* + if (pair_callback) + pair_callback(pair_callback_userdata,p_A->userdata,p_B->userdata); + */ } else { E->get().refcount++; @@ -970,8 +974,10 @@ void Octree<T,use_pairs,AL>::move(OctreeElementID p_id, const Rect3& p_aabb) { Octant *o=E->get().octant; typename List<typename Element::OctantOwner,AL>::Element *N=E->next(); -// if (!use_pairs) -// o->elements.erase( E->get().E ); + /* + if (!use_pairs) + o->elements.erase( E->get().E ); + */ if (use_pairs && e.pairable) o->pairable_elements.erase( E->get().E ); diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index ab81a068d4..756e48d0b4 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -483,7 +483,7 @@ Error QuickHull::build(const Vector<Vector3>& p_points, Geometry::MeshData &r_me //fill mesh r_mesh.faces.clear(); r_mesh.faces.resize(ret_faces.size()); -// print_line("FACECOUNT: "+itos(r_mesh.faces.size())); + //print_line("FACECOUNT: "+itos(r_mesh.faces.size())); int idx=0; for (List<Geometry::MeshData::Face>::Element *E=ret_faces.front();E;E=E->next()) { diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp index fc5f55066b..74c4656771 100644 --- a/core/math/triangle_mesh.cpp +++ b/core/math/triangle_mesh.cpp @@ -320,7 +320,7 @@ bool TriangleMesh::intersect_segment(const Vector3& p_begin,const Vector3& p_end bool valid = b.aabb.intersects_segment(p_begin,p_end); -// bool valid = b.aabb.intersects(ray_aabb); + //bool valid = b.aabb.intersects(ray_aabb); if (!valid) { diff --git a/core/math/triangulator.cpp b/core/math/triangulator.cpp index 8f82d76823..75b2b064c4 100644 --- a/core/math/triangulator.cpp +++ b/core/math/triangulator.cpp @@ -1128,7 +1128,7 @@ int TriangulatorPartition::MonotonePartition(List<TriangulatorPoly> *inpolys, Li //this makes deleting existing edges much faster Set<ScanLineEdge>::Element **edgeTreeIterators,*edgeIter; edgeTreeIterators = new Set<ScanLineEdge>::Element*[maxnumvertices]; -// Pair<Set<ScanLineEdge>::Element*,bool> edgeTreeRet; + //Pair<Set<ScanLineEdge>::Element*,bool> edgeTreeRet; for(i = 0; i<numvertices; i++) edgeTreeIterators[i] = NULL; //for each vertex diff --git a/core/object.cpp b/core/object.cpp index 3bb917bd38..8af088122e 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -369,8 +369,10 @@ void Object::set(const String& p_name, const Variant& p_value) { _setv(p_name,p_value); - //if (!_use_builtin_script()) -// return; + /* + if (!_use_builtin_script()) + return; + */ bool success; ClassDB::set_property(this,p_name,p_value,success); @@ -410,8 +412,10 @@ void Object::set(const StringName& p_name, const Variant& p_value, bool *r_valid //try built-in setgetter { if (ClassDB::set_property(this,p_name,p_value,r_valid)) { - //if (r_valid) - // *r_valid=true; + /* + if (r_valid) + *r_valid=true; + */ return; } } @@ -1689,12 +1693,12 @@ void Object::_bind_methods() { //todo reimplement this per language so all 5 arguments can be called -// ClassDB::bind_method(_MD("call","method","arg1","arg2","arg3","arg4"),&Object::_call_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); -// ClassDB::bind_method(_MD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); + //ClassDB::bind_method(_MD("call","method","arg1","arg2","arg3","arg4"),&Object::_call_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); + //ClassDB::bind_method(_MD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); ClassDB::bind_method(_MD("add_user_signal","signal","arguments"),&Object::_add_user_signal,DEFVAL(Array())); ClassDB::bind_method(_MD("has_user_signal","signal"),&Object::_has_user_signal); -// ClassDB::bind_method(_MD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array())); + //ClassDB::bind_method(_MD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array())); { diff --git a/core/object.h b/core/object.h index a54693eab6..6ce579ea99 100644 --- a/core/object.h +++ b/core/object.h @@ -579,8 +579,8 @@ public: } /* IAPI */ -// void set(const String& p_name, const Variant& p_value); -// Variant get(const String& p_name) const; + //void set(const String& p_name, const Variant& p_value); + //Variant get(const String& p_name) const; void set(const StringName& p_name, const Variant& p_value, bool *r_valid=NULL); Variant get(const StringName& p_name, bool *r_valid=NULL) const; diff --git a/core/object_type_db.cpp b/core/object_type_db.cpp index f3bb37421f..24b9c26e71 100644 --- a/core/object_type_db.cpp +++ b/core/object_type_db.cpp @@ -897,7 +897,7 @@ bool ClassDB::set_property(Object* p_object,const StringName& p_property, const if (psg->index>=0) { Variant index=psg->index; const Variant* arg[2]={&index,&p_value}; -// p_object->call(psg->setter,arg,2,ce); + //p_object->call(psg->setter,arg,2,ce); if (psg->_setptr) { psg->_setptr->call(p_object,arg,2,ce); } else { @@ -1111,6 +1111,15 @@ MethodBind* ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind , const String instance_type=p_bind->get_instance_class(); +#ifdef DEBUG_ENABLED + + if (has_method(instance_type,mdname)) { + ERR_EXPLAIN("Class "+String(instance_type)+" already has a method "+String(mdname)); + ERR_FAIL_V(NULL); + } +#endif + + ClassInfo *type=classes.getptr(instance_type); if (!type) { ERR_PRINTS("Couldn't bind method '"+mdname+"' for instance: "+instance_type); diff --git a/core/os/dir_access.h b/core/os/dir_access.h index f824b5f319..7c173fc780 100644 --- a/core/os/dir_access.h +++ b/core/os/dir_access.h @@ -72,7 +72,7 @@ protected: public: - virtual bool list_dir_begin()=0; ///< This starts dir listing + virtual Error list_dir_begin()=0; ///< This starts dir listing virtual String get_next(bool* p_is_dir); // compatibility virtual String get_next()=0; virtual bool current_is_dir() const=0; diff --git a/core/os/input.cpp b/core/os/input.cpp index d2bd433ed9..acfd5ba540 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -74,7 +74,7 @@ void Input::_bind_methods() { ClassDB::bind_method(_MD("get_magnetometer"),&Input::get_magnetometer); ClassDB::bind_method(_MD("get_gyroscope"),&Input::get_gyroscope); //ClassDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want - ClassDB::bind_method(_MD("get_mouse_speed"),&Input::get_mouse_speed); + ClassDB::bind_method(_MD("get_last_mouse_speed"),&Input::get_last_mouse_speed); ClassDB::bind_method(_MD("get_mouse_button_mask"),&Input::get_mouse_button_mask); ClassDB::bind_method(_MD("set_mouse_mode","mode"),&Input::set_mouse_mode); ClassDB::bind_method(_MD("get_mouse_mode"),&Input::get_mouse_mode); diff --git a/core/os/input.h b/core/os/input.h index c365894f46..a1b60ba0c8 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -77,7 +77,7 @@ public: virtual void stop_joy_vibration(int p_device)=0; virtual Point2 get_mouse_pos() const=0; - virtual Point2 get_mouse_speed() const=0; + virtual Point2 get_last_mouse_speed() const=0; virtual int get_mouse_button_mask() const=0; virtual void warp_mouse_pos(const Vector2& p_to)=0; diff --git a/core/os/memory.h b/core/os/memory.h index 0e6dea48d3..49424037ff 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -97,8 +97,8 @@ _ALWAYS_INLINE_ T *_post_initialize(T *p_obj) { #define memnew(m_class) _post_initialize(new("") m_class) _ALWAYS_INLINE_ void * operator new(size_t p_size,void *p_pointer,size_t check, const char *p_description) { -// void *failptr=0; -// ERR_FAIL_COND_V( check < p_size , failptr); /** bug, or strange compiler, most likely */ + //void *failptr=0; + //ERR_FAIL_COND_V( check < p_size , failptr); /** bug, or strange compiler, most likely */ return p_pointer; } diff --git a/core/os/os.cpp b/core/os/os.cpp index f4c13dabcc..3a8e15a692 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -166,7 +166,7 @@ const char *OS::get_last_error() const { void OS::dump_memory_to_file(const char* p_file) { -// Memory::dump_static_mem_to_file(p_file); + //Memory::dump_static_mem_to_file(p_file); } static FileAccess *_OSPRF=NULL; diff --git a/core/path_remap.cpp b/core/path_remap.cpp index fd5b38fa79..42383e212d 100644 --- a/core/path_remap.cpp +++ b/core/path_remap.cpp @@ -142,7 +142,7 @@ void PathRemap::load_remaps() { // platform remaps second, so override remaps = GlobalConfig::get_singleton()->get("remap/"+OS::get_singleton()->get_name()); -// remaps = Globals::get_singleton()->get("remap/PSP"); + //remaps = Globals::get_singleton()->get("remap/PSP"); { int rlen = remaps.size(); @@ -152,7 +152,7 @@ void PathRemap::load_remaps() { String from = r[i*2+0]; String to = r[i*2+1]; -// print_line("add remap: "+from+" -> "+to); + //print_line("add remap: "+from+" -> "+to); add_remap(from,to); } } diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index d97323a95e..85fa5d27c0 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -123,7 +123,7 @@ void register_core_types() { ClassDB::register_virtual_class<PacketPeer>(); ClassDB::register_class<PacketPeerStream>(); ClassDB::register_class<MainLoop>(); -// ClassDB::register_type<OptimizedSaver>(); + //ClassDB::register_type<OptimizedSaver>(); ClassDB::register_class<Translation>(); ClassDB::register_class<PHashTranslation>(); ClassDB::register_class<UndoRedo>(); diff --git a/core/resource.cpp b/core/resource.cpp index db4d2ec0db..3369e4a5a2 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -522,11 +522,12 @@ void ResourceCache::clear() { void ResourceCache::reload_externals() { - //const String *K=NULL; - //while ((K=resources.next(K))) { -// resources[*K]->reload_external_data(); -// } - + /* + const String *K=NULL; + while ((K=resources.next(K))) { + resources[*K]->reload_external_data(); + } + */ } bool ResourceCache::has(const String& p_path) { diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index a120a28896..bb0109467e 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -66,7 +66,7 @@ Error ScriptDebuggerRemote::connect_to_host(const String& p_host,uint16_t p_port int port = p_port; int tries = 3; - tcp_client->connect(ip, port); + tcp_client->connect_to_host(ip, port); while (tries--) { @@ -129,7 +129,7 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) { //or when execution is paused from editor - if (!tcp_client->is_connected()) { + if (!tcp_client->is_connected_to_host()) { ERR_EXPLAIN("Script Debugger failed to connect, but being used anyway."); ERR_FAIL(); } @@ -446,7 +446,7 @@ void ScriptDebuggerRemote::_err_handler(void* ud,const char* p_func,const char*p sdr->mutex->lock(); - if (!sdr->locking && sdr->tcp_client->is_connected()) { + if (!sdr->locking && sdr->tcp_client->is_connected_to_host()) { sdr->errors.push_back(oe); } @@ -887,7 +887,7 @@ void ScriptDebuggerRemote::idle_poll() { void ScriptDebuggerRemote::send_message(const String& p_message, const Array &p_args) { mutex->lock(); - if (!locking && tcp_client->is_connected()) { + if (!locking && tcp_client->is_connected_to_host()) { Message msg; msg.message=p_message; @@ -928,7 +928,7 @@ void ScriptDebuggerRemote::_print_handler(void *p_this,const String& p_string) { } sdr->mutex->lock(); - if (!sdr->locking && sdr->tcp_client->is_connected()) { + if (!sdr->locking && sdr->tcp_client->is_connected_to_host()) { sdr->output_strings.push_back(s); } diff --git a/core/set.h b/core/set.h index 9da2887671..13c2b3a4f6 100644 --- a/core/set.h +++ b/core/set.h @@ -141,7 +141,7 @@ private: #ifdef GLOBALNIL_DISABLED memdelete_allocator<Element,A>(_nil); #endif -// memdelete_allocator<Element,A>(_root); + //memdelete_allocator<Element,A>(_root); } }; @@ -307,7 +307,7 @@ private: new_node->right=_data._nil; new_node->left=_data._nil; new_node->value=p_value; -// new_node->data=_data; + //new_node->data=_data; if (new_parent==_data._root || less(p_value,new_parent->value)) { new_parent->left=new_node; diff --git a/core/ustring.cpp b/core/ustring.cpp index a73a6a3e76..66608379be 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -560,7 +560,7 @@ String String::get_slice(String p_splitter, int p_slice) const { int pos=0; int prev_pos=0; -// int slices=1; + //int slices=1; if (p_slice<0) return ""; if (find(p_splitter)==-1) @@ -574,7 +574,7 @@ String String::get_slice(String p_splitter, int p_slice) const { pos=length(); //reached end int from=prev_pos; - // int to=pos; + //int to=pos; if (p_slice==i) { @@ -1420,7 +1420,7 @@ bool String::parse_utf8(const char* p_utf8,int p_len) { } } -// printf("char %i, len %i\n",unichar,len); + //printf("char %i, len %i\n",unichar,len); if (sizeof(wchar_t)==2 && unichar>0xFFFF) { unichar=' '; //too long for windows @@ -2951,6 +2951,78 @@ bool String::matchn(const String& p_wildcard) const { } +String String::format(const Variant& values,String placeholder) const { + + String new_string = String( this->ptr() ); + + if( values.get_type() == Variant::ARRAY ) { + Array values_arr = values; + + for(int i=0;i<values_arr.size();i++) { + String i_as_str = String::num_int64( i ); + + if( values_arr[i].get_type() == Variant::ARRAY ) {//Array in Array structure [["name","RobotGuy"],[0,"godot"],["strength",9000.91]] + Array value_arr = values_arr[i]; + + if( value_arr.size()==2 ) { + Variant v_key = value_arr[0]; + String key; + + key = v_key.get_construct_string(); + if( key.left(1)=="\"" && key.right(key.length()-1)=="\"" ) { + key = key.substr(1,key.length()-2); + } + + Variant v_val = value_arr[1]; + String val; + val = v_val.get_construct_string(); + + if( val.left(1)=="\"" && val.right(val.length()-1)=="\"" ) { + val = val.substr(1,val.length()-2); + } + + new_string = new_string.replacen( placeholder.replace("_", key ), val ); + }else { + ERR_PRINT(String("STRING.format Inner Array size != 2 ").ascii().get_data()); + } + } else {//Array structure ["RobotGuy","Logis","rookie"] + Variant v_val = values_arr[i]; + String val; + val = v_val.get_construct_string(); + + if( val.left(1)=="\"" && val.right(val.length()-1)=="\"" ) { + val = val.substr(1,val.length()-2); + } + + new_string = new_string.replacen( placeholder.replace("_", i_as_str ), val ); + } + } + }else if( values.get_type() == Variant::DICTIONARY ) { + Dictionary d = values; + List<Variant> keys; + d.get_key_list(&keys); + + for (List<Variant>::Element *E=keys.front();E;E=E->next()) { + String key = E->get().get_construct_string(); + String val = d[E->get()].get_construct_string(); + + if( key.left(1)=="\"" && key.right(key.length()-1)=="\"" ) { + key = key.substr(1,key.length()-2); + } + + if( val.left(1)=="\"" && val.right(val.length()-1)=="\"" ) { + val = val.substr(1,val.length()-2); + } + + new_string = new_string.replacen( placeholder.replace("_", key ), val ); + } + }else{ + ERR_PRINT(String("Invalid type: use Array or Dictionary.").ascii().get_data()); + } + + return new_string; +} + String String::replace(String p_key,String p_with) const { String new_string; @@ -3812,7 +3884,7 @@ String String::get_file() const { return substr(sep+1,length()); } -String String::extension() const { +String String::get_extension() const { int pos = find_last("."); if (pos<0) @@ -3892,7 +3964,7 @@ String String::percent_decode() const { return String::utf8(pe.ptr()); } -String String::basename() const { +String String::get_basename() const { int pos = find_last("."); if (pos<0) @@ -4212,4 +4284,3 @@ String RTR(const String& p_text) { return p_text; } - diff --git a/core/ustring.h b/core/ustring.h index 9a145143d0..426762a9e1 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -125,6 +125,7 @@ public: bool is_subsequence_ofi(const String& p_string) const; Vector<String> bigrams() const; float similarity(const String& p_string) const; + String format(const Variant& values,String placeholder="{_}") const; String replace_first(String p_key,String p_with) const; String replace(String p_key,String p_with) const; String replacen(String p_key,String p_with) const; @@ -176,8 +177,8 @@ public: String right(int p_pos) const; String strip_edges(bool left = true, bool right = true) const; String strip_escapes() const; - String extension() const; - String basename() const; + String get_extension() const; + String get_basename() const; String plus_file(const String& p_file) const; CharType ord_at(int p_idx) const; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 0c8b40539d..51ad115d46 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -146,7 +146,7 @@ struct _VariantCall { Arg(Variant::Type p_type,const StringName &p_name) { name=p_name; type=p_type; } }; -// void addfunc(Variant::Type p_type, const StringName& p_name,VariantFunc p_func); + //void addfunc(Variant::Type p_type, const StringName& p_name,VariantFunc p_func); static void make_func_return_variant(Variant::Type p_type,const StringName& p_name) { @@ -261,6 +261,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM1R(String,is_subsequence_ofi); VCALL_LOCALMEM0R(String,bigrams); VCALL_LOCALMEM1R(String,similarity); + VCALL_LOCALMEM2R(String,format); VCALL_LOCALMEM2R(String,replace); VCALL_LOCALMEM2R(String,replacen); VCALL_LOCALMEM2R(String,insert); @@ -272,8 +273,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM1R(String,left); VCALL_LOCALMEM1R(String,right); VCALL_LOCALMEM2R(String,strip_edges); - VCALL_LOCALMEM0R(String,extension); - VCALL_LOCALMEM0R(String,basename); + VCALL_LOCALMEM0R(String,get_extension); + VCALL_LOCALMEM0R(String,get_basename); VCALL_LOCALMEM1R(String,plus_file); VCALL_LOCALMEM1R(String,ord_at); VCALL_LOCALMEM2(String,erase); @@ -349,12 +350,12 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM0R(Vector2,tangent); VCALL_LOCALMEM0R(Vector2,floor); VCALL_LOCALMEM1R(Vector2,snapped); - VCALL_LOCALMEM0R(Vector2,get_aspect); + VCALL_LOCALMEM0R(Vector2,aspect); VCALL_LOCALMEM1R(Vector2,dot); VCALL_LOCALMEM1R(Vector2,slide); VCALL_LOCALMEM1R(Vector2,reflect); VCALL_LOCALMEM0R(Vector2,angle); -// VCALL_LOCALMEM1R(Vector2,cross); + //VCALL_LOCALMEM1R(Vector2,cross); VCALL_LOCALMEM0R(Vector2,abs); VCALL_LOCALMEM1R(Vector2,clamped); @@ -1392,6 +1393,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(STRING,POOL_STRING_ARRAY,String,bigrams,varray()); ADDFUNC1(STRING,REAL,String,similarity,STRING,"text",varray()); + ADDFUNC2(STRING,STRING,String,format,NIL,"values",STRING,"placeholder",varray("{_}")); ADDFUNC2(STRING,STRING,String,replace,STRING,"what",STRING,"forwhat",varray()); ADDFUNC2(STRING,STRING,String,replacen,STRING,"what",STRING,"forwhat",varray()); ADDFUNC2(STRING,STRING,String,insert,INT,"pos",STRING,"what",varray()); @@ -1405,8 +1407,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(STRING,STRING,String,left,INT,"pos",varray()); ADDFUNC1(STRING,STRING,String,right,INT,"pos",varray()); ADDFUNC2(STRING,STRING,String,strip_edges,BOOL,"left",BOOL,"right",varray(true,true)); - ADDFUNC0(STRING,STRING,String,extension,varray()); - ADDFUNC0(STRING,STRING,String,basename,varray()); + ADDFUNC0(STRING,STRING,String,get_extension,varray()); + ADDFUNC0(STRING,STRING,String,get_basename,varray()); ADDFUNC1(STRING,STRING,String,plus_file,STRING,"file",varray()); ADDFUNC1(STRING,INT,String,ord_at,INT,"at",varray()); ADDFUNC2(STRING,NIL,String,erase,INT,"pos",INT,"chars", varray()); @@ -1457,7 +1459,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(VECTOR2,VECTOR2,Vector2,tangent,varray()); ADDFUNC0(VECTOR2,VECTOR2,Vector2,floor,varray()); ADDFUNC1(VECTOR2,VECTOR2,Vector2,snapped,VECTOR2,"by",varray()); - ADDFUNC0(VECTOR2,REAL,Vector2,get_aspect,varray()); + ADDFUNC0(VECTOR2,REAL,Vector2,aspect,varray()); ADDFUNC1(VECTOR2,REAL,Vector2,dot,VECTOR2,"with",varray()); ADDFUNC1(VECTOR2,VECTOR2,Vector2,slide,VECTOR2,"vec",varray()); ADDFUNC1(VECTOR2,VECTOR2,Vector2,reflect,VECTOR2,"vec",varray()); diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 402c8d41da..ca748b7fd3 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -2094,8 +2094,10 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud,"{ "); for(List<Variant>::Element *E=keys.front();E;E=E->next()) { - //if (!_check_type(dict[E->get()])) - // continue; + /* + if (!_check_type(dict[E->get()])) + continue; + */ write(E->get(),p_store_string_func,p_store_string_ud,p_encode_res_func,p_encode_res_ud); p_store_string_func(p_store_string_ud,":"); write(dict[E->get()],p_store_string_func,p_store_string_ud,p_encode_res_func,p_encode_res_ud); diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 368cd1bcba..0088f576f0 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -8816,7 +8816,7 @@ <constants> </constants> </class> -<class name="ColorFrame" inherits="Control" category="Core"> +<class name="ColorRect" inherits="Control" category="Core"> <brief_description> </brief_description> <description> @@ -26354,7 +26354,7 @@ </constant> </constants> </class> -<class name="Patch9Frame" inherits="Control" category="Core"> +<class name="Patch9Rect" inherits="Control" category="Core"> <brief_description> </brief_description> <description> @@ -32557,7 +32557,7 @@ <constants> </constants> </class> -<class name="ReferenceFrame" inherits="Control" category="Core"> +<class name="ReferenceRect" inherits="Control" category="Core"> <brief_description> Reference frame for GUI. </brief_description> diff --git a/drivers/convex_decomp/b2Glue.h b/drivers/convex_decomp/b2Glue.h index 7ec6d7f181..425486356e 100644 --- a/drivers/convex_decomp/b2Glue.h +++ b/drivers/convex_decomp/b2Glue.h @@ -134,11 +134,13 @@ struct b2Vec2 return length; } - ///// Does this vector contain finite coordinates? - //bool IsValid() const - //{ - // return b2IsValid(x) && b2IsValid(y); - //} + /* + /// Does this vector contain finite coordinates? + bool IsValid() const + { + return b2IsValid(x) && b2IsValid(y); + } + */ float32 x, y; }; diff --git a/drivers/convex_decomp/b2Polygon.cpp b/drivers/convex_decomp/b2Polygon.cpp index 73955d3573..f45d98250a 100644 --- a/drivers/convex_decomp/b2Polygon.cpp +++ b/drivers/convex_decomp/b2Polygon.cpp @@ -189,7 +189,7 @@ void b2Polygon::MergeParallelEdges(float32 tolerance) { x = newx; y = newy; nVertices = newNVertices; -// printf("%d \n", newNVertices); + //printf("%d \n", newNVertices); } /* @@ -436,7 +436,6 @@ bool b2Polygon::IsSimple() { * For internal use. */ b2Polygon* b2Polygon::Add(b2Triangle& t) { -// float32 equalTol = .001f; // First, find vertices that connect int32 firstP = -1; int32 firstT = -1; @@ -963,7 +962,7 @@ int32 DecomposeConvex(b2Polygon* p, b2Polygon* results, int32 maxPolys) { tempP.Set(*p); ReversePolygon(tempP.x, tempP.y, tempP.nVertices); nTri = TriangulatePolygon(tempP.x, tempP.y, tempP.nVertices, triangulated); -// ReversePolygon(p->x, p->y, p->nVertices); //reset orientation + //ReversePolygon(p->x, p->y, p->nVertices); //reset orientation } else { //printf("It is not ccw \n"); nTri = TriangulatePolygon(p->x, p->y, p->nVertices, triangulated); @@ -997,7 +996,7 @@ void DecomposeConvexAndAddTo(b2Polygon* p, b2Body* bd, b2FixtureDef* prototype) if (p->nVertices < 3) return; b2Polygon* decomposed = new b2Polygon[p->nVertices - 2]; //maximum number of polys int32 nPolys = DecomposeConvex(p, decomposed, p->nVertices - 2); -// printf("npolys: %d",nPolys); + //printf("npolys: %d",nPolys); b2FixtureDef* pdarray = new b2FixtureDef[2*p->nVertices];//extra space in case of splits int32 extra = 0; for (int32 i = 0; i < nPolys; ++i) { @@ -1362,14 +1361,15 @@ b2Polygon TraceEdge(b2Polygon* p){ //printf("knode %d on node %d now has %d connections\n",k,j,knode->nConnected); //printf("Found duplicate point.\n"); } - //printf("Orphaning node at address %d\n",(int)jnode); - //for (int32 k=0; k<njConn; ++k) { - // if (jnode->connected[k]->IsConnectedTo(*jnode)) printf("Problem!!!\n"); - //} /* + printf("Orphaning node at address %d\n",(int)jnode); + for (int32 k=0; k<njConn; ++k) { + if (jnode->connected[k]->IsConnectedTo(*jnode)) printf("Problem!!!\n"); + } for (int32 k=0; k < njConn; ++k){ jnode->RemoveConnectionByIndex(k); - }*/ + } + */ jnode->nConnected = 0; } } diff --git a/drivers/convex_decomp/b2Polygon.h b/drivers/convex_decomp/b2Polygon.h index 36af2fd9d0..c466e28f7e 100644 --- a/drivers/convex_decomp/b2Polygon.h +++ b/drivers/convex_decomp/b2Polygon.h @@ -74,9 +74,11 @@ public: void print(){ printFormatted(); -// for (int32 i=0; i<nVertices; ++i){ -// printf("i: %d, x:%f, y:%f\n",i,x[i],y[i]); -// } + /* + for (int32 i=0; i<nVertices; ++i){ + printf("i: %d, x:%f, y:%f\n",i,x[i],y[i]); + } + */ } void printFormatted(){ diff --git a/drivers/convex_decomp/b2d_decompose.cpp b/drivers/convex_decomp/b2d_decompose.cpp index 82eade5b69..f84faaf586 100644 --- a/drivers/convex_decomp/b2d_decompose.cpp +++ b/drivers/convex_decomp/b2d_decompose.cpp @@ -144,7 +144,7 @@ static Vector< Vector<Vector2> > _b2d_decompose(const Vector<Vector2>& p_polygon Skip: ; } -// delete[] pdarray; + //delete[] pdarray; delete[] decomposed; delete p; return res;// pdarray; //needs to be deleted after body is created diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 2673c79232..fd3e5e508e 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -915,7 +915,7 @@ void RasterizerGLES2::texture_allocate(RID p_texture,int p_width, int p_height,I if (scale_textures) { texture->alloc_width = po2_width; texture->alloc_height = po2_height; - // print_line("scale because npo2: "+itos(npo2_textures_available)+" mm: "+itos(p_format&VS::TEXTURE_FLAG_MIPMAPS)+" "+itos(p_mipmap_count) ); + //print_line("scale because npo2: "+itos(npo2_textures_available)+" mm: "+itos(p_format&VS::TEXTURE_FLAG_MIPMAPS)+" "+itos(p_mipmap_count) ); } else { texture->alloc_width = texture->width; @@ -1910,7 +1910,7 @@ void RasterizerGLES2::mesh_add_surface(RID p_mesh,VS::PrimitiveType p_primitive, use_VBO=false; } -// surface->packed=pack_arrays && use_VBO; + //surface->packed=pack_arrays && use_VBO; int total_elem_size=0; @@ -3917,7 +3917,7 @@ void RasterizerGLES2::light_instance_set_shadow_transform(RID p_light_instance, ERR_FAIL_COND(!lighti); ERR_FAIL_COND(lighti->base->type!=VS::LIGHT_DIRECTIONAL); -// ERR_FAIL_INDEX(p_index,1); + //ERR_FAIL_INDEX(p_index,1); lighti->custom_projection[p_index]=p_camera; lighti->custom_transform[p_index]=p_transform; @@ -4043,8 +4043,10 @@ RID RasterizerGLES2::viewport_data_create() { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - //glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, - // GL_RGBA, GL_UNSIGNED_BYTE, NULL); + /* + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + */ glTexImage2D(GL_TEXTURE_2D, 0, format_luminance, 1, 1, 0, format_luminance_components, format_luminance_type, NULL); @@ -4295,11 +4297,11 @@ void RasterizerGLES2::begin_frame() { draw_next_frame=false; -// material_shader.set_uniform_default(MaterialShaderGLES2::SCREENZ_SCALE, Math::fmod(time, 3600.0)); + //material_shader.set_uniform_default(MaterialShaderGLES2::SCREENZ_SCALE, Math::fmod(time, 3600.0)); /* nehe ?*/ -// glClearColor(0,0,1,1); -// glClear(GL_COLOR_BUFFER_BIT); //should not clear if anything else cleared.. + //glClearColor(0,0,1,1); + //glClear(GL_COLOR_BUFFER_BIT); //should not clear if anything else cleared.. } void RasterizerGLES2::capture_viewport(Image* r_capture) { @@ -4329,7 +4331,7 @@ void RasterizerGLES2::capture_viewport(Image* r_capture) { PoolVector<uint8_t>::Write w = pixels.write(); glPixelStorei(GL_PACK_ALIGNMENT, 4); -// uint64_t time = OS::get_singleton()->get_ticks_usec(); + //uint64_t time = OS::get_singleton()->get_ticks_usec(); if (current_rt) { #ifdef GLEW_ENABLED @@ -4456,7 +4458,7 @@ void RasterizerGLES2::begin_shadow_map( RID p_light_instance, int p_shadow_pass opaque_render_list.clear(); alpha_render_list.clear(); -// pre_zpass_render_list.clear(); + //pre_zpass_render_list.clear(); light_instance_count=0; glCullFace(GL_FRONT); @@ -4614,7 +4616,7 @@ void RasterizerGLES2::_update_shader( Shader* p_shader) const { //print_line("compiled fragment: "+fragment_code); - // ("compiled fragment globals: "+fragment_globals); + //("compiled fragment globals: "+fragment_globals); //print_line("UCF: "+itos(p_shader->uniforms.size())); @@ -5128,9 +5130,11 @@ _FORCE_INLINE_ void RasterizerGLES2::_update_material_shader_params(Material *p_ ud.value=E->value().default_value; old_inuse=false; //if reverted to default, obviously did not work - //print_line("NEW: "+String(E->key())+" because: hasold-"+itos(old_mparams.has(E->key()))); - //if (old_mparams.has(E->key())) - // print_line(" told "+Variant::get_type_name(old_mparams[E->key()].value.get_type())+" tnew "+Variant::get_type_name(E->value().default_value.get_type())); + /* + print_line("NEW: "+String(E->key())+" because: hasold-"+itos(old_mparams.has(E->key()))); + if (old_mparams.has(E->key())) + print_line(" told "+Variant::get_type_name(old_mparams[E->key()].value.get_type())+" tnew "+Variant::get_type_name(E->value().default_value.get_type())); + */ } @@ -5216,12 +5220,14 @@ bool RasterizerGLES2::_setup_material(const Geometry *p_geometry,const Material if (p_material->shader_cache && p_material->shader_cache->valid) { - // // reduce amount of conditional compilations - // for(int i=0;i<_tex_version_count;i++) - // material_shader.set_conditional((MaterialShaderGLES2::Conditionals)_tex_version[i],false); + /* + // reduce amount of conditional compilations + for(int i=0;i<_tex_version_count;i++) + material_shader.set_conditional((MaterialShaderGLES2::Conditionals)_tex_version[i],false); + */ - // material_shader.set_custom_shader(p_material->shader_cache->custom_code_id); + //material_shader.set_custom_shader(p_material->shader_cache->custom_code_id); if (p_material->shader_version!=p_material->shader_cache->version) { //shader changed somehow, must update uniforms @@ -5241,7 +5247,7 @@ bool RasterizerGLES2::_setup_material(const Geometry *p_geometry,const Material if (E->get().index<0) continue; -// print_line(String(E->key())+": "+E->get().value); + //print_line(String(E->key())+": "+E->get().value); if (E->get().istexture) { //clearly a texture.. RID rid = E->get().value; @@ -5418,13 +5424,7 @@ void RasterizerGLES2::_setup_light(uint16_t p_light) { if (li->near_shadow_buffer) { glActiveTexture(GL_TEXTURE0+max_texture_units-1); - //if (read_depth_supported) { - - glBindTexture(GL_TEXTURE_2D,li->near_shadow_buffer->depth); - //} else { - - - //} + glBindTexture(GL_TEXTURE_2D,li->near_shadow_buffer->depth); material_shader.set_uniform(MaterialShaderGLES2::SHADOW_MATRIX,li->shadow_projection[0]); material_shader.set_uniform(MaterialShaderGLES2::SHADOW_TEXEL_SIZE,Vector2(1.0,1.0)/li->near_shadow_buffer->size); @@ -5944,8 +5944,10 @@ Error RasterizerGLES2::_setup_geometry(const Geometry *p_geometry, const Materia const Surface::ArrayData& ad=surf->array[i]; -// if (!gl_texcoord_shader[i]) -// continue; + /* + if (!gl_texcoord_shader[i]) + continue; + */ if (ad.size==0 || ! ad.bind) { glDisableVertexAttribArray(i); @@ -5957,7 +5959,7 @@ Error RasterizerGLES2::_setup_geometry(const Geometry *p_geometry, const Materia } glEnableVertexAttribArray(i); -// print_line("set: "+itos(i)+" - count: "+itos(ad.count)+" datatype: "+itos(ad.datatype)+" ofs: "+itos(ad.ofs)+" stride: "+itos(stride)+" total len: "+itos(surf->array_len)); + //print_line("set: "+itos(i)+" - count: "+itos(ad.count)+" datatype: "+itos(ad.datatype)+" ofs: "+itos(ad.ofs)+" stride: "+itos(stride)+" total len: "+itos(surf->array_len)); glVertexAttribPointer(i, ad.count, ad.datatype, ad.normalize, stride, &base[ad.ofs]); } @@ -6015,7 +6017,7 @@ void RasterizerGLES2::_render(const Geometry *p_geometry,const Material *p_mater glDrawElements(gl_primitive[s->primitive], s->index_array_len, (s->array_len>(1<<16))?GL_UNSIGNED_INT:GL_UNSIGNED_SHORT, s->index_array_local); } else { - // print_line("indices: "+itos(s->index_array_local) ); + //print_line("indices: "+itos(s->index_array_local) ); //print_line("VBO F: "+itos(s->format)+" C: "+itos(s->index_array_len)+" VC: "+itos(s->array_len)); @@ -6405,7 +6407,7 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans material_shader.set_conditional(MaterialShaderGLES2::SHADELESS,false); material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_OCTREE,false); material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_LIGHTMAP,false); -// material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_TEXTURE,false); + //material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_TEXTURE,false); } @@ -6956,7 +6958,7 @@ void RasterizerGLES2::_process_glow_bloom() { glUniform1i(copy_shader.get_uniform_location(CopyShaderGLES2::HDR_SOURCE),2); copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_EXPOSURE,float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_EXPOSURE])); copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_WHITE,float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_WHITE])); -// copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_WHITE,1.0); + //copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_WHITE,1.0); copy_shader.set_uniform(CopyShaderGLES2::HDR_GLOW_TRESHOLD,float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_GLOW_TRESHOLD])); copy_shader.set_uniform(CopyShaderGLES2::HDR_GLOW_SCALE,float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_GLOW_SCALE])); @@ -7040,7 +7042,7 @@ void RasterizerGLES2::_process_hdr() { _copy_screen_quad(); copy_shader.set_conditional(CopyShaderGLES2::USE_HDR_COPY,false); -// int passes = current_env->fx_param[VS::ENV_FX_PARAM_GLOW_BLUR_PASSES]; + //int passes = current_env->fx_param[VS::ENV_FX_PARAM_GLOW_BLUR_PASSES]; copy_shader.set_conditional(CopyShaderGLES2::USE_HDR_REDUCE,true); copy_shader.bind(); @@ -7345,7 +7347,7 @@ void RasterizerGLES2::end_scene() { print_line(String("setting camera to ")+camera_transform_inverse); */ -// material_shader.set_uniform_default(MaterialShaderGLES2::CAMERA_INVERSE, camera_transform_inverse); + //material_shader.set_uniform_default(MaterialShaderGLES2::CAMERA_INVERSE, camera_transform_inverse); current_depth_test=true; @@ -7391,7 +7393,7 @@ void RasterizerGLES2::end_scene() { _render_list_forward(&alpha_render_list,camera_transform,camera_transform_inverse,camera_projection,false,fragment_lighting,true); glColorMask(1,1,1,1); -// material_shader.set_conditional( MaterialShaderGLES2::USE_FOG,false); + //material_shader.set_conditional( MaterialShaderGLES2::USE_FOG,false); DEBUG_TEST_ERROR("Drawing Scene"); @@ -7534,8 +7536,8 @@ void RasterizerGLES2::end_scene() { if (GLOBAL_DEF("rasterizer/debug_shadow_maps",false)) { _debug_shadows(); } -// _debug_luminances(); -// _debug_samplers(); + //_debug_luminances(); + //_debug_samplers(); if (using_canvas_bg) { using_canvas_bg=false; @@ -7884,7 +7886,7 @@ void RasterizerGLES2::_debug_draw_shadows_type(Vector<ShadowBuffer>& p_shadows,P Size2 debug_size(128,128); -// Size2 debug_size(512,512); + //Size2 debug_size(512,512); int useblur=shadow_filter==SHADOW_FILTER_ESM?1:0; @@ -7989,7 +7991,7 @@ void RasterizerGLES2::_debug_shadows() { _debug_draw_shadows_type(near_shadow_buffers,ofs); -// _debug_draw_shadows_type(far_shadow_buffers,ofs); + //_debug_draw_shadows_type(far_shadow_buffers,ofs); } @@ -8841,11 +8843,11 @@ RID RasterizerGLES2::canvas_light_shadow_buffer_create(int p_width) { } else { // We'll use a RGBA texture into which we pack the depth info glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, cls->size, cls->height, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); + GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Attach the RGBA texture to FBO color attachment point glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, cls->depth, 0); + GL_TEXTURE_2D, cls->depth, 0); cls->rgba=cls->depth; // Allocate 16-bit depth buffer @@ -8853,7 +8855,7 @@ RID RasterizerGLES2::canvas_light_shadow_buffer_create(int p_width) { // Attach the render buffer as depth buffer - will be ignored glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, - GL_RENDERBUFFER, cls->rbo); + GL_RENDERBUFFER, cls->rbo); } @@ -8922,7 +8924,7 @@ void RasterizerGLES2::canvas_light_shadow_buffer_update(RID p_buffer, const Matr //light.basis.scale(Vector3(to_light.elements[0].length(),to_light.elements[1].length(),1)); - /// p_near=1; + / //p_near=1; CameraMatrix projection; { real_t fov = 90; @@ -9121,10 +9123,10 @@ void RasterizerGLES2::canvas_debug_viewport_shadows(CanvasLight* p_lights_with_s //print_line(" debug lights "); while(light) { - // print_line("debug light"); + //print_line("debug light"); if (light->shadow_buffer.is_valid()) { - // print_line("sb is valid"); + //print_line("sb is valid"); CanvasLightShadow * sb = canvas_light_shadow_owner.get(light->shadow_buffer); if (sb) { glActiveTexture(GL_TEXTURE0); @@ -9172,7 +9174,7 @@ void RasterizerGLES2::_canvas_item_render_commands(CanvasItem *p_item,CanvasItem case CanvasItem::Command::TYPE_RECT: { CanvasItem::CommandRect* rect = static_cast<CanvasItem::CommandRect*>(c); -// canvas_draw_rect(rect->rect,rect->region,rect->source,rect->flags&CanvasItem::CommandRect::FLAG_TILE,rect->flags&CanvasItem::CommandRect::FLAG_FLIP_H,rect->flags&CanvasItem::CommandRect::FLAG_FLIP_V,rect->texture,rect->modulate); + //canvas_draw_rect(rect->rect,rect->region,rect->source,rect->flags&CanvasItem::CommandRect::FLAG_TILE,rect->flags&CanvasItem::CommandRect::FLAG_FLIP_H,rect->flags&CanvasItem::CommandRect::FLAG_FLIP_V,rect->texture,rect->modulate); #if 0 int flags=0; @@ -9344,9 +9346,6 @@ void RasterizerGLES2::_canvas_item_setup_shader_params(CanvasItemMaterial *mater } else { glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height); } -// if (current_clip) { -// // print_line(" a clip "); -// } canvas_texscreen_used=true; } @@ -9925,8 +9924,8 @@ RID RasterizerGLES2::sampled_light_dp_create(int p_width,int p_height) { glGenTextures(1,&slight->texture); glBindTexture(GL_TEXTURE_2D, slight->texture); // for debug, but glitchy -// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -10046,7 +10045,7 @@ void RasterizerGLES2::free(const RID& p_rid) { // delete the texture Texture *texture = texture_owner.get(p_rid); -// glDeleteTextures( 1,&texture->tex_id ); + //glDeleteTextures( 1,&texture->tex_id ); _rinfo.texture_mem-=texture->total_data_size; texture_owner.free(p_rid); memdelete(texture); @@ -10232,9 +10231,11 @@ void RasterizerGLES2::free(const RID& p_rid) { glDeleteFramebuffers(1,&cls->fbo); glDeleteRenderbuffers(1,&cls->rbo); glDeleteTextures(1,&cls->depth); - //if (!read_depth_supported) { - // glDeleteTextures(1,&cls->rgba); - //} + /* + if (!read_depth_supported) { + glDeleteTextures(1,&cls->rgba); + } + */ canvas_light_shadow_owner.free(p_rid); memdelete(cls); @@ -10286,18 +10287,18 @@ bool RasterizerGLES2::ShadowBuffer::init(int p_size,bool p_use_depth) { } else { // We'll use a RGBA texture into which we pack the depth info glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size, size, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); + GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Attach the RGBA texture to FBO color attachment point glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, depth, 0); + GL_TEXTURE_2D, depth, 0); // Allocate 16-bit depth buffer glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, size,size); // Attach the render buffer as depth buffer - will be ignored glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, - GL_RENDERBUFFER, rbo); + GL_RENDERBUFFER, rbo); } @@ -10332,8 +10333,8 @@ bool RasterizerGLES2::ShadowBuffer::init(int p_size,bool p_use_depth) { } else { -// glGenRenderbuffers(1, &rbo); -// glBindRenderbuffer(GL_RENDERBUFFER, rbo); + //glGenRenderbuffers(1, &rbo); + //glBindRenderbuffer(GL_RENDERBUFFER, rbo); glGenTextures(1, &depth); glBindTexture(GL_TEXTURE_2D, depth); @@ -10383,20 +10384,21 @@ bool RasterizerGLES2::ShadowBuffer::init(int p_size,bool p_use_depth) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size, size, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); -// glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, size, size, 0, -// GL_DEPTH_COMPONENT16, GL_UNSIGNED_SHORT, NULL); + //glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, size, size, 0, + //GL_DEPTH_COMPONENT16, GL_UNSIGNED_SHORT, NULL); - // Attach the RGBA texture to FBO color attachment point - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, blur, 0); + // Attach the RGBA texture to FBO color attachment point + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, blur, 0); - // Allocate 16-bit depth buffer - /* glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, size, size); + // Allocate 16-bit depth buffer + /* + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, size, size); - // Attach the render buffer as depth buffer - will be ignored - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, - GL_RENDERBUFFER, rbo_blur); -*/ + // Attach the render buffer as depth buffer - will be ignored + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_RENDERBUFFER, rbo_blur); + */ status = glCheckFramebufferStatus(GL_FRAMEBUFFER); OS::get_singleton()->print("Status: %x\n",status); glBindFramebuffer(GL_FRAMEBUFFER, 0); @@ -10502,7 +10504,7 @@ void RasterizerGLES2::_update_framebuffer() { #endif //color -// GLuint format_rgba = use_fp16_fb?_GL_RGBA16F_EXT:GL_RGBA; + //GLuint format_rgba = use_fp16_fb?_GL_RGBA16F_EXT:GL_RGBA; GLuint format_rgba = GL_RGBA; GLuint format_type = use_fp16_fb?_GL_HALF_FLOAT_OES:GL_UNSIGNED_BYTE; GLuint format_internal=GL_RGBA; @@ -10528,8 +10530,8 @@ void RasterizerGLES2::_update_framebuffer() { glTexImage2D(GL_TEXTURE_2D, 0, format_rgba, framebuffer.width, framebuffer.height, 0, format_internal, format_type, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, framebuffer.color, 0); @@ -10562,8 +10564,8 @@ void RasterizerGLES2::_update_framebuffer() { glTexImage2D(GL_TEXTURE_2D, 0, format_rgba, framebuffer.width, framebuffer.height, 0, format_internal, format_type, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -// glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, framebuffer.sample_color, 0); @@ -10730,9 +10732,9 @@ void RasterizerGLES2::_update_blur_buffer() { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size, size, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); + GL_RGBA, GL_UNSIGNED_BYTE, NULL); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, framebuffer.blur[i].color, 0); + GL_TEXTURE_2D, framebuffer.blur[i].color, 0); GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); @@ -10915,9 +10917,9 @@ void RasterizerGLES2::init() { framebuffer.fbo=0; framebuffer.width=0; framebuffer.height=0; -// framebuffer.buff16=false; -// framebuffer.blur[0].fbo=false; -// framebuffer.blur[1].fbo=false; + //framebuffer.buff16=false; + //framebuffer.blur[0].fbo=false; + //framebuffer.blur[1].fbo=false; framebuffer.active=false; @@ -10945,8 +10947,8 @@ void RasterizerGLES2::init() { use_depth24 =true; s3tc_supported = true; atitc_supported = false; -// use_texture_instancing=false; -// use_attribute_instancing=true; + //use_texture_instancing=false; + //use_attribute_instancing=true; use_texture_instancing=false; use_attribute_instancing=true; full_float_fb_supported=true; @@ -11017,8 +11019,10 @@ void RasterizerGLES2::init() { use_hw_skeleton_xform=vtf>0 && float_supported; float_linear_supported = extensions.has("GL_OES_texture_float_linear"); - //if (extensions.has("GL_QCOM_tiled_rendering")) - // use_hw_skeleton_xform=false; + /* + if (extensions.has("GL_QCOM_tiled_rendering")) + use_hw_skeleton_xform=false; + */ GLint mva; glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,&mva); if (vtf==0 && mva>8) { @@ -11195,7 +11199,7 @@ void RasterizerGLES2::set_extensions(const char *p_strings) { for(int i=0;i<strings.size();i++) { extensions.insert(strings[i]); -// print_line(strings[i]); + //print_line(strings[i]); } } diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index adb9fe0e83..247a35141e 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -435,7 +435,7 @@ String ShaderCompilerGLES2::dump_node_code(SL::Node *p_node,int p_level,bool p_a //create the call to sample the screen, and clamp it uses_texpos=true; code="get_texpos("+dump_node_code(onode->arguments[1],p_level)+""; -// code="get_texpos(gl_ProjectionMatrixInverse * texture2D( depth_texture, clamp(("+dump_node_code(onode->arguments[1],p_level)+").xy,vec2(0.0),vec2(1.0))*gl_LightSource[5].specular.zw+gl_LightSource[5].specular.xy)"; + //code="get_texpos(gl_ProjectionMatrixInverse * texture2D( depth_texture, clamp(("+dump_node_code(onode->arguments[1],p_level)+").xy,vec2(0.0),vec2(1.0))*gl_LightSource[5].specular.zw+gl_LightSource[5].specular.xy)"; //code="(texture2D( screen_texture, ("+dump_node_code(onode->arguments[1],p_level)+").xy).rgb"; break; } else if (custom_h && callfunc=="cosh_custom") { @@ -571,12 +571,13 @@ Error ShaderCompilerGLES2::compile_node(SL::ProgramNode *p_program) { global_code+=uline; if (uniforms) { - //if (uniforms->has(E->key())) { - // //repeated uniform, error - // ERR_EXPLAIN("Uniform already exists from other shader: "+String(E->key())); - // ERR_FAIL_COND_V(uniforms->has(E->key()),ERR_ALREADY_EXISTS); -// -// } + /* + if (uniforms->has(E->key())) { + //repeated uniform, error + ERR_EXPLAIN("Uniform already exists from other shader: "+String(E->key())); + ERR_FAIL_COND_V(uniforms->has(E->key()),ERR_ALREADY_EXISTS); + } + */ SL::Uniform u = E->get(); u.order+=ubase; uniforms->insert(E->key(),u); @@ -812,8 +813,8 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["VAR1"]="var1_interp"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["VAR2"]="var2_interp"; -// mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SCREEN_POS"]="SCREEN_POS"; -// mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SCREEN_SIZE"]="SCREEN_SIZE"; + //mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SCREEN_POS"]="SCREEN_POS"; + //mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SCREEN_SIZE"]="SCREEN_SIZE"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["INSTANCE_ID"]="instance_id"; mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["TIME"]="time"; diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp index 2ee89e9895..97c31dfc1c 100644 --- a/drivers/gles2/shader_gles2.cpp +++ b/drivers/gles2/shader_gles2.cpp @@ -561,7 +561,7 @@ ShaderGLES2::Version* ShaderGLES2::get_current_version() { v.uniform_location[j]=glGetUniformLocation(v.id,uniform_names[j]); - // print_line("uniform "+String(uniform_names[j])+" location "+itos(v.uniform_location[j])); + //print_line("uniform "+String(uniform_names[j])+" location "+itos(v.uniform_location[j])); } // set texture uniforms diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index eeab42ee64..4bcebbd69d 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -392,7 +392,7 @@ LIGHT_SHADER_CODE //use lighting #endif -// color.rgb*=color.a; + //color.rgb*=color.a; gl_FragColor = color; diff --git a/drivers/gles2/shaders/material.glsl b/drivers/gles2/shaders/material.glsl index e5be25757d..704a22c5d1 100644 --- a/drivers/gles2/shaders/material.glsl +++ b/drivers/gles2/shaders/material.glsl @@ -820,7 +820,7 @@ void main() { vec3 binormal = normalize(binormal_interp)*side; vec3 tangent = normalize(tangent_interp)*side; #endif -// vec3 normal = abs(normalize(normal_interp))*side; + //vec3 normal = abs(normalize(normal_interp))*side; vec3 normal = normalize(normal_interp)*side; #if defined(ENABLE_SCREEN_UV) vec2 screen_uv = gl_FragCoord.xy*screen_uv_mult; @@ -989,7 +989,7 @@ FRAGMENT_SHADER_CODE #ifdef LIGHT_USE_PSSM -// if (vertex_interp.z > light_pssm_split) { + //if (vertex_interp.z > light_pssm_split) { #if 0 highp vec3 splane = vec3(0.0,0.0,0.0); @@ -1261,12 +1261,12 @@ LIGHT_SHADER_CODE vec3 ambient = const_light_mult*ambient_light*diffuse.rgb; # if defined(LIGHT_TYPE_OMNI) || defined (LIGHT_TYPE_SPOT) -// ambient*=diffuse_interp.a; //attenuation affects ambient too + //ambient*=diffuse_interp.a; //attenuation affects ambient too # endif -// diffuse.rgb=(diffuse.rgb * diffuse_interp.rgb + specular * specular_interp)*shadow_attenuation + ambient; -// diffuse.rgb+=emission * const_light_mult; + //diffuse.rgb=(diffuse.rgb * diffuse_interp.rgb + specular * specular_interp)*shadow_attenuation + ambient; + //diffuse.rgb+=emission * const_light_mult; diffuse.rgb=(diffuse.rgb * diffuse_interp.rgb + specular * specular_interp)*shadow_attenuation + ambient; diffuse.rgb+=emission * const_light_mult; diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 3c3768be67..e658fbbe88 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -147,7 +147,7 @@ void RasterizerCanvasGLES3::canvas_begin(){ -// state.canvas_shader.set_uniform(CanvasShaderGLES3::PROJECTION_MATRIX,state.vp); + //state.canvas_shader.set_uniform(CanvasShaderGLES3::PROJECTION_MATRIX,state.vp); //state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX,Transform()); //state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,Transform()); @@ -743,9 +743,6 @@ void RasterizerGLES2::_canvas_item_setup_shader_params(CanvasItemMaterial *mater } else { glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height); } -// if (current_clip) { -// // print_line(" a clip "); -// } canvas_texscreen_used=true; } @@ -1193,10 +1190,10 @@ void RasterizerCanvasGLES3::canvas_debug_viewport_shadows(Light* p_lights_with_s while(light) { - // print_line("debug light"); + //print_line("debug light"); if (light->shadow_buffer.is_valid()) { - // print_line("sb is valid"); + //print_line("sb is valid"); RasterizerStorageGLES3::CanvasLightShadow * sb = storage->canvas_light_shadow_owner.get(light->shadow_buffer); if (sb) { glBindTexture(GL_TEXTURE_2D,sb->distance); @@ -1253,7 +1250,7 @@ void RasterizerCanvasGLES3::canvas_light_shadow_buffer_update(RID p_buffer, cons //light.basis.scale(Vector3(to_light.elements[0].length(),to_light.elements[1].length(),1)); - /// p_near=1; + //p_near=1; CameraMatrix projection; { real_t fov = 90; diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index efad6c7e55..b7616db8b1 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -300,9 +300,9 @@ void RasterizerGLES3::end_frame(){ glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, 0, vtx ); -// glBindBuffer(GL_ARRAY_BUFFER,canvas->data.canvas_quad_vertices); -// glEnableVertexAttribArray(VS::ARRAY_VERTEX); -// glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, 0, 0 ); + //glBindBuffer(GL_ARRAY_BUFFER,canvas->data.canvas_quad_vertices); + //glEnableVertexAttribArray(VS::ARRAY_VERTEX); + //glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, 0, 0 ); glBindVertexArray(canvas->data.canvas_quad_array); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 5e0f439e3e..a026199bc7 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1102,10 +1102,10 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material* p_m glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); else glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); - */ - //if (p_material->line_width) - // glLineWidth(p_material->line_width); + if (p_material->line_width) + glLineWidth(p_material->line_width); + */ #if 0 //blend mode @@ -2067,8 +2067,10 @@ void RasterizerSceneGLES3::_add_geometry( RasterizerStorageGLES3::Geometry* p_g } } - //if (e->geometry->type==RasterizerStorageGLES3::Geometry::GEOMETRY_MULTISURFACE) - // e->sort_flags|=RenderList::SORT_FLAG_INSTANCING; + /* + if (e->geometry->type==RasterizerStorageGLES3::Geometry::GEOMETRY_MULTISURFACE) + e->sort_flags|=RenderList::SORT_FLAG_INSTANCING; + */ if (mirror) { @@ -3949,9 +3951,10 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C if (env && env->bg_mode==VS::ENV_BG_SKYBOX) { - //if (use_mrt) { - // glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); //switch to alpha fbo for skybox, only diffuse/ambient matters - // + /* + if (use_mrt) { + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); //switch to alpha fbo for skybox, only diffuse/ambient matters + */ _draw_skybox(skybox,p_cam_projection,p_cam_transform,storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP],env->skybox_scale); } @@ -3963,7 +3966,7 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C //_render_list_forward(&alpha_render_list,camera_transform,camera_transform_inverse,camera_projection,false,fragment_lighting,true); //glColorMask(1,1,1,1); -// state.scene_shader.set_conditional( SceneShaderGLES3::USE_FOG,false); + //state.scene_shader.set_conditional( SceneShaderGLES3::USE_FOG,false); if (use_mrt) { @@ -4016,7 +4019,7 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C storage->canvas->canvas_begin(); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D,exposure_shrink[4].color); -// glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->exposure.color); + //glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->exposure.color); storage->canvas->draw_generic_textured_rect(Rect2(0,0,storage->frame.current_rt->width/16,storage->frame.current_rt->height/16),Rect2(0,0,1,1)); } @@ -4189,8 +4192,8 @@ void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const C if (GLOBAL_DEF("rasterizer/debug_shadow_maps",false)) { _debug_shadows(); } -// _debug_luminances(); -// _debug_samplers(); + //_debug_luminances(); + //_debug_samplers(); if (using_canvas_bg) { using_canvas_bg=false; diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 26b9aeada4..97872226a4 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -676,7 +676,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].renames["AO"]="ao"; actions[VS::SHADER_SPATIAL].renames["EMISSION"]="emission"; actions[VS::SHADER_SPATIAL].renames["DISCARD"]="_discard"; -// actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2; + //actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2; actions[VS::SHADER_SPATIAL].renames["POINT_COORD"]="gl_PointCoord"; diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp index 13b2160ec6..42a9f19671 100644 --- a/drivers/gles3/shader_gles3.cpp +++ b/drivers/gles3/shader_gles3.cpp @@ -573,7 +573,7 @@ ShaderGLES3::Version* ShaderGLES3::get_current_version() { v.uniform_location[j]=glGetUniformLocation(v.id,uniform_names[j]); - // print_line("uniform "+String(uniform_names[j])+" location "+itos(v.uniform_location[j])); + //print_line("uniform "+String(uniform_names[j])+" location "+itos(v.uniform_location[j])); } // set texture uniforms @@ -720,7 +720,7 @@ void ShaderGLES3::setup(const char** p_conditional_defines, int p_conditional_co } else { fragment_code3=code3.substr(0,cpos).ascii(); - // print_line("CODE3:\n"+String(fragment_code3.get_data())); + //print_line("CODE3:\n"+String(fragment_code3.get_data())); fragment_code4 = code3.substr(cpos+light_code_tag.length(),code3.length()).ascii(); //print_line("CODE4:\n"+String(fragment_code4.get_data())); } diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index cf2e0f776f..e6c72da8f1 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -449,7 +449,7 @@ LIGHT_SHADER_CODE //use lighting #endif -// color.rgb*=color.a; + //color.rgb*=color.a; frag_color = color; } diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index c5af010c96..66123193e6 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -681,11 +681,13 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 bino splane.z=1.0 - splane.z; - //if (clamp_rect.z<clamp_rect.w) { - // clamp_rect.x+=clamp_rect.z; - //} else { - // clamp_rect.y+=clamp_rect.w; - //} + /* + if (clamp_rect.z<clamp_rect.w) { + clamp_rect.x+=clamp_rect.z; + } else { + clamp_rect.y+=clamp_rect.w; + } + */ } diff --git a/drivers/gles3/shaders/ssao_blur.glsl b/drivers/gles3/shaders/ssao_blur.glsl index 31f3841a2a..ff852487c0 100644 --- a/drivers/gles3/shaders/ssao_blur.glsl +++ b/drivers/gles3/shaders/ssao_blur.glsl @@ -69,9 +69,11 @@ void main() { depth*=depth_divide; - //if (depth > camera_z_far*0.999) { - // discard;//skybox - //} + /* + if (depth > camera_z_far*0.999) { + discard;//skybox + } + */ float sum = texelFetch(source_ssao, ssC, 0).r; diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp index de095c20ac..51429f3416 100644 --- a/drivers/png/image_loader_png.cpp +++ b/drivers/png/image_loader_png.cpp @@ -134,7 +134,7 @@ Error ImageLoaderPNG::_load_image(void *rf_up,png_rw_ptr p_func,Image *p_image) } if (png_get_valid(png,info,PNG_INFO_tRNS)) { -// png_set_expand_gray_1_2_4_to_8(png); + //png_set_expand_gray_1_2_4_to_8(png); png_set_tRNS_to_alpha(png); update_info=true; } diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp index a798990449..850e5ab053 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.cpp +++ b/drivers/rtaudio/audio_driver_rtaudio.cpp @@ -104,11 +104,11 @@ Error AudioDriverRtAudio::init() { unsigned int target_number_of_buffers = 4; options.numberOfBuffers = target_number_of_buffers; -// options. -// RtAudioStreamFlags flags; /*!< A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE). */// -// unsigned int numberOfBuffers; /*!< Number of stream buffers. */ -// std::string streamName; /*!< A stream name (currently used only in Jack). */ -// int priority; /*!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). */ + //options. + //RtAudioStreamFlags flags; /*!< A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE). */// + //unsigned int numberOfBuffers; /*!< Number of stream buffers. */ + //std::string streamName; /*!< A stream name (currently used only in Jack). */ + //int priority; /*!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). */ parameters.firstChannel = 0; mix_rate = GLOBAL_DEF("audio/mix_rate",44100); diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 3bb30700db..a09cf80e6c 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -44,20 +44,20 @@ DirAccess *DirAccessUnix::create_fs() { return memnew( DirAccessUnix ); } -bool DirAccessUnix::list_dir_begin() { +Error DirAccessUnix::list_dir_begin() { list_dir_end(); //close any previous dir opening! -// char real_current_dir_name[2048]; //is this enough?! + //char real_current_dir_name[2048]; //is this enough?! //getcwd(real_current_dir_name,2048); //chdir(curent_path.utf8().get_data()); dir_stream = opendir(current_dir.utf8().get_data()); //chdir(real_current_dir_name); if (!dir_stream) - return true; //error! + return ERR_CANT_OPEN; //error! - return false; + return OK; } bool DirAccessUnix::file_exists(String p_file) { diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h index 324d2a379c..f075c48268 100644 --- a/drivers/unix/dir_access_unix.h +++ b/drivers/unix/dir_access_unix.h @@ -57,7 +57,7 @@ protected: public: - virtual bool list_dir_begin(); ///< This starts dir listing + virtual Error list_dir_begin(); ///< This starts dir listing virtual String get_next(); virtual bool current_is_dir() const; virtual bool current_is_hidden() const; diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 4d9ef6cdae..6adb3eea70 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -230,7 +230,7 @@ int PacketPeerUDPPosix::_get_socket() { } -void PacketPeerUDPPosix::set_send_address(const IP_Address& p_address,int p_port) { +void PacketPeerUDPPosix::set_dest_address(const IP_Address& p_address,int p_port) { peer_addr=p_address; peer_port=p_port; diff --git a/drivers/unix/packet_peer_udp_posix.h b/drivers/unix/packet_peer_udp_posix.h index 89b8886cf5..ead7174a9d 100644 --- a/drivers/unix/packet_peer_udp_posix.h +++ b/drivers/unix/packet_peer_udp_posix.h @@ -73,7 +73,7 @@ public: virtual IP_Address get_packet_address() const; virtual int get_packet_port() const; - virtual void set_send_address(const IP_Address& p_address,int p_port); + virtual void set_dest_address(const IP_Address& p_address,int p_port); static void make_default(); diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index f2a1417920..82f3115f4b 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -139,14 +139,14 @@ void StreamPeerTCPPosix::set_socket(int p_sockfd, IP_Address p_host, int p_port, peer_port = p_port; }; -Error StreamPeerTCPPosix::connect(const IP_Address& p_host, uint16_t p_port) { +Error StreamPeerTCPPosix::connect_to_host(const IP_Address& p_host, uint16_t p_port) { ERR_FAIL_COND_V( p_host == IP_Address(), ERR_INVALID_PARAMETER); sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); if (sockfd == -1) { ERR_PRINT("Socket creation failed!"); - disconnect(); + disconnect_from_host(); //perror("socket"); return FAILED; }; @@ -165,7 +165,7 @@ Error StreamPeerTCPPosix::connect(const IP_Address& p_host, uint16_t p_port) { if (::connect(sockfd, (struct sockaddr *)&their_addr,addr_size) == -1 && errno != EINPROGRESS) { ERR_PRINT("Connection to remote host failed!"); - disconnect(); + disconnect_from_host(); return FAILED; }; @@ -217,7 +217,7 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, if (errno != EAGAIN) { perror("shit?"); - disconnect(); + disconnect_from_host(); ERR_PRINT("Server disconnected!\n"); return FAILED; }; @@ -243,7 +243,7 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, Error StreamPeerTCPPosix::read(uint8_t* p_buffer, int p_bytes,int &r_received, bool p_block) { - if (!is_connected()) { + if (!is_connected_to_host()) { return FAILED; }; @@ -274,7 +274,7 @@ Error StreamPeerTCPPosix::read(uint8_t* p_buffer, int p_bytes,int &r_received, b if (errno != EAGAIN) { perror("shit?"); - disconnect(); + disconnect_from_host(); ERR_PRINT("Server disconnected!\n"); return FAILED; }; @@ -308,12 +308,12 @@ Error StreamPeerTCPPosix::read(uint8_t* p_buffer, int p_bytes,int &r_received, b void StreamPeerTCPPosix::set_nodelay(bool p_enabled) { - ERR_FAIL_COND(!is_connected()); + ERR_FAIL_COND(!is_connected_to_host()); int flag=p_enabled?1:0; setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, sizeof(int)); } -bool StreamPeerTCPPosix::is_connected() const { +bool StreamPeerTCPPosix::is_connected_to_host() const { if (status == STATUS_NONE || status == STATUS_ERROR) { @@ -336,7 +336,7 @@ StreamPeerTCP::Status StreamPeerTCPPosix::get_status() const { }; -void StreamPeerTCPPosix::disconnect() { +void StreamPeerTCPPosix::disconnect_from_host() { if (sockfd != -1) close(sockfd); @@ -398,7 +398,7 @@ StreamPeerTCPPosix::StreamPeerTCPPosix() { StreamPeerTCPPosix::~StreamPeerTCPPosix() { - disconnect(); + disconnect_from_host(); }; #endif diff --git a/drivers/unix/stream_peer_tcp_posix.h b/drivers/unix/stream_peer_tcp_posix.h index 1df509cac4..e0091d55b7 100644 --- a/drivers/unix/stream_peer_tcp_posix.h +++ b/drivers/unix/stream_peer_tcp_posix.h @@ -59,7 +59,7 @@ protected: public: - virtual Error connect(const IP_Address& p_host, uint16_t p_port); + virtual Error connect_to_host(const IP_Address& p_host, uint16_t p_port); virtual Error put_data(const uint8_t* p_data,int p_bytes); virtual Error put_partial_data(const uint8_t* p_data,int p_bytes, int &r_sent); @@ -74,9 +74,9 @@ public: virtual IP_Address get_connected_host() const; virtual uint16_t get_connected_port() const; - virtual bool is_connected() const; + virtual bool is_connected_to_host() const; virtual Status get_status() const; - virtual void disconnect(); + virtual void disconnect_from_host(); virtual void set_nodelay(bool p_enabled); diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index c7082dbc7c..14742aa420 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -59,7 +59,7 @@ struct DirAccessWindowsPrivate { // CreateFolderAsync -bool DirAccessWindows::list_dir_begin() { +Error DirAccessWindows::list_dir_begin() { _cisdir=false; _cishidden=false; @@ -67,7 +67,7 @@ bool DirAccessWindows::list_dir_begin() { list_dir_end(); p->h = FindFirstFileExW((current_dir+"\\*").c_str(), FindExInfoStandard, &p->fu, FindExSearchNameMatch, NULL, 0); - return (p->h==INVALID_HANDLE_VALUE); + return (p->h==INVALID_HANDLE_VALUE) ? ERR_CANT_OPEN : OK; } diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h index 4d9fdd08e2..f4105b7bc9 100644 --- a/drivers/windows/dir_access_windows.h +++ b/drivers/windows/dir_access_windows.h @@ -62,7 +62,7 @@ class DirAccessWindows : public DirAccess { public: - virtual bool list_dir_begin(); ///< This starts dir listing + virtual Error list_dir_begin(); ///< This starts dir listing virtual String get_next(); virtual bool current_is_dir() const; virtual bool current_is_hidden() const; diff --git a/main/input_default.cpp b/main/input_default.cpp index 61a3a7da7e..50b0006438 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -307,7 +307,7 @@ void InputDefault::parse_input_event(const InputEvent& p_event) { if (p_event.key.scancode==0) break; - // print_line(p_event); + //print_line(p_event); if (p_event.key.pressed) keys_pressed.insert(p_event.key.scancode); @@ -465,7 +465,7 @@ Point2 InputDefault::get_mouse_pos() const { return mouse_pos; } -Point2 InputDefault::get_mouse_speed() const { +Point2 InputDefault::get_last_mouse_speed() const { return mouse_speed_track.speed; } diff --git a/main/input_default.h b/main/input_default.h index 33a852ab10..cab505644d 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -196,7 +196,7 @@ public: virtual Vector3 get_gyroscope() const; virtual Point2 get_mouse_pos() const; - virtual Point2 get_mouse_speed() const; + virtual Point2 get_last_mouse_speed() const; virtual int get_mouse_button_mask() const; virtual void warp_mouse_pos(const Vector2& p_to); diff --git a/main/main.cpp b/main/main.cpp index a6fff517bd..e535da3e28 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -239,7 +239,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas while (I) { I->get()=unescape_cmdline(I->get().strip_escapes()); -// print_line("CMD: "+I->get()); + //print_line("CMD: "+I->get()); I=I->next(); } @@ -711,7 +711,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas input_map->load_from_globals(); //keys for game if (video_driver=="") // specified in engine.cfg - video_driver=_GLOBAL_DEF("display/driver/name",Variant((const char*)OS::get_singleton()->get_video_driver_name(0))); + video_driver=GLOBAL_DEF("display/driver/name",Variant((const char*)OS::get_singleton()->get_video_driver_name(0))); if (!force_res && use_custom_res && globals->has("display/window/width")) video_mode.width=globals->get("display/window/width"); @@ -879,10 +879,12 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas // Note 1: *zip_packed_data live into *packed_data // Note 2: PackedData::~PackedData destroy this. -//#ifdef MINIZIP_ENABLED -// if (zip_packed_data) -// memdelete( zip_packed_data ); -//#endif +/* +#ifdef MINIZIP_ENABLED + if (zip_packed_data) + memdelete( zip_packed_data ); +#endif +*/ unregister_core_driver_types(); unregister_core_types(); @@ -955,7 +957,7 @@ Error Main::setup2() { VisualServer::get_singleton()->set_boot_image(boot_logo, boot_bg,boot_logo_scale); #ifndef TOOLS_ENABLED //no tools, so free the boot logo (no longer needed) - // GlobalConfig::get_singleton()->set("application/boot_logo",Image()); + //GlobalConfig::get_singleton()->set("application/boot_logo",Image()); #endif } else { @@ -1009,7 +1011,7 @@ Error Main::setup2() { //print_line("use custom cursor"); Ref<Texture> cursor=ResourceLoader::load(GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image")); if (cursor.is_valid()) { - // print_line("loaded ok"); + //print_line("loaded ok"); Vector2 hotspot = GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image_hotspot"); Input::get_singleton()->set_custom_mouse_cursor(cursor,hotspot); } @@ -1587,9 +1589,10 @@ bool Main::iteration() { double step=(double)ticks_elapsed / 1000000.0; float frame_slice=1.0/Engine::get_singleton()->get_iterations_per_second(); -// if (time_accum+step < frame_slice) -// return false; - + /* + if (time_accum+step < frame_slice) + return false; + */ uint64_t fixed_process_ticks=0; uint64_t idle_process_ticks=0; @@ -1635,8 +1638,10 @@ bool Main::iteration() { time_accum-=frame_slice; message_queue->flush(); - //if (AudioServer::get_singleton()) - // AudioServer::get_singleton()->update(); + /* + if (AudioServer::get_singleton()) + AudioServer::get_singleton()->update(); + */ fixed_process_ticks=MAX(fixed_process_ticks,OS::get_singleton()->get_ticks_usec()-fixed_begin); // keep the largest one for reference fixed_process_max=MAX(OS::get_singleton()->get_ticks_usec()-fixed_begin,fixed_process_max); @@ -1692,7 +1697,7 @@ bool Main::iteration() { } - // x11_delay_usec(10000); + //x11_delay_usec(10000); frames++; Engine::get_singleton()->_idle_frames++; diff --git a/main/tests/test_containers.cpp b/main/tests/test_containers.cpp index 4bc297d0ba..2711d107e4 100644 --- a/main/tests/test_containers.cpp +++ b/main/tests/test_containers.cpp @@ -55,7 +55,6 @@ MainLoop * test() { { -// static const int size = 16; Image img; img.create(default_mouse_cursor_xpm); @@ -78,7 +77,7 @@ MainLoop * test() { for (int i=0;i<1100;i++) { int num=i;//(int)Math::random(0,1024); - // print_line("inserting "+itos(num)); + //print_line("inserting "+itos(num)); set.insert( num ); } diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 1ee27ec661..4f4e76d517 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -1026,7 +1026,7 @@ MainLoop* test(TestType p_test) { } else if (p_test==TEST_BYTECODE) { Vector<uint8_t> buf = GDTokenizerBuffer::parse_code_string(code); - String dst = test.basename()+".gdc"; + String dst = test.get_basename()+".gdc"; FileAccess *fw = FileAccess::open(dst,FileAccess::WRITE); fw->store_buffer(buf.ptr(),buf.size()); memdelete(fw); diff --git a/main/tests/test_gui.cpp b/main/tests/test_gui.cpp index ab3df3b022..b0ebc20180 100644 --- a/main/tests/test_gui.cpp +++ b/main/tests/test_gui.cpp @@ -46,7 +46,7 @@ #include "scene/gui/tab_container.h" #include "scene/gui/tree.h" #include "scene/gui/rich_text_label.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "io/image_loader.h" #include "print_string.h" #include "scene/2d/sprite.h" @@ -97,7 +97,7 @@ public: Sprite *sp = memnew( Sprite ); sp->set_texture( vp->get_render_target_texture() ); -// sp->set_texture( ResourceLoader::load("res://ball.png") ); + //sp->set_texture( ResourceLoader::load("res://ball.png") ); sp->set_pos(Point2(300,300)); get_root()->add_child(sp); diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp index f3d9ddba87..89513b81d9 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -596,7 +596,7 @@ MainLoop* test() { { - // print_line("NUM: "+itos(237641278346127)); + //print_line("NUM: "+itos(237641278346127)); print_line("NUM: "+itos(-128)); return NULL; diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp index ea5b1cae85..ea98da34ca 100644 --- a/main/tests/test_physics.cpp +++ b/main/tests/test_physics.cpp @@ -358,9 +358,9 @@ public: gxf.basis.scale(Vector3(1.4,0.4,1.4)); gxf.origin=Vector3(-2,1,-2); make_grid(5,5,2.5,1,gxf); - // create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,gxf); + //create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,gxf); //create_static_plane( Plane( Vector3(0,1,0), -2) ); -// test_joint(); + //test_joint(); test_fall(); //test_joint(); diff --git a/main/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp index 2074d532b1..8a6a8c78f9 100644 --- a/main/tests/test_physics_2d.cpp +++ b/main/tests/test_physics_2d.cpp @@ -218,8 +218,10 @@ class TestPhysics2DMainLoop : public MainLoop { void _do_ray_query() { -// Physics2DServer *ps = Physics2DServer::get_singleton(); - // ps->query_intersection_segment(ray_query,ray_from,ray_to); + /* + Physics2DServer *ps = Physics2DServer::get_singleton(); + ps->query_intersection_segment(ray_query,ray_from,ray_to); + */ } @@ -273,7 +275,7 @@ protected: ps->body_set_continuous_collision_detection_mode(body,Physics2DServer::CCD_MODE_CAST_SHAPE); ps->body_set_state(body,Physics2DServer::BODY_STATE_TRANSFORM,p_xform); -// print_line("add body with xform: "+p_xform); + //print_line("add body with xform: "+p_xform); RID sprite = vs->canvas_item_create(); vs->canvas_item_set_parent(sprite,canvas); vs->canvas_item_set_transform(sprite,p_xform); @@ -281,8 +283,8 @@ protected: vs->canvas_item_add_texture_rect(sprite,Rect2(-imgsize/2.0,imgsize),body_shape_data[p_shape].image); ps->body_set_force_integration_callback(body,this,"_body_moved",sprite); -// RID q = ps->query_create(this,"_body_moved",sprite); -// ps->query_body_state(q,body); + //RID q = ps->query_create(this,"_body_moved",sprite); + //ps->query_body_state(q,body); return body; } @@ -409,10 +411,12 @@ public: }; Physics2DServer::ShapeType type = types[i%4]; -// type=Physics2DServer::SHAPE_SEGMENT; + //type=Physics2DServer::SHAPE_SEGMENT; _add_body(type,Transform2D(i*0.8,Point2(152+i*40,100-40*i))); - //if (i==0) - // ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC); + /* + if (i==0) + ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC); + */ } //RID b= _add_body(Physics2DServer::SHAPE_CIRCLE,Transform2D(0,Point2(101,140))); diff --git a/main/tests/test_render.cpp b/main/tests/test_render.cpp index 3049ba7d45..7380c1ff6a 100644 --- a/main/tests/test_render.cpp +++ b/main/tests/test_render.cpp @@ -192,7 +192,6 @@ public: */ RID lightaux; - //* lightaux = vs->light_create( VisualServer::LIGHT_DIRECTIONAL ); //vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,0.0) ); vs->light_set_color( lightaux, Color(1.0,1.0,1.0) ); @@ -203,17 +202,14 @@ public: lla.set_look_at(Vector3(),Vector3(-0.000000,-0.836026,-0.548690),Vector3(0,1,0)); vs->instance_set_transform( light, lla ); - // */ - //* lightaux = vs->light_create( VisualServer::LIGHT_OMNI ); -// vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,1.0) ); + //vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,1.0) ); vs->light_set_color( lightaux, Color(1.0,1.0,0.0) ); vs->light_set_param( lightaux, VisualServer::LIGHT_PARAM_RANGE, 4 ); vs->light_set_param( lightaux, VisualServer::LIGHT_PARAM_ENERGY, 8 ); //vs->light_set_shadow( lightaux, true ); //light = vs->instance_create( lightaux ); - // */ ofs=0; quit=false; diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp index d99ad4476f..a4a8ceb072 100644 --- a/main/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -252,7 +252,7 @@ bool test_13() { /* how can i embed UTF in here? */ static const CharType ustr[] = { 0x304A , 0x360F, 0x3088, 0x3046, 0 }; -// static const wchar_t ustr[] = { 'P', 0xCE, 'p',0xD3, 0 }; + //static const wchar_t ustr[] = { 'P', 0xCE, 'p',0xD3, 0 }; String s=ustr; OS::get_singleton()->print("\tUnicode: %ls\n",ustr); diff --git a/modules/chibi/cp_loader_it_samples.cpp b/modules/chibi/cp_loader_it_samples.cpp index 60db9b7f74..c736c99c0f 100644 --- a/modules/chibi/cp_loader_it_samples.cpp +++ b/modules/chibi/cp_loader_it_samples.cpp @@ -147,7 +147,7 @@ CPLoader::Error CPLoader_IT::load_sample(CPSample *p_sample) { p_sample->set_sample_data(samp_id); if (!samp_id.is_null()) { - // printf("Loaded ID: stereo: %i len %i 16bit %i\n",CPSampleManager::get_singleton()->is_stereo(samp_id), CPSampleManager::get_singleton()->get_size( samp_id), CPSampleManager::get_singleton()->is_16bits( samp_id) ); + //printf("Loaded ID: stereo: %i len %i 16bit %i\n",CPSampleManager::get_singleton()->is_stereo(samp_id), CPSampleManager::get_singleton()->get_size( samp_id), CPSampleManager::get_singleton()->is_16bits( samp_id) ); } CP_ERR_COND_V( file->eof_reached(),FILE_CORRUPTED ); diff --git a/modules/chibi/cp_loader_mod.cpp b/modules/chibi/cp_loader_mod.cpp index 4a47ce5c43..cfa3e34736 100644 --- a/modules/chibi/cp_loader_mod.cpp +++ b/modules/chibi/cp_loader_mod.cpp @@ -208,7 +208,7 @@ CPLoader::Error CPLoader_MOD::load_song(const char *p_file,CPSong *p_song,bool p uint8_t order_count=file->get_byte(); -// uint8_t loop_to=file->get_byte(); + //uint8_t loop_to=file->get_byte(); int pattern_count=0; diff --git a/modules/chibi/cp_loader_s3m.cpp b/modules/chibi/cp_loader_s3m.cpp index eb5fad12e1..4943e6d86c 100644 --- a/modules/chibi/cp_loader_s3m.cpp +++ b/modules/chibi/cp_loader_s3m.cpp @@ -102,7 +102,7 @@ void CPLoader_S3M::set_header() { song->set_name( header.songname ); -// song->variables.filename= + //song->variables.filename= song->set_row_highlight_minor( 4 ); song->set_row_highlight_major( 16 ); @@ -135,7 +135,7 @@ CPLoader::Error CPLoader_S3M::load_sample(CPSample *p_sample) { uint32_t samplepos=(uint32_t)file->get_byte() << 16; samplepos|=file->get_word(); samplepos*=16; -// printf("sample at %i\n",samplepos); + //printf("sample at %i\n",samplepos); /**/ int sample_size=file->get_dword(); @@ -178,7 +178,7 @@ CPLoader::Error CPLoader_S3M::load_sample(CPSample *p_sample) { if ((type!=1) || scrs[0]!='S' || scrs[1]!='C' || scrs[2]!='R' || scrs[3]!='S' ) { -// printf("type: %i, %c%c%c%c\n",type,scrs[0],scrs[1],scrs[2],scrs[3]); + //printf("type: %i, %c%c%c%c\n",type,scrs[0],scrs[1],scrs[2],scrs[3]); CP_PRINTERR("Not an S3M CPSample!"); return FILE_CORRUPTED; } diff --git a/modules/chibi/cp_loader_xm.cpp b/modules/chibi/cp_loader_xm.cpp index 65c7bc7ee1..cbd883642c 100644 --- a/modules/chibi/cp_loader_xm.cpp +++ b/modules/chibi/cp_loader_xm.cpp @@ -399,7 +399,7 @@ CPLoader::Error CPLoader_XM::load_song(const char *p_file,CPSong *p_song,bool p_ instrument.set_name( instrname ); -// printf("Header Len: %i, CPInstrument %i, %i samples , name: s,\n",hsize,i,sampnum,instrname); + //printf("Header Len: %i, CPInstrument %i, %i samples , name: s,\n",hsize,i,sampnum,instrname); if (sampnum==0) { //aux=file->get_dword(); //Why is this for? -- for nothing, skipped diff --git a/modules/chibi/cp_player_data.h b/modules/chibi/cp_player_data.h index c59df5f0d9..2157319855 100644 --- a/modules/chibi/cp_player_data.h +++ b/modules/chibi/cp_player_data.h @@ -124,7 +124,7 @@ class CPPlayer { CPInstrument* instrument_ptr; CPSample* sample_ptr; -// Sample_Data *sample_data; + //Sample_Data *sample_data; int32_t period; diff --git a/modules/chibi/cp_player_data_effects.cpp b/modules/chibi/cp_player_data_effects.cpp index 6c774afb16..56fb7a2905 100644 --- a/modules/chibi/cp_player_data_effects.cpp +++ b/modules/chibi/cp_player_data_effects.cpp @@ -615,7 +615,7 @@ void CPPlayer::do_effect_S(int p_track) { break; case 8: {/* S8x set panning position */ -// if (pf->panflag) { + //if (pf->panflag) { if (inf<=8) inf<<=4; else inf*=17; control.channel[p_track].panning=control.channel[p_track].channel_panning=inf; diff --git a/modules/chibi/cp_player_data_events.cpp b/modules/chibi/cp_player_data_events.cpp index 7ec3f1931c..94a048ab2f 100644 --- a/modules/chibi/cp_player_data_events.cpp +++ b/modules/chibi/cp_player_data_events.cpp @@ -194,7 +194,7 @@ void CPPlayer::Voice_Control::update_info_from_master_channel() { reverb_send=master_channel->reverb_send; chorus_send=master_channel->chorus_send; -// last_note_type=master_channel->last_note_type; + //last_note_type=master_channel->last_note_type; sample_start_index=master_channel->sample_start_index; filter=master_channel->filter; @@ -262,7 +262,7 @@ void CPPlayer::update_mixer() { /* Start Envelopes */ if ( song->has_instruments() && ((v.kick==KICK_NOTE)||(v.kick==KICK_ENVELOPE))) { -// Voice_Control *carry=0; + //Voice_Control *carry=0; if (v.has_master_channel && v.master_channel->carry.maybe) { @@ -462,7 +462,7 @@ void CPPlayer::update_mixer() { } else { filter_env=pe_value+32; //max 64 -// printf("pitch envelope at %i",filter_env); + //printf("pitch envelope at %i",filter_env); } } @@ -602,17 +602,19 @@ void CPPlayer::handle_tick() { /* process pattern-delay. pf->patdly2 is the counter and pf->patdly is the command memory. */ -// if (control.pattern_delay_1) { - -// control.pattern_delay_2=control.pattern_delay_1; -// control.pattern_delay_1=0; -// } -// if (control.pattern_delay_2) { -// patterndelay active -// if (--control.pattern_delay_2) -// so turn back pf->patpos by 1 -// if (pf->patpos) pf->patpos--; -// } + /* + if (control.pattern_delay_1) { + + control.pattern_delay_2=control.pattern_delay_1; + control.pattern_delay_1=0; + } + if (control.pattern_delay_2) { + patterndelay active + if (--control.pattern_delay_2) + // so turn back pf->patpos by 1 + if (pf->patpos) pf->patpos--; + } + */ if (control.play_mode!=PLAY_NOTHING) { diff --git a/modules/chibi/cp_player_data_notes.cpp b/modules/chibi/cp_player_data_notes.cpp index 1bfe24bc20..189403343c 100644 --- a/modules/chibi/cp_player_data_notes.cpp +++ b/modules/chibi/cp_player_data_notes.cpp @@ -67,7 +67,7 @@ void CPPlayer::process_new_note(int p_track,uint8_t p_note) { // if there's real bool CPPlayer::process_new_instrument(int p_track,uint8_t p_instrument) { -// bool different_instrument=false; + //bool different_instrument=false; ERR_FAIL_INDEX_V(p_instrument,CPSong::MAX_INSTRUMENTS,false); if ( song->has_instruments() ) { diff --git a/modules/chibi/cp_player_data_utils.cpp b/modules/chibi/cp_player_data_utils.cpp index 1ee3f30b33..b99dbfcb99 100644 --- a/modules/chibi/cp_player_data_utils.cpp +++ b/modules/chibi/cp_player_data_utils.cpp @@ -111,8 +111,10 @@ int CPPlayer::find_empty_voice() { for (i=0;i<control.max_voices;i++) { /* allow us to take over a nonexisting sample */ -// if ((voice[i].s==NULL) -// return k; + /* + if ((voice[i].s==NULL) + return k; + */ if ((voice[i].kick==KICK_NOTHING)||(voice[i].kick==KICK_ENVELOPE)) { diff --git a/modules/chibi/event_stream_chibi.cpp b/modules/chibi/event_stream_chibi.cpp index 73d1c01e33..ab34080525 100644 --- a/modules/chibi/event_stream_chibi.cpp +++ b/modules/chibi/event_stream_chibi.cpp @@ -408,8 +408,8 @@ void CPMixerImpl::set_voice_chorus_send(int p_voice_index,int p_chorus){ void CPMixerImpl::set_reverb_mode(ReverbMode p_mode){ -// Voice &v=voices[p_voice_index]; -// ERR_FAIL_COND(v.channel==AudioMixer::INVALID_CHANNEL); + //Voice &v=voices[p_voice_index]; + //ERR_FAIL_COND(v.channel==AudioMixer::INVALID_CHANNEL); switch(p_mode) { case CPMixer::REVERB_MODE_STUDIO_SMALL: reverb_type=AudioMixer::REVERB_SMALL; break; case CPMixer::REVERB_MODE_STUDIO_MEDIUM: reverb_type=AudioMixer::REVERB_MEDIUM; break; @@ -422,8 +422,8 @@ void CPMixerImpl::set_reverb_mode(ReverbMode p_mode){ void CPMixerImpl::set_chorus_params(unsigned int p_delay_ms,unsigned int p_separation_ms,unsigned int p_depth_ms10,unsigned int p_speed_hz10){ -// Voice &v=voices[p_voice_index]; -// ERR_FAIL_COND(v.channel==AudioMixer::INVALID_CHANNEL); + //Voice &v=voices[p_voice_index]; + //ERR_FAIL_COND(v.channel==AudioMixer::INVALID_CHANNEL); } @@ -785,7 +785,7 @@ RES ResourceFormatLoaderChibi::load(const String &p_path, const String& p_origin if (r_error) *r_error=ERR_FILE_CANT_OPEN; - String el = p_path.extension().to_lower(); + String el = p_path.get_extension().to_lower(); CPFileAccessWrapperImpl f; @@ -849,7 +849,7 @@ bool ResourceFormatLoaderChibi::handles_type(const String& p_type) const { } String ResourceFormatLoaderChibi::get_resource_type(const String &p_path) const { - String el = p_path.extension().to_lower(); + String el = p_path.get_extension().to_lower(); if (el=="it" || el=="s3m" || el=="xm" || el=="mod") return "EventStreamChibi"; return ""; diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 1de98a6b1f..5295183c35 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -221,7 +221,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, if (!(flags&DDSD_MIPMAPCOUNT)) mipmaps=1; -// print_line("found format: "+String(dds_format_info[dds_format].name)); + //print_line("found format: "+String(dds_format_info[dds_format].name)); PoolVector<uint8_t> src_data; @@ -478,7 +478,7 @@ bool ResourceFormatDDS::handles_type(const String& p_type) const { String ResourceFormatDDS::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="dds") + if (p_path.get_extension().to_lower()=="dds") return "ImageTexture"; return ""; } diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index 43d9988de1..d10634e9ea 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -506,8 +506,10 @@ uint32_t NetworkedMultiplayerENet::_gen_unique_id() const { (uint32_t)OS::get_singleton()->get_unix_time(), hash ); hash = hash_djb2_one_32( (uint32_t)OS::get_singleton()->get_data_dir().hash64(), hash ); - //hash = hash_djb2_one_32( - // (uint32_t)OS::get_singleton()->get_unique_ID().hash64(), hash ); + /* + hash = hash_djb2_one_32( + (uint32_t)OS::get_singleton()->get_unique_ID().hash64(), hash ); + */ hash = hash_djb2_one_32( (uint32_t)((uint64_t)this), hash ); //rely on aslr heap hash = hash_djb2_one_32( diff --git a/modules/etc1/image_etc.cpp b/modules/etc1/image_etc.cpp index 845084fef7..36ff1b86df 100644 --- a/modules/etc1/image_etc.cpp +++ b/modules/etc1/image_etc.cpp @@ -138,13 +138,13 @@ static void _compress_etc(Image *p_img) { uint8_t *dst = &w[dst_data.size()-mmsize]; -// print_line("bh: "+itos(bh)+" bw: "+itos(bw)); + //print_line("bh: "+itos(bh)+" bw: "+itos(bw)); for(int y=0;y<bh;y++) { for(int x=0;x<bw;x++) { -// print_line("x: "+itos(x)+" y: "+itos(y)); + //print_line("x: "+itos(x)+" y: "+itos(y)); uint8_t block[4*4*4]; zeromem(block,4*4*4); diff --git a/modules/etc1/texture_loader_pkm.cpp b/modules/etc1/texture_loader_pkm.cpp index 42c9937b8f..e720e1fb4c 100644 --- a/modules/etc1/texture_loader_pkm.cpp +++ b/modules/etc1/texture_loader_pkm.cpp @@ -78,7 +78,7 @@ bool ResourceFormatPKM::handles_type(const String& p_type) const { String ResourceFormatPKM::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="pkm") + if (p_path.get_extension().to_lower()=="pkm") return "ImageTexture"; return ""; } diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 17a9c549b4..8e9e94cc48 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -1420,9 +1420,10 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode * GDFunction *gdfunc=NULL; - //if (String(p_func->name)=="") { //initializer func - // gdfunc = &p_script->initializer; - + /* + if (String(p_func->name)=="") { //initializer func + gdfunc = &p_script->initializer; + */ //} else { //regular func p_script->member_functions[func_name]=memnew(GDFunction); gdfunc = p_script->member_functions[func_name]; diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index 00b080190f..19472d3d46 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -364,10 +364,12 @@ static GDCompletionIdentifier _get_type_from_variant(const Variant& p_variant) { if (p_variant.get_type()==Variant::OBJECT) { Object *obj = p_variant; if (obj) { - //if (obj->cast_to<GDNativeClass>()) { - // t.obj_type=obj->cast_to<GDNativeClass>()->get_name(); - // t.value=Variant(); - //} else { + /* + if (obj->cast_to<GDNativeClass>()) { + t.obj_type=obj->cast_to<GDNativeClass>()->get_name(); + t.value=Variant(); + } else { + */ t.obj_type=obj->get_class(); //} } @@ -671,7 +673,7 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: if (!script.ends_with(".gd")) { //not a script, try find the script anyway, //may have some success - script=script.basename()+".gd"; + script=script.get_basename()+".gd"; } if (FileAccess::exists(script)) { @@ -1168,7 +1170,7 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const if (!script.ends_with(".gd")) { //not a script, try find the script anyway, //may have some success - script=script.basename()+".gd"; + script=script.get_basename()+".gd"; } if (FileAccess::exists(script)) { @@ -1771,7 +1773,7 @@ static void _find_type_arguments(GDCompletionContext& context,const GDParser::No String s = E->get().name; if (!s.begins_with("autoload/")) continue; - // print_line("found "+s); + //print_line("found "+s); String name = s.get_slice("/",1); result.insert("\"/root/"+name+"\""); } @@ -1998,10 +2000,10 @@ static void _find_call_arguments(GDCompletionContext& context,const GDParser::No List<MethodInfo> methods; ClassDB::get_method_list(type,&methods); for(List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { - //if (E->get().arguments.size()) - // result.insert(E->get().name+"("); - //else - // result.insert(E->get().name+"()"); + if (E->get().arguments.size()) + result.insert(E->get().name+"("); + else + result.insert(E->get().name+"()"); }*/ } break; @@ -2832,7 +2834,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol if (!script.ends_with(".gd")) { //not a script, try find the script anyway, //may have some success - script=script.basename()+".gd"; + script=script.get_basename()+".gd"; } if (FileAccess::exists(script)) { diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 6aed7c9491..bd0704fff9 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -225,8 +225,8 @@ bool GDParser::_get_completable_identifier(CompletionType p_type,StringName& ide GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_allow_assign,bool p_parsing_constant) { -// Vector<Node*> expressions; -// Vector<OperatorNode::Operator> operators; + //Vector<Node*> expressions; + //Vector<OperatorNode::Operator> operators; Vector<Expression> expression; diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index ad012e54b1..b216ef42b9 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -358,9 +358,11 @@ bool GDScript::get_property_default_value(const StringName& p_property, Variant #ifdef TOOLS_ENABLED - //for (const Map<StringName,Variant>::Element *I=member_default_values.front();I;I=I->next()) { - // print_line("\t"+String(String(I->key())+":"+String(I->get()))); - //} + /* + for (const Map<StringName,Variant>::Element *I=member_default_values.front();I;I=I->next()) { + print_line("\t"+String(String(I->key())+":"+String(I->get()))); + } + */ const Map<StringName,Variant>::Element *E=member_default_values_cache.find(p_property); if (E) { r_value=E->get(); @@ -1862,7 +1864,7 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script>& p_script,bool p_sof void GDScriptLanguage::frame() { - // print_line("calls: "+itos(calls)); + //print_line("calls: "+itos(calls)); calls=0; #ifdef DEBUG_ENABLED @@ -2068,7 +2070,7 @@ bool ResourceFormatLoaderGDScript::handles_type(const String& p_type) const { String ResourceFormatLoaderGDScript::get_resource_type(const String &p_path) const { - String el = p_path.extension().to_lower(); + String el = p_path.get_extension().to_lower(); if (el=="gd" || el=="gdc" || el=="gde") return "GDScript"; return ""; diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h index 960b06f3ff..4d3baa5bc0 100644 --- a/modules/gdscript/gd_script.h +++ b/modules/gdscript/gd_script.h @@ -139,7 +139,7 @@ protected: void _get_property_list(List<PropertyInfo> *p_properties) const; Variant call(const StringName& p_method,const Variant** p_args,int p_argcount,Variant::CallError &r_error); -// void call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount); + //void call_multilevel(const StringName& p_method,const Variant** p_args,int p_argcount); static void _bind_methods(); public: diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index 30ac988295..5dabf50ba1 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -513,9 +513,11 @@ void GDTokenizerText::_advance() { if (GETCHAR(1)=='=') { _make_token(TK_OP_ASSIGN_ADD); INCPOS(1); - //} else if (GETCHAR(1)=='+') { - // _make_token(TK_OP_PLUS_PLUS); - // INCPOS(1); + /* + } else if (GETCHAR(1)=='+') { + _make_token(TK_OP_PLUS_PLUS); + INCPOS(1); + */ } else { _make_token(TK_OP_ADD); } @@ -526,9 +528,11 @@ void GDTokenizerText::_advance() { if (GETCHAR(1)=='=') { _make_token(TK_OP_ASSIGN_SUB); INCPOS(1); - //} else if (GETCHAR(1)=='-') { - // _make_token(TK_OP_MINUS_MINUS); - // INCPOS(1); + /* + } else if (GETCHAR(1)=='-') { + _make_token(TK_OP_MINUS_MINUS); + INCPOS(1); + */ } else { _make_token(TK_OP_SUB); } diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 11bdf783f8..051d1d85cd 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -100,7 +100,7 @@ public: if (err==OK) { fae->store_buffer(file.ptr(),file.size()); - p_path=p_path.basename()+".gde"; + p_path=p_path.get_basename()+".gde"; } memdelete(fae); @@ -111,7 +111,7 @@ public: } else { - p_path=p_path.basename()+".gdc"; + p_path=p_path.get_basename()+".gdc"; return file; } } diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 8bd346d7bb..271db4babc 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -731,7 +731,7 @@ void GridMap::_octant_update(const OctantKey &p_key) { ii.shape->add_vertices_to_array(col_debug,xform); } - // print_line("PHIS x: "+xform); + //print_line("PHIS x: "+xform); } // add the item's navmesh at given xform to GridMap's Navigation ancestor @@ -796,7 +796,7 @@ void GridMap::_octant_exit_world(const OctantKey &p_key) { for(Map<int,Octant::ItemInstances>::Element *E=g.items.front();E;E=E->next()) { VS::get_singleton()->instance_set_scenario(E->get().multimesh_instance,RID()); - // VS::get_singleton()->instance_set_transform(E->get().multimesh_instance,get_global_transform()); + //VS::get_singleton()->instance_set_transform(E->get().multimesh_instance,get_global_transform()); VS::get_singleton()->instance_set_room(E->get().multimesh_instance,RID()); } @@ -1001,8 +1001,8 @@ void GridMap::_notification(int p_what) { _update_area_instances(); for(Map<OctantKey,Octant*>::Element *E=octant_map.front();E;E=E->next()) { -// IndexKey ik; -// ik.key = E->key().indexkey; + //IndexKey ik; + //ik.key = E->key().indexkey; _octant_enter_world(E->key()); _octant_update(E->key()); } @@ -1201,7 +1201,7 @@ void GridMap::_bind_methods() { ClassDB::bind_method(_MD("get_cell_item","x","y","z"),&GridMap::get_cell_item); ClassDB::bind_method(_MD("get_cell_item_orientation","x","y","z"),&GridMap::get_cell_item_orientation); -// ClassDB::bind_method(_MD("_recreate_octants"),&GridMap::_recreate_octants); + //ClassDB::bind_method(_MD("_recreate_octants"),&GridMap::_recreate_octants); ClassDB::bind_method(_MD("_update_dirty_map_callback"),&GridMap::_update_dirty_map_callback); ClassDB::bind_method(_MD("resource_changed","resource"),&GridMap::resource_changed); @@ -1706,10 +1706,12 @@ void GridMap::bake_geometry() { void GridMap::_baked_light_changed() { -// if (!baked_light_instance) -// VS::get_singleton()->instance_geometry_set_baked_light(get_instance(),RID()); -// else -// VS::get_singleton()->instance_geometry_set_baked_light(get_instance(),baked_light_instance->get_baked_light_instance()); + /* + if (!baked_light_instance) + VS::get_singleton()->instance_geometry_set_baked_light(get_instance(),RID()); + else + VS::get_singleton()->instance_geometry_set_baked_light(get_instance(),baked_light_instance->get_baked_light_instance()); + */ for(Map<OctantKey,Octant*>::Element *E=octant_map.front();E;E=E->next()) { for(Map<int,Octant::ItemInstances>::Element *F=E->get()->items.front();F;F=F->next()) { diff --git a/modules/openssl/stream_peer_openssl.cpp b/modules/openssl/stream_peer_openssl.cpp index 140ea1b9e7..43a1f610d8 100644 --- a/modules/openssl/stream_peer_openssl.cpp +++ b/modules/openssl/stream_peer_openssl.cpp @@ -35,8 +35,8 @@ bool StreamPeerOpenSSL::_match_host_name(const char *name, const char *hostname) { return Tool_Curl_cert_hostcheck(name,hostname)==CURL_HOST_MATCH; -// print_line("MATCH: "+String(name)+" vs "+String(hostname)); -// return true; + //print_line("MATCH: "+String(name)+" vs "+String(hostname)); + //return true; } Error StreamPeerOpenSSL::_match_common_name(const char *hostname, const X509 *server_cert) { @@ -293,10 +293,10 @@ BIO_METHOD StreamPeerOpenSSL::_bio_method = { _bio_destroy }; -Error StreamPeerOpenSSL::connect(Ref<StreamPeer> p_base, bool p_validate_certs, const String& p_for_hostname) { +Error StreamPeerOpenSSL::connect_to_stream(Ref<StreamPeer> p_base, bool p_validate_certs, const String& p_for_hostname) { if (connected) - disconnect(); + disconnect_from_stream(); hostname=p_for_hostname; @@ -415,7 +415,7 @@ Error StreamPeerOpenSSL::connect(Ref<StreamPeer> p_base, bool p_validate_certs, return OK; } -Error StreamPeerOpenSSL::accept(Ref<StreamPeer> p_base) { +Error StreamPeerOpenSSL::accept_stream(Ref<StreamPeer> p_base) { return ERR_UNAVAILABLE; @@ -451,7 +451,7 @@ Error StreamPeerOpenSSL::put_data(const uint8_t* p_data,int p_bytes) { int ret = SSL_write(ssl,p_data,p_bytes); if (ret<=0) { _print_error(ret); - disconnect(); + disconnect_from_stream(); return ERR_CONNECTION_ERROR; } p_data+=ret; @@ -486,7 +486,7 @@ Error StreamPeerOpenSSL::get_data(uint8_t* p_buffer, int p_bytes){ int ret = SSL_read(ssl,p_buffer,p_bytes); if (ret<=0) { _print_error(ret); - disconnect(); + disconnect_from_stream(); return ERR_CONNECTION_ERROR; } p_buffer+=ret; @@ -529,7 +529,7 @@ StreamPeerOpenSSL::StreamPeerOpenSSL() { flags=0; } -void StreamPeerOpenSSL::disconnect() { +void StreamPeerOpenSSL::disconnect_from_stream() { if (!connected) return; @@ -552,7 +552,7 @@ StreamPeerOpenSSL::Status StreamPeerOpenSSL::get_status() const { StreamPeerOpenSSL::~StreamPeerOpenSSL() { - disconnect(); + disconnect_from_stream(); } StreamPeerSSL* StreamPeerOpenSSL::_create_func() { diff --git a/modules/openssl/stream_peer_openssl.h b/modules/openssl/stream_peer_openssl.h index d79fb97ff8..3d6875698c 100644 --- a/modules/openssl/stream_peer_openssl.h +++ b/modules/openssl/stream_peer_openssl.h @@ -85,11 +85,11 @@ protected: public: - virtual Error accept(Ref<StreamPeer> p_base); - virtual Error connect(Ref<StreamPeer> p_base,bool p_validate_certs=false,const String& p_for_hostname=String()); + virtual Error accept_stream(Ref<StreamPeer> p_base); + virtual Error connect_to_stream(Ref<StreamPeer> p_base,bool p_validate_certs=false,const String& p_for_hostname=String()); virtual Status get_status() const; - virtual void disconnect(); + virtual void disconnect_from_stream(); virtual Error put_data(const uint8_t* p_data,int p_bytes); virtual Error put_partial_data(const uint8_t* p_data,int p_bytes, int &r_sent); diff --git a/modules/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp index f438dde689..4a6b2e224c 100644 --- a/modules/opus/audio_stream_opus.cpp +++ b/modules/opus/audio_stream_opus.cpp @@ -366,7 +366,7 @@ void ResourceFormatLoaderAudioStreamOpus::get_recognized_extensions(List<String> } String ResourceFormatLoaderAudioStreamOpus::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="opus") + if (p_path.get_extension().to_lower()=="opus") return "AudioStreamOpus"; return ""; } diff --git a/modules/pbm/bitmap_loader_pbm.cpp b/modules/pbm/bitmap_loader_pbm.cpp index 6caaf10334..ab0805a6b0 100644 --- a/modules/pbm/bitmap_loader_pbm.cpp +++ b/modules/pbm/bitmap_loader_pbm.cpp @@ -244,7 +244,7 @@ bool ResourceFormatPBM::handles_type(const String& p_type) const { } String ResourceFormatPBM::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="pbm") + if (p_path.get_extension().to_lower()=="pbm") return "BitMap"; return ""; } diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 9f8db98e05..0d8cabb331 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -185,7 +185,7 @@ bool ResourceFormatPVR::handles_type(const String& p_type) const { String ResourceFormatPVR::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="pvr") + if (p_path.get_extension().to_lower()=="pvr") return "Texture"; return ""; } @@ -669,9 +669,11 @@ static void decompress_pvrtc(PVRTCBlock *p_comp_img, const int p_2bit, const int static void _pvrtc_decompress(Image* p_img) { -// static void decompress_pvrtc(const void *p_comp_img, const int p_2bit, const int p_width, const int p_height, unsigned char* p_dst) { -// decompress_pvrtc((PVRTCBlock*)p_comp_img,p_2bit,p_width,p_height,1,p_dst); -// } + /* + static void decompress_pvrtc(const void *p_comp_img, const int p_2bit, const int p_width, const int p_height, unsigned char* p_dst) { + decompress_pvrtc((PVRTCBlock*)p_comp_img,p_2bit,p_width,p_height,1,p_dst); + } + */ ERR_FAIL_COND( p_img->get_format()!=Image::FORMAT_PVRTC2 && p_img->get_format()!=Image::FORMAT_PVRTC2A && p_img->get_format()!=Image::FORMAT_PVRTC4 && p_img->get_format()!=Image::FORMAT_PVRTC4A); @@ -687,9 +689,11 @@ static void _pvrtc_decompress(Image* p_img) { decompress_pvrtc((PVRTCBlock*)r.ptr(),_2bit,p_img->get_width(),p_img->get_height(),0,(unsigned char*)w.ptr()); - //for(int i=0;i<newdata.size();i++) { - // print_line(itos(w[i])); - //} + /* + for(int i=0;i<newdata.size();i++) { + print_line(itos(w[i])); + } + */ w=PoolVector<uint8_t>::Write(); r=PoolVector<uint8_t>::Read(); diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index b847f17bb7..9d2dfc7f56 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -81,6 +81,9 @@ void VideoStreamPlaybackTheora::video_write(void){ th_ycbcr_buffer yuv; th_decode_ycbcr_out(td,yuv); + // FIXME: The way stuff is commented out with `//*/` closing comments + // sounds very fishy... + /* int y_offset, uv_offset; y_offset=(ti.pic_x&~1)+yuv[0].stride*(ti.pic_y&~1); @@ -105,7 +108,7 @@ void VideoStreamPlaybackTheora::video_write(void){ } format = Image::FORMAT_RGBA8; } - // */ + //*/ //* @@ -228,7 +231,7 @@ void VideoStreamPlaybackTheora::video_write(void){ format = Image::FORMAT_YUV_422; }; }; - // */ + //*/ frames_pending = 1; } @@ -598,7 +601,7 @@ void VideoStreamPlaybackTheora::update(float p_delta) { if (vd.granulepos>=0) { - // print_line("wrote: "+itos(audio_frames_wrote)+" gpos: "+itos(vd.granulepos)); + //print_line("wrote: "+itos(audio_frames_wrote)+" gpos: "+itos(vd.granulepos)); } //print_line("mix audio!"); @@ -933,7 +936,7 @@ bool ResourceFormatLoaderVideoStreamTheora::handles_type(const String& p_type) c String ResourceFormatLoaderVideoStreamTheora::get_resource_type(const String &p_path) const { - String exl=p_path.extension().to_lower(); + String exl=p_path.get_extension().to_lower(); if (exl=="ogm" || exl=="ogv") return "VideoStreamTheora"; return ""; diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp index 79bf3d50b2..5fe87a4956 100644 --- a/modules/visual_script/register_types.cpp +++ b/modules/visual_script/register_types.cpp @@ -82,7 +82,7 @@ void register_visual_script_types() { ClassDB::register_class<VisualScriptFunctionCall>(); ClassDB::register_class<VisualScriptPropertySet>(); ClassDB::register_class<VisualScriptPropertyGet>(); -// ClassDB::register_type<VisualScriptScriptCall>(); + //ClassDB::register_type<VisualScriptScriptCall>(); ClassDB::register_class<VisualScriptEmitSignal>(); ClassDB::register_class<VisualScriptReturn>(); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 08796b3868..e1e180432a 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -2631,7 +2631,7 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level,List<String> const StringName *f = _call_stack[l].function; ERR_FAIL_COND(!_call_stack[l].instance->functions.has(*f)); -// VisualScriptInstance::Function *func = &_call_stack[l].instance->functions[*f]; + //VisualScriptInstance::Function *func = &_call_stack[l].instance->functions[*f]; VisualScriptNodeInstance *node =_call_stack[l].instance->instances[*_call_stack[l].current_id]; ERR_FAIL_COND(!node); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index c9698a1a10..37ee225aeb 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -822,7 +822,7 @@ void VisualScriptEditor::_member_selected() { selected=ti->get_metadata(0); -// print_line("selected: "+String(selected)); + //print_line("selected: "+String(selected)); if (ti->get_parent()==members->get_root()->get_children()) { @@ -1136,9 +1136,11 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt undo_redo->add_undo_method(script.ptr(),"data_connect",name,E->get().from_node,E->get().from_port,E->get().to_node,E->get().to_port); } - //for(int i=0;i<script->function_get_argument_count(name);i++) { - //// undo_redo->add_undo_method(script.ptr(),"function_add_argument",name,script->function_get_argument_name(name,i),script->function_get_argument_type(name,i)); - //} + /* + for(int i=0;i<script->function_get_argument_count(name);i++) { + undo_redo->add_undo_method(script.ptr(),"function_add_argument",name,script->function_get_argument_name(name,i),script->function_get_argument_type(name,i)); + } + */ undo_redo->add_do_method(this,"_update_members"); undo_redo->add_undo_method(this,"_update_members"); undo_redo->add_do_method(this,"_update_graph"); @@ -1776,7 +1778,7 @@ void VisualScriptEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat if (node) { graph->set_selected(node); _node_selected(node); - } + } } if (d.has("type") && String(d["type"])=="resource") { @@ -3082,7 +3084,7 @@ void VisualScriptEditor::_menu_option(int p_what) { //popup disappearing grabs focus to owner, so use call deferred node_filter->call_deferred("grab_focus"); node_filter->call_deferred("select_all"); - } break; + } break; case EDIT_COPY_NODES: case EDIT_CUT_NODES: { diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 9f3ba8a8cb..a8d78b9298 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -396,7 +396,7 @@ void VisualScriptFunctionCall::_update_method_cache() { } -// print_line("BASE: "+String(type)+" FUNC: "+String(function)); + //print_line("BASE: "+String(type)+" FUNC: "+String(function)); MethodBind *mb = ClassDB::get_method(type,function); if (mb) { use_default_args=mb->get_default_argument_count(); @@ -2508,7 +2508,7 @@ void register_visual_script_func_nodes() { VisualScriptLanguage::singleton->add_register_func("functions/get",create_node_generic<VisualScriptPropertyGet>); //VisualScriptLanguage::singleton->add_register_func("functions/call_script/call_self",create_script_call_node<VisualScriptScriptCall::CALL_MODE_SELF>); -// VisualScriptLanguage::singleton->add_register_func("functions/call_script/call_node",create_script_call_node<VisualScriptScriptCall::CALL_MODE_NODE_PATH>); + //VisualScriptLanguage::singleton->add_register_func("functions/call_script/call_node",create_script_call_node<VisualScriptScriptCall::CALL_MODE_NODE_PATH>); VisualScriptLanguage::singleton->add_register_func("functions/emit_signal",create_node_generic<VisualScriptEmitSignal>); diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 7abcd0a8b7..2b05daca16 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -78,7 +78,7 @@ int AudioStreamPlaybackOGGVorbis::_ov_seek_func(void *_f,ogg_int64_t offs, int w } int AudioStreamPlaybackOGGVorbis::_ov_close_func(void *_f) { -// printf("close %p\n",_f); + //printf("close %p\n",_f); if (!_f) return 0; FileAccess *fa=(FileAccess*)_f; @@ -419,7 +419,7 @@ void ResourceFormatLoaderAudioStreamOGGVorbis::get_recognized_extensions(List<St } String ResourceFormatLoaderAudioStreamOGGVorbis::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="ogg") + if (p_path.get_extension().to_lower()=="ogg") return "AudioStreamOGGVorbis"; return ""; } diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index d132e89690..bdd97f1df7 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -415,7 +415,7 @@ bool ResourceFormatLoaderVideoStreamWebm::handles_type(const String &p_type) con String ResourceFormatLoaderVideoStreamWebm::get_resource_type(const String &p_path) const { - const String exl = p_path.extension().to_lower(); + const String exl = p_path.get_extension().to_lower(); if (exl == "webm") return "VideoStreamWebm"; return ""; diff --git a/platform/android/audio_driver_jandroid.cpp b/platform/android/audio_driver_jandroid.cpp index 8c57eaaab6..d9e40a5913 100644 --- a/platform/android/audio_driver_jandroid.cpp +++ b/platform/android/audio_driver_jandroid.cpp @@ -71,7 +71,7 @@ Error AudioDriverAndroid::init(){ } */ -// Android_JNI_SetupThread(); + //Android_JNI_SetupThread(); // __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device"); diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp index 5e3cfcbbab..7aec2b174e 100644 --- a/platform/android/audio_driver_opensl.cpp +++ b/platform/android/audio_driver_opensl.cpp @@ -108,7 +108,7 @@ void AudioDriverOpenSL::_buffer_callbacks( AudioDriverOpenSL *ad = (AudioDriverOpenSL*)pContext; -// ad->_buffer_callback(queueItf,eventFlags,pBuffer,bufferSize,dataUsed); + //ad->_buffer_callback(queueItf,eventFlags,pBuffer,bufferSize,dataUsed); ad->_buffer_callback(queueItf); } @@ -271,8 +271,8 @@ void AudioDriverOpenSL::start(){ ERR_FAIL_COND( res !=SL_RESULT_SUCCESS ); SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, BUFFER_COUNT}; -// bufferQueue.locatorType = SL_DATALOCATOR_BUFFERQUEUE; -// bufferQueue.numBuffers = BUFFER_COUNT; /* Four buffers in our buffer queue */ + //bufferQueue.locatorType = SL_DATALOCATOR_BUFFERQUEUE; + //bufferQueue.numBuffers = BUFFER_COUNT; /* Four buffers in our buffer queue */ /* Setup the format of the content in the buffer queue */ pcm.formatType = SL_DATAFORMAT_PCM; pcm.numChannels = 2; @@ -295,7 +295,7 @@ void AudioDriverOpenSL::start(){ audioSink.pLocator = (void *)&locator_outputmix; audioSink.pFormat = NULL; /* Initialize the context for Buffer queue callbacks */ -// cntxt.pDataBase = (void*)&pcmData; + //cntxt.pDataBase = (void*)&pcmData; //cntxt.pData = cntxt.pDataBase; //cntxt.size = sizeof(pcmData); /* Set arrays required[] and iidArray[] for SEEK interface diff --git a/platform/android/dir_access_android.cpp b/platform/android/dir_access_android.cpp index f1a488cec2..42ac34a589 100644 --- a/platform/android/dir_access_android.cpp +++ b/platform/android/dir_access_android.cpp @@ -37,16 +37,16 @@ DirAccess *DirAccessAndroid::create_fs() { return memnew(DirAccessAndroid); } -bool DirAccessAndroid::list_dir_begin() { +Error DirAccessAndroid::list_dir_begin() { list_dir_end(); AAssetDir* aad = AAssetManager_openDir(FileAccessAndroid::asset_manager,current_dir.utf8().get_data()); if (!aad) - return true; //nothing + return ERR_CANT_OPEN; //nothing - return false; + return OK; } String DirAccessAndroid::get_next(){ diff --git a/platform/android/dir_access_android.h b/platform/android/dir_access_android.h index 15c29a9a02..72611ceb59 100644 --- a/platform/android/dir_access_android.h +++ b/platform/android/dir_access_android.h @@ -49,7 +49,7 @@ class DirAccessAndroid : public DirAccess { public: - virtual bool list_dir_begin(); ///< This starts dir listing + virtual Error list_dir_begin(); ///< This starts dir listing virtual String get_next(); virtual bool current_is_dir() const; virtual bool current_is_hidden() const; diff --git a/platform/android/dir_access_jandroid.cpp b/platform/android/dir_access_jandroid.cpp index bbd041f6c7..2528b18248 100644 --- a/platform/android/dir_access_jandroid.cpp +++ b/platform/android/dir_access_jandroid.cpp @@ -47,7 +47,7 @@ DirAccess *DirAccessJAndroid::create_fs() { return memnew(DirAccessJAndroid); } -bool DirAccessJAndroid::list_dir_begin() { +Error DirAccessJAndroid::list_dir_begin() { list_dir_end(); JNIEnv *env = ThreadAndroid::get_env(); @@ -55,11 +55,11 @@ bool DirAccessJAndroid::list_dir_begin() { jstring js = env->NewStringUTF(current_dir.utf8().get_data()); int res = env->CallIntMethod(io,_dir_open,js); if (res<=0) - return true; + return ERR_CANT_OPEN; id=res; - return false; + return OK; } String DirAccessJAndroid::get_next(){ @@ -257,7 +257,7 @@ void DirAccessJAndroid::setup( jobject p_io) { __android_log_print(ANDROID_LOG_INFO,"godot","*******GOT METHOD _dir_is_dir ok!!"); } -// (*env)->CallVoidMethod(env,obj,aMethodID, myvar); + //(*env)->CallVoidMethod(env,obj,aMethodID, myvar); } diff --git a/platform/android/dir_access_jandroid.h b/platform/android/dir_access_jandroid.h index bfd7912aaf..5db32b945c 100644 --- a/platform/android/dir_access_jandroid.h +++ b/platform/android/dir_access_jandroid.h @@ -58,7 +58,7 @@ class DirAccessJAndroid : public DirAccess { public: - virtual bool list_dir_begin(); ///< This starts dir listing + virtual Error list_dir_begin(); ///< This starts dir listing virtual String get_next(); virtual bool current_is_dir() const; virtual bool current_is_hidden() const; diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index e836258e04..204bf684b7 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -729,17 +729,17 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool } -// print_line("String "+itos(i)+": "+string_table[i]); + //print_line("String "+itos(i)+": "+string_table[i]); } for(uint32_t i=string_end;i<(ofs+size);i++) { stable_extra.push_back(p_manifest[i]); } -// printf("stable extra: %i\n",int(stable_extra.size())); + //printf("stable extra: %i\n",int(stable_extra.size())); string_table_ends=ofs+size; -// print_line("STABLE SIZE: "+itos(size)+" ACTUAL: "+itos(string_table_ends)); + //print_line("STABLE SIZE: "+itos(size)+" ACTUAL: "+itos(string_table_ends)); } break; case CHUNK_XML_START_TAG: { @@ -752,7 +752,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool String tname=string_table[name]; -// printf("NSPACE: %i\n",nspace); + //printf("NSPACE: %i\n",nspace); //printf("NAME: %i (%s)\n",name,tname.utf8().get_data()); //printf("CHECK: %x\n",check); uint32_t attrcount=decode_uint32(&p_manifest[iofs+20]); @@ -1523,7 +1523,7 @@ void EditorExportPlatformAndroid::_device_poll_thread(void *ud) { if (dpos==-1) continue; d=d.substr(0,dpos).strip_edges(); - // print_line("found devuce: "+d); + //print_line("found devuce: "+d); ldevices.push_back(d); } @@ -1602,8 +1602,8 @@ void EditorExportPlatformAndroid::_device_poll_thread(void *ud) { } d.name=vendor+" "+device; - // print_line("name: "+d.name); - // print_line("description: "+d.description); + //print_line("name: "+d.name); + //print_line("description: "+d.description); } @@ -1864,10 +1864,12 @@ bool EditorExportPlatformAndroid::can_export(String *r_error) const { if (apk_expansion) { - //if (apk_expansion_salt=="") { - // valid=false; - // err+="Invalid SALT for apk expansion.\n"; - //} + /* + if (apk_expansion_salt=="") { + valid=false; + err+="Invalid SALT for apk expansion.\n"; + } + */ if (apk_expansion_pkey=="") { valid=false; err+="Invalid public key for apk expansion.\n"; diff --git a/platform/android/file_access_jandroid.cpp b/platform/android/file_access_jandroid.cpp index 4755f1d029..a4e9c191e9 100644 --- a/platform/android/file_access_jandroid.cpp +++ b/platform/android/file_access_jandroid.cpp @@ -236,7 +236,7 @@ void FileAccessJAndroid::setup( jobject p_io) { __android_log_print(ANDROID_LOG_INFO,"godot","*******GOT METHOD _file_close ok!!"); } -// (*env)->CallVoidMethod(env,obj,aMethodID, myvar); + //(*env)->CallVoidMethod(env,obj,aMethodID, myvar); } diff --git a/platform/android/globals/global_defaults.cpp b/platform/android/globals/global_defaults.cpp index 52b59b2dc1..bbf9bd5b0b 100644 --- a/platform/android/globals/global_defaults.cpp +++ b/platform/android/globals/global_defaults.cpp @@ -35,7 +35,7 @@ void register_android_global_defaults() { /* GLOBAL_DEF("rasterizer.Android/use_fragment_lighting",false); GLOBAL_DEF("rasterizer.Android/fp16_framebuffer",false); GLOBAL_DEF("display.Android/driver","GLES2"); -// GLOBAL_DEF("rasterizer.Android/trilinear_mipmap_filter",false); + //GLOBAL_DEF("rasterizer.Android/trilinear_mipmap_filter",false); GlobalConfig::get_singleton()->set_custom_property_info("display.Android/driver",PropertyInfo(Variant::STRING,"display.Android/driver",PROPERTY_HINT_ENUM,"GLES2")); */ diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp index c4d1a85c5f..3c7f7f5854 100644 --- a/platform/android/godot_android.cpp +++ b/platform/android/godot_android.cpp @@ -535,29 +535,33 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) case AMOTION_EVENT_ACTION_DOWN: { engine->os->process_touch(0,0,touchvec); - //System.out.printf("action down at: %f,%f\n", event.getX(),event.getY()); + //System.out.printf("action down at: %f,%f\n", event.getX(),event.getY()); } break; case AMOTION_EVENT_ACTION_MOVE: { engine->os->process_touch(1,0,touchvec); - //for(int i=0;i<event.getPointerCount();i++) { - // System.out.printf("%d - moved to: %f,%f\n",i, event.getX(i),event.getY(i)); - //} + /* + for(int i=0;i<event.getPointerCount();i++) { + System.out.printf("%d - moved to: %f,%f\n",i, event.getX(i),event.getY(i)); + } + */ } break; case AMOTION_EVENT_ACTION_POINTER_UP: { engine->os->process_touch(4,pidx,touchvec); - //System.out.printf("%d - s.up at: %f,%f\n",pointer_idx, event.getX(pointer_idx),event.getY(pointer_idx)); + //System.out.printf("%d - s.up at: %f,%f\n",pointer_idx, event.getX(pointer_idx),event.getY(pointer_idx)); } break; case AMOTION_EVENT_ACTION_POINTER_DOWN: { engine->os->process_touch(3,pidx,touchvec); - //System.out.printf("%d - s.down at: %f,%f\n",pointer_idx, event.getX(pointer_idx),event.getY(pointer_idx)); + //System.out.printf("%d - s.down at: %f,%f\n",pointer_idx, event.getX(pointer_idx),event.getY(pointer_idx)); } break; case AMOTION_EVENT_ACTION_CANCEL: case AMOTION_EVENT_ACTION_UP: { engine->os->process_touch(2,0,touchvec); - //for(int i=0;i<event.getPointerCount();i++) { - // System.out.printf("%d - up! %f,%f\n",i, event.getX(i),event.getY(i)); - //} + /* + for(int i=0;i<event.getPointerCount();i++) { + System.out.printf("%d - up! %f,%f\n",i, event.getX(i),event.getY(i)); + } + */ } break; } @@ -638,8 +642,8 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { } break; case APP_CMD_INIT_WINDOW: - //The window is being shown, get it ready. - // LOGI("INIT WINDOW"); + //The window is being shown, get it ready. + //LOGI("INIT WINDOW"); if (engine->app->window != NULL) { if (engine->os==NULL) { @@ -647,7 +651,7 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { //do initialization here, when there's OpenGL! hackish but the only way engine->os = new OS_Android(_gfx_init,engine); - // char *args[]={"-test","gui",NULL}; + //char *args[]={"-test","gui",NULL}; __android_log_print(ANDROID_LOG_INFO,"godot","pre asdasd setup..."); #if 0 Error err = Main::setup("apk",2,args); @@ -722,15 +726,15 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { engine->animating=1; engine_draw_frame(engine); } - break; + break; case APP_CMD_TERM_WINDOW: - // The window is being hidden or closed, clean it up. - // LOGI("TERM WINDOW"); - engine_term_display(engine); - break; + // The window is being hidden or closed, clean it up. + //LOGI("TERM WINDOW"); + engine_term_display(engine); + break; case APP_CMD_GAINED_FOCUS: - // When our app gains focus, we start monitoring the accelerometer. - if (engine->accelerometerSensor != NULL) { + // When our app gains focus, we start monitoring the accelerometer. + if (engine->accelerometerSensor != NULL) { ASensorEventQueue_enableSensor(engine->sensorEventQueue, engine->accelerometerSensor); // We'd like to get 60 events per second (in us). @@ -833,7 +837,7 @@ void android_main(struct android_app* state) { // Process this event. if (source != NULL) { - // LOGI("process\n"); + // LOGI("process\n"); source->process(state, source); } else { nullmax--; @@ -883,12 +887,12 @@ void android_main(struct android_app* state) { return; } -// LOGI("end\n"); + // LOGI("end\n"); } -// LOGI("engine animating? %i\n",engine.animating); + // LOGI("engine animating? %i\n",engine.animating); if (engine.animating) { //do os render diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 94d29a3350..610f707b47 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -257,8 +257,8 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC public void onVideoInit(boolean use_gl2) { -// mView = new GodotView(getApplication(),io,use_gl2); -// setContentView(mView); + //mView = new GodotView(getApplication(),io,use_gl2); + //setContentView(mView); layout = new FrameLayout(this); layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); @@ -582,7 +582,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC initializeGodot(); - // instanceSingleton( new GodotFacebook(this) ); + //instanceSingleton( new GodotFacebook(this) ); } @@ -804,9 +804,11 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC } break; case MotionEvent.ACTION_MOVE: { GodotLib.touch(1,0,evcount,arr); - //for(int i=0;i<event.getPointerCount();i++) { - // System.out.printf("%d - moved to: %f,%f\n",i, event.getX(i),event.getY(i)); - //} + /* + for(int i=0;i<event.getPointerCount();i++) { + System.out.printf("%d - moved to: %f,%f\n",i, event.getX(i),event.getY(i)); + } + */ } break; case MotionEvent.ACTION_POINTER_UP: { final int indexPointUp = event.getActionIndex(); @@ -822,9 +824,11 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: { GodotLib.touch(2,0,evcount,arr); - //for(int i=0;i<event.getPointerCount();i++) { - // System.out.printf("%d - up! %f,%f\n",i, event.getX(i),event.getY(i)); - //} + /* + for(int i=0;i<event.getPointerCount();i++) { + System.out.printf("%d - up! %f,%f\n",i, event.getX(i),event.getY(i)); + } + */ } break; } @@ -866,9 +870,11 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC return mPaymentsManager; } -// public void setPaymentsManager(PaymentsManager mPaymentsManager) { -// this.mPaymentsManager = mPaymentsManager; -// }; + /* + public void setPaymentsManager(PaymentsManager mPaymentsManager) { + this.mPaymentsManager = mPaymentsManager; + } + */ // Audio diff --git a/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java index 878528f7c7..fba082e80d 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java +++ b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java @@ -57,7 +57,7 @@ public class GodotDownloaderService extends DownloaderService { Log.d("GODOT", "getting public key:" + prefs.getString("store_public_key", null)); return prefs.getString("store_public_key", null); -// return BASE64_PUBLIC_KEY; + //return BASE64_PUBLIC_KEY; } /** diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java index db67144bcc..4cfe295835 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotView.java +++ b/platform/android/java/src/org/godotengine/godot/GodotView.java @@ -265,7 +265,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { if (keyCode == KeyEvent.KEYCODE_BACK) { GodotLib.quit(); // press 'back' button should not terminate program - // normal handle 'back' event in game logic + //normal handle 'back' event in game logic return true; } diff --git a/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java index 13a24994f8..67293df2a8 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java @@ -47,19 +47,19 @@ abstract public class ConsumeTask { public void consume(final String sku){ -// Log.d("XXX", "Consuming product " + sku); + //Log.d("XXX", "Consuming product " + sku); PaymentsCache pc = new PaymentsCache(context); Boolean isBlocked = pc.getConsumableFlag("block", sku); String _token = pc.getConsumableValue("token", sku); -// Log.d("XXX", "token " + _token); + //Log.d("XXX", "token " + _token); if(!isBlocked && _token == null){ -// _token = "inapp:"+context.getPackageName()+":android.test.purchased"; -// Log.d("XXX", "Consuming product " + sku + " with token " + _token); + //_token = "inapp:"+context.getPackageName()+":android.test.purchased"; + //Log.d("XXX", "Consuming product " + sku + " with token " + _token); }else if(!isBlocked){ -// Log.d("XXX", "It is not blocked ¿?"); + //Log.d("XXX", "It is not blocked ¿?"); return; }else if(_token == null){ -// Log.d("XXX", "No token available"); + //Log.d("XXX", "No token available"); this.error("No token for sku:" + sku); return; } @@ -69,9 +69,9 @@ abstract public class ConsumeTask { @Override protected String doInBackground(String... params) { try { -// Log.d("XXX", "Requesting to release item."); + //Log.d("XXX", "Requesting to release item."); int response = mService.consumePurchase(3, context.getPackageName(), token); -// Log.d("XXX", "release response code: " + response); + //Log.d("XXX", "release response code: " + response); if(response == 0 || response == 8){ return null; } diff --git a/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java index 20feaef581..dfa363ed75 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java @@ -60,9 +60,9 @@ abstract public class GenericConsumeTask extends AsyncTask<String, String, Strin @Override protected String doInBackground(String... params) { try { -// Log.d("godot", "Requesting to consume an item with token ." + token); + //Log.d("godot", "Requesting to consume an item with token ." + token); int response = mService.consumePurchase(3, context.getPackageName(), token); -// Log.d("godot", "consumePurchase response: " + response); + //Log.d("godot", "consumePurchase response: " + response); if(response == 0 || response == 8){ return null; } diff --git a/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java index 1aa210265d..3850453a77 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java @@ -56,29 +56,29 @@ abstract public class HandlePurchaseTask { public void handlePurchaseRequest(int resultCode, Intent data){ -// Log.d("XXX", "Handling purchase response"); -// int responseCode = data.getIntExtra("RESPONSE_CODE", 0); + //Log.d("XXX", "Handling purchase response"); + //int responseCode = data.getIntExtra("RESPONSE_CODE", 0); PaymentsCache pc = new PaymentsCache(context); String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA"); -// Log.d("XXX", "Purchase data:" + purchaseData); + //Log.d("XXX", "Purchase data:" + purchaseData); String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE"); //Log.d("XXX", "Purchase signature:" + dataSignature); if (resultCode == Activity.RESULT_OK) { try { -// Log.d("SARLANGA", purchaseData); + //Log.d("SARLANGA", purchaseData); JSONObject jo = new JSONObject(purchaseData); -// String sku = jo.getString("productId"); -// alert("You have bought the " + sku + ". Excellent choice, aventurer!"); -// String orderId = jo.getString("orderId"); -// String packageName = jo.getString("packageName"); + //String sku = jo.getString("productId"); + //alert("You have bought the " + sku + ". Excellent choice, aventurer!"); + //String orderId = jo.getString("orderId"); + //String packageName = jo.getString("packageName"); String productId = jo.getString("productId"); -// Long purchaseTime = jo.getLong("purchaseTime"); -// Integer state = jo.getInt("purchaseState"); + //Long purchaseTime = jo.getLong("purchaseTime"); + //Integer state = jo.getInt("purchaseState"); String developerPayload = jo.getString("developerPayload"); String purchaseToken = jo.getString("purchaseToken"); @@ -86,7 +86,7 @@ abstract public class HandlePurchaseTask { error("Untrusted callback"); return; } -// Log.d("XXX", "Este es el product ID:" + productId); + //Log.d("XXX", "Este es el product ID:" + productId); pc.setConsumableValue("ticket_signautre", productId, dataSignature); pc.setConsumableValue("ticket", productId, purchaseData); pc.setConsumableFlag("block", productId, true); diff --git a/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java index 88fd1a0fe4..4678dae1b3 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java +++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java @@ -59,14 +59,14 @@ public class PaymentsCache { SharedPreferences sharedPref = context.getSharedPreferences("consumables_" + set, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPref.edit(); editor.putString(sku, value); -// Log.d("XXX", "Setting asset: consumables_" + set + ":" + sku); + //Log.d("XXX", "Setting asset: consumables_" + set + ":" + sku); editor.commit(); } public String getConsumableValue(String set, String sku){ SharedPreferences sharedPref = context.getSharedPreferences( "consumables_" + set, Context.MODE_PRIVATE); -// Log.d("XXX", "Getting asset: consumables_" + set + ":" + sku); + //Log.d("XXX", "Getting asset: consumables_" + set + ":" + sku); return sharedPref.getString(sku, null); } diff --git a/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java index d154ef0c78..5ad96b35ee 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java @@ -63,18 +63,20 @@ abstract public class PurchaseTask { Log.d("XXX", "Starting purchase for: " + sku); PaymentsCache pc = new PaymentsCache(context); Boolean isBlocked = pc.getConsumableFlag("block", sku); -// if(isBlocked){ -// Log.d("XXX", "Is awaiting payment confirmation"); -// error("Awaiting payment confirmation"); -// return; -// } + /* + if(isBlocked){ + Log.d("XXX", "Is awaiting payment confirmation"); + error("Awaiting payment confirmation"); + return; + } + */ final String hash = transactionId; Bundle buyIntentBundle; try { buyIntentBundle = mService.getBuyIntent(3, context.getApplicationContext().getPackageName(), sku, "inapp", hash ); } catch (RemoteException e) { -// Log.d("XXX", "Error: " + e.getMessage()); + //Log.d("XXX", "Error: " + e.getMessage()); error(e.getMessage()); return; } @@ -87,7 +89,7 @@ abstract public class PurchaseTask { }else if( rc instanceof Long){ responseCode = (int)((Long)rc).longValue(); } -// Log.d("XXX", "Buy intent response code: " + responseCode); + //Log.d("XXX", "Buy intent response code: " + responseCode); if(responseCode == 1 || responseCode == 3 || responseCode == 4){ canceled(); return; @@ -102,12 +104,12 @@ abstract public class PurchaseTask { pc.setConsumableValue("validation_hash", sku, hash); try { if(context == null){ -// Log.d("XXX", "No context!"); + //Log.d("XXX", "No context!"); } if(pendingIntent == null){ -// Log.d("XXX", "No pending intent"); + //Log.d("XXX", "No pending intent"); } -// Log.d("XXX", "Starting activity for purchase!"); + //Log.d("XXX", "Starting activity for purchase!"); context.startIntentSenderForResult( pendingIntent.getIntentSender(), PaymentsManager.REQUEST_CODE_FOR_PURCHASE, diff --git a/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java index c74269890d..60a43a9070 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java @@ -56,13 +56,13 @@ abstract public class ReleaseAllConsumablesTask { public void consumeItAll(){ try{ -// Log.d("godot", "consumeItall for " + context.getPackageName()); + //Log.d("godot", "consumeItall for " + context.getPackageName()); Bundle bundle = mService.getPurchases(3, context.getPackageName(), "inapp",null); for (String key : bundle.keySet()) { - Object value = bundle.get(key); -// Log.d("godot", String.format("%s %s (%s)", key, -// value.toString(), value.getClass().getName())); + Object value = bundle.get(key); + //Log.d("godot", String.format("%s %s (%s)", key, + //value.toString(), value.getClass().getName())); } @@ -73,13 +73,13 @@ abstract public class ReleaseAllConsumablesTask { if (myPurchases == null || myPurchases.size() == 0){ -// Log.d("godot", "No purchases!"); + //Log.d("godot", "No purchases!"); notRequired(); return; } -// Log.d("godot", "# products to be consumed:" + myPurchases.size()); + //Log.d("godot", "# products to be consumed:" + myPurchases.size()); for (int i=0;i<myPurchases.size();i++) { @@ -89,7 +89,7 @@ abstract public class ReleaseAllConsumablesTask { String sku = inappPurchaseData.getString("productId"); String token = inappPurchaseData.getString("purchaseToken"); String signature = mySignatures.get(i); -// Log.d("godot", "A punto de consumir un item con token:" + token + "\n" + receipt); + //Log.d("godot", "A punto de consumir un item con token:" + token + "\n" + receipt); new GenericConsumeTask(context, mService, sku, receipt,signature, token) { @Override diff --git a/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java index dafab13ad7..f09bcbf9a4 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java @@ -79,14 +79,14 @@ abstract public class ValidateTask { param.put("ticket", pc.getConsumableValue("ticket", sku)); param.put("purchaseToken", pc.getConsumableValue("token", sku)); param.put("sku", sku); -// Log.d("XXX", "Haciendo request a " + url); -// Log.d("XXX", "ticket: " + pc.getConsumableValue("ticket", sku)); -// Log.d("XXX", "purchaseToken: " + pc.getConsumableValue("token", sku)); -// Log.d("XXX", "sku: " + sku); + //Log.d("XXX", "Haciendo request a " + url); + //Log.d("XXX", "ticket: " + pc.getConsumableValue("ticket", sku)); + //Log.d("XXX", "purchaseToken: " + pc.getConsumableValue("token", sku)); + //Log.d("XXX", "sku: " + sku); param.put("package", context.getApplicationContext().getPackageName()); HttpRequester requester = new HttpRequester(); String jsonResponse = requester.post(param); -// Log.d("XXX", "Validation response:\n"+jsonResponse); + //Log.d("XXX", "Validation response:\n"+jsonResponse); return jsonResponse; } diff --git a/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java index 9dd08a9563..faefbbd2c6 100644 --- a/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java +++ b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java @@ -78,12 +78,12 @@ public class HttpRequester { private long cttl=0; public HttpRequester(){ -// Log.d("XXX", "Creando http request sin contexto"); + //Log.d("XXX", "Creando http request sin contexto"); } public HttpRequester(Context context){ this.context=context; -// Log.d("XXX", "Creando http request con contexto"); + //Log.d("XXX", "Creando http request con contexto"); } public String post(RequestParams params){ @@ -99,7 +99,7 @@ public class HttpRequester { public String get(RequestParams params){ String response = getResponseFromCache(params.getUrl()); if(response == null){ -// Log.d("XXX", "Cache miss!"); + //Log.d("XXX", "Cache miss!"); HttpGet httpget = new HttpGet(params.getUrl()); long timeInit = new Date().getTime(); response = request(httpget); @@ -117,7 +117,7 @@ public class HttpRequester { } private String request(HttpUriRequest request){ -// Log.d("XXX", "Haciendo request a: " + request.getURI() ); + //Log.d("XXX", "Haciendo request a: " + request.getURI() ); Log.d("PPP", "Haciendo request a: " + request.getURI() ); long init = new Date().getTime(); HttpClient httpclient = getNewHttpClient(); @@ -128,10 +128,10 @@ public class HttpRequester { try { HttpResponse response = httpclient.execute(request); Log.d("PPP", "Fin de request (" + (new Date().getTime() - init) + ") a: " + request.getURI() ); -// Log.d("XXX1", "Status:" + response.getStatusLine().toString()); + //Log.d("XXX1", "Status:" + response.getStatusLine().toString()); if(response.getStatusLine().getStatusCode() == 200){ String strResponse = EntityUtils.toString(response.getEntity()); -// Log.d("XXX2", strResponse); + //Log.d("XXX2", strResponse); return strResponse; }else{ Log.d("XXX3", "Response status code:" + response.getStatusLine().getStatusCode() + "\n" + EntityUtils.toString(response.getEntity())); @@ -192,7 +192,7 @@ public class HttpRequester { public void saveResponseIntoCache(String request, String response){ if(context == null){ -// Log.d("XXX", "No context, cache failed!"); + //Log.d("XXX", "No context, cache failed!"); return; } SharedPreferences sharedPref = context.getSharedPreferences("http_get_cache", Context.MODE_PRIVATE); diff --git a/platform/android/java_class_wrapper.cpp b/platform/android/java_class_wrapper.cpp index 296ac0a831..9acda005f1 100644 --- a/platform/android/java_class_wrapper.cpp +++ b/platform/android/java_class_wrapper.cpp @@ -1240,7 +1240,7 @@ Ref<JavaClass> JavaClassWrapper::wrap(const String& p_class) { //args[i] = _jobject_to_variant(env, obj); -// print_line("\targ"+itos(i)+": "+Variant::get_type_name(args[i].get_type())); + //print_line("\targ"+itos(i)+": "+Variant::get_type_name(args[i].get_type())); }; diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index a691e60575..dfbb437344 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -802,7 +802,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * e env->GetJavaVM(&jvm); _godot_instance=env->NewGlobalRef(activity); -// _godot_instance=activity; + //_godot_instance=activity; __android_log_print(ANDROID_LOG_INFO,"godot","***************** HELLO FROM JNI!!!!!!!!"); @@ -879,7 +879,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * e if (!rawString) { __android_log_print(ANDROID_LOG_INFO,"godot","cmdline arg %i is null\n",i); } else { - // __android_log_print(ANDROID_LOG_INFO,"godot","cmdline arg %i is: %s\n",i,rawString); + //__android_log_print(ANDROID_LOG_INFO,"godot","cmdline arg %i is: %s\n",i,rawString); if (strcmp(rawString,"-main_pack")==0) use_apk_expansion=true; @@ -1151,8 +1151,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch(JNIEnv * env, j pointer_events.push_back(jpe); input_mutex->unlock(); - //if (os_android) -// os_android->process_touch(ev,pointer,points); + /* + if (os_android) + os_android->process_touch(ev,pointer,points); + */ } @@ -1753,7 +1755,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv * args[i] = _jobject_to_variant(env, obj); env->DeleteLocalRef(obj); -// print_line("\targ"+itos(i)+": "+Variant::get_type_name(args[i].get_type())); + //print_line("\targ"+itos(i)+": "+Variant::get_type_name(args[i].get_type())); }; diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 55fe3f21a0..562666b679 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -399,7 +399,7 @@ void OS_Android::process_event(InputEvent p_event) { void OS_Android::process_touch(int p_what,int p_pointer, const Vector<TouchPos>& p_points) { -// print_line("ev: "+itos(p_what)+" pnt: "+itos(p_pointer)+" pointc: "+itos(p_points.size())); + //print_line("ev: "+itos(p_what)+" pnt: "+itos(p_pointer)+" pointc: "+itos(p_points.size())); switch(p_what) { case 0: { //gesture begin @@ -482,8 +482,8 @@ void OS_Android::process_touch(int p_what,int p_pointer, const Vector<TouchPos>& ev.mouse_motion.x=p_points[0].pos.x; ev.mouse_motion.y=p_points[0].pos.y; input->set_mouse_pos(Point2(ev.mouse_motion.x,ev.mouse_motion.y)); - ev.mouse_motion.speed_x=input->get_mouse_speed().x; - ev.mouse_motion.speed_y=input->get_mouse_speed().y; + ev.mouse_motion.speed_x=input->get_last_mouse_speed().x; + ev.mouse_motion.speed_y=input->get_last_mouse_speed().y; ev.mouse_motion.relative_x=p_points[0].pos.x-last_mouse.x; ev.mouse_motion.relative_y=p_points[0].pos.y-last_mouse.y; last_mouse=p_points[0].pos; diff --git a/platform/bb10/os_bb10.cpp b/platform/bb10/os_bb10.cpp index ed40355eb5..ea2e326b05 100644 --- a/platform/bb10/os_bb10.cpp +++ b/platform/bb10/os_bb10.cpp @@ -190,9 +190,11 @@ void OSBB10::finalize() { spatial_sound_2d_server->finish(); memdelete(spatial_sound_2d_server); - //if (debugger_connection_console) { -// memdelete(debugger_connection_console); -//} + /* + if (debugger_connection_console) { + memdelete(debugger_connection_console); + } + */ memdelete(sample_manager); @@ -376,8 +378,8 @@ void OSBB10::handle_screen_event(bps_event_t *event) { ievent.mouse_motion.x = ievent.mouse_motion.global_x = mpos.x; ievent.mouse_motion.y = ievent.mouse_motion.global_y = mpos.y; input->set_mouse_pos(Point2(ievent.mouse_motion.x,ievent.mouse_motion.y)); - ievent.mouse_motion.speed_x=input->get_mouse_speed().x; - ievent.mouse_motion.speed_y=input->get_mouse_speed().y; + ievent.mouse_motion.speed_x=input->get_last_mouse_speed().x; + ievent.mouse_motion.speed_y=input->get_last_mouse_speed().y; ievent.mouse_motion.relative_x = mrel.x; ievent.mouse_motion.relative_y = mrel.y; ievent.mouse_motion.button_mask = 1; // pressed diff --git a/platform/bb10/os_bb10.h b/platform/bb10/os_bb10.h index 8011550987..5c484cd120 100644 --- a/platform/bb10/os_bb10.h +++ b/platform/bb10/os_bb10.h @@ -58,7 +58,7 @@ class OSBB10 : public OS_Unix { Rasterizer *rasterizer; VisualServer *visual_server; -// AudioDriverPSP audio_driver_psp; + //AudioDriverPSP audio_driver_psp; AudioServerSW *audio_server; SampleManagerMallocSW *sample_manager; SpatialSoundServerSW *spatial_sound_server; diff --git a/platform/haiku/haiku_direct_window.cpp b/platform/haiku/haiku_direct_window.cpp index 1def361367..e7ff65e3ba 100644 --- a/platform/haiku/haiku_direct_window.cpp +++ b/platform/haiku/haiku_direct_window.cpp @@ -145,10 +145,12 @@ void HaikuDirectWindow::HandleMouseButton(BMessage* message) { last_buttons_state = buttons; // TODO: implement the mouse_mode checks - //if (mouse_mode == MOUSE_MODE_CAPTURED) { - // event.xbutton.x=last_mouse_pos.x; - // event.xbutton.y=last_mouse_pos.y; - //} + /* + if (mouse_mode == MOUSE_MODE_CAPTURED) { + event.xbutton.x=last_mouse_pos.x; + event.xbutton.y=last_mouse_pos.y; + } + */ InputEvent mouse_event; mouse_event.ID = ++event_id; @@ -219,8 +221,8 @@ void HaikuDirectWindow::HandleMouseMoved(BMessage* message) { input->set_mouse_pos(pos); motion_event.mouse_motion.global_x = pos.x; motion_event.mouse_motion.global_y = pos.y; - motion_event.mouse_motion.speed_x = input->get_mouse_speed().x; - motion_event.mouse_motion.speed_y = input->get_mouse_speed().y; + motion_event.mouse_motion.speed_x = input->get_last_mouse_speed().x; + motion_event.mouse_motion.speed_y = input->get_last_mouse_speed().y; motion_event.mouse_motion.relative_x = rel.x; motion_event.mouse_motion.relative_y = rel.y; diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 10e1b055be..176e1b0fbc 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -119,9 +119,11 @@ void OS_Haiku::initialize(const VideoMode& p_desired, int p_video_driver, int p_ ERR_FAIL_COND(!visual_server); // TODO: enable multithreaded VS - //if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { - // visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); - //} + /* + if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { + visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD)); + } + */ input = memnew(InputDefault); window->SetInput(input); diff --git a/platform/javascript/audio_driver_javascript.cpp b/platform/javascript/audio_driver_javascript.cpp index 579cbaed3c..af9f28169b 100644 --- a/platform/javascript/audio_driver_javascript.cpp +++ b/platform/javascript/audio_driver_javascript.cpp @@ -68,14 +68,18 @@ AudioDriverSW::OutputFormat AudioDriverJavaScript::get_output_format() const{ } void AudioDriverJavaScript::lock(){ - //if (active && mutex) - // mutex->lock(); + /* + if (active && mutex) + mutex->lock(); + */ } void AudioDriverJavaScript::unlock() { - //if (active && mutex) - // mutex->unlock(); + /* + if (active && mutex) + mutex->unlock(); + */ } void AudioDriverJavaScript::finish(){ diff --git a/platform/javascript/audio_server_javascript.cpp b/platform/javascript/audio_server_javascript.cpp index d1fba030a5..5489f179eb 100644 --- a/platform/javascript/audio_server_javascript.cpp +++ b/platform/javascript/audio_server_javascript.cpp @@ -617,9 +617,11 @@ void AudioServerJavascript::mix_to_js(int p_frames) { void AudioServerJavascript::init(){ - //EM_ASM( -// console.log('server is '+audio_server); -// ); + /* + EM_ASM( + console.log('server is '+audio_server); + ); + */ //int latency = GLOBAL_DEF("javascript/audio_latency",16384); diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index c151bff45c..33776bc273 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -265,7 +265,7 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool FileAccess *f=FileAccess::open(p_path.get_base_dir()+"/data.pck",FileAccess::WRITE); if (!f) { - EditorNode::add_io_error("Could not create file for writing:\n"+p_path.basename()+"_files.js"); + EditorNode::add_io_error("Could not create file for writing:\n"+p_path.get_basename()+"_files.js"); return ERR_FILE_CANT_WRITE; } Error err = save_pack(f); @@ -307,32 +307,32 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool if (file=="godot.html") { - _fix_html(data,p_path.get_file().basename(), p_debug); + _fix_html(data,p_path.get_file().get_basename(), p_debug); file=p_path.get_file(); } if (file=="godotfs.js") { _fix_files(data,len); - file=p_path.get_file().basename()+"fs.js"; + file=p_path.get_file().get_basename()+"fs.js"; } if (file=="godot.js") { - file=p_path.get_file().basename()+".js"; + file=p_path.get_file().get_basename()+".js"; } if (file=="godot.asm.js") { - file=p_path.get_file().basename()+".asm.js"; + file=p_path.get_file().get_basename()+".asm.js"; } if (file=="godot.mem") { - file=p_path.get_file().basename()+".mem"; + file=p_path.get_file().get_basename()+".mem"; } if (file=="godot.wasm") { - file=p_path.get_file().basename()+".wasm"; + file=p_path.get_file().get_basename()+".wasm"; } String dst = p_path.get_base_dir().plus_file(file); diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp index 4c47594810..6ec7f1ec3d 100644 --- a/platform/javascript/javascript_main.cpp +++ b/platform/javascript/javascript_main.cpp @@ -159,8 +159,8 @@ int main(int argc, char *argv[]) { char *args[]={"-test","gui","-v",NULL}; Error err = Main::setup("apk",3,args); #else -// char *args[]={"-v",NULL};// -// Error err = Main::setup("",1,args); + //char *args[]={"-v",NULL};// + //Error err = Main::setup("",1,args); Error err = Main::setup("",0,NULL); #endif diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 47c8ea89d7..18bf8f6a86 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -243,7 +243,7 @@ void OS_JavaScript::initialize(const VideoMode& p_desired,int p_video_driver,int rasterizer_gles22->set_extensions(gl_extensions); rasterizer = rasterizer_gles22; } else { -// rasterizer = memnew( RasterizerGLES1(true, false) ); + //rasterizer = memnew( RasterizerGLES1(true, false) ); } print_line("Init VS"); @@ -561,7 +561,7 @@ void OS_JavaScript::push_input(const InputEvent& p_ev) { void OS_JavaScript::process_touch(int p_what,int p_pointer, const Vector<TouchPos>& p_points) { -// print_line("ev: "+itos(p_what)+" pnt: "+itos(p_pointer)+" pointc: "+itos(p_points.size())); + //print_line("ev: "+itos(p_what)+" pnt: "+itos(p_pointer)+" pointc: "+itos(p_points.size())); switch(p_what) { case 0: { //gesture begin @@ -644,8 +644,8 @@ void OS_JavaScript::process_touch(int p_what,int p_pointer, const Vector<TouchPo ev.mouse_motion.x=p_points[0].pos.x; ev.mouse_motion.y=p_points[0].pos.y; input->set_mouse_pos(Point2(ev.mouse_motion.x,ev.mouse_motion.y)); - ev.mouse_motion.speed_x=input->get_mouse_speed().x; - ev.mouse_motion.speed_y=input->get_mouse_speed().y; + ev.mouse_motion.speed_x=input->get_last_mouse_speed().x; + ev.mouse_motion.speed_y=input->get_last_mouse_speed().y; ev.mouse_motion.relative_x=p_points[0].pos.x-last_mouse.x; ev.mouse_motion.relative_y=p_points[0].pos.y-last_mouse.y; last_mouse=p_points[0].pos; @@ -804,8 +804,10 @@ String OS_JavaScript::get_resource_dir() const { String OS_JavaScript::get_data_dir() const { - //if (get_data_dir_func) - // return get_data_dir_func(); + /* + if (get_data_dir_func) + return get_data_dir_func(); + */ return "/userfs"; //return GlobalConfig::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); }; diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index fc64c2b867..f6559f1f7a 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -59,7 +59,7 @@ class OS_OSX : public OS_Unix { public: bool force_quit; // rasterizer seems to no longer be given to visual server, its using GLES3 directly? -// Rasterizer *rasterizer; + //Rasterizer *rasterizer; VisualServer *visual_server; List<String> args; diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index a66f6abba5..5750e19c87 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -148,36 +148,36 @@ static int button_mask=0; - (void)applicationDidHide:(NSNotification *)notification { - /* _Godotwindow* window; - - for (window = _Godot.windowListHead; window; window = window->next) - _GodotInputWindowVisibility(window, GL_FALSE); + /* + _Godotwindow* window; + for (window = _Godot.windowListHead; window; window = window->next) + _GodotInputWindowVisibility(window, GL_FALSE); */ } - (void)applicationDidUnhide:(NSNotification *)notification { /* - _Godotwindow* window; + _Godotwindow* window; - for (window = _Godot.windowListHead; window; window = window->next) - { + for (window = _Godot.windowListHead; window; window = window->next) + { if ([window_object isVisible]) _GodotInputWindowVisibility(window, GL_TRUE); - } - */ + } + */ } - (void)applicationDidChangeScreenParameters:(NSNotification *) notification { - //_GodotInputMonitorChange(); + //_GodotInputMonitorChange(); } @end @interface GodotWindowDelegate : NSObject { - // _Godotwindow* window; + //_Godotwindow* window; } @end @@ -187,7 +187,7 @@ static int button_mask=0; - (BOOL)windowShouldClose:(id)sender { - //_GodotInputWindowCloseRequest(window); + //_GodotInputWindowCloseRequest(window); if (OS_OSX::singleton->get_main_loop()) OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_QUIT_REQUEST); return NO; @@ -207,38 +207,42 @@ static int button_mask=0; OS_OSX::singleton->window_size.height=fbRect.size.height*OS_OSX::singleton->display_scale; - // _GodotInputFramebufferSize(window, fbRect.size.width, fbRect.size.height); - // _GodotInputWindowSize(window, contentRect.size.width, contentRect.size.height); - //_GodotInputWindowDamage(window); + /* + _GodotInputFramebufferSize(window, fbRect.size.width, fbRect.size.height); + _GodotInputWindowSize(window, contentRect.size.width, contentRect.size.height); + _GodotInputWindowDamage(window); - //if (window->cursorMode == Godot_CURSOR_DISABLED) - // centerCursor(window); + if (window->cursorMode == Godot_CURSOR_DISABLED) + centerCursor(window); + */ } - (void)windowDidMove:(NSNotification *)notification { - // [window->nsgl.context update]; + /* + [window->nsgl.context update]; - // int x, y; - // _GodotPlatformGetWindowPos(window, &x, &y); - // _GodotInputWindowPos(window, x, y); + int x, y; + _GodotPlatformGetWindowPos(window, &x, &y); + _GodotInputWindowPos(window, x, y); - //if (window->cursorMode == Godot_CURSOR_DISABLED) - // centerCursor(window); + if (window->cursorMode == Godot_CURSOR_DISABLED) + centerCursor(window); + */ } - (void)windowDidBecomeKey:(NSNotification *)notification { - // _GodotInputWindowFocus(window, GL_TRUE); - // _GodotPlatformSetCursorMode(window, window->cursorMode); + //_GodotInputWindowFocus(window, GL_TRUE); + //_GodotPlatformSetCursorMode(window, window->cursorMode); if (OS_OSX::singleton->get_main_loop()) OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN); } - (void)windowDidResignKey:(NSNotification *)notification { - // _GodotInputWindowFocus(window, GL_FALSE); - // _GodotPlatformSetCursorMode(window, Godot_CURSOR_NORMAL); + //_GodotInputWindowFocus(window, GL_FALSE); + //_GodotPlatformSetCursorMode(window, Godot_CURSOR_NORMAL); if (OS_OSX::singleton->get_main_loop()) OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT); } @@ -273,16 +277,18 @@ static int button_mask=0; + (void)initialize { - if (self == [GodotContentView class]) - { - /* if (_glfw.ns.cursor == nil) + if (self == [GodotContentView class]) { - NSImage* data = [[NSImage alloc] initWithSize:NSMakeSize(1, 1)]; - _glfw.ns.cursor = [[NSCursor alloc] initWithImage:data - hotSpot:NSZeroPoint]; - [data release]; - }*/ - } + /* + if (_glfw.ns.cursor == nil) + { + NSImage* data = [[NSImage alloc] initWithSize:NSMakeSize(1, 1)]; + _glfw.ns.cursor = [[NSCursor alloc] initWithImage:data + hotSpot:NSZeroPoint]; + [data release]; + } + */ + } } - (id)init @@ -993,7 +999,7 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi [window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; } -// [window_object setTitle:[NSString stringWithUTF8String:"GodotEnginies"]]; + //[window_object setTitle:[NSString stringWithUTF8String:"GodotEnginies"]]; [window_object setContentView:window_view]; [window_object setDelegate:window_delegate]; [window_object setAcceptsMouseMovedEvents:YES]; @@ -1019,7 +1025,7 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi ADD_ATTR(NSOpenGLPFADoubleBuffer); ADD_ATTR(NSOpenGLPFAClosestPolicy); -// we now need OpenGL 3 or better, maybe even change this to 3_3Core ? + //we now need OpenGL 3 or better, maybe even change this to 3_3Core ? ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core); ADD_ATTR2(NSOpenGLPFAColorSize, colorBits); @@ -1083,15 +1089,16 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi RasterizerGLES3::register_config(); RasterizerGLES3::make_current(); -// rasterizer = instance_RasterizerGLES2(); -// visual_server = memnew( VisualServerRaster(rasterizer) ); + //rasterizer = instance_RasterizerGLES2(); + //visual_server = memnew( VisualServerRaster(rasterizer) ); visual_server = memnew( VisualServerRaster ); // FIXME: Reimplement threaded rendering? Or remove? -// if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { -// -// visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); -// } + /* + if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { + visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); + } + */ visual_server->init(); visual_server->cursor_set_visible(false, 0); @@ -1175,7 +1182,7 @@ void OS_OSX::finalize() { visual_server->finish(); memdelete(visual_server); -// memdelete(rasterizer); + //memdelete(rasterizer); physics_server->finish(); memdelete(physics_server); @@ -1730,10 +1737,10 @@ void OS_OSX::run() { set_window_fullscreen(true); } -// uint64_t last_ticks=get_ticks_usec(); + //uint64_t last_ticks=get_ticks_usec(); -// int frames=0; -// uint64_t frame=0; + //int frames=0; + //uint64_t frame=0; while (!force_quit) { diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index e35ad1adf8..6b91a5ce77 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -103,9 +103,11 @@ void OS_Server::finalize() { spatial_sound_2d_server->finish(); memdelete(spatial_sound_2d_server); - //if (debugger_connection_console) { -// memdelete(debugger_connection_console); -//} + /* + if (debugger_connection_console) { + memdelete(debugger_connection_console); + } + */ memdelete(sample_manager); diff --git a/platform/server/os_server.h b/platform/server/os_server.h index 6aa1b9e14b..f7fe586b1b 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -51,7 +51,7 @@ class OS_Server : public OS_Unix { -// Rasterizer *rasterizer; + //Rasterizer *rasterizer; VisualServer *visual_server; VideoMode current_videomode; List<String> args; diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 1844df5eef..4648384480 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -612,7 +612,7 @@ void AppxPackager::make_content_types() { for (int i = 0; i < file_metadata.size(); i++) { - String ext = file_metadata[i].name.extension(); + String ext = file_metadata[i].name.get_extension(); if (types.has(ext)) continue; diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 34977bc048..9dd745716e 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -412,9 +412,11 @@ void OSUWP::finalize() { spatial_sound_2d_server->finish(); memdelete(spatial_sound_2d_server); - //if (debugger_connection_console) { -// memdelete(debugger_connection_console); -//} + /* + if (debugger_connection_console) { + memdelete(debugger_connection_console); + } + */ memdelete(sample_manager); diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index 6b60ade5f0..7a81dfef77 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -199,7 +199,7 @@ Error ContextGL_Win::initialize() { } wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress ("wglSwapIntervalEXT"); -// glWrapperInit(wrapper_get_proc_address); + //glWrapperInit(wrapper_get_proc_address); return OK; } diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 6256cb58e0..8910b23a2e 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -401,8 +401,8 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { } input->set_mouse_pos(Point2(mm.x,mm.y)); - mm.speed_x=input->get_mouse_speed().x; - mm.speed_y=input->get_mouse_speed().y; + mm.speed_x=input->get_last_mouse_speed().x; + mm.speed_y=input->get_last_mouse_speed().y; if (old_invalid) { @@ -635,8 +635,10 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { gr_mem=alt_mem; } - //if (wParam==VK_WIN) TODO wtf is this? - // meta_mem=uMsg==WM_KEYDOWN; + /* + if (wParam==VK_WIN) TODO wtf is this? + meta_mem=uMsg==WM_KEYDOWN; + */ } //fallthrough @@ -1085,12 +1087,12 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_ visual_server = memnew( VisualServerRaster ); // FIXME: Reimplement threaded rendering? Or remove? -// if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { -// -// visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); -// } + /* + if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { + visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); + } + */ - // physics_server = memnew( PhysicsServerSW ); physics_server->init(); @@ -1274,9 +1276,11 @@ void OS_Windows::finalize() { spatial_sound_2d_server->finish(); memdelete(spatial_sound_2d_server); - //if (debugger_connection_console) { -// memdelete(debugger_connection_console); -//} + /* + if (debugger_connection_console) { + memdelete(debugger_connection_console); + } + */ memdelete(sample_manager); @@ -1608,7 +1612,7 @@ void OS_Windows::set_window_fullscreen(bool p_enabled){ */ } -// MoveWindow(hWnd,r.left,r.top,p_size.x,p_size.y,TRUE); + //MoveWindow(hWnd,r.left,r.top,p_size.x,p_size.y,TRUE); } @@ -1986,7 +1990,7 @@ Error OS_Windows::execute(const String& p_path, const List<String>& p_arguments, argss+=String(" \"")+p_arguments[i]+"\""; } -// print_line("ARGS: "+argss); + //print_line("ARGS: "+argss); //argss+"\""; //argss+=" 2>nul"; diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp index ef497c428d..5baa01c289 100644 --- a/platform/windows/packet_peer_udp_winsock.cpp +++ b/platform/windows/packet_peer_udp_winsock.cpp @@ -247,7 +247,7 @@ int PacketPeerUDPWinsock::_get_socket() { } -void PacketPeerUDPWinsock::set_send_address(const IP_Address& p_address,int p_port) { +void PacketPeerUDPWinsock::set_dest_address(const IP_Address& p_address,int p_port) { peer_addr=p_address; peer_port=p_port; diff --git a/platform/windows/packet_peer_udp_winsock.h b/platform/windows/packet_peer_udp_winsock.h index 2199115889..18e6bd8f3d 100644 --- a/platform/windows/packet_peer_udp_winsock.h +++ b/platform/windows/packet_peer_udp_winsock.h @@ -75,7 +75,7 @@ public: virtual IP_Address get_packet_address() const; virtual int get_packet_port() const; - virtual void set_send_address(const IP_Address& p_address,int p_port); + virtual void set_dest_address(const IP_Address& p_address,int p_port); static void make_default(); PacketPeerUDPWinsock(); diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp index a48a02c7a7..6ceae0fcc7 100644 --- a/platform/windows/stream_peer_winsock.cpp +++ b/platform/windows/stream_peer_winsock.cpp @@ -149,7 +149,7 @@ Error StreamPeerWinsock::write(const uint8_t* p_data,int p_bytes, int &r_sent, b if (WSAGetLastError() != WSAEWOULDBLOCK) { perror("shit?"); - disconnect(); + disconnect_from_host(); ERR_PRINT("Server disconnected!\n"); return FAILED; }; @@ -175,7 +175,7 @@ Error StreamPeerWinsock::write(const uint8_t* p_data,int p_bytes, int &r_sent, b Error StreamPeerWinsock::read(uint8_t* p_buffer, int p_bytes,int &r_received, bool p_block) { - if (!is_connected()) { + if (!is_connected_to_host()) { return FAILED; }; @@ -206,7 +206,7 @@ Error StreamPeerWinsock::read(uint8_t* p_buffer, int p_bytes,int &r_received, bo if (WSAGetLastError() != WSAEWOULDBLOCK) { perror("shit?"); - disconnect(); + disconnect_from_host(); ERR_PRINT("Server disconnected!\n"); return FAILED; }; @@ -218,7 +218,7 @@ Error StreamPeerWinsock::read(uint8_t* p_buffer, int p_bytes,int &r_received, bo }; _block(sockfd, true, false); } else if (read == 0) { - disconnect(); + disconnect_from_host(); return ERR_FILE_EOF; } else { @@ -264,7 +264,7 @@ StreamPeerTCP::Status StreamPeerWinsock::get_status() const { }; -bool StreamPeerWinsock::is_connected() const { +bool StreamPeerWinsock::is_connected_to_host() const { if (status == STATUS_NONE || status == STATUS_ERROR) { @@ -277,7 +277,7 @@ bool StreamPeerWinsock::is_connected() const { return (sockfd!=INVALID_SOCKET); }; -void StreamPeerWinsock::disconnect() { +void StreamPeerWinsock::disconnect_from_host() { if (sockfd != INVALID_SOCKET) closesocket(sockfd); @@ -298,14 +298,14 @@ void StreamPeerWinsock::set_socket(int p_sockfd, IP_Address p_host, int p_port, peer_port = p_port; }; -Error StreamPeerWinsock::connect(const IP_Address& p_host, uint16_t p_port) { +Error StreamPeerWinsock::connect_to_host(const IP_Address& p_host, uint16_t p_port) { ERR_FAIL_COND_V( p_host == IP_Address(), ERR_INVALID_PARAMETER); sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); if (sockfd == INVALID_SOCKET) { ERR_PRINT("Socket creation failed!"); - disconnect(); + disconnect_from_host(); //perror("socket"); return FAILED; }; @@ -313,7 +313,7 @@ Error StreamPeerWinsock::connect(const IP_Address& p_host, uint16_t p_port) { unsigned long par = 1; if (ioctlsocket(sockfd, FIONBIO, &par)) { perror("setting non-block mode"); - disconnect(); + disconnect_from_host(); return FAILED; }; @@ -324,7 +324,7 @@ Error StreamPeerWinsock::connect(const IP_Address& p_host, uint16_t p_port) { if (WSAGetLastError() != WSAEWOULDBLOCK) { ERR_PRINT("Connection to remote host failed!"); - disconnect(); + disconnect_from_host(); return FAILED; }; status = STATUS_CONNECTING; @@ -339,7 +339,7 @@ Error StreamPeerWinsock::connect(const IP_Address& p_host, uint16_t p_port) { }; void StreamPeerWinsock::set_nodelay(bool p_enabled) { - ERR_FAIL_COND(!is_connected()); + ERR_FAIL_COND(!is_connected_to_host()); int flag=p_enabled?1:0; setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, sizeof(int)); } @@ -373,7 +373,7 @@ StreamPeerWinsock::StreamPeerWinsock() { StreamPeerWinsock::~StreamPeerWinsock() { - disconnect(); + disconnect_from_host(); }; diff --git a/platform/windows/stream_peer_winsock.h b/platform/windows/stream_peer_winsock.h index e17a7167e1..eff96930dd 100644 --- a/platform/windows/stream_peer_winsock.h +++ b/platform/windows/stream_peer_winsock.h @@ -58,7 +58,7 @@ protected: public: - virtual Error connect(const IP_Address& p_host, uint16_t p_port); + virtual Error connect_to_host(const IP_Address& p_host, uint16_t p_port); virtual Error put_data(const uint8_t* p_data,int p_bytes); virtual Error put_partial_data(const uint8_t* p_data,int p_bytes, int &r_sent); @@ -73,9 +73,9 @@ public: virtual IP_Address get_connected_host() const; virtual uint16_t get_connected_port() const; - virtual bool is_connected() const; + virtual bool is_connected_to_host() const; virtual Status get_status() const; - virtual void disconnect(); + virtual void disconnect_from_host(); static void make_default(); static void cleanup(); diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index 4adb47938c..39b704d2c4 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -88,7 +88,7 @@ Error ContextGL_X11::initialize() { GLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = NULL; -// const char *extensions = glXQueryExtensionsString(x11_display, DefaultScreen(x11_display)); + //const char *extensions = glXQueryExtensionsString(x11_display, DefaultScreen(x11_display)); glXCreateContextAttribsARB = (GLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB"); diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h index efe377ad92..efea700224 100644 --- a/platform/x11/context_gl_x11.h +++ b/platform/x11/context_gl_x11.h @@ -48,7 +48,7 @@ class ContextGL_X11 : public ContextGL { ContextGL_X11_Private *p; OS::VideoMode default_video_mode; -// ::Colormap x11_colormap; + //::Colormap x11_colormap; ::Display *x11_display; ::Window& x11_window; bool double_buffer; diff --git a/platform/x11/key_mapping_x11.cpp b/platform/x11/key_mapping_x11.cpp index 7b92ed95de..d25fe40c4d 100644 --- a/platform/x11/key_mapping_x11.cpp +++ b/platform/x11/key_mapping_x11.cpp @@ -90,8 +90,8 @@ static _XTranslatePair _xkeysym_to_keycode[]={ { XK_Begin, KEY_CLEAR }, { XK_Insert, KEY_INSERT }, { XK_Delete, KEY_DELETE }, -// { XK_KP_Equal, KEY_EQUAL }, -// { XK_KP_Separator, KEY_COMMA }, + //{ XK_KP_Equal, KEY_EQUAL }, + //{ XK_KP_Separator, KEY_COMMA }, { XK_KP_Decimal, KEY_KP_PERIOD }, { XK_KP_Delete, KEY_KP_PERIOD }, { XK_KP_Enter, KEY_KP_ENTER }, diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 9a4b19f2db..13e01ab6ac 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -474,9 +474,11 @@ void OS_X11::finalize() { spatial_sound_2d_server->finish(); memdelete(spatial_sound_2d_server); - //if (debugger_connection_console) { -// memdelete(debugger_connection_console); -//} + /* + if (debugger_connection_console) { + memdelete(debugger_connection_console); + } + */ #ifdef JOYDEV_ENABLED memdelete(joypad); @@ -1467,8 +1469,8 @@ void OS_X11::process_xevents() { input->set_mouse_pos(pos); motion_event.mouse_motion.global_x=pos.x; motion_event.mouse_motion.global_y=pos.y; - motion_event.mouse_motion.speed_x=input->get_mouse_speed().x; - motion_event.mouse_motion.speed_y=input->get_mouse_speed().y; + motion_event.mouse_motion.speed_x=input->get_last_mouse_speed().x; + motion_event.mouse_motion.speed_y=input->get_last_mouse_speed().y; motion_event.mouse_motion.relative_x=rel.x; motion_event.mouse_motion.relative_y=rel.y; @@ -1923,10 +1925,10 @@ void OS_X11::run() { main_loop->init(); -// uint64_t last_ticks=get_ticks_usec(); + //uint64_t last_ticks=get_ticks_usec(); -// int frames=0; -// uint64_t frame=0; + //int frames=0; + //uint64_t frame=0; while (!force_quit) { diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index ac24e4ee97..64d6ef5560 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -429,7 +429,7 @@ void AnimatedSprite::_notification(int p_what) { //texture->draw_rect(ci,dst_rect,false,modulate); texture->draw_rect_region(ci,dst_rect,Rect2(Vector2(),texture->get_size())); -// VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate); + //VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate); } break; } diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index a72e1164b4..67c596421f 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -418,7 +418,7 @@ void Area2D::_notification(int p_what) { } -void Area2D::set_enable_monitoring(bool p_enable) { +void Area2D::set_monitoring(bool p_enable) { if (p_enable==monitoring) @@ -443,7 +443,7 @@ void Area2D::set_enable_monitoring(bool p_enable) { } } -bool Area2D::is_monitoring_enabled() const { +bool Area2D::is_monitoring() const { return monitoring; } @@ -629,8 +629,8 @@ void Area2D::_bind_methods() { ClassDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&Area2D::set_layer_mask_bit); ClassDB::bind_method(_MD("get_layer_mask_bit","bit"),&Area2D::get_layer_mask_bit); - ClassDB::bind_method(_MD("set_enable_monitoring","enable"),&Area2D::set_enable_monitoring); - ClassDB::bind_method(_MD("is_monitoring_enabled"),&Area2D::is_monitoring_enabled); + ClassDB::bind_method(_MD("set_monitoring","enable"),&Area2D::set_monitoring); + ClassDB::bind_method(_MD("is_monitoring"),&Area2D::is_monitoring); ClassDB::bind_method(_MD("set_monitorable","enable"),&Area2D::set_monitorable); ClassDB::bind_method(_MD("is_monitorable"),&Area2D::is_monitorable); @@ -664,7 +664,7 @@ void Area2D::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"0,100,0.01"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"0,100,0.01"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"priority",PROPERTY_HINT_RANGE,"0,128,1"),_SCS("set_priority"),_SCS("get_priority")); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_enable_monitoring"),_SCS("is_monitoring_enabled")); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_monitoring"),_SCS("is_monitoring")); ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitorable"),_SCS("set_monitorable"),_SCS("is_monitorable")); ADD_GROUP("Collision","collision_"); ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); @@ -687,7 +687,7 @@ Area2D::Area2D() : CollisionObject2D(Physics2DServer::get_singleton()->area_crea monitorable=false; collision_mask=1; layer_mask=1; - set_enable_monitoring(true); + set_monitoring(true); set_monitorable(true); } diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index e1adc16666..68bada707b 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -153,8 +153,8 @@ public: void set_priority(real_t p_priority); real_t get_priority() const; - void set_enable_monitoring(bool p_enable); - bool is_monitoring_enabled() const; + void set_monitoring(bool p_enable); + bool is_monitoring() const; void set_monitorable(bool p_enable); bool is_monitorable() const; diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index b921db239d..0bafef1b83 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -52,7 +52,7 @@ void Camera2D::_update_scroll() { if (viewport) { viewport->set_canvas_transform( xform ); } - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,group_name,"_camera_moved",xform); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME,group_name,"_camera_moved",xform); }; } @@ -145,7 +145,7 @@ Transform2D Camera2D::get_camera_transform() { float c = smoothing*get_fixed_process_delta_time(); smoothed_camera_pos = ((camera_pos-smoothed_camera_pos)*c)+smoothed_camera_pos; ret_camera_pos=smoothed_camera_pos; - // camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing; + //camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing; } else { ret_camera_pos=smoothed_camera_pos=camera_pos; @@ -252,7 +252,7 @@ void Camera2D::_notification(int p_what) { canvas = get_canvas(); - RID vp = viewport->get_viewport(); + RID vp = viewport->get_viewport_rid(); group_name = "__cameras_"+itos(vp.get_id()); canvas_group_name ="__cameras_c"+itos(canvas.get_id()); @@ -375,7 +375,7 @@ void Camera2D::make_current() { if (!is_inside_tree()) { current=true; } else { - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,group_name,"_make_current",this); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME,group_name,"_make_current",this); } } @@ -383,7 +383,7 @@ void Camera2D::clear_current() { current=false; if (is_inside_tree()) { - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,group_name,"_make_current",(Object*)(NULL)); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME,group_name,"_make_current",(Object*)(NULL)); } } @@ -573,7 +573,7 @@ void Camera2D::set_custom_viewport(Node *p_viewport) { else viewport=get_viewport(); - RID vp = viewport->get_viewport(); + RID vp = viewport->get_viewport_rid(); group_name = "__cameras_"+itos(vp.get_id()); canvas_group_name ="__cameras_c"+itos(canvas.get_id()); add_to_group(group_name); diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 0a3e06602b..817707f96e 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -394,7 +394,7 @@ void CanvasItem::_enter_canvas() { else get_viewport()->gui_reset_canvas_sort_index(); - get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); } else { @@ -444,7 +444,7 @@ void CanvasItem::_notification(int p_what) { break; if (group!="") { - get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); } else { CanvasItem *p = get_parent_item(); ERR_FAIL_COND(!p); @@ -818,7 +818,7 @@ Ref<World2D> CanvasItem::get_world_2d() const { RID CanvasItem::get_viewport_rid() const { ERR_FAIL_COND_V(!is_inside_tree(),RID()); - return get_viewport()->get_viewport(); + return get_viewport()->get_viewport_rid(); } void CanvasItem::set_block_transform_notify(bool p_enable) { @@ -1115,7 +1115,7 @@ CanvasItem::CanvasItem() : xform_change(this) { drawing=false; behind=false; block_transform_notify=false; -// viewport=NULL; + //viewport=NULL; canvas_layer=NULL; use_parent_material=false; global_invalid=true; diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index e90bf8b96e..3668963251 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -282,7 +282,7 @@ void CollisionObject2D::set_shape(int p_shape_idx, const Ref<Shape2D>& p_shape) else Physics2DServer::get_singleton()->body_set_shape(get_rid(),p_shape_idx,p_shape->get_rid()); -// _update_shapes(); + //_update_shapes(); } void CollisionObject2D::set_shape_transform(int p_shape_idx, const Transform2D& p_transform) { @@ -295,7 +295,7 @@ void CollisionObject2D::set_shape_transform(int p_shape_idx, const Transform2D& else Physics2DServer::get_singleton()->body_set_shape_transform(get_rid(),p_shape_idx,p_transform); -// _update_shapes(); + //_update_shapes(); } Ref<Shape2D> CollisionObject2D::get_shape(int p_shape_idx) const { diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index 2d0fbf1cfc..03c2c698eb 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -432,7 +432,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect while(!found_route) { if (open_list.size()==0) { - // print_line("NOU OPEN LIST"); + //print_line("NOU OPEN LIST"); break; } //check open list diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index b91b2d4f56..012120d023 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -310,7 +310,7 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) { if (get_tree()->is_editor_hint() || get_tree()->is_debugging_navigation_hint()) update(); -// update_gizmo(); + //update_gizmo(); } bool NavigationPolygonInstance::is_enabled() const { diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 46a345f1cb..feecbd9e20 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -375,7 +375,7 @@ void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shap if (!E) { E = contact_monitor->body_map.insert(objid,BodyState()); -// E->get().rc=0; + //E->get().rc=0; E->get().in_scene=node && node->is_inside_tree(); if (node) { node->connect(SceneStringNames::get_singleton()->tree_entered,this,SceneStringNames::get_singleton()->_body_enter_tree,make_binds(objid)); @@ -494,7 +494,7 @@ void RigidBody2D::_direct_state_changed(Object *p_state) { int local_shape = state->get_contact_local_shape(i); int shape = state->get_contact_collider_shape(i); -// bool found=false; + //bool found=false; Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.find(obj); if (!E) { @@ -1141,8 +1141,10 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { float d = a.distance_to(b); - //if (d<margin) - /// continue; + /* + if (d<margin) + continue; + */ recover_motion+=(b-a)*0.4; } diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 99147b0a39..20db63b66f 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -307,8 +307,10 @@ Rect2 TouchScreenButton::get_item_rect() const { if (texture.is_null()) return Rect2(0,0,1,1); - //if (texture.is_null()) - // return CanvasItem::get_item_rect(); + /* + if (texture.is_null()) + return CanvasItem::get_item_rect(); + */ return Rect2(Size2(),texture->get_size()); } diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 01aa99c6a4..bea45aae4e 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -255,8 +255,10 @@ Rect2 Sprite::get_item_rect() const { if (texture.is_null()) return Rect2(0,0,1,1); - //if (texture.is_null()) - // return CanvasItem::get_item_rect(); + /* + if (texture.is_null()) + return CanvasItem::get_item_rect(); + */ Size2i s; @@ -510,8 +512,10 @@ Rect2 ViewportSprite::get_item_rect() const { if (texture.is_null()) return Rect2(0,0,1,1); - //if (texture.is_null()) - // return CanvasItem::get_item_rect(); + /* + if (texture.is_null()) + return CanvasItem::get_item_rect(); + */ Size2i s; diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 26f9f7b879..a7bb53bf63 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -610,7 +610,7 @@ Map<TileMap::PosKey,TileMap::Quadrant>::Element *TileMap::_create_quadrant(const xform.set_origin( q.pos ); -// q.canvas_item = VisualServer::get_singleton()->canvas_item_create(); + //q.canvas_item = VisualServer::get_singleton()->canvas_item_create(); q.body=Physics2DServer::get_singleton()->body_create(use_kinematic?Physics2DServer::BODY_MODE_KINEMATIC:Physics2DServer::BODY_MODE_STATIC); Physics2DServer::get_singleton()->body_attach_object_instance_ID(q.body,get_instance_ID()); Physics2DServer::get_singleton()->body_set_layer_mask(q.body,collision_layer); @@ -849,8 +849,10 @@ void TileMap::_set_tile_data(const PoolVector<int>& p_data) { bool transpose = v&(1<<31); v&=(1<<29)-1; -// if (x<-20 || y <-20 || x>4000 || y>4000) -// continue; + /* + if (x<-20 || y <-20 || x>4000 || y>4000) + continue; + */ set_cell(x,y,v,flip_h,flip_v,transpose); } diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index c4afed4b31..99e40984c5 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -295,7 +295,7 @@ void Area::_notification(int p_what) { } } -void Area::set_enable_monitoring(bool p_enable) { +void Area::set_monitoring(bool p_enable) { if (locked) { ERR_EXPLAIN("This function can't be used during the in/out signal."); @@ -433,7 +433,7 @@ void Area::_area_inout(int p_status,const RID& p_area, int p_instance, int p_are } -bool Area::is_monitoring_enabled() const { +bool Area::is_monitoring() const { return monitoring; } @@ -622,8 +622,8 @@ void Area::_bind_methods() { ClassDB::bind_method(_MD("is_monitorable"),&Area::is_monitorable); - ClassDB::bind_method(_MD("set_enable_monitoring","enable"),&Area::set_enable_monitoring); - ClassDB::bind_method(_MD("is_monitoring_enabled"),&Area::is_monitoring_enabled); + ClassDB::bind_method(_MD("set_monitoring","enable"),&Area::set_monitoring); + ClassDB::bind_method(_MD("is_monitoring"),&Area::is_monitoring); ClassDB::bind_method(_MD("get_overlapping_bodies"),&Area::get_overlapping_bodies); ClassDB::bind_method(_MD("get_overlapping_areas"),&Area::get_overlapping_areas); @@ -653,7 +653,7 @@ void Area::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"0,1024,0.001"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); ADD_PROPERTY( PropertyInfo(Variant::INT,"priority",PROPERTY_HINT_RANGE,"0,128,1"),_SCS("set_priority"),_SCS("get_priority")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_enable_monitoring"),_SCS("is_monitoring_enabled")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_monitoring"),_SCS("is_monitoring")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"monitorable"),_SCS("set_monitorable"),_SCS("is_monitorable")); ADD_GROUP("Collision","collision_"); ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); @@ -676,7 +676,7 @@ Area::Area() : CollisionObject(PhysicsServer::get_singleton()->area_create(),tru collision_mask=1; layer_mask=1; set_ray_pickable(false); - set_enable_monitoring(true); + set_monitoring(true); set_monitorable(true); } diff --git a/scene/3d/area.h b/scene/3d/area.h index 3260bad0a4..7956846505 100644 --- a/scene/3d/area.h +++ b/scene/3d/area.h @@ -153,8 +153,8 @@ public: void set_priority(real_t p_priority); real_t get_priority() const; - void set_enable_monitoring(bool p_enable); - bool is_monitoring_enabled() const; + void set_monitoring(bool p_enable); + bool is_monitoring() const; void set_monitorable(bool p_enable); bool is_monitorable() const; diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp index 59d8d7ecac..e42439bf3b 100644 --- a/scene/3d/baked_light_instance.cpp +++ b/scene/3d/baked_light_instance.cpp @@ -1524,7 +1524,7 @@ void BakedLight::set_cell_subdiv(int p_subdiv) { cell_subdiv=p_subdiv; -// VS::get_singleton()->baked_light_set_subdivision(baked_light,p_subdiv); + //VS::get_singleton()->baked_light_set_subdivision(baked_light,p_subdiv); } int BakedLight::get_cell_subdiv() const { @@ -1745,7 +1745,7 @@ void BakedLight::_bind_methods() { BakedLight::BakedLight() { -// baked_light=VisualServer::get_singleton()->baked_light_create(); + //baked_light=VisualServer::get_singleton()->baked_light_create(); VS::get_singleton()->instance_set_base(get_instance(),baked_light); cell_subdiv=8; @@ -1815,7 +1815,7 @@ void BakedLightSampler::_bind_methods() { ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/strength",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_STRENGTH); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/attenuation",PROPERTY_HINT_EXP_EASING),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/detail_ratio",PROPERTY_HINT_RANGE,"0.01,1.0,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_DETAIL_RATIO); -// ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/detail_ratio",PROPERTY_HINT_RANGE,"0,20,1"),_SCS("set_param"),_SCS("get_param"),PARAM_DETAIL_RATIO); + //ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/detail_ratio",PROPERTY_HINT_RANGE,"0,20,1"),_SCS("set_param"),_SCS("get_param"),PARAM_DETAIL_RATIO); ADD_PROPERTY( PropertyInfo(Variant::REAL,"params/resolution",PROPERTY_HINT_RANGE,"4,32,1"),_SCS("set_resolution"),_SCS("get_resolution")); } diff --git a/scene/3d/body_shape.cpp b/scene/3d/body_shape.cpp index ff8b0f15bf..f6ec8639d3 100644 --- a/scene/3d/body_shape.cpp +++ b/scene/3d/body_shape.cpp @@ -96,7 +96,7 @@ void CollisionShape::_update_indicator() { pt = VS::PRIMITIVE_LINES; } else if (shape->cast_to<SphereShape>()) { -// VisualServer *vs=VisualServer::get_singleton(); + //VisualServer *vs=VisualServer::get_singleton(); SphereShape *shapeptr=shape->cast_to<SphereShape>(); @@ -337,7 +337,7 @@ void CollisionShape::_notification(int p_what) { //indicator_instance = VisualServer::get_singleton()->instance_create2(indicator,get_world()->get_scenario()); } break; case NOTIFICATION_TRANSFORM_CHANGED: { - // VisualServer::get_singleton()->instance_set_transform(indicator_instance,get_global_transform()); + //VisualServer::get_singleton()->instance_set_transform(indicator_instance,get_global_transform()); if (can_update_body && updating_body) { _update_body(); } diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 50ddafc3e4..3f36caf62c 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -190,9 +190,11 @@ void Camera::_update_camera() { tr.origin+=tr.basis.get_axis(0)*h_offset; VisualServer::get_singleton()->camera_set_transform( camera, tr ); -// here goes listener stuff -// if (viewport_ptr && is_inside_scene() && is_current()) -// get_viewport()->_camera_transform_changed_notify(); + // here goes listener stuff + /* + if (viewport_ptr && is_inside_scene() && is_current()) + get_viewport()->_camera_transform_changed_notify(); + */ if (is_inside_tree() && is_current()) { get_viewport()->_camera_transform_changed_notify(); @@ -373,7 +375,7 @@ Vector3 Camera::project_local_ray_normal(const Point2& p_pos) const { ray=Vector3(0,0,-1); } else { CameraMatrix cm; - cm.set_perspective(fov,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH); + cm.set_perspective(fov,viewport_size.aspect(),near,far,keep_aspect==KEEP_WIDTH); float screen_w,screen_h; cm.get_viewport_size(screen_w,screen_h); ray=Vector3( ((cpos.x/viewport_size.width)*2.0-1.0)*screen_w, ((1.0-(cpos.y/viewport_size.height))*2.0-1.0)*screen_h,-near).normalized(); @@ -400,7 +402,7 @@ Vector3 Camera::project_ray_origin(const Point2& p_pos) const { #endif ERR_FAIL_COND_V( viewport_size.y == 0, Vector3() ); -// float aspect = viewport_size.x / viewport_size.y; + //float aspect = viewport_size.x / viewport_size.y; if (mode == PROJECTION_PERSPECTIVE) { @@ -410,10 +412,10 @@ Vector3 Camera::project_ray_origin(const Point2& p_pos) const { Vector2 pos = cpos / viewport_size; float vsize,hsize; if (keep_aspect==KEEP_WIDTH) { - vsize = size/viewport_size.get_aspect(); + vsize = size/viewport_size.aspect(); hsize = size; } else { - hsize = size*viewport_size.get_aspect(); + hsize = size*viewport_size.aspect(); vsize = size; } @@ -449,9 +451,9 @@ Point2 Camera::unproject_position(const Vector3& p_pos) const { if (mode==PROJECTION_ORTHOGONAL) - cm.set_orthogonal(size,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH); + cm.set_orthogonal(size,viewport_size.aspect(),near,far,keep_aspect==KEEP_WIDTH); else - cm.set_perspective(fov,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH); + cm.set_perspective(fov,viewport_size.aspect(),near,far,keep_aspect==KEEP_WIDTH); Plane p(get_camera_transform().xform_inv(p_pos),1.0); @@ -479,9 +481,9 @@ Vector3 Camera::project_position(const Point2& p_point) const { CameraMatrix cm; if (mode==PROJECTION_ORTHOGONAL) - cm.set_orthogonal(size,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH); + cm.set_orthogonal(size,viewport_size.aspect(),near,far,keep_aspect==KEEP_WIDTH); else - cm.set_perspective(fov,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH); + cm.set_perspective(fov,viewport_size.aspect(),near,far,keep_aspect==KEEP_WIDTH); Size2 vp_size; cm.get_viewport_size(vp_size.x,vp_size.y); @@ -628,9 +630,9 @@ Vector<Plane> Camera::get_frustum() const { Size2 viewport_size = get_viewport()->get_visible_rect().size; CameraMatrix cm; if (mode==PROJECTION_PERSPECTIVE) - cm.set_perspective(fov,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH); + cm.set_perspective(fov,viewport_size.aspect(),near,far,keep_aspect==KEEP_WIDTH); else - cm.set_orthogonal(size,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH); + cm.set_orthogonal(size,viewport_size.aspect(),near,far,keep_aspect==KEEP_WIDTH); return cm.get_projection_planes(get_camera_transform()); diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index 96d8d13a29..7bba382db0 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -339,7 +339,7 @@ CollisionObject::CollisionObject(RID p_rid, bool p_area) { } else { PhysicsServer::get_singleton()->body_attach_object_instance_ID(rid,get_instance_ID()); } -// set_transform_notify(true); + //set_transform_notify(true); } diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 13e7c175ed..54d7cb6b9e 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -1182,7 +1182,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ if (p_create_visual_debug) { - // _create_debug_mesh(&baker); + //_create_debug_mesh(&baker); } diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 66bad45c45..764aff1c08 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -298,7 +298,7 @@ void MeshInstance::_bind_methods() { ClassDB::bind_method(_MD("get_mesh:Mesh"),&MeshInstance::get_mesh); ClassDB::bind_method(_MD("set_skeleton_path","skeleton_path:NodePath"),&MeshInstance::set_skeleton_path); ClassDB::bind_method(_MD("get_skeleton_path:NodePath"),&MeshInstance::get_skeleton_path); - ClassDB::bind_method(_MD("get_aabb"),&MeshInstance::get_aabb); + ClassDB::bind_method(_MD("create_trimesh_collision"),&MeshInstance::create_trimesh_collision); ClassDB::set_method_flags("MeshInstance","create_trimesh_collision",METHOD_FLAGS_DEFAULT); ClassDB::bind_method(_MD("create_convex_collision"),&MeshInstance::create_convex_collision); diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index 40666a60dc..9bb19880bf 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -368,7 +368,7 @@ Vector<Vector3> Navigation::get_simple_path(const Vector3& p_start, const Vector while(!found_route) { if (open_list.size()==0) { - // print_line("NOU OPEN LIST"); + //print_line("NOU OPEN LIST"); break; } //check open list diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 9e37658cd9..72fab4cccc 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -325,7 +325,7 @@ RES Particles::_get_gizmo_geometry() const { mat->set_parameter( FixedSpatialMaterial::PARAM_EMISSION,Color(0.5,0.7,0.8) ); mat->set_blend_mode( Material::BLEND_MODE_ADD ); mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); -// mat->set_hint(Material::HINT_NO_DEPTH_DRAW,true); + //mat->set_hint(Material::HINT_NO_DEPTH_DRAW,true); surface_tool->begin(Mesh::PRIMITIVE_TRIANGLES); @@ -334,7 +334,7 @@ RES Particles::_get_gizmo_geometry() const { int sides=16; int sections=24; -// float len=1; + //float len=1; float deg=Math::deg2rad(var[VAR_SPREAD]*180); if (deg==180) deg=179.5; diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 9235eae643..0a44ad9c3d 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -437,7 +437,7 @@ void RigidBody::_direct_state_changed(Object *p_state) { int local_shape = state->get_contact_local_shape(i); int shape = state->get_contact_collider_shape(i); -// bool found=false; + //bool found=false; Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.find(obj); if (!E) { @@ -1000,7 +1000,7 @@ Vector3 KinematicBody::move(const Vector3& p_motion) { if (collide_character) mask|=PhysicsDirectSpaceState::TYPE_MASK_CHARACTER_BODY; -// print_line("motion: "+p_motion+" margin: "+rtos(margin)); + //print_line("motion: "+p_motion+" margin: "+rtos(margin)); //print_line("margin: "+rtos(margin)); @@ -1038,10 +1038,10 @@ Vector3 KinematicBody::move(const Vector3& p_motion) { #if 0 float d = a.distance_to(b); - //if (d<margin) - /// continue; - /// - /// + /* + if (d<margin) + continue; + */ recover_motion+=(b-a)*0.2; #else float dist = a.distance_to(b); @@ -1144,7 +1144,7 @@ Vector3 KinematicBody::move(const Vector3& p_motion) { colliding=false; } - // print_line("Rest Travel: "+rest.normal); + //print_line("Rest Travel: "+rest.normal); } @@ -1159,8 +1159,10 @@ Vector3 KinematicBody::move(const Vector3& p_motion) { } Vector3 motion=p_motion*safe; - //if (colliding) - // motion+=normal*0.001; + /* + if (colliding) + motion+=normal*0.001; + */ Transform gt = get_global_transform(); gt.origin+=motion; set_global_transform(gt); diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp index 5ef0d3f176..9f4b5c7a03 100644 --- a/scene/3d/proximity_group.cpp +++ b/scene/3d/proximity_group.cpp @@ -135,7 +135,7 @@ void ProximityGroup::broadcast(String p_name, Variant p_params) { E = groups.front(); while (E) { - get_tree()->call_group(SceneTree::GROUP_CALL_DEFAULT, E->key(), "_proximity_group_broadcast", p_name, p_params); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFAULT, E->key(), "_proximity_group_broadcast", p_name, p_params); E = E->next(); }; diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index 5e576b4960..f2e339604e 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -482,7 +482,7 @@ Transform Skeleton::get_bone_pose(int p_bone) const { void Skeleton::set_bone_custom_pose(int p_bone, const Transform& p_custom_pose) { ERR_FAIL_INDEX( p_bone, bones.size() ); -// ERR_FAIL_COND( !is_inside_scene() ); + //ERR_FAIL_COND( !is_inside_scene() ); bones[p_bone].custom_pose_enable=(p_custom_pose!=Transform()); diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 7c452f90af..6843a7e9b3 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -95,8 +95,10 @@ void Spatial::_propagate_transform_changed(Spatial *p_origin) { return; } -// if (data.dirty&DIRTY_GLOBAL) -// return; //already dirty + /* + if (data.dirty&DIRTY_GLOBAL) + return; //already dirty + */ data.children_lock++; @@ -179,8 +181,8 @@ void Spatial::_notification(int p_what) { #ifdef TOOLS_ENABLED if (get_tree()->is_editor_hint()) { -// get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,SceneStringNames::get_singleton()->_spatial_editor_group,SceneStringNames::get_singleton()->_request_gizmo,this); - get_tree()->call_group(0,SceneStringNames::get_singleton()->_spatial_editor_group,SceneStringNames::get_singleton()->_request_gizmo,this); + //get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,SceneStringNames::get_singleton()->_spatial_editor_group,SceneStringNames::get_singleton()->_request_gizmo,this); + get_tree()->call_group_flags(0,SceneStringNames::get_singleton()->_spatial_editor_group,SceneStringNames::get_singleton()->_request_gizmo,this); if (!data.gizmo_disabled) { if (data.gizmo.is_valid()) @@ -821,7 +823,7 @@ void Spatial::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"rotation",PROPERTY_HINT_NONE,"",0), _SCS("set_rotation"), _SCS("get_rotation") ); ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"scale",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_scale"), _SCS("get_scale") ); ADD_GROUP("Visibility",""); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visible"), _SCS("_set_visible_"), _SCS("_is_visible_") ); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visible"), _SCS("set_visible"), _SCS("is_visible") ); //ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"transform/local"), _SCS("set_transform"), _SCS("get_transform") ); ADD_SIGNAL( MethodInfo("visibility_changed" ) ); diff --git a/scene/3d/spatial_stream_player.cpp b/scene/3d/spatial_stream_player.cpp index 087e60b48b..1f9765c1d3 100644 --- a/scene/3d/spatial_stream_player.cpp +++ b/scene/3d/spatial_stream_player.cpp @@ -153,10 +153,12 @@ void SpatialStreamPlayer::play(float p_from_offset) { SpatialSoundServer::get_singleton()->source_set_audio_stream(get_source_rid(),&internal_stream); -// AudioServer::get_singleton()->stream_set_active(stream_rid,true); -// AudioServer::get_singleton()->stream_set_volume_scale(stream_rid,volume); -// if (stream->get_update_mode()!=AudioStream::UPDATE_NONE) -// set_idle_process(true); + /* + AudioServer::get_singleton()->stream_set_active(stream_rid,true); + AudioServer::get_singleton()->stream_set_volume_scale(stream_rid,volume); + if (stream->get_update_mode()!=AudioStream::UPDATE_NONE) + set_idle_process(true); + */ } @@ -289,8 +291,10 @@ bool SpatialStreamPlayer::has_autoplay() const { void SpatialStreamPlayer::set_paused(bool p_paused) { paused=p_paused; - //if (stream.is_valid()) - // stream->set_paused(p_paused); + /* + if (stream.is_valid()) + stream->set_paused(p_paused); + */ } bool SpatialStreamPlayer::is_paused() const { diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index a2a96d7d0e..9f0c91c4b8 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -563,8 +563,10 @@ Rect2 Sprite3D::get_item_rect() const { if (texture.is_null()) return Rect2(0,0,1,1); - //if (texture.is_null()) - // return CanvasItem::get_item_rect(); + /* + if (texture.is_null()) + return CanvasItem::get_item_rect(); + */ Size2i s; @@ -1130,7 +1132,7 @@ void AnimatedSprite3D::_notification(int p_what) { //texture->draw_rect(ci,dst_rect,false,modulate); texture->draw_rect_region(ci,dst_rect,Rect2(Vector2(),texture->get_size()),modulate); -// VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate); + //VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate); } break; #endif diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index f5d3957370..a14ce40495 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -185,7 +185,7 @@ public: virtual Rect2 get_item_rect() const; Sprite3D(); -// ~Sprite3D(); + //~Sprite3D(); }; #if 0 @@ -215,7 +215,7 @@ public: virtual Rect2 get_item_rect() const; AnimatedSprite3D(); -// ~AnimatedSprite3D(); + //~AnimatedSprite3D(); }; #endif diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 1cb443225c..a3f05f719d 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -340,10 +340,11 @@ void VehicleBody::_update_wheel_transform(VehicleWheel& wheel ,PhysicsDirectBody wheel.m_raycastInfo.m_isInContact = false; Transform chassisTrans = s->get_transform(); - //if (interpolatedTransform && (getRigidBody()->getMotionState())) - //{ - // getRigidBody()->getMotionState()->getWorldTransform(chassisTrans); - //} + /* + if (interpolatedTransform && (getRigidBody()->getMotionState())) { + getRigidBody()->getMotionState()->getWorldTransform(chassisTrans); + } + */ wheel.m_raycastInfo.m_hardPointWS = chassisTrans.xform( wheel.m_chassisConnectionPointCS ); //wheel.m_raycastInfo.m_hardPointWS+=s->get_linear_velocity()*s->get_step(); @@ -360,8 +361,8 @@ void VehicleBody::_update_wheel(int p_idx,PhysicsDirectBodyState *s) { const Vector3& right = wheel.m_raycastInfo.m_wheelAxleWS; Vector3 fwd = up.cross(right); fwd = fwd.normalized(); -// up = right.cross(fwd); -// up.normalize(); + //up = right.cross(fwd); + //up.normalize(); //rotate around steering over de wheelAxleWS real_t steering = wheel.steers?m_steeringValue:0.0; @@ -371,8 +372,10 @@ void VehicleBody::_update_wheel(int p_idx,PhysicsDirectBodyState *s) { Basis rotatingMat(right,-wheel.m_rotation); -// if (p_idx==1) -// print_line("steeringMat " +steeringMat); + /* + if (p_idx==1) + print_line("steeringMat " +steeringMat); + */ Basis basis2( right[0],up[0],fwd[0], @@ -502,7 +505,7 @@ void VehicleBody::_update_suspension(PhysicsDirectBodyState *s) if ( wheel_info.m_raycastInfo.m_isInContact ) { real_t force; - // Spring + //Spring { real_t susp_length = wheel_info.m_suspensionRestLength; real_t current_length = wheel_info.m_raycastInfo.m_suspensionLength; diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h index cd627f8998..273e63d741 100644 --- a/scene/3d/vehicle_body.h +++ b/scene/3d/vehicle_body.h @@ -63,7 +63,7 @@ friend class VehicleBody; VehicleBody *body; -// btVector3 m_wheelAxleCS; // const or modified by steering ? + //btVector3 m_wheelAxleCS; // const or modified by steering ? real_t m_steering; real_t m_rotation; diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index ca78f8e21f..ec37aa2bc4 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -102,7 +102,7 @@ void VisualInstance::_notification(int p_what) { VisualServer::get_singleton()->instance_set_scenario( instance, RID() ); VisualServer::get_singleton()->instance_set_room(instance,RID()); VisualServer::get_singleton()->instance_attach_skeleton( instance, RID() ); - // VS::get_singleton()->instance_geometry_set_baked_light_sampler(instance, RID() ); + //VS::get_singleton()->instance_geometry_set_baked_light_sampler(instance, RID() ); } break; case NOTIFICATION_VISIBILITY_CHANGED: { @@ -368,7 +368,7 @@ void GeometryInstance::_bind_methods() { ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_max_distance",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_max_distance"), _SCS("get_lod_max_distance")); ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_max_hysteresis",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_max_hysteresis"), _SCS("get_lod_max_hysteresis")); -// ADD_SIGNAL( MethodInfo("visibility_changed")); + //ADD_SIGNAL( MethodInfo("visibility_changed")); BIND_CONSTANT(FLAG_CAST_SHADOW ); BIND_CONSTANT(FLAG_BILLBOARD ); @@ -399,7 +399,7 @@ GeometryInstance::GeometryInstance() { shadow_casting_setting=SHADOW_CASTING_SETTING_ON; extra_cull_margin=0; -// VS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0); + //VS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0); } diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index fa0700584c..8b81c45597 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -36,7 +36,7 @@ bool AnimationPlayer::_set(const StringName& p_name, const Variant& p_value) { String name=p_name; if (p_name==SceneStringNames::get_singleton()->playback_speed || p_name==SceneStringNames::get_singleton()->speed) { //bw compatibility - set_speed(p_value); + set_speed_scale(p_value); } else if (p_name==SceneStringNames::get_singleton()->playback_active) { set_active(p_value); @@ -426,8 +426,10 @@ void AnimationPlayer::_animation_process_animation(AnimationData* p_anim,float p Variant value=a->value_track_interpolate(i,p_time); //thanks to trigger mode, this should be solved now.. - //if (p_delta==0 && value.get_type()==Variant::STRING) - // continue; // doing this with strings is messy, should find another way + /* + if (p_delta==0 && value.get_type()==Variant::STRING) + continue; // doing this with strings is messy, should find another way + */ if (pa->accum_pass!=accum_pass) { ERR_CONTINUE( cache_update_prop_size >= NODE_CACHE_UPDATE_MAX ); cache_update_prop[cache_update_prop_size++]=pa; @@ -713,7 +715,7 @@ void AnimationPlayer::_animation_process(float p_delta) { -// bool any_active=false; + //bool any_active=false; if (playback.current.from) { @@ -1082,13 +1084,13 @@ void AnimationPlayer::stop_all() { } -void AnimationPlayer::set_speed(float p_speed) { +void AnimationPlayer::set_speed_scale(float p_speed) { speed_scale=p_speed; } -float AnimationPlayer::get_speed() const { +float AnimationPlayer::get_speed_scale() const { return speed_scale; } @@ -1323,8 +1325,8 @@ void AnimationPlayer::_bind_methods() { ClassDB::bind_method(_MD("set_active","active"),&AnimationPlayer::set_active); ClassDB::bind_method(_MD("is_active"),&AnimationPlayer::is_active); - ClassDB::bind_method(_MD("set_speed","speed"),&AnimationPlayer::set_speed); - ClassDB::bind_method(_MD("get_speed"),&AnimationPlayer::get_speed); + ClassDB::bind_method(_MD("set_speed_scale","speed"),&AnimationPlayer::set_speed_scale); + ClassDB::bind_method(_MD("get_speed_scale"),&AnimationPlayer::get_speed_scale); ClassDB::bind_method(_MD("set_autoplay","name"),&AnimationPlayer::set_autoplay); ClassDB::bind_method(_MD("get_autoplay"),&AnimationPlayer::get_autoplay); diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 94955bec60..41bae6c928 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -271,8 +271,8 @@ public: bool is_active() const; bool is_valid() const; - void set_speed(float p_speed); - float get_speed() const; + void set_speed_scale(float p_speed); + float get_speed_scale() const; void set_autoplay(const String& pname); String get_autoplay() const; diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index dbcdb284be..c3a05240bb 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -214,7 +214,7 @@ bool AnimationTreePlayer::_set(const StringName& p_name, const Variant& p_value) StringName src = connections[i*3+0]; StringName dst = connections[i*3+1]; int dst_in = connections[i*3+2]; - connect(src,dst,dst_in); + connect_nodes(src,dst,dst_in); } set_active(data.get_valid("active")); @@ -506,10 +506,10 @@ float AnimationTreePlayer::_process_node(const StringName& p_node,AnimationNode float rem = 0; if (!an->animation.is_null()) { - // float pos = an->time; -// float delta = p_time; + //float pos = an->time; + //float delta = p_time; - // const Animation *a = an->animation.operator->(); + //const Animation *a = an->animation.operator->(); if (p_seek) { an->time=p_time; @@ -1496,17 +1496,17 @@ AnimationTreePlayer::ConnectError AnimationTreePlayer::_cycle_test(const StringN } -Error AnimationTreePlayer::connect(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input) { +Error AnimationTreePlayer::connect_nodes(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input) { ERR_FAIL_COND_V( !node_map.has(p_src_node) , ERR_INVALID_PARAMETER); ERR_FAIL_COND_V( !node_map.has(p_dst_node) , ERR_INVALID_PARAMETER); ERR_FAIL_COND_V( p_src_node==p_dst_node , ERR_INVALID_PARAMETER); -// NodeBase *src = node_map[p_src_node]; + //NodeBase *src = node_map[p_src_node]; NodeBase *dst = node_map[p_dst_node]; ERR_FAIL_INDEX_V( p_dst_input, dst->inputs.size(), ERR_INVALID_PARAMETER); -// int oldval = dst->inputs[p_dst_input].node; + //int oldval = dst->inputs[p_dst_input].node; for(Map<StringName,NodeBase*>::Element *E=node_map.front();E;E=E->next()) { @@ -1538,7 +1538,7 @@ Error AnimationTreePlayer::connect(const StringName& p_src_node,const StringName return OK; } -bool AnimationTreePlayer::is_connected(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input) const { +bool AnimationTreePlayer::are_nodes_connected(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input) const { ERR_FAIL_COND_V( !node_map.has(p_src_node) , false); ERR_FAIL_COND_V( !node_map.has(p_dst_node) , false); @@ -1550,7 +1550,7 @@ bool AnimationTreePlayer::is_connected(const StringName& p_src_node,const String } -void AnimationTreePlayer::disconnect(const StringName& p_node, int p_input) { +void AnimationTreePlayer::disconnect_nodes(const StringName& p_node, int p_input) { ERR_FAIL_COND( !node_map.has(p_node)); @@ -1901,9 +1901,9 @@ void AnimationTreePlayer::_bind_methods() { ClassDB::bind_method(_MD("node_get_pos","id"),&AnimationTreePlayer::node_get_pos); ClassDB::bind_method(_MD("remove_node","id"),&AnimationTreePlayer::remove_node); - ClassDB::bind_method(_MD("connect","id","dst_id","dst_input_idx"),&AnimationTreePlayer::connect); - ClassDB::bind_method(_MD("is_connected","id","dst_id","dst_input_idx"),&AnimationTreePlayer::is_connected); - ClassDB::bind_method(_MD("disconnect","id","dst_input_idx"),&AnimationTreePlayer::disconnect); + ClassDB::bind_method(_MD("connect_nodes","id","dst_id","dst_input_idx"),&AnimationTreePlayer::connect_nodes); + ClassDB::bind_method(_MD("are_nodes_connected","id","dst_id","dst_input_idx"),&AnimationTreePlayer::are_nodes_connected); + ClassDB::bind_method(_MD("disconnect_nodes","id","dst_input_idx"),&AnimationTreePlayer::disconnect_nodes); ClassDB::bind_method(_MD("set_active","enabled"),&AnimationTreePlayer::set_active); ClassDB::bind_method(_MD("is_active"),&AnimationTreePlayer::is_active); diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index ae2fe8c2bb..5e118be034 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -397,9 +397,9 @@ public: void get_node_list(List<StringName> *p_node_list) const; void remove_node(const StringName& p_node); - Error connect(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input); - bool is_connected(const StringName& p_src_node,const StringName& p_dst_node, int p_input) const; - void disconnect(const StringName& p_src_node, int p_input); + Error connect_nodes(const StringName& p_src_node,const StringName& p_dst_node, int p_dst_input); + bool are_nodes_connected(const StringName& p_src_node,const StringName& p_dst_node, int p_input) const; + void disconnect_nodes(const StringName& p_src_node, int p_input); void set_base_path(const NodePath& p_path); NodePath get_base_path() const; diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 62a8286041..0916119db3 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -109,7 +109,7 @@ bool Tween::_set(const StringName& p_name, const Variant& p_value) { String name=p_name; if (name=="playback/speed" || name=="speed") { //bw compatibility - set_speed(p_value); + set_speed_scale(p_value); } else if (name=="playback/active") { set_active(p_value); @@ -192,8 +192,8 @@ void Tween::_bind_methods() { ClassDB::bind_method(_MD("is_repeat"),&Tween::is_repeat ); ClassDB::bind_method(_MD("set_repeat","repeat"),&Tween::set_repeat ); - ClassDB::bind_method(_MD("set_speed","speed"),&Tween::set_speed); - ClassDB::bind_method(_MD("get_speed"),&Tween::get_speed); + ClassDB::bind_method(_MD("set_speed_scale","speed"),&Tween::set_speed_scale); + ClassDB::bind_method(_MD("get_speed_scale"),&Tween::get_speed_scale); ClassDB::bind_method(_MD("set_tween_process_mode","mode"),&Tween::set_tween_process_mode); ClassDB::bind_method(_MD("get_tween_process_mode"),&Tween::get_tween_process_mode); @@ -697,12 +697,12 @@ void Tween::set_repeat(bool p_repeat) { repeat = p_repeat; } -void Tween::set_speed(float p_speed) { +void Tween::set_speed_scale(float p_speed) { speed_scale=p_speed; } -float Tween::get_speed() const { +float Tween::get_speed_scale() const { return speed_scale; } diff --git a/scene/animation/tween.h b/scene/animation/tween.h index 12c7aa62a1..07c2e90da2 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -165,8 +165,8 @@ public: void set_tween_process_mode(TweenProcessMode p_mode); TweenProcessMode get_tween_process_mode() const; - void set_speed(float p_speed); - float get_speed() const; + void set_speed_scale(float p_speed); + float get_speed_scale() const; bool start(); bool reset(Object *p_node, String p_key); diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp index 2f53dc239f..9e506034a6 100644 --- a/scene/audio/stream_player.cpp +++ b/scene/audio/stream_player.cpp @@ -167,8 +167,10 @@ void StreamPlayer::play(float p_from_offset) { sp_update(); AudioServer::get_singleton()->stream_set_active(stream_rid,true); AudioServer::get_singleton()->stream_set_volume_scale(stream_rid,volume); -// if (stream->get_update_mode()!=AudioStream::UPDATE_NONE) -// set_idle_process(true); + /* + if (stream->get_update_mode()!=AudioStream::UPDATE_NONE) + set_idle_process(true); + */ } @@ -305,8 +307,10 @@ bool StreamPlayer::has_autoplay() const { void StreamPlayer::set_paused(bool p_paused) { paused=p_paused; - //if (stream.is_valid()) - // stream->set_paused(p_paused); + /* + if (stream.is_valid()) + stream->set_paused(p_paused); + */ } bool StreamPlayer::is_paused() const { diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 8949a080c1..0b40983ddf 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -108,7 +108,7 @@ void BaseButton::_gui_input(InputEvent p_event) { emit_signal("button_up"); /* this is pointless if (status.press_attempt && status.pressing_inside) { -// released(); + //released(); emit_signal("released"); } */ diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp index 600b6141c5..7ca44ac27b 100644 --- a/scene/gui/box_container.cpp +++ b/scene/gui/box_container.cpp @@ -296,7 +296,7 @@ BoxContainer::BoxContainer(bool p_vertical) { vertical=p_vertical; align = ALIGN_BEGIN; -// set_ignore_mouse(true); + //set_ignore_mouse(true); set_mouse_filter(MOUSE_FILTER_PASS); } diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index a0a7442849..da2fb1bc91 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -75,7 +75,7 @@ void ColorPicker::_update_controls() { } -void ColorPicker::set_color(const Color& p_color) { +void ColorPicker::set_pick_color(const Color& p_color) { color=p_color; if (color != last_hsv) { @@ -121,7 +121,7 @@ void ColorPicker::_value_changed(double) { color.components[i] = scroll[i]->get_value()/(raw_mode_enabled?1.0:255.0); } - set_color(color); + set_pick_color(color); _update_text_value(); @@ -139,7 +139,7 @@ void ColorPicker::_html_entered(const String& p_html) { if (!is_inside_tree()) return; - set_color(color); + set_pick_color(color); emit_signal("color_changed",color); } @@ -208,7 +208,7 @@ void ColorPicker::_text_type_toggled() _update_color(); } -Color ColorPicker::get_color() const { +Color ColorPicker::get_pick_color() const { return color; } @@ -320,7 +320,7 @@ void ColorPicker::_uv_input(const InputEvent &ev) { v=1.0-y/256.0; color.set_hsv(h,s,v,color.a); last_hsv = color; - set_color(color); + set_pick_color(color); _update_color(); emit_signal("color_changed", color); } else { @@ -336,7 +336,7 @@ void ColorPicker::_uv_input(const InputEvent &ev) { v=1.0-y/256.0; color.set_hsv(h,s,v,color.a); last_hsv = color; - set_color(color); + set_pick_color(color); _update_color(); emit_signal("color_changed", color); } @@ -354,7 +354,7 @@ void ColorPicker::_w_input(const InputEvent &ev) { } color.set_hsv(h,s,v,color.a); last_hsv = color; - set_color(color); + set_pick_color(color); _update_color(); emit_signal("color_changed", color); } else if (ev.type == InputEvent::MOUSE_MOTION) { @@ -365,7 +365,7 @@ void ColorPicker::_w_input(const InputEvent &ev) { h=1.0-y/256.0; color.set_hsv(h,s,v,color.a); last_hsv = color; - set_color(color); + set_pick_color(color); _update_color(); emit_signal("color_changed", color); } @@ -376,7 +376,7 @@ void ColorPicker::_preset_input(const InputEvent &ev) { const InputEventMouseButton &bev = ev.mouse_button; if (bev.pressed && bev.button_index==BUTTON_LEFT) { int index = bev.x/(preset->get_size().x/presets.size()); - set_color(presets[index]); + set_pick_color(presets[index]); } else if (bev.pressed && bev.button_index==BUTTON_RIGHT) { int index = bev.x/(preset->get_size().x/presets.size()); presets.erase(presets[index]); @@ -425,7 +425,7 @@ void ColorPicker::_screen_input(const InputEvent &ev) Color c( r[ofs+0]/255.0, r[ofs+1]/255.0, r[ofs+2]/255.0 ); - set_color(c); + set_pick_color(c); } } } @@ -451,8 +451,8 @@ void ColorPicker::_screen_pick_pressed() void ColorPicker::_bind_methods() { - ClassDB::bind_method(_MD("set_color","color"),&ColorPicker::set_color); - ClassDB::bind_method(_MD("get_color"),&ColorPicker::get_color); + ClassDB::bind_method(_MD("set_pick_color","color"),&ColorPicker::set_pick_color); + ClassDB::bind_method(_MD("get_pick_color"),&ColorPicker::get_pick_color); ClassDB::bind_method(_MD("set_raw_mode","mode"),&ColorPicker::set_raw_mode); ClassDB::bind_method(_MD("is_raw_mode"),&ColorPicker::is_raw_mode); ClassDB::bind_method(_MD("set_edit_alpha","show"),&ColorPicker::set_edit_alpha); @@ -584,7 +584,7 @@ ColorPicker::ColorPicker() : //_update_color(); updating=false; - set_color(Color(1,1,1)); + set_pick_color(Color(1,1,1)); HBoxContainer *bbc = memnew( HBoxContainer ); @@ -632,20 +632,20 @@ void ColorPickerButton::_notification(int p_what) { if (p_what==NOTIFICATION_DRAW) { Ref<StyleBox> normal = get_stylebox("normal" ); - draw_rect(Rect2(normal->get_offset(),get_size()-normal->get_minimum_size()),picker->get_color()); + draw_rect(Rect2(normal->get_offset(),get_size()-normal->get_minimum_size()),picker->get_pick_color()); } } -void ColorPickerButton::set_color(const Color& p_color){ +void ColorPickerButton::set_pick_color(const Color& p_color){ - picker->set_color(p_color); + picker->set_pick_color(p_color); update(); emit_signal("color_changed",p_color); } -Color ColorPickerButton::get_color() const{ +Color ColorPickerButton::get_pick_color() const{ - return picker->get_color(); + return picker->get_pick_color(); } void ColorPickerButton::set_edit_alpha(bool p_show) { @@ -665,15 +665,15 @@ ColorPicker *ColorPickerButton::get_picker() { void ColorPickerButton::_bind_methods(){ - ClassDB::bind_method(_MD("set_color","color"),&ColorPickerButton::set_color); - ClassDB::bind_method(_MD("get_color"),&ColorPickerButton::get_color); + ClassDB::bind_method(_MD("set_pick_color","color"),&ColorPickerButton::set_pick_color); + ClassDB::bind_method(_MD("get_pick_color"),&ColorPickerButton::get_pick_color); ClassDB::bind_method(_MD("get_picker:ColorPicker"),&ColorPickerButton::get_picker); ClassDB::bind_method(_MD("set_edit_alpha","show"),&ColorPickerButton::set_edit_alpha); ClassDB::bind_method(_MD("is_editing_alpha"),&ColorPickerButton::is_editing_alpha); ClassDB::bind_method(_MD("_color_changed"),&ColorPickerButton::_color_changed); ADD_SIGNAL( MethodInfo("color_changed",PropertyInfo(Variant::COLOR,"color"))); - ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color") ); + ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_pick_color"),_SCS("get_pick_color") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"edit_alpha"),_SCS("set_edit_alpha"),_SCS("is_editing_alpha") ); } diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index bb8a4a8dbd..d9db9c89f7 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -36,7 +36,7 @@ #include "scene/gui/button.h" #include "scene/gui/popup.h" #include "scene/gui/box_container.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/tool_button.h" #include "scene/gui/check_button.h" @@ -98,8 +98,8 @@ public: void set_edit_alpha(bool p_show); bool is_editing_alpha() const; - void set_color(const Color& p_color); - Color get_color() const; + void set_pick_color(const Color& p_color); + Color get_pick_color() const; void add_preset(const Color& p_color); void set_raw_mode(bool p_enabled); @@ -126,8 +126,8 @@ protected: static void _bind_methods(); public: - void set_color(const Color& p_color); - Color get_color() const; + void set_pick_color(const Color& p_color); + Color get_pick_color() const; void set_edit_alpha(bool p_show); bool is_editing_alpha() const; diff --git a/scene/gui/color_ramp_edit.cpp b/scene/gui/color_ramp_edit.cpp index c3ed3d821d..5d5d6c31a2 100644 --- a/scene/gui/color_ramp_edit.cpp +++ b/scene/gui/color_ramp_edit.cpp @@ -60,7 +60,7 @@ void ColorRampEdit::_show_color_picker() { if (grabbed==-1) return; Size2 ms = Size2(350, picker->get_combined_minimum_size().height+10); - picker->set_color(points[grabbed].color); + picker->set_pick_color(points[grabbed].color); popup->set_pos(get_global_pos()-Vector2(ms.width-get_size().width,ms.height)); popup->set_size(ms); popup->popup(); diff --git a/scene/gui/color_rect.cpp b/scene/gui/color_rect.cpp index ce12a27460..99797aa9c1 100644 --- a/scene/gui/color_rect.cpp +++ b/scene/gui/color_rect.cpp @@ -1,8 +1,34 @@ +/*************************************************************************/ +/* color_rect.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "color_rect.h" - - void ColorRect::set_frame_color(const Color& p_color) { color=p_color; @@ -33,4 +59,3 @@ ColorRect::ColorRect() { color=Color(1,1,1); } - diff --git a/scene/gui/color_rect.h b/scene/gui/color_rect.h index 9d8b958130..55e413ce27 100644 --- a/scene/gui/color_rect.h +++ b/scene/gui/color_rect.h @@ -1,5 +1,33 @@ -#ifndef COLORRECT_H -#define COLORRECT_H +/*************************************************************************/ +/* color_rect.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#ifndef COLOR_RECT_H +#define COLOR_RECT_H #include "scene/gui/control.h" @@ -19,4 +47,4 @@ public: ColorRect(); }; -#endif // COLORRECT_H +#endif // COLOR_RECT_H diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 2e6dd48442..533d24f998 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -468,10 +468,12 @@ void Control::_notification(int p_notification) { } - //if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) { - // data.theme_owner=data.parent->data.theme_owner; - // notification(NOTIFICATION_THEME_CHANGED); - //} + /* + if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) { + data.theme_owner=data.parent->data.theme_owner; + notification(NOTIFICATION_THEME_CHANGED); + } + */ } break; case NOTIFICATION_EXIT_CANVAS: { @@ -503,10 +505,12 @@ void Control::_notification(int p_notification) { data.parent=NULL; data.parent_canvas_item=NULL; - //if (data.theme_owner && data.theme.is_null()) { - // data.theme_owner=NULL; - //notification(NOTIFICATION_THEME_CHANGED); - //} + /* + if (data.theme_owner && data.theme.is_null()) { + data.theme_owner=NULL; + notification(NOTIFICATION_THEME_CHANGED); + } + */ } break; case NOTIFICATION_MOVED_IN_PARENT: { @@ -2444,7 +2448,7 @@ bool Control::is_clipping_contents() { void Control::_bind_methods() { -// ClassDB::bind_method(_MD("_window_resize_event"),&Control::_window_resize_event); + //ClassDB::bind_method(_MD("_window_resize_event"),&Control::_window_resize_event); ClassDB::bind_method(_MD("_size_changed"),&Control::_size_changed); ClassDB::bind_method(_MD("_update_minimum_size"),&Control::_update_minimum_size); diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index c7beeea7a3..6650c5eb5d 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -94,7 +94,7 @@ class AcceptDialog : public WindowDialog { HBoxContainer *hbc; Label *label; Button *ok; -// Button *cancel; no more cancel (there is X on tht titlebar) + //Button *cancel; no more cancel (there is X on tht titlebar) bool hide_on_ok; diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 2a73e32864..ba1ab1afa8 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -295,7 +295,7 @@ void GraphEdit::_notification(int p_what) { zoom_reset->set_icon(get_icon("reset")); zoom_plus->set_icon(get_icon("more")); snap_button->set_icon(get_icon("snap")); -// zoom_icon->set_texture( get_icon("Zoom", "EditorIcons")); + //zoom_icon->set_texture( get_icon("Zoom", "EditorIcons")); } if (p_what==NOTIFICATION_DRAW) { diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h index 86b976c4fe..3e9944332f 100644 --- a/scene/gui/graph_edit.h +++ b/scene/gui/graph_edit.h @@ -34,7 +34,7 @@ #include "scene/gui/slider.h" #include "scene/gui/tool_button.h" #include "scene/gui/spin_box.h" -#include "texture_frame.h" +#include "scene/gui/texture_rect.h" class GraphEdit; diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 8b7b84910d..aa8c875f40 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -217,8 +217,8 @@ void GraphNode::_notification(int p_what) { sb = get_stylebox( selected ? "selectedframe" : "frame"); } - sb=sb->duplicate(); - sb->call("set_modulate",modulate); + //sb=sb->duplicate(); + //sb->call("set_modulate",modulate); Ref<Texture> port =get_icon("port"); Ref<Texture> close =get_icon("close"); Ref<Texture> resizer =get_icon("resizer"); @@ -675,16 +675,6 @@ void GraphNode::_gui_input(const InputEvent& p_ev) { } -void GraphNode::set_modulate(const Color &p_color) { - - modulate=p_color; - update(); -} - -Color GraphNode::get_modulate() const{ - - return modulate; -} void GraphNode::set_overlay(Overlay p_overlay) { overlay=p_overlay; @@ -758,9 +748,6 @@ void GraphNode::_bind_methods() { ClassDB::bind_method(_MD("get_connection_input_type","idx"),&GraphNode::get_connection_input_type); ClassDB::bind_method(_MD("get_connection_input_color","idx"),&GraphNode::get_connection_input_color); - ClassDB::bind_method(_MD("set_modulate","color"),&GraphNode::set_modulate); - ClassDB::bind_method(_MD("get_modulate"),&GraphNode::get_modulate); - ClassDB::bind_method(_MD("set_show_close_button","show"),&GraphNode::set_show_close_button); ClassDB::bind_method(_MD("is_close_button_visible"),&GraphNode::is_close_button_visible); @@ -788,7 +775,6 @@ GraphNode::GraphNode() { show_close=false; connpos_dirty=true; set_mouse_filter(MOUSE_FILTER_PASS); - modulate=Color(1,1,1,1); comment=false; resizeable=false; resizing=false; diff --git a/scene/gui/graph_node.h b/scene/gui/graph_node.h index a128426d38..9cb46fc49c 100644 --- a/scene/gui/graph_node.h +++ b/scene/gui/graph_node.h @@ -92,8 +92,6 @@ private: Overlay overlay; - Color modulate; - bool has_point(const Point2& p_point) const; protected: @@ -147,9 +145,6 @@ public: Color get_connection_output_color(int p_idx); - void set_modulate(const Color& p_color); - Color get_modulate() const; - void set_overlay(Overlay p_overlay); Overlay get_overlay() const; diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index 7c67d443af..597169ca83 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -70,7 +70,7 @@ void GridContainer::_notification(int p_what) { else row_minh[row]=ms.height; - // print_line("store row "+itos(row)+" mw "+itos(ms.height)); + //print_line("store row "+itos(row)+" mw "+itos(ms.height)); if (c->get_h_size_flags()&SIZE_EXPAND) col_expanded.insert(col); @@ -136,7 +136,7 @@ void GridContainer::_notification(int p_what) { Point2 p(col_ofs,row_ofs); -// print_line("col: "+itos(col)+" row: "+itos(row)+" col_ofs: "+itos(col_ofs)+" row_ofs: "+itos(row_ofs)); + //print_line("col: "+itos(col)+" row: "+itos(row)+" col_ofs: "+itos(col_ofs)+" row_ofs: "+itos(row_ofs)); fit_child_in_rect(c,Rect2(p,s)); //print_line("col: "+itos(col)+" row: "+itos(row)+" rect: "+Rect2(p,s)); diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 89a937a301..3a72e0e445 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -96,8 +96,6 @@ void LineEdit::_gui_input(InputEvent p_event) { } } - // if (!editable) - // non_editable_clicked_signal.call(); update(); } else { @@ -873,7 +871,7 @@ void LineEdit::delete_char() { if (cursor_pos==window_pos) { - // set_window_pos(cursor_pos-get_window_length()); + //set_window_pos(cursor_pos-get_window_length()); } _text_changed(); diff --git a/scene/gui/patch_9_frame.cpp b/scene/gui/patch_9_rect.cpp index 1f6145d5db..4e1856778e 100644 --- a/scene/gui/patch_9_frame.cpp +++ b/scene/gui/patch_9_rect.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* patch_9_frame.cpp */ +/* patch_9_rect.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -26,7 +26,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "patch_9_frame.h" +#include "patch_9_rect.h" #include "servers/visual_server.h" @@ -40,7 +40,7 @@ void NinePatchRect::_notification(int p_what) { Size2 s=get_size(); RID ci = get_canvas_item(); VS::get_singleton()->canvas_item_add_nine_patch(ci,Rect2(Point2(),s),region_rect,texture->get_rid(),Vector2(margin[MARGIN_LEFT],margin[MARGIN_TOP]),Vector2(margin[MARGIN_RIGHT],margin[MARGIN_BOTTOM]),VS::NINE_PATCH_STRETCH,VS::NINE_PATCH_STRETCH,draw_center); -// draw_texture_rect(texture,Rect2(Point2(),s),false,modulate); + //draw_texture_rect(texture,Rect2(Point2(),s),false,modulate); /* Vector<Point2> points; @@ -98,8 +98,10 @@ void NinePatchRect::set_texture(const Ref<Texture>& p_tex) { return; texture=p_tex; update(); - //if (texture.is_valid()) - // texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites + /* + if (texture.is_valid()) + texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites + */ minimum_size_changed(); emit_signal("texture_changed"); } diff --git a/scene/gui/patch_9_frame.h b/scene/gui/patch_9_rect.h index d55f4e4f69..b87f2f64ec 100644 --- a/scene/gui/patch_9_frame.h +++ b/scene/gui/patch_9_rect.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* patch_9_frame.h */ +/* patch_9_rect.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index c5ac6778a9..65e7c3ab39 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -136,7 +136,7 @@ int PopupMenu::_get_mouse_over(const Point2& p_over) const { Ref<Font> font = get_font("font"); int vseparation = get_constant("vseparation"); -// int hseparation = get_constant("hseparation"); + //int hseparation = get_constant("hseparation"); float font_h=font->get_height(); diff --git a/scene/gui/reference_frame.cpp b/scene/gui/reference_rect.cpp index 37bc3ae6fb..ff4cdf04fd 100644 --- a/scene/gui/reference_frame.cpp +++ b/scene/gui/reference_rect.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* reference_frame.cpp */ +/* reference_rect.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -26,9 +26,9 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "reference_frame.h" +#include "reference_rect.h" -void ReferenceFrame::_notification(int p_what) { +void ReferenceRect::_notification(int p_what) { if (p_what==NOTIFICATION_DRAW) { @@ -39,6 +39,6 @@ void ReferenceFrame::_notification(int p_what) { } } -ReferenceFrame::ReferenceFrame() +ReferenceRect::ReferenceRect() { } diff --git a/scene/gui/reference_frame.h b/scene/gui/reference_rect.h index 8b4a16cb43..be493f346c 100644 --- a/scene/gui/reference_frame.h +++ b/scene/gui/reference_rect.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* reference_frame.h */ +/* reference_rect.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -26,20 +26,20 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef REFERENCE_FRAME_H -#define REFERENCE_FRAME_H +#ifndef REFERENCE_RECT_H +#define REFERENCE_RECT_H #include "scene/gui/control.h" -class ReferenceFrame : public Control { +class ReferenceRect : public Control { - GDCLASS( ReferenceFrame, Control); + GDCLASS( ReferenceRect, Control); protected: void _notification(int p_what); public: - ReferenceFrame(); + ReferenceRect(); }; -#endif // REFERENCE_FRAME_H +#endif // REFERENCE_RECT_H diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index da267b9f27..fc406ff0f5 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -51,9 +51,11 @@ void ScrollBar::_gui_input(InputEvent p_event) { if (b.button_index==5 && b.pressed) { - //if (orientation==VERTICAL) - // set_val( get_val() + get_page() / 4.0 ); - //else + /* + if (orientation==VERTICAL) + set_val( get_val() + get_page() / 4.0 ); + else + */ set_value( get_value() + get_page() / 4.0 ); accept_event(); @@ -61,9 +63,11 @@ void ScrollBar::_gui_input(InputEvent p_event) { if (b.button_index==4 && b.pressed) { - //if (orientation==HORIZONTAL) - // set_val( get_val() - get_page() / 4.0 ); - //else + /* + if (orientation==HORIZONTAL) + set_val( get_val() - get_page() / 4.0 ); + else + */ set_value( get_value() - get_page() / 4.0 ); accept_event(); } @@ -425,8 +429,10 @@ double ScrollBar::get_grabber_size() const { return 0; float page = (get_page()>0)? get_page() : 0; -// if (grabber_range < get_step()) -// grabber_range=get_step(); + /* + if (grabber_range < get_step()) + grabber_range=get_step(); + */ double area_size=get_area_size(); double grabber_size = page / range * area_size; @@ -620,12 +626,16 @@ void ScrollBar::_drag_slave_input(const InputEvent& p_input) { if (orientation==HORIZONTAL) set_value(diff.x); - //else - // drag_slave_accum.x=0; + /* + else + drag_slave_accum.x=0; + */ if (orientation==VERTICAL) set_value(diff.y); - //else - // drag_slave_accum.y=0; + /* + else + drag_slave_accum.y=0; + */ time_since_motion=0; } diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index a7cc38846d..ad6e8786d7 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -164,8 +164,10 @@ void Slider::_notification(int p_what) { if (orientation==VERTICAL) { style->draw(ci,Rect2i(Point2i(),Size2i(style->get_minimum_size().width+style->get_center_size().width,size.height))); - //if (mouse_inside||has_focus()) - // focus->draw(ci,Rect2i(Point2i(),Size2i(style->get_minimum_size().width+style->get_center_size().width,size.height))); + /* + if (mouse_inside||has_focus()) + focus->draw(ci,Rect2i(Point2i(),Size2i(style->get_minimum_size().width+style->get_center_size().width,size.height))); + */ float areasize = size.height - grabber->get_size().height; if (ticks>1) { int tickarea = size.height - tick->get_height(); @@ -179,8 +181,10 @@ void Slider::_notification(int p_what) { grabber->draw(ci,Point2i(size.width/2-grabber->get_size().width/2,size.height - get_as_ratio()*areasize - grabber->get_size().height)); } else { style->draw(ci,Rect2i(Point2i(),Size2i(size.width,style->get_minimum_size().height+style->get_center_size().height))); - //if (mouse_inside||has_focus()) - // focus->draw(ci,Rect2i(Point2i(),Size2i(size.width,style->get_minimum_size().height+style->get_center_size().height))); + /* + if (mouse_inside||has_focus()) + focus->draw(ci,Rect2i(Point2i(),Size2i(size.width,style->get_minimum_size().height+style->get_center_size().height))); + */ float areasize = size.width - grabber->get_size().width; if (ticks>1) { diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 070f9fc72e..ec6be0d19d 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -49,8 +49,10 @@ void SpinBox::_value_changed(double) { void SpinBox::_text_entered(const String& p_string) { - //if (!p_string.is_numeric()) - // return; + /* + if (!p_string.is_numeric()) + return; + */ String value = p_string; if (prefix!="" && p_string.begins_with(prefix)) value = p_string.substr(prefix.length(), p_string.length()-prefix.length()); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 46939765b0..8efff21fc9 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4357,7 +4357,7 @@ void TextEdit::_update_completion_candidates() { if (completion_options.size()==1) { //one option to complete, just complete it automagically _confirm_completion(); - // insert_text_at_cursor(completion_options[0].substr(s.length(),completion_options[0].length()-s.length())); + //insert_text_at_cursor(completion_options[0].substr(s.length(),completion_options[0].length()-s.length())); _cancel_completion(); return; @@ -4732,8 +4732,8 @@ TextEdit::TextEdit() { tab_size=4; text.set_tab_size(tab_size); text.clear(); - // text.insert(1,"Mongolia.."); - // text.insert(2,"PAIS GENEROSO!!"); + //text.insert(1,"Mongolia.."); + //text.insert(2,"PAIS GENEROSO!!"); text.set_color_regions(&color_regions); h_scroll = memnew( HScrollBar ); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index c7467f9b13..6113fd72c2 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -294,7 +294,7 @@ class TextEdit : public Control { void _scroll_lines_up(); void _scroll_lines_down(); -// void mouse_motion(const Point& p_pos, const Point& p_rel, int p_button_mask); + //void mouse_motion(const Point& p_pos, const Point& p_rel, int p_button_mask); Size2 get_minimum_size() const; int get_row_height() const; diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp index 83cd853572..03e37e9d9f 100644 --- a/scene/gui/texture_button.cpp +++ b/scene/gui/texture_button.cpp @@ -120,13 +120,13 @@ void TextureButton::_notification(int p_what) { if (texdraw.is_valid()) { Rect2 drect(Point2(),texdraw->get_size()*scale); - draw_texture_rect(texdraw,drect,false,modulate); + draw_texture_rect(texdraw,drect,false); } if (has_focus() && focused.is_valid()) { Rect2 drect(Point2(),focused->get_size()*scale); - draw_texture_rect(focused,drect,false,modulate); + draw_texture_rect(focused,drect,false); }; @@ -143,7 +143,6 @@ void TextureButton::_bind_methods() { ClassDB::bind_method(_MD("set_focused_texture","texture:Texture"),&TextureButton::set_focused_texture); ClassDB::bind_method(_MD("set_click_mask","mask:BitMap"),&TextureButton::set_click_mask); ClassDB::bind_method(_MD("set_texture_scale","scale"),&TextureButton::set_texture_scale); - ClassDB::bind_method(_MD("set_modulate","color"),&TextureButton::set_modulate); ClassDB::bind_method(_MD("get_normal_texture:Texture"),&TextureButton::get_normal_texture); ClassDB::bind_method(_MD("get_pressed_texture:Texture"),&TextureButton::get_pressed_texture); @@ -152,7 +151,6 @@ void TextureButton::_bind_methods() { ClassDB::bind_method(_MD("get_focused_texture:Texture"),&TextureButton::get_focused_texture); ClassDB::bind_method(_MD("get_click_mask:BitMap"),&TextureButton::get_click_mask); ClassDB::bind_method(_MD("get_texture_scale"),&TextureButton::get_texture_scale); - ClassDB::bind_method(_MD("get_modulate"),&TextureButton::get_modulate); ADD_GROUP("Textures","texture_"); ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_normal_texture"), _SCS("get_normal_texture")); @@ -241,17 +239,7 @@ Size2 TextureButton::get_texture_scale() const{ return scale; } -void TextureButton::set_modulate(const Color& p_modulate) { - modulate=p_modulate; - update(); -} - -Color TextureButton::get_modulate() const { - return modulate; -} - - TextureButton::TextureButton() { scale=Size2(1.0, 1.0); - modulate=Color(1,1,1); + } diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h index b6cb531c71..ef4d4d5b5b 100644 --- a/scene/gui/texture_button.h +++ b/scene/gui/texture_button.h @@ -42,8 +42,6 @@ class TextureButton : public BaseButton { Ref<Texture> focused; Ref<BitMap> click_mask; Size2 scale; - Color modulate; - protected: @@ -71,9 +69,6 @@ public: void set_texture_scale(Size2 p_scale); Size2 get_texture_scale() const; - void set_modulate(const Color& p_modulate); - Color get_modulate() const; - TextureButton(); }; diff --git a/scene/gui/texture_frame.cpp b/scene/gui/texture_rect.cpp index 6556e487f1..cbb077ef5d 100644 --- a/scene/gui/texture_frame.cpp +++ b/scene/gui/texture_rect.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* texture_frame.cpp */ +/* texture_rect.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -26,7 +26,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "texture_frame.h" +#include "texture_rect.h" #include "servers/visual_server.h" void TextureRect::_notification(int p_what) { @@ -121,8 +121,10 @@ void TextureRect::set_texture(const Ref<Texture>& p_tex) { texture=p_tex; update(); - //if (texture.is_valid()) - // texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites + /* + if (texture.is_valid()) + texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites + */ minimum_size_changed(); } diff --git a/scene/gui/texture_frame.h b/scene/gui/texture_rect.h index dea5b3b0ac..e95d742759 100644 --- a/scene/gui/texture_frame.h +++ b/scene/gui/texture_rect.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* texture_frame.h */ +/* texture_rect.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index b50ecc58ef..58c829690f 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -949,8 +949,10 @@ void Tree::draw_item_rect(const TreeItem::Cell& p_cell,const Rect2i& p_rect,cons } -// if (p_tool) -// rect.size.x-=Math::floor(rect.size.y/2); + /* + if (p_tool) + rect.size.x-=Math::floor(rect.size.y/2); + */ Ref<Font> font = cache.font; @@ -1029,7 +1031,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2& } //draw separation. -// if (p_item->get_parent()!=root || !hide_root) + //if (p_item->get_parent()!=root || !hide_root) Ref<Font> font = cache.font; @@ -1262,7 +1264,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2& } break; case TreeItem::CELL_MODE_CUSTOM: { - // int option = (int)p_item->cells[i].val; + //int option = (int)p_item->cells[i].val; @@ -1414,8 +1416,10 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c emit_signal("item_selected"); emitted_row=true; } - //if (p_col==i) - // p_current->selected_signal.call(p_col); + /* + if (p_col==i) + p_current->selected_signal.call(p_col); + */ } else if (c.selected) { @@ -1672,9 +1676,11 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_ } } - //if (!c.selected && select_mode==SELECT_MULTI) { - // emit_signal("multi_selected",p_item,col,true); - //} + /* + if (!c.selected && select_mode==SELECT_MULTI) { + emit_signal("multi_selected",p_item,col,true); + } + */ update(); } @@ -1997,7 +2003,7 @@ void Tree::_gui_input(InputEvent p_event) { } break; case KEY_LEFT: { -// TreeItem *next = NULL; + //TreeItem *next = NULL; if (!selected_item) break; if (select_mode==SELECT_ROW) @@ -2027,7 +2033,7 @@ void Tree::_gui_input(InputEvent p_event) { next=selected_item->get_next_visible(); -// if (diff < uint64_t(GLOBAL_DEF("gui/incr_search_max_interval_msec",2000))) { + //if (diff < uint64_t(GLOBAL_DEF("gui/incr_search_max_interval_msec",2000))) { if (last_keypress!=0) { //incr search next int col; @@ -2470,7 +2476,7 @@ void Tree::_gui_input(InputEvent p_event) { if (!click_handled) { drag_speed=0; drag_accum=0; -// last_drag_accum=0; + //last_drag_accum=0; drag_from=v_scroll->get_value(); drag_touching=OS::get_singleton()->has_touchscreen_ui_hint(); drag_touching_deaccel=false; @@ -2787,13 +2793,10 @@ void Tree::_notification(int p_what) { } int ofs=0; -// int from_y=exposed.pos.y+bg->get_margin(MARGIN_TOP); -// int size_y=exposed.size.height-bg->get_minimum_size().height; for (int i=0;i<(columns.size()-1-1);i++) { ofs+=get_column_width(i); - //get_painter()->draw_fill_rect( Point2(ofs+cache.hseparation/2, from_y), Size2( 1, size_y ),color( COLOR_TREE_GRID) ); } if (show_column_titles) { @@ -3016,8 +3019,10 @@ int Tree::get_edited_column() const { TreeItem* Tree::get_next_selected( TreeItem* p_item) { - //if (!p_item) - // return NULL; + /* + if (!p_item) + return NULL; + */ if (!root) return NULL; diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 8327e356b3..d715ff4772 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -334,7 +334,7 @@ friend class TreeItem; int compute_item_height(TreeItem *p_item) const; int get_item_height(TreeItem *p_item) const; -// void draw_item_text(String p_text,const Ref<Texture>& p_icon,int p_icon_max_w,bool p_tool,Rect2i p_rect,const Color& p_color); + //void draw_item_text(String p_text,const Ref<Texture>& p_icon,int p_icon_max_w,bool p_tool,Rect2i p_rect,const Color& p_color); void draw_item_rect(const TreeItem::Cell& p_cell,const Rect2i& p_rect,const Color& p_color); int draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2& p_draw_size,TreeItem *p_item); void select_single_item(TreeItem *p_selected,TreeItem *p_current,int p_col,TreeItem *p_prev=NULL,bool *r_in_range=NULL,bool p_force_deselect=false); diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index f7d2ad1c63..4c177ea53c 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -394,7 +394,7 @@ void VideoPlayer::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::INT, "audio_track",PROPERTY_HINT_RANGE,"0,128,1"), _SCS("set_audio_track"), _SCS("get_audio_track") ); ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE,"VideoStream"), _SCS("set_stream"), _SCS("get_stream") ); -// ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") ); + //ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") ); ADD_PROPERTY( PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "paused"), _SCS("set_paused"), _SCS("is_paused") ); diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp index cc3d9baa74..2d098d01f5 100644 --- a/scene/io/resource_format_image.cpp +++ b/scene/io/resource_format_image.cpp @@ -36,7 +36,7 @@ RES ResourceFormatLoaderImage::load(const String &p_path, const String& p_origin if (r_error) *r_error=ERR_CANT_OPEN; - if (p_path.extension()=="cube") { + if (p_path.get_extension()=="cube") { // open as cubemap txture CubeMap* ptr = memnew(CubeMap); @@ -235,7 +235,7 @@ void ResourceFormatLoaderImage::get_recognized_extensions(List<String> *p_extens String ResourceFormatLoaderImage::get_resource_type(const String &p_path) const { - String ext=p_path.extension().to_lower(); + String ext=p_path.get_extension().to_lower(); if (ext=="cube") return "CubeMap"; diff --git a/scene/io/resource_format_wav.cpp b/scene/io/resource_format_wav.cpp index f75836d2df..0a19e6f72b 100644 --- a/scene/io/resource_format_wav.cpp +++ b/scene/io/resource_format_wav.cpp @@ -267,7 +267,7 @@ bool ResourceFormatLoaderWAV::handles_type(const String& p_type) const { String ResourceFormatLoaderWAV::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="wav") + if (p_path.get_extension().to_lower()=="wav") return "Sample"; return ""; } diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index 2e2e1d6c80..84fe2a00f6 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -176,7 +176,7 @@ void CanvasLayer::_notification(int p_what) { } ERR_FAIL_COND(!vp); - viewport=vp->get_viewport(); + viewport=vp->get_viewport_rid(); VisualServer::get_singleton()->viewport_attach_canvas(viewport,canvas->get_canvas()); VisualServer::get_singleton()->viewport_set_canvas_layer(viewport,canvas->get_canvas(),layer); @@ -232,7 +232,7 @@ void CanvasLayer::set_custom_viewport(Node *p_viewport) { else vp=Node::get_viewport(); - viewport = vp->get_viewport(); + viewport = vp->get_viewport_rid(); VisualServer::get_singleton()->viewport_attach_canvas(viewport,canvas->get_canvas()); VisualServer::get_singleton()->viewport_set_canvas_layer(viewport,canvas->get_canvas(),layer); @@ -285,7 +285,7 @@ void CanvasLayer::_bind_methods() { ClassDB::bind_method(_MD("get_custom_viewport:Viewport"),&CanvasLayer::get_custom_viewport); ClassDB::bind_method(_MD("get_world_2d:World2D"),&CanvasLayer::get_world_2d); -// ClassDB::bind_method(_MD("get_viewport"),&CanvasLayer::get_viewport); + //ClassDB::bind_method(_MD("get_viewport"),&CanvasLayer::get_viewport); ADD_PROPERTY( PropertyInfo(Variant::INT,"layer",PROPERTY_HINT_RANGE,"-128,128,1"),_SCS("set_layer"),_SCS("get_layer") ); //ADD_PROPERTY( PropertyInfo(Variant::MATRIX32,"transform",PROPERTY_HINT_RANGE),_SCS("set_transform"),_SCS("get_transform") ); diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 25180b568f..63a81a139d 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -40,7 +40,7 @@ void HTTPRequest::_redirect_request(const String& p_new_url) { Error HTTPRequest::_request() { //print_line("Requesting:\n\tURL: "+url+"\n\tString: "+request_string+"\n\tPort: "+itos(port)+"\n\tSSL: "+itos(use_ssl)+"\n\tValidate SSL: "+itos(validate_ssl)); - return client->connect(url,port,use_ssl,validate_ssl); + return client->connect_to_host(url,port,use_ssl,validate_ssl); } Error HTTPRequest::_parse_url(const String& p_url) { diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 3a533d24b3..86b78f60f6 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1384,10 +1384,8 @@ String Node::_generate_serial_child_name(Node *p_child) { if (name=="") { name = p_child->get_class(); - /* this is probably too slow to use here, should check alternatives - * // Adjust casing according to project setting. The current type name is expected to be in PascalCase. - switch (Globals::get_singleton()->get("node/name_casing").operator int()) { + switch (GlobalConfig::get_singleton()->get("editor/node_name_casing").operator int()) { case NAME_CASING_PASCAL_CASE: break; case NAME_CASING_CAMEL_CASE: @@ -1397,7 +1395,6 @@ String Node::_generate_serial_child_name(Node *p_child) { name = name.camelcase_to_underscore(true); break; } - */ } // Extract trailing number @@ -2737,7 +2734,7 @@ void Node::_set_tree(SceneTree *p_tree) { SceneTree *tree_changed_a=NULL; SceneTree *tree_changed_b=NULL; -// ERR_FAIL_COND(p_scene && data.parent && !data.parent->data.scene); //nobug if both are null + //ERR_FAIL_COND(p_scene && data.parent && !data.parent->data.scene); //nobug if both are null if (data.tree) { _propagate_exit_tree(); @@ -2902,10 +2899,10 @@ void Node::request_ready() { void Node::_bind_methods() { - _GLOBAL_DEF("editor/node_name_num_separator",0); + GLOBAL_DEF("editor/node_name_num_separator",0); GlobalConfig::get_singleton()->set_custom_property_info("editor/node_name_num_separator",PropertyInfo(Variant::INT,"editor/node_name_num_separator",PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash")); - _GLOBAL_DEF("node/name_casing",NAME_CASING_PASCAL_CASE); - GlobalConfig::get_singleton()->set_custom_property_info("node/name_casing",PropertyInfo(Variant::INT,"node/name_casing",PROPERTY_HINT_ENUM,"PascalCase,camelCase,snake_case")); + GLOBAL_DEF("editor/node_name_casing",NAME_CASING_PASCAL_CASE); + GlobalConfig::get_singleton()->set_custom_property_info("editor/node_name_casing",PropertyInfo(Variant::INT,"editor/node_name_casing",PROPERTY_HINT_ENUM,"PascalCase,camelCase,snake_case")); ClassDB::bind_method(_MD("_add_child_below_node","node:Node","child_node:Node","legible_unique_name"),&Node::add_child_below_node,DEFVAL(false)); @@ -3065,8 +3062,8 @@ void Node::_bind_methods() { ADD_SIGNAL( MethodInfo("tree_entered") ); ADD_SIGNAL( MethodInfo("tree_exited") ); -// ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/process" ),_SCS("set_process"),_SCS("is_processing") ); -// ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/fixed_process" ), _SCS("set_fixed_process"),_SCS("is_fixed_processing") ); + //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/process" ),_SCS("set_process"),_SCS("is_processing") ); + //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/fixed_process" ), _SCS("set_fixed_process"),_SCS("is_fixed_processing") ); //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/input" ), _SCS("set_process_input"),_SCS("is_processing_input" ) ); //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/unhandled_input" ), _SCS("set_process_unhandled_input"),_SCS("is_processing_unhandled_input" ) ); ADD_GROUP("Pause","pause_"); diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index d233bf1a72..147409a862 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -141,7 +141,7 @@ void SceneTree::_flush_ugc() { for(int i=0;i<E->get().size();i++) v[i]=E->get()[i]; - call_group(GROUP_CALL_REALTIME,E->key().group,E->key().call,v[0],v[1],v[2],v[3],v[4]); + call_group_flags(GROUP_CALL_REALTIME,E->key().group,E->key().call,v[0],v[1],v[2],v[3],v[4]); unique_group_calls.erase(E); } @@ -166,7 +166,7 @@ void SceneTree::_update_group_order(Group& g) { } -void SceneTree::call_group(uint32_t p_call_flags,const StringName& p_group,const StringName& p_function,VARIANT_ARG_DECLARE) { +void SceneTree::call_group_flags(uint32_t p_call_flags,const StringName& p_group,const StringName& p_function,VARIANT_ARG_DECLARE) { Map<StringName,Group>::Element *E=group_map.find(p_group); if (!E) @@ -216,7 +216,7 @@ void SceneTree::call_group(uint32_t p_call_flags,const StringName& p_group,const continue; if (p_call_flags&GROUP_CALL_REALTIME) { - if (p_call_flags&GROUP_CALL_MULIILEVEL) + if (p_call_flags&GROUP_CALL_MULTILEVEL) nodes[i]->call_multilevel(p_function,VARIANT_ARG_PASS); else nodes[i]->call(p_function,VARIANT_ARG_PASS); @@ -233,7 +233,7 @@ void SceneTree::call_group(uint32_t p_call_flags,const StringName& p_group,const continue; if (p_call_flags&GROUP_CALL_REALTIME) { - if (p_call_flags&GROUP_CALL_MULIILEVEL) + if (p_call_flags&GROUP_CALL_MULTILEVEL) nodes[i]->call_multilevel(p_function,VARIANT_ARG_PASS); else nodes[i]->call(p_function,VARIANT_ARG_PASS); @@ -248,7 +248,7 @@ void SceneTree::call_group(uint32_t p_call_flags,const StringName& p_group,const call_skip.clear(); } -void SceneTree::notify_group(uint32_t p_call_flags,const StringName& p_group,int p_notification) { +void SceneTree::notify_group_flags(uint32_t p_call_flags,const StringName& p_group,int p_notification) { Map<StringName,Group>::Element *E=group_map.find(p_group); if (!E) @@ -298,7 +298,7 @@ void SceneTree::notify_group(uint32_t p_call_flags,const StringName& p_group,int call_skip.clear(); } -void SceneTree::set_group(uint32_t p_call_flags,const StringName& p_group,const String& p_name,const Variant& p_value) { +void SceneTree::set_group_flags(uint32_t p_call_flags,const StringName& p_group,const String& p_name,const Variant& p_value) { Map<StringName,Group>::Element *E=group_map.find(p_group); if (!E) @@ -348,6 +348,23 @@ void SceneTree::set_group(uint32_t p_call_flags,const StringName& p_group,const call_skip.clear(); } + +void SceneTree::call_group(const StringName& p_group,const StringName& p_function,VARIANT_ARG_DECLARE) { + + call_group_flags(0,p_group,VARIANT_ARG_PASS); +} + +void SceneTree::notify_group(const StringName& p_group,int p_notification) { + + notify_group_flags(0,p_group,p_notification); +} + +void SceneTree::set_group(const StringName& p_group,const String& p_name,const Variant& p_value) { + + set_group_flags(0,p_group,p_name,p_value); +} + + void SceneTree::set_input_as_handled() { input_handled=true; @@ -357,7 +374,7 @@ void SceneTree::input_text( const String& p_text ) { root_lock++; - call_group(GROUP_CALL_REALTIME,"_viewports","_vp_input_text",p_text); //special one for GUI, as controls use their own process check + call_group_flags(GROUP_CALL_REALTIME,"_viewports","_vp_input_text",p_text); //special one for GUI, as controls use their own process check root_lock--; @@ -438,21 +455,22 @@ void SceneTree::input_event( const InputEvent& p_event ) { //call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"input","_input",ev); - /*if (ev.type==InputEvent::KEY && ev.key.pressed && !ev.key.echo && ev.key.scancode==KEY_F12) { + /* + if (ev.type==InputEvent::KEY && ev.key.pressed && !ev.key.echo && ev.key.scancode==KEY_F12) { print_line("RAM: "+itos(Memory::get_static_mem_usage())); print_line("DRAM: "+itos(Memory::get_dynamic_mem_usage())); } -*/ - //if (ev.type==InputEvent::KEY && ev.key.pressed && !ev.key.echo && ev.key.scancode==KEY_F11) { + if (ev.type==InputEvent::KEY && ev.key.pressed && !ev.key.echo && ev.key.scancode==KEY_F11) { - // Memory::dump_static_mem_to_file("memdump.txt"); - //} + Memory::dump_static_mem_to_file("memdump.txt"); + } + */ //transform for the rest #else - call_group(GROUP_CALL_REALTIME,"_viewports","_vp_input",ev); //special one for GUI, as controls use their own process check + call_group_flags(GROUP_CALL_REALTIME,"_viewports","_vp_input",ev); //special one for GUI, as controls use their own process check #endif if (ScriptDebugger::get_singleton() && ScriptDebugger::get_singleton()->is_remote() && ev.type==InputEvent::KEY && ev.key.pressed && !ev.key.echo && ev.key.scancode==KEY_F8) { @@ -477,7 +495,7 @@ void SceneTree::input_event( const InputEvent& p_event ) { } #else - call_group(GROUP_CALL_REALTIME,"_viewports","_vp_unhandled_input",ev); //special one for GUI, as controls use their own process check + call_group_flags(GROUP_CALL_REALTIME,"_viewports","_vp_unhandled_input",ev); //special one for GUI, as controls use their own process check #endif input_handled=true; @@ -528,7 +546,7 @@ bool SceneTree::iteration(float p_time) { _notify_group_pause("fixed_process",Node::NOTIFICATION_FIXED_PROCESS); _flush_ugc(); _flush_transform_notifications(); - call_group(GROUP_CALL_REALTIME,"_viewports","update_worlds"); + call_group_flags(GROUP_CALL_REALTIME,"_viewports","update_worlds"); root_lock--; _flush_delete_queue(); @@ -540,9 +558,9 @@ bool SceneTree::iteration(float p_time) { bool SceneTree::idle(float p_time){ -// print_line("ram: "+itos(OS::get_singleton()->get_static_memory_usage())+" sram: "+itos(OS::get_singleton()->get_dynamic_memory_usage())); -// print_line("node count: "+itos(get_node_count())); -// print_line("TEXTURE RAM: "+itos(VS::get_singleton()->get_render_info(VS::INFO_TEXTURE_MEM_USED))); + //print_line("ram: "+itos(OS::get_singleton()->get_static_memory_usage())+" sram: "+itos(OS::get_singleton()->get_dynamic_memory_usage())); + //print_line("node count: "+itos(get_node_count())); + //print_line("TEXTURE RAM: "+itos(VS::get_singleton()->get_render_info(VS::INFO_TEXTURE_MEM_USED))); root_lock++; @@ -573,7 +591,7 @@ bool SceneTree::idle(float p_time){ _flush_ugc(); _flush_transform_notifications(); //transforms after world update, to avoid unnecesary enter/exit notifications - call_group(GROUP_CALL_REALTIME,"_viewports","update_worlds"); + call_group_flags(GROUP_CALL_REALTIME,"_viewports","update_worlds"); root_lock--; @@ -667,7 +685,7 @@ void SceneTree::_notification(int p_notification) { } break; case NOTIFICATION_WM_UNFOCUS_REQUEST: { - notify_group(GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"input",NOTIFICATION_WM_UNFOCUS_REQUEST); + notify_group_flags(GROUP_CALL_REALTIME|GROUP_CALL_MULTILEVEL,"input",NOTIFICATION_WM_UNFOCUS_REQUEST); } break; @@ -991,7 +1009,7 @@ uint32_t SceneTree::get_last_event_id() const { } -Variant SceneTree::_call_group(const Variant** p_args, int p_argcount, Variant::CallError& r_error) { +Variant SceneTree::_call_group_flags(const Variant** p_args, int p_argcount, Variant::CallError& r_error) { r_error.error=Variant::CallError::CALL_OK; @@ -1011,11 +1029,33 @@ Variant SceneTree::_call_group(const Variant** p_args, int p_argcount, Variant:: v[i]=*p_args[i+3]; } - call_group(flags,group,method,v[0],v[1],v[2],v[3],v[4]); + call_group_flags(flags,group,method,v[0],v[1],v[2],v[3],v[4]); return Variant(); } +Variant SceneTree::_call_group(const Variant** p_args, int p_argcount, Variant::CallError& r_error) { + + + r_error.error=Variant::CallError::CALL_OK; + + ERR_FAIL_COND_V(p_argcount<2,Variant()); + ERR_FAIL_COND_V(p_args[0]->get_type()!=Variant::STRING,Variant()); + ERR_FAIL_COND_V(p_args[1]->get_type()!=Variant::STRING,Variant()); + + StringName group = *p_args[0]; + StringName method = *p_args[1]; + Variant v[VARIANT_ARG_MAX]; + + for(int i=0;i<MIN(p_argcount-2,5);i++) { + + v[i]=*p_args[i+2]; + } + + call_group_flags(0,group,method,v[0],v[1],v[2],v[3],v[4]); + return Variant(); +} + int64_t SceneTree::get_frame() const { return current_frame; @@ -1138,8 +1178,8 @@ void SceneTree::_update_root_rect() { Size2 viewport_size; Size2 screen_size; - float viewport_aspect = desired_res.get_aspect(); - float video_mode_aspect = video_mode.get_aspect(); + float viewport_aspect = desired_res.aspect(); + float video_mode_aspect = video_mode.aspect(); if (stretch_aspect==STRETCH_ASPECT_IGNORE || ABS(viewport_aspect - video_mode_aspect)<CMP_EPSILON) { //same aspect or ignore aspect @@ -1198,8 +1238,8 @@ void SceneTree::_update_root_rect() { VisualServer::get_singleton()->black_bars_set_margins(0,0,0,0); } -// print_line("VP SIZE: "+viewport_size+" OFFSET: "+offset+" = "+(offset*2+viewport_size)); -// print_line("SS: "+video_mode); + //print_line("VP SIZE: "+viewport_size+" OFFSET: "+offset+" = "+(offset*2+viewport_size)); + //print_line("SS: "+video_mode); switch (stretch_mode) { case STRETCH_MODE_2D: { @@ -2181,10 +2221,6 @@ void SceneTree::_bind_methods() { //ClassDB::bind_method(_MD("call_group","call_flags","group","method","arg1","arg2"),&SceneMainLoop::_call_group,DEFVAL(Variant()),DEFVAL(Variant())); - ClassDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneTree::notify_group); - ClassDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneTree::set_group); - - ClassDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group); ClassDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root); ClassDB::bind_method(_MD("has_group","name"),&SceneTree::has_group); @@ -2222,13 +2258,30 @@ void SceneTree::_bind_methods() { MethodInfo mi; - mi.name="call_group"; + mi.name="call_group_flags"; mi.arguments.push_back( PropertyInfo( Variant::INT, "flags")); mi.arguments.push_back( PropertyInfo( Variant::STRING, "group")); mi.arguments.push_back( PropertyInfo( Variant::STRING, "method")); - ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_group",&SceneTree::_call_group,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_group_flags",&SceneTree::_call_group_flags,mi); + + ClassDB::bind_method(_MD("notify_group_flags","call_flags","group","notification"),&SceneTree::notify_group_flags); + ClassDB::bind_method(_MD("set_group_flags","call_flags","group","property","value"),&SceneTree::set_group_flags); + + MethodInfo mi2; + mi2.name="call_group"; + mi2.arguments.push_back( PropertyInfo( Variant::STRING, "group")); + mi2.arguments.push_back( PropertyInfo( Variant::STRING, "method")); + + + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_group",&SceneTree::_call_group,mi2); + + ClassDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneTree::notify_group); + ClassDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneTree::set_group); + + ClassDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group); + ClassDB::bind_method(_MD("set_current_scene","child_node:Node"),&SceneTree::set_current_scene); ClassDB::bind_method(_MD("get_current_scene:Node"),&SceneTree::get_current_scene); diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h index 9de4abe81e..f4271e5454 100644 --- a/scene/main/scene_main_loop.h +++ b/scene/main/scene_main_loop.h @@ -242,9 +242,11 @@ friend class Node; void _notify_group_pause(const StringName& p_group,int p_notification); void _call_input_pause(const StringName& p_group,const StringName& p_method,const InputEvent& p_input); + Variant _call_group_flags(const Variant** p_args, int p_argcount, Variant::CallError& r_error); Variant _call_group(const Variant** p_args, int p_argcount, Variant::CallError& r_error); + static void _debugger_request_tree(void *self); void _flush_delete_queue(); //optimization @@ -332,17 +334,20 @@ public: GROUP_CALL_REVERSE=1, GROUP_CALL_REALTIME=2, GROUP_CALL_UNIQUE=4, - GROUP_CALL_MULIILEVEL=8, + GROUP_CALL_MULTILEVEL=8, }; _FORCE_INLINE_ Viewport *get_root() const { return root; } uint32_t get_last_event_id() const; - void call_group(uint32_t p_call_flags,const StringName& p_group,const StringName& p_function,VARIANT_ARG_LIST); - void notify_group(uint32_t p_call_flags,const StringName& p_group,int p_notification); - void set_group(uint32_t p_call_flags,const StringName& p_group,const String& p_name,const Variant& p_value); + void call_group_flags(uint32_t p_call_flags,const StringName& p_group,const StringName& p_function,VARIANT_ARG_LIST); + void notify_group_flags(uint32_t p_call_flags,const StringName& p_group,int p_notification); + void set_group_flags(uint32_t p_call_flags,const StringName& p_group,const String& p_name,const Variant& p_value); + void call_group(const StringName& p_group,const StringName& p_function,VARIANT_ARG_LIST); + void notify_group(const StringName& p_group,int p_notification); + void set_group(const StringName& p_group,const String& p_name,const Variant& p_value); virtual void input_text( const String& p_text ); virtual void input_event( const InputEvent& p_event ); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index a7d259ef06..c3ece76b05 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -293,12 +293,12 @@ void Viewport::_vp_enter_tree() { VisualServer::get_singleton()->canvas_item_set_parent(canvas_item,parent_ci); VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,false); -// VisualServer::get_singleton()->canvas_item_attach_viewport(canvas_item,viewport); + //VisualServer::get_singleton()->canvas_item_attach_viewport(canvas_item,viewport); parent_control->connect("resized",this,"_parent_resized"); parent_control->connect("visibility_changed",this,"_parent_visibility_changed"); } else if (!parent){ -// VisualServer::get_singleton()->viewport_attach_to_screen(viewport,0); + //VisualServer::get_singleton()->viewport_attach_to_screen(viewport,0); } */ @@ -389,7 +389,7 @@ void Viewport::_notification(int p_what) { if (get_parent()) { parent = get_parent()->get_viewport(); - VisualServer::get_singleton()->viewport_set_parent_viewport(viewport,parent->get_viewport()); + VisualServer::get_singleton()->viewport_set_parent_viewport(viewport,parent->get_viewport_rid()); } else { parent=NULL; } @@ -462,8 +462,10 @@ void Viewport::_notification(int p_what) { if (world_2d.is_valid()) world_2d->_remove_viewport(this); - //if (!render_target) - // _vp_exit_tree(); + /* + if (!render_target) + _vp_exit_tree(); + */ VisualServer::get_singleton()->viewport_set_scenario(viewport,RID()); SpatialSoundServer::get_singleton()->listener_set_space(internal_listener, RID()); @@ -734,7 +736,7 @@ void Viewport::_notification(int p_what) { } } -RID Viewport::get_viewport() const { +RID Viewport::get_viewport_rid() const { return viewport; } @@ -1309,7 +1311,7 @@ void Viewport::queue_screen_capture(){ } Image Viewport::get_screen_capture() const { -// return VS::get_singleton()->viewport_get_screen_capture(viewport); + //return VS::get_singleton()->viewport_get_screen_capture(viewport); return Image(); } @@ -1379,7 +1381,7 @@ Viewport::ShadowAtlasQuadrantSubdiv Viewport::get_shadow_atlas_quadrant_subdiv(i void Viewport::clear() { //clear=true; -// VisualServer::get_singleton()->viewport_clear(viewport); + //VisualServer::get_singleton()->viewport_clear(viewport); } @@ -1399,9 +1401,11 @@ Transform2D Viewport::_get_input_pre_xform() const { Vector2 Viewport::_get_window_offset() const { -// if (parent_control) { -// return (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin(); -// } + /* + if (parent_control) { + return (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin(); + } + */ return Vector2(); } @@ -1521,8 +1525,10 @@ void Viewport::_vp_unhandled_input(const InputEvent& p_ev) { } #endif -// if (parent_control && !parent_control->is_visible_in_tree()) -// return; + /* + if (parent_control && !parent_control->is_visible_in_tree()) + return; + */ if (to_screen_rect==Rect2()) return; //if render target, can't get input events @@ -1647,7 +1653,7 @@ void Viewport::_gui_show_tooltip() { void Viewport::_gui_call_input(Control *p_control,const InputEvent& p_input) { -// _block(); + //_block(); InputEvent ev = p_input; @@ -1745,7 +1751,7 @@ Control* Viewport::_gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_g Control *c=p_node->cast_to<Control>(); if (c) { - // print_line("at "+String(c->get_path())+" POS "+c->get_pos()+" bt "+p_xform); + //print_line("at "+String(c->get_path())+" POS "+c->get_pos()+" bt "+p_xform); } //subwindows first!! @@ -1798,9 +1804,11 @@ void Viewport::_gui_input_event(InputEvent p_event) { return; } //? -// if (!is_visible()) { -// return; //simple and plain -// } + /* + if (!is_visible()) { + return; //simple and plain + } + */ switch(p_event.type) { @@ -1849,10 +1857,10 @@ void Viewport::_gui_input_event(InputEvent p_event) { //Matrix32 parent_xform; - //if (data.parent_canvas_item) - // parent_xform=data.parent_canvas_item->get_global_transform(); - - + /* + if (data.parent_canvas_item) + parent_xform=data.parent_canvas_item->get_global_transform(); + */ gui.mouse_focus = _gui_find_control(pos); //print_line("has mf "+itos(gui.mouse_focus!=NULL)); @@ -1903,7 +1911,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { _gui_call_input(gui.mouse_focus,p_event); } - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID); get_tree()->set_input_as_handled(); @@ -1980,7 +1988,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { }*/ - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID); get_tree()->set_input_as_handled(); } @@ -2419,7 +2427,7 @@ void Viewport::_gui_control_grab_focus(Control* p_control) { if (gui.key_focus && gui.key_focus==p_control) return; - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,"_viewports","_gui_remove_focus"); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME,"_viewports","_gui_remove_focus"); gui.key_focus=p_control; p_control->notification(Control::NOTIFICATION_FOCUS_ENTER); p_control->update(); @@ -2746,7 +2754,7 @@ void Viewport::_bind_methods() { ClassDB::bind_method(_MD("set_physics_object_picking","enable"), &Viewport::set_physics_object_picking); ClassDB::bind_method(_MD("get_physics_object_picking"), &Viewport::get_physics_object_picking); - ClassDB::bind_method(_MD("get_viewport"), &Viewport::get_viewport); + ClassDB::bind_method(_MD("get_viewport_rid"), &Viewport::get_viewport_rid); ClassDB::bind_method(_MD("input","local_event"), &Viewport::input); ClassDB::bind_method(_MD("unhandled_input","local_event"), &Viewport::unhandled_input); @@ -2788,7 +2796,7 @@ void Viewport::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::RECT2,"size"), _SCS("set_size"), _SCS("get_size") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"own_world"), _SCS("set_use_own_world"), _SCS("is_using_own_world") ); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world",PROPERTY_HINT_RESOURCE_TYPE,"World"), _SCS("set_world"), _SCS("get_world") ); -// ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world_2d",PROPERTY_HINT_RESOURCE_TYPE,"World2D"), _SCS("set_world_2d"), _SCS("get_world_2d") ); + //ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world_2d",PROPERTY_HINT_RESOURCE_TYPE,"World2D"), _SCS("set_world_2d"), _SCS("get_world_2d") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"transparent_bg"), _SCS("set_transparent_background"), _SCS("has_transparent_background") ); ADD_GROUP("Rendering",""); ADD_PROPERTY( PropertyInfo(Variant::INT,"msaa",PROPERTY_HINT_ENUM,"Disabled,2x,4x,8x,16x"), _SCS("set_msaa"), _SCS("get_msaa") ); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 1f30044cef..2831d177c9 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -340,7 +340,7 @@ public: Size2 get_size() const; Rect2 get_visible_rect() const; - RID get_viewport() const; + RID get_viewport_rid() const; void set_world(const Ref<World>& p_world); void set_world_2d(const Ref<World2D>& p_world_2d); diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index ca3aef6262..f68e5ca959 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -54,9 +54,9 @@ #include "scene/gui/spin_box.h" #include "scene/gui/option_button.h" #include "scene/gui/color_picker.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/color_rect.h" -#include "scene/gui/patch_9_frame.h" +#include "scene/gui/patch_9_rect.h" #include "scene/gui/menu_button.h" #include "scene/gui/check_box.h" #include "scene/gui/check_button.h" @@ -81,7 +81,7 @@ #include "scene/gui/grid_container.h" #include "scene/gui/split_container.h" #include "scene/gui/video_player.h" -#include "scene/gui/reference_frame.h" +#include "scene/gui/reference_rect.h" #include "scene/gui/graph_node.h" #include "scene/gui/graph_edit.h" #include "scene/gui/tool_button.h" @@ -319,7 +319,7 @@ void register_scene_types() { ClassDB::register_class<ShortCut>(); ClassDB::register_class<Control>(); -// ClassDB::register_type<EmptyControl>(); + //ClassDB::register_type<EmptyControl>(); ClassDB::register_class<Button>(); ClassDB::register_class<Label>(); ClassDB::register_class<HScrollBar>(); @@ -383,7 +383,7 @@ void register_scene_types() { ClassDB::register_virtual_class<TreeItem>(); ClassDB::register_class<OptionButton>(); ClassDB::register_class<SpinBox>(); - ClassDB::register_class<ReferenceFrame>(); + ClassDB::register_class<ReferenceRect>(); ClassDB::register_class<ColorPicker>(); ClassDB::register_class<ColorPickerButton>(); ClassDB::register_class<RichTextLabel>(); @@ -494,7 +494,7 @@ void register_scene_types() { ClassDB::register_class<Particles2D>(); ClassDB::register_class<ParticleAttractor2D>(); ClassDB::register_class<Sprite>(); -// ClassDB::register_type<ViewportSprite>(); + //ClassDB::register_type<ViewportSprite>(); ClassDB::register_class<SpriteFrames>(); ClassDB::register_class<AnimatedSprite>(); ClassDB::register_class<Position2D>(); @@ -537,9 +537,9 @@ void register_scene_types() { /* REGISTER RESOURCES */ ClassDB::register_virtual_class<Shader>(); -// ClassDB::register_virtual_type<ShaderGraph>(); + //ClassDB::register_virtual_type<ShaderGraph>(); ClassDB::register_class<CanvasItemShader>(); -// ClassDB::register_type<CanvasItemShaderGraph>(); + //ClassDB::register_type<CanvasItemShaderGraph>(); #ifndef _3D_DISABLED ClassDB::register_class<Mesh>(); @@ -547,9 +547,9 @@ void register_scene_types() { ClassDB::register_class<FixedSpatialMaterial>(); SceneTree::add_idle_callback(FixedSpatialMaterial::flush_changes); FixedSpatialMaterial::init_shaders(); -// ClassDB::register_type<ShaderMaterial>(); + //ClassDB::register_type<ShaderMaterial>(); ClassDB::register_class<RoomBounds>(); -// ClassDB::register_type<MaterialShaderGraph>(); + //ClassDB::register_type<MaterialShaderGraph>(); ClassDB::register_class<SpatialShader>(); ClassDB::register_class<ParticlesShader>(); ClassDB::register_class<MultiMesh>(); @@ -605,7 +605,7 @@ void register_scene_types() { ClassDB::register_virtual_class<AudioStream>(); ClassDB::register_virtual_class<AudioStreamPlayback>(); //TODO: Adapt to the new AudioStream API or drop (GH-3307) -// ClassDB::register_type<AudioStreamGibberish>(); + //ClassDB::register_type<AudioStreamGibberish>(); ClassDB::register_virtual_class<VideoStream>(); OS::get_singleton()->yield(); //may take time to init diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 1fbb149bf3..5b9baa6a67 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -2005,11 +2005,6 @@ void Animation::_transform_track_optimize(int p_idx,float p_alowed_linear_err,fl prev_erased=false; norm=Vector3(); } - - - - // print_line(itos(i)+" could be eliminated: "+rtos(tr)); - //} } diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 3c6e65bf41..50c6a6c725 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -125,7 +125,7 @@ static Ref<Texture> make_icon(T p_src) { static Ref<Shader> make_shader(const char*vertex_code,const char*fragment_code,const char*lighting_code) { Ref<Shader> shader = (memnew( Shader(Shader::MODE_CANVAS_ITEM) )); -// shader->set_code(vertex_code, fragment_code, lighting_code); + //shader->set_code(vertex_code, fragment_code, lighting_code); return shader; } @@ -934,12 +934,12 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_stylebox("focus","VButtonArray", focus ); - // ReferenceFrame + // ReferenceRect Ref<StyleBoxTexture> ttnc = make_stylebox( full_panel_bg_png,8,8,8,8); ttnc->set_draw_center(false); - t->set_stylebox("border","ReferenceFrame", make_stylebox( reference_border_png,4,4,4,4) ); + t->set_stylebox("border","ReferenceRect", make_stylebox( reference_border_png,4,4,4,4) ); t->set_stylebox("panelnc","Panel", ttnc ); t->set_stylebox("panelf","Panel", tc_sb ); diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 3aadbdbe19..63a7829d26 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -511,7 +511,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { break; } -// print_line("CHAR: "+String::chr(p_char)+" TEX INDEX: "+itos(tex_index)+" X: "+itos(tex_x)+" Y: "+itos(tex_y)); + //print_line("CHAR: "+String::chr(p_char)+" TEX INDEX: "+itos(tex_index)+" X: "+itos(tex_x)+" Y: "+itos(tex_y)); if (tex_index==-1) { //could not find texture to fit, create one @@ -961,7 +961,7 @@ bool ResourceFormatLoaderDynamicFont::handles_type(const String& p_type) const { String ResourceFormatLoaderDynamicFont::get_resource_type(const String &p_path) const { - String el = p_path.extension().to_lower(); + String el = p_path.get_extension().to_lower(); if (el=="ttf" || el=="otf") return "DynamicFontData"; return ""; diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp index a25667d85a..cbbca49f0f 100644 --- a/scene/resources/dynamic_font_stb.cpp +++ b/scene/resources/dynamic_font_stb.cpp @@ -260,7 +260,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { break; } -// print_line("CHAR: "+String::chr(p_char)+" TEX INDEX: "+itos(tex_index)+" X: "+itos(tex_x)+" Y: "+itos(tex_y)); + //print_line("CHAR: "+String::chr(p_char)+" TEX INDEX: "+itos(tex_index)+" X: "+itos(tex_x)+" Y: "+itos(tex_y)); if (tex_index==-1) { //could not find texture to fit, create one diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 3373478336..b1d0611f48 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -252,8 +252,10 @@ Error BitmapFont::create_from_fnt(const String& p_string) { if (keys.has("face")) set_name(keys["face"]); - //if (keys.has("size")) - // font->set_height(keys["size"].to_int()); + /* + if (keys.has("size")) + font->set_height(keys["size"].to_int()); + */ } else if (type=="common") { diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 625cc6a596..5cefca348b 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -529,9 +529,11 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S bool isdefault = ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && value.is_zero()) || ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && value.is_one()); -// if (nd.instance<0 && ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && value.is_zero()) || ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && value.is_one())) { -// continue; -// } + /* + if (nd.instance<0 && ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && value.is_zero()) || ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && value.is_one())) { + continue; + } + */ @@ -614,8 +616,10 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S if (!gi.persistent) continue; -// if (instance_state_node>=0 && instance_state->is_node_in_group(instance_state_node,gi.name)) -// continue; //group was instanced, don't add here + /* + if (instance_state_node>=0 && instance_state->is_node_in_group(instance_state_node,gi.name)) + continue; //group was instanced, don't add here + */ bool skip=false; for (List<PackState>::Element *F=pack_state_stack.front();F;F=F->next()) { @@ -1166,7 +1170,7 @@ void SceneState::set_bundled_scene(const Dictionary& d) { ERR_FAIL_COND( !d.has("nodes")); ERR_FAIL_COND( !d.has("conn_count")); ERR_FAIL_COND( !d.has("conns")); -// ERR_FAIL_COND( !d.has("path")); + //ERR_FAIL_COND( !d.has("path")); int version=1; if (d.has("version")) @@ -1277,7 +1281,7 @@ void SceneState::set_bundled_scene(const Dictionary& d) { editable_instances[i]=ei[i]; } -// path=d["path"]; + //path=d["path"]; } @@ -1362,7 +1366,7 @@ Dictionary SceneState::get_bundled_scene() const { d["version"]=PACK_VERSION; -// d["path"]=path; + //d["path"]=path; return d; diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index fa56f63465..a913687e7f 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -397,7 +397,7 @@ Error ResourceInteractiveLoaderText::poll() { int type=-1; int name=-1; int instance=-1; -// int base_scene=-1; + //int base_scene=-1; if (next_tag.fields.has("name")) { name=packed_scene->get_state()->add_name(next_tag.fields["name"]); @@ -950,7 +950,7 @@ Ref<ResourceInteractiveLoader> ResourceFormatLoaderText::load_interactive(const Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText ); ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); + //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); ria->open(f); return ria; @@ -984,7 +984,7 @@ String ResourceFormatLoaderText::get_resource_type(const String &p_path) const{ - String ext=p_path.extension().to_lower(); + String ext=p_path.get_extension().to_lower(); if (ext=="tscn") return "PackedScene"; else if (ext!="tres") @@ -1001,7 +1001,7 @@ String ResourceFormatLoaderText::get_resource_type(const String &p_path) const{ Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText ); ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); + //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); String r = ria->recognize(f); return r; } @@ -1018,7 +1018,7 @@ void ResourceFormatLoaderText::get_dependencies(const String& p_path,List<String Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText ); ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); + //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); ria->get_dependencies(f,p_dependencies,p_add_types); @@ -1035,7 +1035,7 @@ Error ResourceFormatLoaderText::rename_dependencies(const String &p_path,const M Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText ); ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); + //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); return ria->rename_dependencies(f,p_path,p_map); } @@ -1208,10 +1208,12 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re if (packed_scene.is_null()) title+="type=\""+p_resource->get_class()+"\" "; int load_steps=saved_resources.size()+external_resources.size(); - //if (packed_scene.is_valid()) { - // load_steps+=packed_scene->get_node_count(); - //} + /* + if (packed_scene.is_valid()) { + load_steps+=packed_scene->get_node_count(); + } //no, better to not use load steps from nodes, no point to that + */ if (load_steps>1) { title+="load_steps="+itos(load_steps)+" "; @@ -1299,7 +1301,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re List<PropertyInfo> property_list; res->get_property_list(&property_list); -// property_list.sort(); + //property_list.sort(); for(List<PropertyInfo>::Element *PE = property_list.front();PE;PE=PE->next()) { diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h index 58660fa639..ce18f6a702 100644 --- a/scene/resources/scene_format_text.h +++ b/scene/resources/scene_format_text.h @@ -58,7 +58,7 @@ class ResourceInteractiveLoaderText : public ResourceInteractiveLoader { bool ignore_resource_parsing; -// Map<String,String> remaps; + //Map<String,String> remaps; Map<int,ExtResource> ext_resources; diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 37b019e369..10f852f17c 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -192,7 +192,7 @@ void ShaderGraph::_bind_methods() { ClassDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_get_value); -// void get_node_list(ShaderType p_which,List<int> *p_node_list) const; + //void get_node_list(ShaderType p_which,List<int> *p_node_list) const; ClassDB::bind_method(_MD("texture_node_set_filter_size","shader_type","id","filter_size"),&ShaderGraph::texture_node_set_filter_size); ClassDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_get_filter_size); diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 066062f302..e5e32ba4e9 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -75,8 +75,8 @@ void StyleBox::_bind_methods() { ClassDB::bind_method(_MD("set_default_margin","margin","offset"),&StyleBox::set_default_margin); ClassDB::bind_method(_MD("get_default_margin","margin"),&StyleBox::get_default_margin); -// ClassDB::bind_method(_MD("set_default_margin"),&StyleBox::set_default_margin); -// ClassDB::bind_method(_MD("get_default_margin"),&StyleBox::get_default_margin); + //ClassDB::bind_method(_MD("set_default_margin"),&StyleBox::set_default_margin); + //ClassDB::bind_method(_MD("get_default_margin"),&StyleBox::get_default_margin); ClassDB::bind_method(_MD("get_margin","margin"),&StyleBox::get_margin); ClassDB::bind_method(_MD("get_minimum_size"),&StyleBox::get_minimum_size); diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index cc13c0ff11..27cc7e131b 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -650,9 +650,11 @@ void SurfaceTool::append_from(const Ref<Mesh>& p_existing, int p_surface,const T for(List<int>::Element *E=nindices.front();E;E=E->next()) { int dst_index = E->get()+vfrom; - //if (dst_index <0 || dst_index>=vertex_array.size()) { - // print_line("invalid index!"); - //} + /* + if (dst_index <0 || dst_index>=vertex_array.size()) { + print_line("invalid index!"); + } + */ index_array.push_back(dst_index); } if (index_array.size()%3) diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 462341a751..a1ad5d8237 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -66,7 +66,6 @@ void Texture::_bind_methods() { ClassDB::bind_method(_MD("get_width"),&Texture::get_width); ClassDB::bind_method(_MD("get_height"),&Texture::get_height); ClassDB::bind_method(_MD("get_size"),&Texture::get_size); - ClassDB::bind_method(_MD("get_rid"),&Texture::get_rid); ClassDB::bind_method(_MD("has_alpha"),&Texture::has_alpha); ClassDB::bind_method(_MD("set_flags","flags"),&Texture::set_flags); ClassDB::bind_method(_MD("get_flags"),&Texture::get_flags); @@ -1050,7 +1049,7 @@ void CubeMap::_bind_methods() { ClassDB::bind_method(_MD("get_width"),&CubeMap::get_width); ClassDB::bind_method(_MD("get_height"),&CubeMap::get_height); - ClassDB::bind_method(_MD("get_rid"),&CubeMap::get_rid); + //ClassDB::bind_method(_MD("get_rid"),&CubeMap::get_rid); ClassDB::bind_method(_MD("set_flags","flags"),&CubeMap::set_flags); ClassDB::bind_method(_MD("get_flags"),&CubeMap::get_flags); diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 2e3afbf057..d950407f54 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -267,7 +267,7 @@ void Theme::set_default_font( const Ref<Font>& p_font ) { void Theme::set_icon(const StringName& p_name,const StringName& p_type,const Ref<Texture>& p_icon) { -// ERR_FAIL_COND(p_icon.is_null()); + //ERR_FAIL_COND(p_icon.is_null()); bool new_value=!icon_map.has(p_type) || !icon_map[p_type].has(p_name); @@ -367,7 +367,7 @@ void Theme::get_shader_list(const StringName &p_type, List<StringName> *p_list) void Theme::set_stylebox(const StringName& p_name,const StringName& p_type,const Ref<StyleBox>& p_style) { -// ERR_FAIL_COND(p_style.is_null()); + //ERR_FAIL_COND(p_style.is_null()); bool new_value=!style_map.has(p_type) || !style_map[p_type].has(p_name); @@ -430,7 +430,7 @@ void Theme::get_stylebox_types(List<StringName> *p_list) const { void Theme::set_font(const StringName& p_name,const StringName& p_type,const Ref<Font>& p_font) { -// ERR_FAIL_COND(p_font.is_null()); + //ERR_FAIL_COND(p_font.is_null()); bool new_value=!font_map.has(p_type) || !font_map[p_type].has(p_name); @@ -999,7 +999,7 @@ RES ResourceFormatLoaderTheme::load(const String &p_path, const String& p_origin ERR_FAIL_V(RES()); } -// int margin = params[i+ccodes+1].to_int(); + //int margin = params[i+ccodes+1].to_int(); //sbflat->set_margin_size(Margin(i),margin); } } else if (params.size()!=ccodes+1) { @@ -1147,7 +1147,7 @@ bool ResourceFormatLoaderTheme::handles_type(const String& p_type) const { String ResourceFormatLoaderTheme::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="theme") + if (p_path.get_extension().to_lower()=="theme") return "Theme"; return ""; } diff --git a/servers/audio/audio_mixer_sw.cpp b/servers/audio/audio_mixer_sw.cpp index faed6905ea..0123b66430 100644 --- a/servers/audio/audio_mixer_sw.cpp +++ b/servers/audio/audio_mixer_sw.cpp @@ -271,7 +271,7 @@ void AudioMixerSW::mix_channel(Channel& c) { bool is_stereo=sample_manager->sample_is_stereo(c.sample); int32_t todo=mix_chunk_size; -// int mixed=0; + //int mixed=0; bool use_filter=false; ResamplerState rstate; diff --git a/servers/audio/reverb_sw.cpp b/servers/audio/reverb_sw.cpp index 0050dbedeb..5e02f37679 100644 --- a/servers/audio/reverb_sw.cpp +++ b/servers/audio/reverb_sw.cpp @@ -100,145 +100,145 @@ struct ReverbParamsSW { static ReverbParamsSW reverb_params_Room = { 0x26C0/2, -// gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall + //gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall 0x6D80, 0x54B8, -0x4130, 0x0000, 0x0000, -0x4580, -// gReva gRevb gInputL gInputR + //gReva gRevb gInputL gInputR 0x5800, 0x5300, -0x8000, -0x8000, -// nRevaOldL nRevaOldR nRevbOldL nRevbOldR + //nRevaOldL nRevaOldR nRevbOldL nRevbOldR 0x01B4 - 0x007D, 0x0136 - 0x007D, 0x00B8 - 0x005B, 0x005C - 0x005B, -// nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R + //nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R 0x04D6, 0x0333, 0x03F0, 0x0227, 0x0374, 0x01EF, -// nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R + //nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R 0x0334, 0x01B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -// nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR + //nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR 0x0000, 0x0000, 0x01B4, 0x0136, 0x00B8, 0x005C }; static ReverbParamsSW reverb_params_StudioSmall = { 0x1F40/2, -// gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall + //gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall 0x70F0, 0x4FA8, -0x4320, 0x4410, -0x3F10, -0x6400, -// gReva gRevb gInputL gInputR + //gReva gRevb gInputL gInputR 0x5280, 0x4EC0, -0x8000, -0x8000, -// nRevaOldL nRevaOldR nRevbOldL nRevbOldR + //nRevaOldL nRevaOldR nRevbOldL nRevbOldR 0x00B4 - 0x0033, 0x0080 - 0x0033, 0x004C - 0x0025, 0x0026 - 0x0025, -// nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R + //nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R 0x03E4, 0x031B, 0x03A4, 0x02AF, 0x0372, 0x0266, -// nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R + //nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R 0x031C, 0x025D, 0x025C, 0x018E, 0x022F, 0x0135, 0x01D2, 0x00B7, -// nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR + //nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR 0x018F, 0x00B5, 0x00B4, 0x0080, 0x004C, 0x0026 }; static ReverbParamsSW reverb_params_StudioMedium = { 0x4840/2, -// gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall + //gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall 0x70F0, 0x4FA8, -0x4320, 0x4510, -0x4110, -0x4B40, -// gReva gRevb gInputL gInputR + //gReva gRevb gInputL gInputR 0x5280, 0x4EC0, -0x8000, -0x8000, -// nRevaOldL nRevaOldR nRevbOldL nRevbOldR + //nRevaOldL nRevaOldR nRevbOldL nRevbOldR 0x0264 - 0x00B1, 0x01B2 - 0x00B1, 0x0100 - 0x007F, 0x0080 - 0x007F, -// nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R + //nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R 0x0904, 0x076B, 0x0824, 0x065F, 0x07A2, 0x0616, -// nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R + //nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R 0x076C, 0x05ED, 0x05EC, 0x042E, 0x050F, 0x0305, 0x0462, 0x02B7, -// nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR + //nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR 0x042F, 0x0265, 0x0264, 0x01B2, 0x0100, 0x0080 }; static ReverbParamsSW reverb_params_StudioLarge = { 0x6FE0/2, -// gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall + //gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall 0x6F60, 0x4FA8, -0x4320, 0x4510, -0x4110, -0x5980, -// gReva gRevb gInputL gInputR + //gReva gRevb gInputL gInputR 0x5680, 0x52C0, -0x8000, -0x8000, -// nRevaOldL nRevaOldR nRevbOldL nRevbOldR + //nRevaOldL nRevaOldR nRevbOldL nRevbOldR 0x031C - 0x00E3, 0x0238 - 0x00E3, 0x0154 - 0x00A9, 0x00AA - 0x00A9, -// nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R + //nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R 0x0DFB, 0x0B58, 0x0D09, 0x0A3C, 0x0BD9, 0x0973, -// nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R + //nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R 0x0B59, 0x08DA, 0x08D9, 0x05E9, 0x07EC, 0x04B0, 0x06EF, 0x03D2, -// nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR + //nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR 0x05EA, 0x031D, 0x031C, 0x0238, 0x0154, 0x00AA }; static ReverbParamsSW reverb_params_Hall = { 0xADE0/2, -// gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall + //gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall 0x6000, 0x5000, 0x4C00, -0x4800, -0x4400, -0x4000, -// gReva gRevb gInputL gInputR + //gReva gRevb gInputL gInputR 0x6000, 0x5C00, -0x8000, -0x8000, -// nRevaOldL nRevaOldR nRevbOldL nRevbOldR + //nRevaOldL nRevaOldR nRevbOldL nRevbOldR 0x05C0 - 0x01A5, 0x041A - 0x01A5, 0x0274 - 0x0139, 0x013A - 0x0139, -// nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R + //nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R 0x15BA, 0x11BB, 0x14C2, 0x10BD, 0x11BC, 0x0DC1, -// nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R + //nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R 0x11C0, 0x0DC3, 0x0DC0, 0x09C1, 0x0BC4, 0x07C1, 0x0A00, 0x06CD, -// nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR + //nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR 0x09C2, 0x05C1, 0x05C0, 0x041A, 0x0274, 0x013A }; static ReverbParamsSW reverb_params_SpaceEcho = { 0xF6C0/2, -// gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall + //gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall 0x7E00, 0x5000, -0x4C00, -0x5000, 0x4C00, -0x5000, -// gReva gRevb gInputL gInputR + //gReva gRevb gInputL gInputR 0x6000, 0x5400, -0x8000, -0x8000, -// nRevaOldL nRevaOldR nRevbOldL nRevbOldR + //nRevaOldL nRevaOldR nRevbOldL nRevbOldR 0x0AE0 - 0x033D, 0x07A2 - 0x033D, 0x0464 - 0x0231, 0x0232 - 0x0231, -// nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R + //nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R 0x1ED6, 0x1A31, 0x1D14, 0x183B, 0x1BC2, 0x16B2, -// nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R + //nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R 0x1A32, 0x15EF, 0x15EE, 0x1055, 0x1334, 0x0F2D, 0x11F6, 0x0C5D, -// nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR + //nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR 0x1056, 0x0AE1, 0x0AE0, 0x07A2, 0x0464, 0x0232 }; static ReverbParamsSW reverb_params_Echo = { 0x18040/2, -// gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall + //gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall 0x7FFF, 0x7FFF, 0x0000, 0x0000, 0x0000, -0x7F00, -// gReva gRevb gInputL gInputR + //gReva gRevb gInputL gInputR 0x0000, 0x0000, -0x8000, -0x8000, -// nRevaOldL nRevaOldR nRevbOldL nRevbOldR + //nRevaOldL nRevaOldR nRevbOldL nRevbOldR 0x1004 - 0x0001, 0x1002 - 0x0001, 0x0004 - 0x0001, 0x0002 - 0x0001, -// nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R + //nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R 0x1FFF, 0x0FFF, 0x1005, 0x0005, 0x0000, 0x0000, -// nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R + //nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R 0x1005, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -// nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR + //nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR 0x0000, 0x0000, 0x1004, 0x1002, 0x0004, 0x0002 }; static ReverbParamsSW reverb_params_Delay = { 0x18040/2, -// gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall + //gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall 0x7FFF, 0x7FFF, 0x0000, 0x0000, 0x0000, 0x0000, -// gReva gRevb gInputL gInputR + //gReva gRevb gInputL gInputR 0x0000, 0x0000, -0x8000, -0x8000, -// nRevaOldL nRevaOldR nRevbOldL nRevbOldR + //nRevaOldL nRevaOldR nRevbOldL nRevbOldR 0x1004 - 0x0001, 0x1002 - 0x0001, 0x0004 - 0x0001, 0x0002 - 0x0001, -// nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R + //nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R 0x1FFF, 0x0FFF, 0x1005, 0x0005, 0x0000, 0x0000, -// nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R + //nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R 0x1005, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -// nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR + //nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR 0x0000, 0x0000, 0x1004, 0x1002, 0x0004, 0x0002 }; static ReverbParamsSW reverb_params_HalfEcho = { 0x3C00/2, -// gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall + //gLPF gEcho0 gEcho1 gEcho2 gEcho3 gWall 0x70F0, 0x4FA8, -0x4320, 0x4510, -0x4110, -0x7B00, -// gReva gRevb gInputL gInputR + //gReva gRevb gInputL gInputR 0x5F80, 0x54C0, -0x8000, -0x8000, -// nRevaOldL nRevaOldR nRevbOldL nRevbOldR + //nRevaOldL nRevaOldR nRevbOldL nRevbOldR 0x0058 - 0x0017, 0x0040 - 0x0017, 0x0028 - 0x0013, 0x0014 - 0x0013, -// nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R + //nLwlNew nRwrNew nEcho0L nEcho0R nEcho1L nEcho1R 0x0371, 0x02AF, 0x02E5, 0x01DF, 0x02B0, 0x01D7, -// nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R + //nLwlOld nRwrOld nLwrNew nRwlNew nEcho2L nEcho2R nEcho3L nEcho3R 0x0358, 0x026A, 0x01D6, 0x011E, 0x012D, 0x00B1, 0x011F, 0x0059, -// nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR + //nLwrOld nRwlOld nRevaNewL nRevaNewR nRevbNewL nRevbNewR 0x01A0, 0x00E3, 0x0058, 0x0040, 0x0028, 0x0014 }; @@ -265,7 +265,7 @@ bool ReverbSW::process(int *p_input,int *p_output,int p_frames,int p_stereo_stri // p_input must point to a non-looping buffer. // BOTH p_input and p_output must be touched (use ClearModuleBuffer). - // �������LOCAL MACROS ������۲ + // LOCAL MACROS #undef LM_SETSRCOFFSET #define LM_SETSRCOFFSET(x) \ @@ -296,14 +296,14 @@ MULSHIFT_S32 ( x, current_params->y, 15 ) #undef LM_REVERB #define LM_REVERB(x) reverb_buffer[ (x) + cSample ] - // �������LOCAL VARIABLES ������۲ + // LOCAL VARIABLES unsigned int Offset; int lwl, lwr, rwl, rwr; -// unsigned char HZShift; + //unsigned char HZShift; - // �������CODE ������۲ + // CODE lwl = state.lwl; diff --git a/servers/physics/area_pair_sw.cpp b/servers/physics/area_pair_sw.cpp index 1131aa90d3..e95c85d751 100644 --- a/servers/physics/area_pair_sw.cpp +++ b/servers/physics/area_pair_sw.cpp @@ -110,7 +110,7 @@ bool Area2PairSW::setup(float p_step) { return false; } -// bool result = area_a->test_collision_mask(area_b) && CollisionSolverSW::solve(area_a->get_shape(shape_a),area_a->get_transform() * area_a->get_shape_transform(shape_a),Vector2(),area_b->get_shape(shape_b),area_b->get_transform() * area_b->get_shape_transform(shape_b),Vector2(),NULL,this); + //bool result = area_a->test_collision_mask(area_b) && CollisionSolverSW::solve(area_a->get_shape(shape_a),area_a->get_transform() * area_a->get_shape_transform(shape_a),Vector2(),area_b->get_shape(shape_b),area_b->get_transform() * area_b->get_shape_transform(shape_b),Vector2(),NULL,this); bool result = CollisionSolverSW::solve_static(area_a->get_shape(shape_a),area_a->get_transform() * area_a->get_shape_transform(shape_a),area_b->get_shape(shape_b),area_b->get_transform() * area_b->get_shape_transform(shape_b),NULL,this); if (result!=colliding) { diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index ceeeafe04a..81604dd5e1 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -270,8 +270,10 @@ void BodySW::set_mode(PhysicsServer::BodyMode p_mode) { } _update_inertia(); - //if (get_space()) -// _update_queries(); + /* + if (get_space()) + _update_queries(); + */ } PhysicsServer::BodyMode BodySW::get_mode() const { @@ -319,14 +321,18 @@ void BodySW::set_state(PhysicsServer::BodyState p_state, const Variant& p_varian } break; case PhysicsServer::BODY_STATE_LINEAR_VELOCITY: { - //if (mode==PhysicsServer::BODY_MODE_STATIC) - // break; + /* + if (mode==PhysicsServer::BODY_MODE_STATIC) + break; + */ linear_velocity=p_variant; wakeup(); } break; case PhysicsServer::BODY_STATE_ANGULAR_VELOCITY: { - //if (mode!=PhysicsServer::BODY_MODE_RIGID) - // break; + /* + if (mode!=PhysicsServer::BODY_MODE_RIGID) + break; + */ angular_velocity=p_variant; wakeup(); @@ -400,11 +406,13 @@ void BodySW::set_space(SpaceSW *p_space){ _update_inertia(); if (active) get_space()->body_add_to_active_list(&active_list); -// _update_queries(); - //if (is_active()) { - // active=false; - // set_active(true); - //} + /* + _update_queries(); + if (is_active()) { + active=false; + set_active(true); + } + */ } @@ -479,13 +487,17 @@ void BodySW::integrate_forces(real_t p_step) { // If less than 0, override dampenings with that of the Body if (angular_damp>=0) area_angular_damp=angular_damp; - //else - // area_angular_damp=damp_area->get_angular_damp(); + /* + else + area_angular_damp=damp_area->get_angular_damp(); + */ if (linear_damp>=0) area_linear_damp=linear_damp; - //else - // area_linear_damp=damp_area->get_linear_damp(); + /* + else + area_linear_damp=damp_area->get_linear_damp(); + */ Vector3 motion; @@ -630,10 +642,10 @@ void BodySW::integrate_velocities(real_t p_step) { _update_transform_dependant(); - //if (fi_callback) { - - // get_space()->body_add_to_state_query_list(&direct_state_query_list); - // + /* + if (fi_callback) { + get_space()->body_add_to_state_query_list(&direct_state_query_list); + */ } /* @@ -772,12 +784,12 @@ BodySW::BodySW() : CollisionObjectSW(TYPE_BODY), active_list(this), inertia_upda active=true; mass=1; -// _inv_inertia=Transform(); + //_inv_inertia=Transform(); _inv_mass=1; bounce=0; friction=1; omit_force_integration=false; -// applied_torque=0; + //applied_torque=0; island_step=0; island_next=NULL; island_list_next=NULL; diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index 7f8153611f..d02303e23d 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -42,9 +42,11 @@ struct _CollectorCallback { _FORCE_INLINE_ void call(const Vector3& p_point_A, const Vector3& p_point_B) { - //if (normal.dot(p_point_A) >= normal.dot(p_point_B)) - // return; -// print_line("** A: "+p_point_A+" B: "+p_point_B+" D: "+rtos(p_point_A.distance_to(p_point_B))); + /* + if (normal.dot(p_point_A) >= normal.dot(p_point_B)) + return; + print_line("** A: "+p_point_A+" B: "+p_point_B+" D: "+rtos(p_point_A.distance_to(p_point_B))); + */ if (swap) callback(p_point_B,p_point_A,userdata); @@ -108,7 +110,7 @@ static void _generate_contacts_edge_edge(const Vector3 * p_points_A,int p_point_ Vector3 c=rel_A.cross(rel_B).cross(rel_B); -// if ( Math::abs(rel_A.dot(c) )<_EDGE_IS_VALID_SUPPORT_TRESHOLD ) { + //if ( Math::abs(rel_A.dot(c) )<_EDGE_IS_VALID_SUPPORT_TRESHOLD ) { if ( Math::abs(rel_A.dot(c) )<CMP_EPSILON ) { // should handle somehow.. @@ -205,7 +207,7 @@ static void _generate_contacts_face_face(const Vector3 * p_points_A,int p_point_ // check for different sides and non coplanar -// if ( (dist0*dist1) < -CMP_EPSILON && !(edge && j)) { + //if ( (dist0*dist1) < -CMP_EPSILON && !(edge && j)) { if ( (dist0*dist1) < 0 && !(edge && j)) { // calculate intersection @@ -233,8 +235,10 @@ static void _generate_contacts_face_face(const Vector3 * p_points_A,int p_point_ for (int i=0;i<clipbuf_len;i++) { float d = plane_B.distance_to(clipbuf_src[i]); - //if (d>CMP_EPSILON) - // continue; + /* + if (d>CMP_EPSILON) + continue; + */ Vector3 closest_B=clipbuf_src[i] - plane_B.normal*d; @@ -1379,7 +1383,7 @@ static void _collision_convex_polygon_convex_polygon(const ShapeSW *p_a,const Tr for (int i=0;i<face_count_A;i++) { Vector3 axis = p_transform_a.xform( faces_A[i].plane ).normal; -// Vector3 axis = p_transform_a.basis.xform( faces_A[i].plane.normal ).normalized(); + //Vector3 axis = p_transform_a.basis.xform( faces_A[i].plane.normal ).normalized(); if (!separator.test_axis( axis )) return; @@ -1389,7 +1393,7 @@ static void _collision_convex_polygon_convex_polygon(const ShapeSW *p_a,const Tr for (int i=0;i<face_count_B;i++) { Vector3 axis = p_transform_b.xform( faces_B[i].plane ).normal; -// Vector3 axis = p_transform_b.basis.xform( faces_B[i].plane.normal ).normalized(); + //Vector3 axis = p_transform_b.basis.xform( faces_B[i].plane.normal ).normalized(); if (!separator.test_axis( axis )) @@ -1502,7 +1506,7 @@ static void _collision_convex_polygon_face(const ShapeSW *p_a,const Transform &p // faces of A for (int i=0;i<face_count;i++) { -// Vector3 axis = p_transform_a.xform( faces[i].plane ).normal; + //Vector3 axis = p_transform_a.xform( faces[i].plane ).normal; Vector3 axis = p_transform_a.basis.xform( faces[i].plane.normal ).normalized(); if (!separator.test_axis( axis )) diff --git a/servers/physics/collision_solver_sw.cpp b/servers/physics/collision_solver_sw.cpp index 91ef7913cf..3399849ab7 100644 --- a/servers/physics/collision_solver_sw.cpp +++ b/servers/physics/collision_solver_sw.cpp @@ -383,7 +383,7 @@ bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A,const Transform& concave_B->cull(local_aabb,concave_distance_callback,&cinfo); if (!cinfo.collided) { -// print_line(itos(cinfo.tested)); + //print_line(itos(cinfo.tested)); r_point_A=cinfo.close_A; r_point_B=cinfo.close_B; diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp index 5036a1d8a3..cbf444f1e8 100644 --- a/servers/physics/joints/cone_twist_joint_sw.cpp +++ b/servers/physics/joints/cone_twist_joint_sw.cpp @@ -156,7 +156,7 @@ bool ConeTwistJointSW::setup(float p_step) { if (m_swingSpan1 >= real_t(0.05f)) { b1Axis2 = A->get_transform().basis.xform( this->m_rbAFrame.basis.get_axis(1) ); -// swing1 = btAtan2Fast( b2Axis1.dot(b1Axis2),b2Axis1.dot(b1Axis1) ); + //swing1 = btAtan2Fast( b2Axis1.dot(b1Axis2),b2Axis1.dot(b1Axis1) ); swx = b2Axis1.dot(b1Axis1); swy = b2Axis1.dot(b1Axis2); swing1 = atan2fast(swy, swx); @@ -169,7 +169,7 @@ bool ConeTwistJointSW::setup(float p_step) { if (m_swingSpan2 >= real_t(0.05f)) { b1Axis3 = A->get_transform().basis.xform( this->m_rbAFrame.basis.get_axis(2) ); -// swing2 = btAtan2Fast( b2Axis1.dot(b1Axis3),b2Axis1.dot(b1Axis1) ); + //swing2 = btAtan2Fast( b2Axis1.dot(b1Axis3),b2Axis1.dot(b1Axis1) ); swx = b2Axis1.dot(b1Axis1); swy = b2Axis1.dot(b1Axis3); swing2 = atan2fast(swy, swx); diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp index 5824de0127..48f70d9077 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.cpp +++ b/servers/physics/joints/generic_6dof_joint_sw.cpp @@ -50,10 +50,9 @@ real_t btGetMatrixElem(const Basis& mat, int index) bool matrixToEulerXYZ(const Basis& mat,Vector3& xyz); bool matrixToEulerXYZ(const Basis& mat,Vector3& xyz) { -// // rot = cy*cz -cy*sz sy -// // cz*sx*sy+cx*sz cx*cz-sx*sy*sz -cy*sx -// // -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy -// + // rot = cy*cz -cy*sz sy + // cz*sx*sy+cx*sz cx*cz-sx*sy*sz -cy*sx + // -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy if (btGetMatrixElem(mat,2) < real_t(1.0)) { @@ -325,16 +324,18 @@ void Generic6DOFJointSW::calculateAngleInfo() m_calculatedAxis[2] = axis0.cross(m_calculatedAxis[1]); -// if(m_debugDrawer) -// { -// -// char buff[300]; -// sprintf(buff,"\n X: %.2f ; Y: %.2f ; Z: %.2f ", -// m_calculatedAxisAngleDiff[0], -// m_calculatedAxisAngleDiff[1], -// m_calculatedAxisAngleDiff[2]); -// m_debugDrawer->reportErrorWarning(buff); -// } + /* + if(m_debugDrawer) + { + + char buff[300]; + sprintf(buff,"\n X: %.2f ; Y: %.2f ; Z: %.2f ", + m_calculatedAxisAngleDiff[0], + m_calculatedAxisAngleDiff[1], + m_calculatedAxisAngleDiff[2]); + m_debugDrawer->reportErrorWarning(buff); + } + */ } diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics/joints/hinge_joint_sw.cpp index 2f07779131..277346fbbb 100644 --- a/servers/physics/joints/hinge_joint_sw.cpp +++ b/servers/physics/joints/hinge_joint_sw.cpp @@ -221,7 +221,7 @@ bool HingeJointSW::setup(float p_step) { // Compute limit information real_t hingeAngle = get_hinge_angle(); -// print_line("angle: "+rtos(hingeAngle)); + //print_line("angle: "+rtos(hingeAngle)); //set bias, sign, clear accumulator m_correction = real_t(0.); m_limitSign = real_t(0.); @@ -235,17 +235,17 @@ bool HingeJointSW::setup(float p_step) { print_line("hi: "+rtos(m_upperLimit)); }*/ -// if (m_lowerLimit < m_upperLimit) + //if (m_lowerLimit < m_upperLimit) if (m_useLimit && m_lowerLimit <= m_upperLimit) { -// if (hingeAngle <= m_lowerLimit*m_limitSoftness) + //if (hingeAngle <= m_lowerLimit*m_limitSoftness) if (hingeAngle <= m_lowerLimit) { m_correction = (m_lowerLimit - hingeAngle); m_limitSign = 1.0f; m_solveLimit = true; } -// else if (hingeAngle >= m_upperLimit*m_limitSoftness) + //else if (hingeAngle >= m_upperLimit*m_limitSoftness) else if (hingeAngle >= m_upperLimit) { m_correction = m_upperLimit - hingeAngle; diff --git a/servers/physics/joints/pin_joint_sw.cpp b/servers/physics/joints/pin_joint_sw.cpp index 292d30443c..9c7fe65684 100644 --- a/servers/physics/joints/pin_joint_sw.cpp +++ b/servers/physics/joints/pin_joint_sw.cpp @@ -68,8 +68,8 @@ void PinJointSW::solve(float p_step){ Vector3 normal(0,0,0); -// Vector3 angvelA = A->get_transform().origin.getBasis().transpose() * A->getAngularVelocity(); -// Vector3 angvelB = B->get_transform().origin.getBasis().transpose() * B->getAngularVelocity(); + //Vector3 angvelA = A->get_transform().origin.getBasis().transpose() * A->getAngularVelocity(); + //Vector3 angvelB = B->get_transform().origin.getBasis().transpose() * B->getAngularVelocity(); for (int i=0;i<3;i++) { diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index 4069ccdccb..b71eae54b0 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -1395,11 +1395,13 @@ void PhysicsServerSW::free(RID p_rid) { BodySW *body = body_owner.get(p_rid); -// if (body->get_state_query()) -// _clear_query(body->get_state_query()); + /* + if (body->get_state_query()) + _clear_query(body->get_state_query()); -// if (body->get_direct_state_query()) -// _clear_query(body->get_direct_state_query()); + if (body->get_direct_state_query()) + _clear_query(body->get_direct_state_query()); + */ body->set_space(NULL); @@ -1422,8 +1424,10 @@ void PhysicsServerSW::free(RID p_rid) { AreaSW *area = area_owner.get(p_rid); -// if (area->get_monitor_query()) -// _clear_query(area->get_monitor_query()); + /* + if (area->get_monitor_query()) + _clear_query(area->get_monitor_query()); + */ area->set_space(NULL); diff --git a/servers/physics/physics_server_sw.h b/servers/physics/physics_server_sw.h index a3f98392fc..72b133c4b9 100644 --- a/servers/physics/physics_server_sw.h +++ b/servers/physics/physics_server_sw.h @@ -62,7 +62,7 @@ friend class PhysicsDirectSpaceStateSW; mutable RID_Owner<BodySW> body_owner; mutable RID_Owner<JointSW> joint_owner; -// void _clear_query(QuerySW *p_query); + //void _clear_query(QuerySW *p_query); public: struct CollCbkData { diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index 59ade71475..9f8d1107f4 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -1048,8 +1048,10 @@ void ConcavePolygonShapeSW::_cull_segment(int p_idx,_SegmentCullParams *p_params const BVH *bvh=&p_params->bvh[p_idx]; - //if (p_params->dir.dot(bvh->aabb.get_support(-p_params->dir))>p_params->min_d) - // return; //test against whole AABB, which isn't very costly + /* + if (p_params->dir.dot(bvh->aabb.get_support(-p_params->dir))>p_params->min_d) + return; //test against whole AABB, which isn't very costly + */ //printf("addr: %p\n",bvh); @@ -1309,7 +1311,7 @@ _VolumeSW_BVH* _volume_sw_build_bvh(_VolumeSW_BVH_Element *p_elements,int p_size bvh->left=_volume_sw_build_bvh(p_elements,split,count); bvh->right=_volume_sw_build_bvh(&p_elements[split],p_size-split,count); -// printf("branch at %p - %i: %i\n",bvh,count,bvh->face_index); + //printf("branch at %p - %i: %i\n",bvh,count,bvh->face_index); count++; return bvh; } @@ -1322,7 +1324,7 @@ void ConcavePolygonShapeSW::_fill_bvh(_VolumeSW_BVH* p_bvh_tree,BVH* p_bvh_array p_bvh_array[idx].aabb=p_bvh_tree->aabb; p_bvh_array[idx].face_index=p_bvh_tree->face_index; -// printf("%p - %i: %i(%p) -- %p:%p\n",%p_bvh_array[idx],p_idx,p_bvh_array[i]->face_index,&p_bvh_tree->face_index,p_bvh_tree->left,p_bvh_tree->right); + //printf("%p - %i: %i(%p) -- %p:%p\n",%p_bvh_array[idx],p_idx,p_bvh_array[i]->face_index,&p_bvh_tree->face_index,p_bvh_tree->left,p_bvh_tree->right); if (p_bvh_tree->left) { diff --git a/servers/physics/shape_sw.h b/servers/physics/shape_sw.h index 3cbd1c9609..919c681105 100644 --- a/servers/physics/shape_sw.h +++ b/servers/physics/shape_sw.h @@ -366,8 +366,8 @@ struct HeightMapShapeSW : public ConcaveShapeSW { int depth; float cell_size; -// void _cull_segment(int p_idx,_SegmentCullParams *p_params) const; -// void _cull(int p_idx,_CullParams *p_params) const; + //void _cull_segment(int p_idx,_SegmentCullParams *p_params) const; + //void _cull(int p_idx,_CullParams *p_params) const; void _setup(PoolVector<float> p_heights,int p_width,int p_depth,float p_cell_size); public: diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index d73d5f140e..eaa3d3194c 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -204,8 +204,10 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform& aabb=aabb.merge(Rect3(aabb.pos+p_motion,aabb.size)); //motion aabb=aabb.grow(p_margin); - //if (p_motion!=Vector3()) - // print_line(p_motion); + /* + if (p_motion!=Vector3()) + print_line(p_motion); + */ int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,SpaceSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); diff --git a/servers/physics/step_sw.cpp b/servers/physics/step_sw.cpp index e24081761b..30ee33a7de 100644 --- a/servers/physics/step_sw.cpp +++ b/servers/physics/step_sw.cpp @@ -233,7 +233,7 @@ void StepSW::step(SpaceSW* p_space,float p_delta,int p_iterations) { } -// print_line("island count: "+itos(island_count)+" active count: "+itos(active_count)); + //print_line("island count: "+itos(island_count)+" active count: "+itos(active_count)); /* SETUP CONSTRAINT ISLANDS */ { diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index a32e024fe9..093f69a169 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -251,8 +251,10 @@ void Body2DSW::set_mode(Physics2DServer::BodyMode p_mode) { } _update_inertia(); - //if (get_space()) -// _update_queries(); + /* + if (get_space()) + _update_queries(); + */ } Physics2DServer::BodyMode Body2DSW::get_mode() const { @@ -301,15 +303,19 @@ void Body2DSW::set_state(Physics2DServer::BodyState p_state, const Variant& p_va } break; case Physics2DServer::BODY_STATE_LINEAR_VELOCITY: { - //if (mode==Physics2DServer::BODY_MODE_STATIC) - // break; + /* + if (mode==Physics2DServer::BODY_MODE_STATIC) + break; + */ linear_velocity=p_variant; wakeup(); } break; case Physics2DServer::BODY_STATE_ANGULAR_VELOCITY: { - //if (mode!=Physics2DServer::BODY_MODE_RIGID) - // break; + /* + if (mode!=Physics2DServer::BODY_MODE_RIGID) + break; + */ angular_velocity=p_variant; wakeup(); @@ -385,11 +391,13 @@ void Body2DSW::set_space(Space2DSW *p_space){ _update_inertia(); if (active) get_space()->body_add_to_active_list(&active_list); -// _update_queries(); - //if (is_active()) { - // active=false; - // set_active(true); - //} + /* + _update_queries(); + if (is_active()) { + active=false; + set_active(true); + } + */ } @@ -459,13 +467,17 @@ void Body2DSW::integrate_forces(real_t p_step) { // If less than 0, override dampenings with that of the Body2D if (angular_damp>=0) area_angular_damp = angular_damp; - //else - // area_angular_damp=damp_area->get_angular_damp(); + /* + else + area_angular_damp=damp_area->get_angular_damp(); + */ if (linear_damp>=0) area_linear_damp = linear_damp; - //else - // area_linear_damp=damp_area->get_linear_damp(); + /* + else + area_linear_damp=damp_area->get_linear_damp(); + */ Vector2 motion; bool do_motion=false; @@ -482,10 +494,12 @@ void Body2DSW::integrate_forces(real_t p_step) { do_motion=true; - //for(int i=0;i<get_shape_count();i++) { - // set_shape_kinematic_advance(i,Vector2()); - // set_shape_kinematic_retreat(i,0); - //} + /* + for(int i=0;i<get_shape_count();i++) { + set_shape_kinematic_advance(i,Vector2()); + set_shape_kinematic_retreat(i,0); + } + */ } else { if (!omit_force_integration && !first_integration) { diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index efa12c37cb..d2b37319ad 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -599,8 +599,10 @@ int BroadPhase2DHashGrid::cull_segment(const Vector2& p_from, const Vector2& p_t E->key()->pass=pass; -// if (use_aabb && !p_aabb.intersects(E->key()->aabb)) -// continue; + /* + if (use_aabb && !p_aabb.intersects(E->key()->aabb)) + continue; + */ if (!E->key()->aabb.intersects_segment(p_from,p_to)) continue; @@ -645,8 +647,10 @@ int BroadPhase2DHashGrid::cull_aabb(const Rect2& p_aabb,CollisionObject2DSW** p_ if (!p_aabb.intersects(E->key()->aabb)) continue; -// if (!E->key()->aabb.intersects_segment(p_from,p_to)) -// continue; + /* + if (!E->key()->aabb.intersects_segment(p_from,p_to)) + continue; + */ p_results[cullcount]=E->key()->owner; p_result_indices[cullcount]=E->key()->subindex; diff --git a/servers/physics_2d/collision_solver_2d_sat.cpp b/servers/physics_2d/collision_solver_2d_sat.cpp index 2e7b0d8835..a09574a94c 100644 --- a/servers/physics_2d/collision_solver_2d_sat.cpp +++ b/servers/physics_2d/collision_solver_2d_sat.cpp @@ -40,8 +40,10 @@ struct _CollectorCallback2D { _FORCE_INLINE_ void call(const Vector2& p_point_A, const Vector2& p_point_B) { - //if (normal.dot(p_point_A) >= normal.dot(p_point_B)) - // return; + /* + if (normal.dot(p_point_A) >= normal.dot(p_point_B)) + return; + */ if (swap) callback(p_point_B,p_point_A,userdata); else @@ -462,7 +464,7 @@ public: } } - // print_line("test axis: "+p_axis+" depth: "+rtos(best_depth)); + //print_line("test axis: "+p_axis+" depth: "+rtos(best_depth)); #ifdef DEBUG_ENABLED best_axis_count++; #endif @@ -610,8 +612,10 @@ static void _collision_segment_segment(const Shape2DSW* p_a,const Transform2D& p //this collision is kind of pointless - //if (!separator.test_previous_axis()) - // return; + /* + if (!separator.test_previous_axis()) + return; + */ if (!separator.test_cast()) return; @@ -850,7 +854,7 @@ static void _collision_circle_rectangle(const Shape2DSW* p_a,const Transform2D& const Vector2 &sphere=p_transform_a.elements[2]; const Vector2 *axis=&p_transform_b.elements[0]; -// const Vector2& half_extents = rectangle_B->get_half_extents(); + //const Vector2& half_extents = rectangle_B->get_half_extents(); if (!separator.test_axis(axis[0].normalized())) return; diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp index e509bb76cd..02d59b69f0 100644 --- a/servers/physics_2d/collision_solver_2d_sw.cpp +++ b/servers/physics_2d/collision_solver_2d_sw.cpp @@ -226,7 +226,7 @@ bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A,const Transfo concave_B->cull(local_aabb,concave_callback,&cinfo); -// print_line("Rect2 TESTS: "+itos(cinfo.aabb_tests)); + //print_line("Rect2 TESTS: "+itos(cinfo.aabb_tests)); return cinfo.collided; } @@ -255,9 +255,11 @@ bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A,const Transform2D& p_ if (type_B==Physics2DServer::SHAPE_LINE || type_B==Physics2DServer::SHAPE_RAY) { return false; - //if (type_B==Physics2DServer::SHAPE_RAY) { - // return false; } + /* + if (type_B==Physics2DServer::SHAPE_RAY) { + return false; + */ if (swap) { return solve_static_line(p_shape_B,p_transform_B,p_shape_A,p_transform_A,p_result_callback,p_userdata,true); diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp index 7205e90d27..f0703a0894 100644 --- a/servers/physics_2d/joints_2d_sw.cpp +++ b/servers/physics_2d/joints_2d_sw.cpp @@ -407,8 +407,8 @@ bool GrooveJoint2DSW::setup(float p_step) { jn_max = get_max_force() * p_step; // calculate bias velocity -// cpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1)); -// joint->bias = cpvclamp(cpvmult(delta, -joint->constraint.biasCoef*dt_inv), joint->constraint.maxBias); + //cpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1)); + //joint->bias = cpvclamp(cpvmult(delta, -joint->constraint.biasCoef*dt_inv), joint->constraint.maxBias); Vector2 delta = (B->get_transform().get_origin() +rB) - (A->get_transform().get_origin() + rA); diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp index 3cc69f470e..d134ce7ea8 100644 --- a/servers/physics_2d/physics_2d_server_sw.cpp +++ b/servers/physics_2d/physics_2d_server_sw.cpp @@ -1176,11 +1176,13 @@ void Physics2DServerSW::free(RID p_rid) { Body2DSW *body = body_owner.get(p_rid); -// if (body->get_state_query()) -// _clear_query(body->get_state_query()); + /* + if (body->get_state_query()) + _clear_query(body->get_state_query()); -// if (body->get_direct_state_query()) -// _clear_query(body->get_direct_state_query()); + if (body->get_direct_state_query()) + _clear_query(body->get_direct_state_query()); + */ body->set_space(NULL); @@ -1203,8 +1205,10 @@ void Physics2DServerSW::free(RID p_rid) { Area2DSW *area = area_owner.get(p_rid); -// if (area->get_monitor_query()) -// _clear_query(area->get_monitor_query()); + /* + if (area->get_monitor_query()) + _clear_query(area->get_monitor_query()); + */ area->set_space(NULL); @@ -1380,7 +1384,7 @@ Physics2DServerSW::Physics2DServerSW() { singletonsw=this; BroadPhase2DSW::create_func=BroadPhase2DHashGrid::_create; -// BroadPhase2DSW::create_func=BroadPhase2DBasic::_create; + //BroadPhase2DSW::create_func=BroadPhase2DBasic::_create; active=true; island_count=0; diff --git a/servers/physics_2d/physics_2d_server_sw.h b/servers/physics_2d/physics_2d_server_sw.h index ba45dd9272..1da7d65dc8 100644 --- a/servers/physics_2d/physics_2d_server_sw.h +++ b/servers/physics_2d/physics_2d_server_sw.h @@ -70,7 +70,7 @@ friend class Physics2DDirectBodyStateSW; static Physics2DServerSW *singletonsw; -// void _clear_query(Query2DSW *p_query); + //void _clear_query(Query2DSW *p_query); public: struct CollCbkData { diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 8b19122f17..886ae7730b 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -639,8 +639,10 @@ bool ConvexPolygonShape2DSW::intersect_segment(const Vector2& p_begin,const Vect for(int i=0;i<point_count;i++) { //hmm crap.. no can do.. - //if (d.dot(points[i].normal)>=0) - // continue; + /* + if (d.dot(points[i].normal)>=0) + continue; + */ Vector2 res; @@ -816,8 +818,10 @@ bool ConcavePolygonShape2DSW::intersect_segment(const Vector2& p_begin,const Vec real_t d=1e10; bool inters=false; - //for(int i=0;i<bvh_depth;i++) - // stack[i]=0; + /* + for(int i=0;i<bvh_depth;i++) + stack[i]=0; + */ int level=0; @@ -1077,8 +1081,10 @@ void ConcavePolygonShape2DSW::cull(const Rect2& p_local_aabb,Callback p_callback }; - //for(int i=0;i<bvh_depth;i++) - // stack[i]=0; + /* + for(int i=0;i<bvh_depth;i++) + stack[i]=0; + */ int level=0; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 2c7b099b36..e95707f135 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -248,8 +248,10 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transfor aabb=aabb.merge(Rect2(aabb.pos+p_motion,aabb.size)); //motion aabb=aabb.grow(p_margin); - //if (p_motion!=Vector2()) - // print_line(p_motion); + /* + if (p_motion!=Vector2()) + print_line(p_motion); + */ int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,Space2DSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); @@ -661,8 +663,10 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co const Body2DSW *body=static_cast<const Body2DSW*>(col_obj); Vector2 cdir = body->get_one_way_collision_direction(); - //if (cdir!=Vector2() && p_motion.dot(cdir)<0) - // continue; + /* + if (cdir!=Vector2() && p_motion.dot(cdir)<0) + continue; + */ cbk.valid_dir=cdir; cbk.valid_depth=body->get_one_way_collision_max_depth(); @@ -698,11 +702,10 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co float traveled = n.dot(recover_motion); a+=n*traveled; + float d = a.distance_to(b); + if (d<margin) + continue; #endif - // float d = a.distance_to(b); - - //if (d<margin) - /// continue; recover_motion+=(b-a)*0.4; } @@ -972,7 +975,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co if (collide_character) mask|=Physics2DDirectSpaceState::TYPE_MASK_CHARACTER_BODY; -// print_line("motion: "+p_motion+" margin: "+rtos(margin)); + //print_line("motion: "+p_motion+" margin: "+rtos(margin)); //print_line("margin: "+rtos(margin)); do { @@ -999,8 +1002,10 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co float d = a.distance_to(b); - //if (d<margin) - /// continue; + /* + if (d<margin) + continue; + */ recover_motion+=(b-a)*0.4; } diff --git a/servers/physics_2d/step_2d_sw.cpp b/servers/physics_2d/step_2d_sw.cpp index 05c0bf0516..8be4e2b5d5 100644 --- a/servers/physics_2d/step_2d_sw.cpp +++ b/servers/physics_2d/step_2d_sw.cpp @@ -216,7 +216,7 @@ void Step2DSW::step(Space2DSW* p_space,float p_delta,int p_iterations) { p_space->area_remove_from_moved_list((SelfList<Area2DSW>*)aml.first()); //faster to remove here } -// print_line("island count: "+itos(island_count)+" active count: "+itos(active_count)); + //print_line("island count: "+itos(island_count)+" active count: "+itos(active_count)); { //profile profile_endtime=OS::get_singleton()->get_ticks_usec(); diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp index c175c04ee9..bd5a58e57b 100644 --- a/servers/physics_2d_server.cpp +++ b/servers/physics_2d_server.cpp @@ -602,7 +602,7 @@ void Physics2DServer::_bind_methods() { ClassDB::bind_method(_MD("body_add_collision_exception","body","excepted_body"),&Physics2DServer::body_add_collision_exception); ClassDB::bind_method(_MD("body_remove_collision_exception","body","excepted_body"),&Physics2DServer::body_remove_collision_exception); -// virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions)=0; + //virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions)=0; ClassDB::bind_method(_MD("body_set_max_contacts_reported","body","amount"),&Physics2DServer::body_set_max_contacts_reported); ClassDB::bind_method(_MD("body_get_max_contacts_reported","body"),&Physics2DServer::body_get_max_contacts_reported); @@ -641,9 +641,9 @@ void Physics2DServer::_bind_methods() { ClassDB::bind_method(_MD("get_process_info","process_info"),&Physics2DServer::get_process_info); -// ClassDB::bind_method(_MD("init"),&Physics2DServer::init); -// ClassDB::bind_method(_MD("step"),&Physics2DServer::step); -// ClassDB::bind_method(_MD("sync"),&Physics2DServer::sync); + //ClassDB::bind_method(_MD("init"),&Physics2DServer::init); + //ClassDB::bind_method(_MD("step"),&Physics2DServer::step); + //ClassDB::bind_method(_MD("sync"),&Physics2DServer::sync); //ClassDB::bind_method(_MD("flush_queries"),&Physics2DServer::flush_queries); BIND_CONSTANT( SPACE_PARAM_CONTACT_RECYCLE_RADIUS ); @@ -710,8 +710,8 @@ void Physics2DServer::_bind_methods() { BIND_CONSTANT( CCD_MODE_CAST_RAY ); BIND_CONSTANT( CCD_MODE_CAST_SHAPE ); -// BIND_CONSTANT( TYPE_BODY ); -// BIND_CONSTANT( TYPE_AREA ); + //BIND_CONSTANT( TYPE_BODY ); + //BIND_CONSTANT( TYPE_AREA ); BIND_CONSTANT( AREA_BODY_ADDED ); BIND_CONSTANT( AREA_BODY_REMOVED ); diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp index 8f57fcfbdb..93553efb27 100644 --- a/servers/physics_server.cpp +++ b/servers/physics_server.cpp @@ -363,8 +363,8 @@ PhysicsDirectSpaceState::PhysicsDirectSpaceState() { void PhysicsDirectSpaceState::_bind_methods() { -// ClassDB::bind_method(_MD("intersect_ray","from","to","exclude","umask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0)); -// ClassDB::bind_method(_MD("intersect_shape:PhysicsShapeQueryResult","shape","xform","result_max","exclude","umask"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); + //ClassDB::bind_method(_MD("intersect_ray","from","to","exclude","umask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0)); + //ClassDB::bind_method(_MD("intersect_shape:PhysicsShapeQueryResult","shape","xform","result_max","exclude","umask"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); ClassDB::bind_method(_MD("intersect_ray:Dictionary","from","to","exclude","layer_mask","type_mask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); ClassDB::bind_method(_MD("intersect_shape","shape:PhysicsShapeQueryParameters","max_results"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(32)); @@ -529,7 +529,7 @@ void PhysicsServer::_bind_methods() { ClassDB::bind_method(_MD("body_add_collision_exception","body","excepted_body"),&PhysicsServer::body_add_collision_exception); ClassDB::bind_method(_MD("body_remove_collision_exception","body","excepted_body"),&PhysicsServer::body_remove_collision_exception); -// virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions)=0; + //virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions)=0; ClassDB::bind_method(_MD("body_set_max_contacts_reported","body","amount"),&PhysicsServer::body_set_max_contacts_reported); ClassDB::bind_method(_MD("body_get_max_contacts_reported","body"),&PhysicsServer::body_get_max_contacts_reported); @@ -678,9 +678,9 @@ void PhysicsServer::_bind_methods() { ClassDB::bind_method(_MD("set_active","active"),&PhysicsServer::set_active); -// ClassDB::bind_method(_MD("init"),&PhysicsServer::init); -// ClassDB::bind_method(_MD("step"),&PhysicsServer::step); -// ClassDB::bind_method(_MD("sync"),&PhysicsServer::sync); + //ClassDB::bind_method(_MD("init"),&PhysicsServer::init); + //ClassDB::bind_method(_MD("step"),&PhysicsServer::step); + //ClassDB::bind_method(_MD("sync"),&PhysicsServer::sync); //ClassDB::bind_method(_MD("flush_queries"),&PhysicsServer::flush_queries); @@ -739,8 +739,8 @@ void PhysicsServer::_bind_methods() { BIND_CONSTANT( DAMPED_STRING_STIFFNESS ); BIND_CONSTANT( DAMPED_STRING_DAMPING ); */ -// BIND_CONSTANT( TYPE_BODY ); -// BIND_CONSTANT( TYPE_AREA ); + //BIND_CONSTANT( TYPE_BODY ); + //BIND_CONSTANT( TYPE_AREA ); BIND_CONSTANT( AREA_BODY_ADDED ); BIND_CONSTANT( AREA_BODY_REMOVED ); diff --git a/servers/physics_server.h b/servers/physics_server.h index d57ca93d92..653959be45 100644 --- a/servers/physics_server.h +++ b/servers/physics_server.h @@ -135,8 +135,8 @@ class PhysicsDirectSpaceState : public Object { GDCLASS( PhysicsDirectSpaceState, Object ); -// Variant _intersect_ray(const Vector3& p_from, const Vector3& p_to,const Vector<RID>& p_exclude=Vector<RID>(),uint32_t p_collision_mask=0); -// Variant _intersect_shape(const RID& p_shape, const Transform& p_xform,int p_result_max=64,const Vector<RID>& p_exclude=Vector<RID>(),uint32_t p_collision_mask=0); + //Variant _intersect_ray(const Vector3& p_from, const Vector3& p_to,const Vector<RID>& p_exclude=Vector<RID>(),uint32_t p_collision_mask=0); + //Variant _intersect_shape(const RID& p_shape, const Transform& p_xform,int p_result_max=64,const Vector<RID>& p_exclude=Vector<RID>(),uint32_t p_collision_mask=0); public: enum ObjectTypeMask { diff --git a/servers/spatial_sound/spatial_sound_server_sw.cpp b/servers/spatial_sound/spatial_sound_server_sw.cpp index ccde73561f..d550134d82 100644 --- a/servers/spatial_sound/spatial_sound_server_sw.cpp +++ b/servers/spatial_sound/spatial_sound_server_sw.cpp @@ -66,7 +66,7 @@ void SpatialSoundServerSW::_update_sources() { SpatialSoundServerSW::Room::Room() { -// params[ROOM_PARAM_SPEED_OF_SOUND]=343.0; + //params[ROOM_PARAM_SPEED_OF_SOUND]=343.0; params[ROOM_PARAM_SPEED_OF_SOUND_SCALE]=1; params[ROOM_PARAM_DOPPLER_FACTOR]=1.0; params[ROOM_PARAM_PITCH_SCALE]=1.0; diff --git a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp index 33e51eb262..2bcc9644f1 100644 --- a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp +++ b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp @@ -67,7 +67,7 @@ void SpatialSound2DServerSW::_update_sources() { SpatialSound2DServerSW::Room::Room() { -// params[ROOM_PARAM_SPEED_OF_SOUND]=343.0; + //params[ROOM_PARAM_SPEED_OF_SOUND]=343.0; params[ROOM_PARAM_PITCH_SCALE]=1.0; params[ROOM_PARAM_VOLUME_SCALE_DB]=0; params[ROOM_PARAM_REVERB_SEND]=0; @@ -79,7 +79,7 @@ SpatialSound2DServerSW::Room::Room() { params[ROOM_PARAM_ATTENUATION_REVERB_SCALE]=0.0; override_other_sources=false; reverb=ROOM_REVERB_HALL; -// octree_id=0; + //octree_id=0; level=-1; @@ -149,7 +149,7 @@ void SpatialSound2DServerSW::room_set_space(RID p_room,RID p_space) { Space *space = space_owner.get(room->space); space->rooms.erase(p_room); -// space->octree.erase(room->octree_id); + //space->octree.erase(room->octree_id); //room->octree_id=0; } @@ -160,10 +160,10 @@ void SpatialSound2DServerSW::room_set_space(RID p_room,RID p_space) { Space *space = space_owner.get(p_space); ERR_FAIL_COND(!space); space->rooms.insert(p_room); -// room->octree_id=space->octree.create(room,AABB()); + //room->octree_id=space->octree.create(room,AABB()); //set bounds -// AABB aabb = room->bounds.is_empty()?AABB():room->bounds.get_aabb(); - // space->octree.move(room->octree_id,room->transform.xform(aabb)); + //AABB aabb = room->bounds.is_empty()?AABB():room->bounds.get_aabb(); + //space->octree.move(room->octree_id,room->transform.xform(aabb)); room->space=p_space; } @@ -191,11 +191,11 @@ void SpatialSound2DServerSW::room_set_bounds(RID p_room, const PoolVector<Point2 if (!room->space.is_valid()) return; -// AABB aabb = room->bounds.is_empty()?AABB():room->bounds.get_aabb(); -// Space* space = space_owner.get(room->space); -// ERR_FAIL_COND(!space); + //AABB aabb = room->bounds.is_empty()?AABB():room->bounds.get_aabb(); + //Space* space = space_owner.get(room->space); + //ERR_FAIL_COND(!space); -// space->octree.move(room->octree_id,room->transform.xform(aabb)); + //space->octree.move(room->octree_id,room->transform.xform(aabb)); } PoolVector<Point2> SpatialSound2DServerSW::room_get_bounds(RID p_room) const { @@ -603,7 +603,7 @@ void SpatialSound2DServerSW::free(RID p_id) { if (room->space.is_valid()) { Space *space = space_owner.get(room->space); ERR_FAIL_COND(!space); -// space->octree.erase(room->octree_id); + //space->octree.erase(room->octree_id); space->rooms.erase(p_id); } room_owner.free(p_id); diff --git a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h index 16d2c93e7d..7999a8c22b 100644 --- a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h +++ b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h @@ -179,7 +179,7 @@ class SpatialSound2DServerSW : public SpatialSound2DServer { ActiveVoice(Source *p_source=NULL,int p_voice=0) { source=p_source; voice=p_voice; } }; -// Room *cull_rooms[MAX_CULL_ROOMS]; + //Room *cull_rooms[MAX_CULL_ROOMS]; Set<Source*> streaming_sources; Set<ActiveVoice> active_voices; diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp index 1adf2ee021..ba85f92e37 100644 --- a/servers/visual/rasterizer.cpp +++ b/servers/visual/rasterizer.cpp @@ -256,7 +256,7 @@ RID Rasterizer::_create_shader(const FixedSpatialMaterialShaderKey& p_key) { vcode+="uniform float "+_fixed_material_point_size_name+";\n"; vcode+="POINT_SIZE="+_fixed_material_point_size_name+";\n"; -// vcode+="POINT_SIZE=10.0;\n"; + //vcode+="POINT_SIZE=10.0;\n"; } String lcode; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index ea634e8f06..6a6f437816 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2920,7 +2920,7 @@ ShaderLanguage::Node* ShaderLanguage::_reduce_expression(BlockNode *p_block, Sha ERR_FAIL_COND_V(op->arguments[0]->type!=Node::TYPE_VARIABLE,p_node); VariableNode *vn = static_cast<VariableNode*>(op->arguments[0]); - // StringName name=vn->name; + //StringName name=vn->name; DataType base=get_scalar_type(op->get_datatype()); diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h index b5f843c114..4f8717088e 100644 --- a/servers/visual/shader_language.h +++ b/servers/visual/shader_language.h @@ -579,7 +579,7 @@ private: public: -// static void get_keyword_list(ShaderType p_type,List<String> *p_keywords); + //static void get_keyword_list(ShaderType p_type,List<String> *p_keywords); void clear(); Error compile(const String& p_code,const Map< StringName, Map<StringName,DataType> > &p_functions,const Set<String>& p_render_modes); diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index d68c580442..2f7bcccf73 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -1188,9 +1188,11 @@ bool VisualServerCanvas::free(RID p_rid) { canvas_item->child_items[i]->parent=RID(); } -// if (canvas_item->material) { -// canvas_item->material->owners.erase(canvas_item); -// } + /* + if (canvas_item->material) { + canvas_item->material->owners.erase(canvas_item); + } + */ canvas_item_owner.free( p_rid ); diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 3262479c43..e3bc0fb6c6 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -85,8 +85,10 @@ void VisualServerRaster::free( RID p_rid ){ void VisualServerRaster::draw(){ - //if (changes) - // print_line("changes: "+itos(changes)); + /* + if (changes) + print_line("changes: "+itos(changes)); + */ changes=0; @@ -181,7 +183,7 @@ BalloonAllocator<> *VisualServerRaster::OctreeAllocator::allocator=NULL; #define VS_CHANGED\ changes++;\ -// print_line(__FUNCTION__); + //print_line(__FUNCTION__); @@ -2928,7 +2930,7 @@ void VisualServerRaster::instance_geometry_set_flag(RID p_instance,InstanceFlags Instance *instance = instance_owner.get( p_instance ); ERR_FAIL_COND( !instance ); -// ERR_FAIL_COND( ! ( (1<<instance->base_type) & INSTANCE_GEOMETRY_MASK) ); + //ERR_FAIL_COND( ! ( (1<<instance->base_type) & INSTANCE_GEOMETRY_MASK) ); switch(p_flags) { @@ -2980,7 +2982,7 @@ bool VisualServerRaster::instance_geometry_get_flag(RID p_instance,InstanceFlags const Instance *instance = instance_owner.get( p_instance ); ERR_FAIL_COND_V( !instance, false ); -// ERR_FAIL_COND_V( ! ( (1<<instance->base_type) & INSTANCE_GEOMETRY_MASK), false ); + //ERR_FAIL_COND_V( ! ( (1<<instance->base_type) & INSTANCE_GEOMETRY_MASK), false ); switch(p_flags) { @@ -3335,8 +3337,10 @@ void VisualServerRaster::_update_instance(Instance *p_instance) { } else { - // if (new_aabb==p_instance->data.transformed_aabb) - // return; + /* + if (new_aabb==p_instance->data.transformed_aabb) + return; + */ p_instance->scenario->octree.move(p_instance->octree_id,new_aabb); } @@ -4656,7 +4660,7 @@ void VisualServerRaster::_free_attached_instances(RID p_rid,bool p_free_scenario void VisualServerRaster::custom_shade_model_set_shader(int p_model, RID p_shader) { VS_CHANGED; -// rasterizer->custom_shade_model_set_shader(p_model,p_shader); + //rasterizer->custom_shade_model_set_shader(p_model,p_shader); } RID VisualServerRaster::custom_shade_model_get_shader(int p_model) const { @@ -4746,8 +4750,10 @@ void VisualServerRaster::free( RID p_rid ) { BakedLightSampler *baked_light_sampler = baked_light_sampler_owner.get(p_rid); ERR_FAIL_COND(!baked_light_sampler); - //if (baked_light->data.octree_texture.is_valid()) - // rasterizer->free(baked_light->data.octree_texture); + /* + if (baked_light->data.octree_texture.is_valid()) + rasterizer->free(baked_light->data.octree_texture); + */ baked_light_sampler_owner.free(p_rid); memdelete(baked_light_sampler); @@ -4766,7 +4772,7 @@ void VisualServerRaster::free( RID p_rid ) { Viewport *viewport = viewport_owner.get( p_rid ); ERR_FAIL_COND(!viewport); -// Viewport *parent=NULL; + //Viewport *parent=NULL; rasterizer->free(viewport->viewport_data); if (viewport->render_target.is_valid()) { @@ -5105,7 +5111,7 @@ void VisualServerRaster::_light_instance_update_pssm_shadow(Instance *p_light,Sc float distances[5]; float texsize=rasterizer->light_instance_get_shadow_size( p_light->light_info->instance ); -// float cull_min=p_cull_range.min; + //float cull_min=p_cull_range.min; //float cull_max=p_cull_range.max; @@ -6657,7 +6663,7 @@ void VisualServerRaster::_render_camera(Viewport *p_viewport,Camera *p_camera, S /* print_line("OT: "+rtos( (OS::get_singleton()->get_ticks_usec()-t)/1000.0)); print_line("OTO: "+itos(p_scenario->octree.get_octant_count())); -// print_line("OTE: "+itos(p_scenario->octree.get_elem_count())); + //print_line("OTE: "+itos(p_scenario->octree.get_elem_count())); print_line("OTP: "+itos(p_scenario->octree.get_pair_count())); */ @@ -6761,7 +6767,7 @@ void VisualServerRaster::_render_camera(Viewport *p_viewport,Camera *p_camera, S if (light_cull_count<MAX_LIGHTS_CULLED) { light_cull_result[light_cull_count++]=ins; -// rasterizer->light_instance_set_active_hint(ins->light_info->instance); + //rasterizer->light_instance_set_active_hint(ins->light_info->instance); { //compute distance to camera using aabb support Vector3 n = ins->data.transform.basis.xform_inv(cull_range.nearp.normal).normalized(); @@ -7284,7 +7290,7 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ ViewportRect desired_rect=p_viewport->rect; ViewportRect old_rect = viewport_rect; -// bool vpchanged=false; + //bool vpchanged=false; // convert default expanding viewports to actual size //if (desired_rect.x==0 && desired_rect.y==0 && desired_rect.width==0 && desired_rect.height==0) { if (p_parent_w != 0 && p_parent_h != 0) { @@ -7476,7 +7482,7 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ for (Map<Viewport::CanvasKey,Viewport::CanvasData*>::Element *E=canvas_map.front();E;E=E->next()) { - // print_line("canvas "+itos(i)+" size: "+itos(I->get()->canvas->child_items.size())); + //print_line("canvas "+itos(i)+" size: "+itos(I->get()->canvas->child_items.size())); //print_line("GT "+p_viewport->global_transform+". CT: "+E->get()->transform); Matrix32 xform = p_viewport->global_transform * E->get()->transform; @@ -7508,7 +7514,7 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ } -// rasterizer->canvas_debug_viewport_shadows(lights_with_shadow); + //rasterizer->canvas_debug_viewport_shadows(lights_with_shadow); } //capture @@ -7721,8 +7727,10 @@ void VisualServerRaster::sync() { } void VisualServerRaster::draw() { - //if (changes) - // print_line("changes: "+itos(changes)); + /* + if (changes) + print_line("changes: "+itos(changes)); + */ changes=0; shadows_enabled=GLOBAL_DEF("render/shadows_enabled",true); room_cull_enabled = GLOBAL_DEF("render/room_cull_enabled",true); diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 030796a22d..157a85be98 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -78,7 +78,7 @@ void VisualServerScene::camera_set_use_vertical_aspect(RID p_camera,bool p_enabl void* VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance *p_A,int, OctreeElementID, Instance *p_B,int) { -// VisualServerScene *self = (VisualServerScene*)p_self; + //VisualServerScene *self = (VisualServerScene*)p_self; Instance *A = p_A; Instance *B = p_B; @@ -204,7 +204,7 @@ void* VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance } void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance *p_A,int, OctreeElementID, Instance *p_B,int,void* udata) { -// VisualServerScene *self = (VisualServerScene*)p_self; + //VisualServerScene *self = (VisualServerScene*)p_self; Instance *A = p_A; Instance *B = p_B; @@ -1239,8 +1239,10 @@ void VisualServerScene::_update_instance(Instance *p_instance) { } else { - // if (new_aabb==p_instance->data.transformed_aabb) - // return; + /* + if (new_aabb==p_instance->data.transformed_aabb) + return; + */ p_instance->scenario->octree.move(p_instance->octree_id,new_aabb); } @@ -1773,7 +1775,7 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform,const Came VSG::scene_render->set_scene_pass(render_pass); -// rasterizer->set_camera(camera->transform, camera_matrix,ortho); + //rasterizer->set_camera(camera->transform, camera_matrix,ortho); Vector<Plane> planes = p_cam_projection.get_projection_planes(p_cam_transform); @@ -1786,11 +1788,11 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform,const Came reflection_probe_cull_count=0; -// light_samplers_culled=0; + //light_samplers_culled=0; /* print_line("OT: "+rtos( (OS::get_singleton()->get_ticks_usec()-t)/1000.0)); print_line("OTO: "+itos(p_scenario->octree.get_octant_count())); -// print_line("OTE: "+itos(p_scenario->octree.get_elem_count())); + //print_line("OTE: "+itos(p_scenario->octree.get_elem_count())); print_line("OTP: "+itos(p_scenario->octree.get_pair_count())); */ @@ -3375,7 +3377,7 @@ void VisualServerScene::render_probes() { probe->dynamic.updating_stage=GI_UPDATE_STAGE_CHECK; -// print_line("UPLOAD TIME: "+rtos((OS::get_singleton()->get_ticks_usec()-us)/1000000.0)); + //print_line("UPLOAD TIME: "+rtos((OS::get_singleton()->get_ticks_usec()-us)/1000000.0)); } break; } diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index 780335a7f4..d2ee32f9cc 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -176,7 +176,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport) { light=light->shadows_next_ptr; } - // VSG::canvas_render->reset_canvas(); + //VSG::canvas_render->reset_canvas(); } VSG::rasterizer->restore_render_target(); @@ -196,7 +196,7 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport) { VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas*>(E->get()->canvas); - // print_line("canvas "+itos(i)+" size: "+itos(I->get()->canvas->child_items.size())); + //print_line("canvas "+itos(i)+" size: "+itos(I->get()->canvas->child_items.size())); //print_line("GT "+p_viewport->global_transform+". CT: "+E->get()->transform); Transform2D xform = p_viewport->global_transform * E->get()->transform; diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 71f9c88f2a..da73980e08 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -1675,7 +1675,7 @@ RID VisualServer::instance_create2(RID p_base, RID p_scenario) { VisualServer::VisualServer() { -// ERR_FAIL_COND(singleton); + //ERR_FAIL_COND(singleton); singleton=this; } diff --git a/servers/visual_server.h b/servers/visual_server.h index cb4d87ce8a..f75223e378 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -706,7 +706,7 @@ public: virtual RID instance_create2(RID p_base, RID p_scenario); -// virtual RID instance_create(RID p_base,RID p_scenario)=0; // from can be mesh, light, area and portal so far. + //virtual RID instance_create(RID p_base,RID p_scenario)=0; // from can be mesh, light, area and portal so far. virtual RID instance_create()=0; // from can be mesh, light, poly, area and portal so far. virtual void instance_set_base(RID p_instance, RID p_base)=0; // from can be mesh, light, poly, area and portal so far. diff --git a/tools/collada/collada.cpp b/tools/collada/collada.cpp index 9f2416223e..daf30b00d7 100644 --- a/tools/collada/collada.cpp +++ b/tools/collada/collada.cpp @@ -103,7 +103,7 @@ Transform Collada::fix_transform(const Transform& p_transform) { } #endif -// tr.scale(Vector3(state.unit_scale.unit_scale.unit_scale)); + //tr.scale(Vector3(state.unit_scale.unit_scale.unit_scale)); return tr; //return state.matrix_fix * p_transform; } @@ -444,9 +444,11 @@ Vector<String> Collada::_read_string_array(XMLParser& parser) { // parse String data String str = parser.get_node_data(); array=str.split_spaces(); - //for(int i=0;i<array.size();i++) { - // print_line(itos(i)+": "+array[i]); - //} + /* + for(int i=0;i<array.size();i++) { + print_line(itos(i)+": "+array[i]); + } + */ } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END) @@ -1367,8 +1369,11 @@ void Collada::_parse_skin_controller(XMLParser& parser,String p_id) { skindata.weights=weights; - }// else if (!parser.is_empty()) - // parser.skip_section(); + } + /* + else if (!parser.is_empty()) + parser.skip_section(); + */ } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name()=="skin") break; @@ -1396,7 +1401,7 @@ void Collada::_parse_skin_controller(XMLParser& parser,String p_id) { for(int i=0;i<joint_source.sarray.size();i++) { String name = joint_source.sarray[i]; - Transform xform = _read_transform_from_array(ibm_source.array,i*16);// <- this is a mistake, it must be applied to vertices + Transform xform = _read_transform_from_array(ibm_source.array,i*16); //<- this is a mistake, it must be applied to vertices xform.affine_invert(); // inverse for rest, because it's an inverse #ifdef COLLADA_IMPORT_SCALE_SCENE xform.origin*=state.unit_scale; @@ -1442,8 +1447,10 @@ void Collada::_parse_morph_controller(XMLParser& parser, String p_id) { } else if (section=="Name_array" || section=="IDREF_array") { // create a new array and read it. - //if (section=="IDREF_array") - // morphdata.use_idrefs=true; + /* + if (section=="IDREF_array") + morphdata.use_idrefs=true; + */ if (morphdata.sources.has(current_source)) { morphdata.sources[current_source].sarray = _read_string_array(parser); @@ -1491,8 +1498,10 @@ void Collada::_parse_morph_controller(XMLParser& parser, String p_id) { } - // else if (!parser.is_empty()) - // parser.skip_section(); + /* + else if (!parser.is_empty()) + parser.skip_section(); + */ } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name()=="morph") break; @@ -1705,7 +1714,7 @@ Collada::Node* Collada::_parse_visual_scene_node(XMLParser& parser) { if ( parser.has_attribute("sid") ) { //bones may not have sid joint->sid=parser.get_attribute_value("sid"); -// state.bone_map[joint->sid]=joint; + //state.bone_map[joint->sid]=joint; } else if (state.idref_joints.has(name)) { joint->sid=name; //kind of a cheat but.. } else if (parser.has_attribute("name")) { diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp index 6b6a864ecc..f18265c541 100644 --- a/tools/doc/doc_data.cpp +++ b/tools/doc/doc_data.cpp @@ -250,7 +250,7 @@ void DocData::generate(bool p_basic_types) { } else if (arginfo.type!=Variant::NIL) // { #endif method.return_type=(arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE)?arginfo.hint_string:Variant::get_type_name(arginfo.type); -// } + //} } else { @@ -804,7 +804,7 @@ Error DocData::_load(Ref<XMLParser> parser) { class_list[name]=ClassDoc(); ClassDoc& c = class_list[name]; -// print_line("class: "+name); + //print_line("class: "+name); c.name=name; if (parser->has_attribute("inherits")) c.inherits = parser->get_attribute_value("inherits"); diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index bdf4e83236..cb95f5fb7d 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -198,7 +198,7 @@ public: static void _bind_methods() { - // ClassDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj); + //ClassDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj); ClassDB::bind_method("_gui_input",&AnimationCurveEdit::_gui_input); ADD_SIGNAL(MethodInfo("transition_changed")); } @@ -647,8 +647,10 @@ public: } break; } - //if (animation->track_get_type(track)!=Animation::TYPE_METHOD) - // p_list->push_back( PropertyInfo( Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING)); + /* + if (animation->track_get_type(track)!=Animation::TYPE_METHOD) + p_list->push_back( PropertyInfo( Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING)); + */ } UndoRedo *undo_redo; @@ -2641,8 +2643,10 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent& p_input) { for(Map<SelectedKey,KeyInfo>::Element *E=selection.back();E;E=E->prev()) { float newpos=E->get().pos-from_t+motion; - //if (newpos<0) - // continue; //no add at the begining + /* + if (newpos<0) + continue; //no add at the begining + */ undo_redo->add_do_method(animation.ptr(),"track_insert_key",E->key().track,newpos,animation->track_get_key_value(E->key().track,E->key().key),animation->track_get_key_transition(E->key().track,E->key().key)); } @@ -2651,8 +2655,10 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent& p_input) { for(Map<SelectedKey,KeyInfo>::Element *E=selection.back();E;E=E->prev()) { float newpos=E->get().pos+-from_t+motion; - //if (newpos<0) - // continue; //no remove what no inserted + /* + if (newpos<0) + continue; //no remove what no inserted + */ undo_redo->add_undo_method(animation.ptr(),"track_remove_key_at_pos",E->key().track,newpos); } @@ -2690,7 +2696,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const InputEvent& p_input) { float oldpos=E->get().pos; float newpos=oldpos-from_t+motion; //if (newpos>=0) - undo_redo->add_do_method(this,"_select_at_anim",animation,E->key().track,newpos); + undo_redo->add_do_method(this,"_select_at_anim",animation,E->key().track,newpos); undo_redo->add_undo_method(this,"_select_at_anim",animation,E->key().track,oldpos); } @@ -3148,7 +3154,7 @@ void AnimationKeyEditor::_notification(int p_what) { } call_select->connect("selected",this,"_add_call_track"); -// rename_anim->set_icon( get_icon("Rename","EditorIcons") ); + //rename_anim->set_icon( get_icon("Rename","EditorIcons") ); /* edit_anim->set_icon( get_icon("Edit","EditorIcons") ); blend_anim->set_icon( get_icon("Blend","EditorIcons") ); @@ -3156,8 +3162,8 @@ void AnimationKeyEditor::_notification(int p_what) { stop->set_icon( get_icon("Stop","EditorIcons") ); pause->set_icon( get_icon("Pause","EditorIcons") ); */ -// menu->set_icon(get_icon("Animation","EditorIcons")); -// play->set_icon(get_icon("AnimationPlay","EditorIcons")); + //menu->set_icon(get_icon("Animation","EditorIcons")); + //play->set_icon(get_icon("AnimationPlay","EditorIcons")); //menu->set_icon(get_icon("Animation","EditorIcons")); _update_menu(); @@ -3920,7 +3926,7 @@ void AnimationKeyEditor::_bind_methods() { ClassDB::bind_method(_MD("set_root"),&AnimationKeyEditor::set_root); -// ClassDB::bind_method(_MD("_confirm_insert"),&AnimationKeyEditor::_confirm_insert); + //ClassDB::bind_method(_MD("_confirm_insert"),&AnimationKeyEditor::_confirm_insert); ClassDB::bind_method(_MD("_confirm_insert_list"),&AnimationKeyEditor::_confirm_insert_list); @@ -4143,9 +4149,9 @@ AnimationKeyEditor::AnimationKeyEditor() { /* l = memnew( Label ); l->set_text("Base: "); l->set_pos(Point2(0,3)); -// dr_panel->add_child(l);*/ + //dr_panel->add_child(l);*/ -// menu->get_popup()->connect("id_pressed",this,"_menu_callback"); + //menu->get_popup()->connect("id_pressed",this,"_menu_callback"); hb = memnew( HBoxContainer); diff --git a/tools/editor/animation_editor.h b/tools/editor/animation_editor.h index 8ae706dfa8..c4539cd763 100644 --- a/tools/editor/animation_editor.h +++ b/tools/editor/animation_editor.h @@ -33,7 +33,7 @@ #include "scene/gui/slider.h" #include "scene/gui/menu_button.h" #include "scene/gui/spin_box.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/scroll_bar.h" #include "scene/gui/tool_button.h" #include "scene/gui/file_dialog.h" diff --git a/tools/editor/asset_library_editor_plugin.cpp b/tools/editor/asset_library_editor_plugin.cpp index 12489ada0d..ad17364685 100644 --- a/tools/editor/asset_library_editor_plugin.cpp +++ b/tools/editor/asset_library_editor_plugin.cpp @@ -1462,7 +1462,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { library_vb->set_h_size_flags(SIZE_EXPAND_FILL); library_vb_border->add_child(library_vb); -// margin_panel->set_stop_mouse(false); + //margin_panel->set_stop_mouse(false); asset_top_page = memnew( HBoxContainer ); library_vb->add_child(asset_top_page); diff --git a/tools/editor/call_dialog.cpp b/tools/editor/call_dialog.cpp index 054a5098f0..f8966093f6 100644 --- a/tools/editor/call_dialog.cpp +++ b/tools/editor/call_dialog.cpp @@ -283,7 +283,7 @@ CallDialog::CallDialog() { property_editor->set_anchor_and_margin( MARGIN_RIGHT, ANCHOR_END, 15 ); property_editor->set_anchor_and_margin( MARGIN_TOP, ANCHOR_BEGIN, 50 ); -// property_editor->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 ); + //property_editor->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 ); property_editor->set_anchor_and_margin( MARGIN_BOTTOM, ANCHOR_END, 90 ); property_editor->get_scene_tree()->set_hide_root( true ); property_editor->hide_top_label(); diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 343070375d..00767fd297 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -714,7 +714,7 @@ void FindReplaceDialog::_replace() { } text_edit->set_v_scroll(vsval); -// text_edit->set_h_scroll(hsval); + //text_edit->set_h_scroll(hsval); error_label->set_text(vformat(TTR("Replaced %d ocurrence(s)."),rc)); @@ -951,7 +951,7 @@ FindReplaceDialog::FindReplaceDialog() { VBoxContainer *rvb = memnew( VBoxContainer); opt_mg->add_child(rvb); replace_vb=rvb; -// rvb ->add_child(memnew(HSeparator)); + //rvb ->add_child(memnew(HSeparator)); rvb ->add_child(memnew(Label)); prompt = memnew( CheckButton ); diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp index 6e53c32080..92dd206030 100644 --- a/tools/editor/connections_dialog.cpp +++ b/tools/editor/connections_dialog.cpp @@ -421,7 +421,7 @@ ConnectDialog::ConnectDialog() { -// dst_method_list->get_popup()->connect("id_pressed", this,"_dst_method_list_selected"); + //dst_method_list->get_popup()->connect("id_pressed", this,"_dst_method_list_selected"); tree->connect("node_selected", this,"_tree_node_selected"); set_as_toplevel(true); @@ -432,7 +432,7 @@ ConnectDialog::ConnectDialog() { add_child(error); error->get_ok()->set_text(TTR("Close")); get_ok()->set_text(TTR("Connect")); -// error->get_cancel()->set_text("Close"); + //error->get_cancel()->set_text("Close"); @@ -857,7 +857,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) { hb->add_spacer(); hb->add_child(connect_button); connect_button->connect("pressed",this,"_connect_pressed"); -// add_child(tree); + //add_child(tree); connect_dialog = memnew( ConnectDialog ); connect_dialog->set_as_toplevel(true); diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h index 6f35cf3db0..64b292bc34 100644 --- a/tools/editor/connections_dialog.h +++ b/tools/editor/connections_dialog.h @@ -86,8 +86,8 @@ public: void set_dst_method(const StringName& p_method); void set_dst_node(Node* p_node); -// Button *get_ok() { return ok; } -// Button *get_cancel() { return cancel; } + //Button *get_ok() { return ok; } + //Button *get_cancel() { return cancel; } void edit(Node *p_node); ConnectDialog(); diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index 5a76439a5a..b69234e704 100644 --- a/tools/editor/create_dialog.cpp +++ b/tools/editor/create_dialog.cpp @@ -694,7 +694,7 @@ CreateDialog::CreateDialog() { set_hide_on_ok(false); search_options->connect("item_activated",this,"_confirmed"); search_options->connect("cell_selected",this,"_item_selected"); -// search_options->set_hide_root(true); + //search_options->set_hide_root(true); base_type="Object"; help_bit = memnew( EditorHelpBit ); diff --git a/tools/editor/editor_asset_installer.cpp b/tools/editor/editor_asset_installer.cpp index 54099ddce5..9992100ff8 100644 --- a/tools/editor/editor_asset_installer.cpp +++ b/tools/editor/editor_asset_installer.cpp @@ -196,7 +196,7 @@ void EditorAssetInstaller::open(const String& p_path,int p_depth) { ti->set_icon(0,get_icon("folder","FileDialog")); } else { String file = path.get_file(); - String extension = file.extension().to_lower(); + String extension = file.get_extension().to_lower(); if (extension_guess.has(extension)) { ti->set_icon(0,extension_guess[extension]); } else { diff --git a/tools/editor/editor_autoload_settings.cpp b/tools/editor/editor_autoload_settings.cpp index 071a237ea8..087bf1a3b7 100644 --- a/tools/editor/editor_autoload_settings.cpp +++ b/tools/editor/editor_autoload_settings.cpp @@ -307,7 +307,7 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu void EditorAutoloadSettings::_autoload_file_callback(const String& p_path) { - autoload_add_name->set_text(p_path.get_file().basename()); + autoload_add_name->set_text(p_path.get_file().get_basename()); } void EditorAutoloadSettings::update_autoload() { diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index 710d955326..08b03ae65f 100644 --- a/tools/editor/editor_data.cpp +++ b/tools/editor/editor_data.cpp @@ -524,8 +524,10 @@ void EditorData::remove_scene(int p_idx){ bool EditorData::_find_updated_instances(Node* p_root,Node *p_node,Set<String> &checked_paths) { -// if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner())) -// return false; + /* + if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner())) + return false; + */ Ref<SceneState> ss; @@ -814,7 +816,7 @@ EditorData::EditorData() { current_edited_scene=-1; -// load_imported_scenes_from_globals(); + //load_imported_scenes_from_globals(); } /////////// diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp index 352aba08bb..e2b7d475b0 100644 --- a/tools/editor/editor_dir_dialog.cpp +++ b/tools/editor/editor_dir_dialog.cpp @@ -255,7 +255,7 @@ EditorDirDialog::EditorDirDialog() { VBoxContainer *makevb= memnew( VBoxContainer ); makedialog->add_child(makevb); -// makedialog->set_child_rect(makevb); + //makedialog->set_child_rect(makevb); makedirname = memnew( LineEdit ); makevb->add_margin_child(TTR("Name:"),makedirname); diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index 5efbb17ee4..d4ca515493 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -713,8 +713,10 @@ void EditorFileDialog::update_file_list() { } // ?? - //if (tree->get_root() && tree->get_root()->get_children()) - // tree->get_root()->get_children()->select(0); + /* + if (tree->get_root() && tree->get_root()->get_children()) + tree->get_root()->get_children()->select(0); + */ files.clear(); diff --git a/tools/editor/editor_file_dialog.h b/tools/editor/editor_file_dialog.h index 04ee0cc55f..193cbc513c 100644 --- a/tools/editor/editor_file_dialog.h +++ b/tools/editor/editor_file_dialog.h @@ -35,7 +35,7 @@ #include "scene/gui/option_button.h" #include "os/dir_access.h" #include "scene/gui/box_container.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/tool_button.h" /** @author Juan Linietsky <reduzio@gmail.com> diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp index 5fb274f38f..1d32415be9 100644 --- a/tools/editor/editor_file_system.cpp +++ b/tools/editor/editor_file_system.cpp @@ -378,7 +378,7 @@ void EditorFileSystem::_scan_filesystem() { //save back the findings -// String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("file_cache"); + //String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("file_cache"); f=FileAccess::open(fscache,FileAccess::WRITE); _save_filesystem_cache(new_filesystem,f); @@ -502,7 +502,7 @@ void EditorFileSystem::scan() { _scan_filesystem(); if (filesystem) memdelete(filesystem); -// file_type_cache.clear(); + //file_type_cache.clear(); filesystem=new_filesystem; new_filesystem=NULL; _update_scan_actions(); @@ -670,7 +670,7 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess for (List<String>::Element*E=files.front();E;E=E->next(),idx++) { - String ext = E->get().extension().to_lower(); + String ext = E->get().get_extension().to_lower(); if (!valid_extensions.has(ext)) continue; //invalid @@ -789,7 +789,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S } else { - String ext = f.extension().to_lower(); + String ext = f.get_extension().to_lower(); if (!valid_extensions.has(ext)) continue; //invalid @@ -1198,7 +1198,7 @@ EditorFileSystemDirectory* EditorFileSystem::find_file(const String& p_file,int* } -EditorFileSystemDirectory *EditorFileSystem::get_path(const String& p_path) { +EditorFileSystemDirectory *EditorFileSystem::get_filesystem_path(const String& p_path) { if (!filesystem || scanning) return NULL; @@ -1352,7 +1352,7 @@ void EditorFileSystem::_bind_methods() { ClassDB::bind_method(_MD("scan"),&EditorFileSystem::scan); ClassDB::bind_method(_MD("scan_sources"),&EditorFileSystem::scan_sources); ClassDB::bind_method(_MD("update_file","path"),&EditorFileSystem::update_file); - ClassDB::bind_method(_MD("get_path:EditorFileSystemDirectory","path"),&EditorFileSystem::get_path); + ClassDB::bind_method(_MD("get_filesystem_path:EditorFileSystemDirectory","path"),&EditorFileSystem::get_filesystem_path); ClassDB::bind_method(_MD("get_file_type","path"),&EditorFileSystem::get_file_type); ADD_SIGNAL( MethodInfo("filesystem_changed") ); diff --git a/tools/editor/editor_file_system.h b/tools/editor/editor_file_system.h index 97c253c70b..3a26f46aa9 100644 --- a/tools/editor/editor_file_system.h +++ b/tools/editor/editor_file_system.h @@ -233,7 +233,7 @@ public: void get_changed_sources(List<String> *r_changed); void update_file(const String& p_file); String find_resource_from_source(const String& p_path) const; - EditorFileSystemDirectory *get_path(const String& p_path); + EditorFileSystemDirectory *get_filesystem_path(const String& p_path); String get_file_type(const String& p_file) const; EditorFileSystemDirectory* find_file(const String& p_file,int* r_index) const; diff --git a/tools/editor/editor_fonts.cpp b/tools/editor/editor_fonts.cpp index 3e128e7759..3c846fc538 100644 --- a/tools/editor/editor_fonts.cpp +++ b/tools/editor/editor_fonts.cpp @@ -127,9 +127,9 @@ void editor_register_fonts(Ref<Theme> p_theme) { p_theme->set_default_theme_font(df); -// Ref<BitmapFont> doc_font = make_font(_bi_font_doc_font_height,_bi_font_doc_font_ascent,0,_bi_font_doc_font_charcount,_bi_font_doc_font_characters,p_theme->get_icon("DocFont","EditorIcons")); -// Ref<BitmapFont> doc_title_font = make_font(_bi_font_doc_title_font_height,_bi_font_doc_title_font_ascent,0,_bi_font_doc_title_font_charcount,_bi_font_doc_title_font_characters,p_theme->get_icon("DocTitleFont","EditorIcons")); -// Ref<BitmapFont> doc_code_font = make_font(_bi_font_doc_code_font_height,_bi_font_doc_code_font_ascent,0,_bi_font_doc_code_font_charcount,_bi_font_doc_code_font_characters,p_theme->get_icon("DocCodeFont","EditorIcons")); + //Ref<BitmapFont> doc_font = make_font(_bi_font_doc_font_height,_bi_font_doc_font_ascent,0,_bi_font_doc_font_charcount,_bi_font_doc_font_characters,p_theme->get_icon("DocFont","EditorIcons")); + //Ref<BitmapFont> doc_title_font = make_font(_bi_font_doc_title_font_height,_bi_font_doc_title_font_ascent,0,_bi_font_doc_title_font_charcount,_bi_font_doc_title_font_characters,p_theme->get_icon("DocTitleFont","EditorIcons")); + //Ref<BitmapFont> doc_code_font = make_font(_bi_font_doc_code_font_height,_bi_font_doc_code_font_ascent,0,_bi_font_doc_code_font_charcount,_bi_font_doc_code_font_characters,p_theme->get_icon("DocCodeFont","EditorIcons")); MAKE_DROID_SANS(df_title,int(EDITOR_DEF("text_editor/help/help_title_font_size",18))*EDSCALE); diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index 7a2a53c929..f96a02bc52 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -334,7 +334,7 @@ EditorHelpSearch::EditorHelpSearch() { search_options->connect("item_activated",this,"_confirmed"); set_title(TTR("Search Help")); -// search_options->set_hide_root(true); + //search_options->set_hide_root(true); } @@ -349,8 +349,10 @@ void EditorHelpIndex::add_type(const String& p_type,HashMap<String,TreeItem*>& p if (p_types.has(p_type)) return; -// if (!ClassDB::is_type(p_type,base) || p_type==base) -// return; + /* + if (!ClassDB::is_type(p_type,base) || p_type==base) + return; + */ String inherits=EditorHelp::get_doc_data()->class_list[p_type].inherits; @@ -571,15 +573,15 @@ void EditorHelp::_button_pressed(int p_idx) { if (p_idx==PAGE_CLASS_LIST) { - // edited_class->set_pressed(false); - // class_list_button->set_pressed(true); - // tabs->set_current_tab(PAGE_CLASS_LIST); + //edited_class->set_pressed(false); + //class_list_button->set_pressed(true); + //tabs->set_current_tab(PAGE_CLASS_LIST); } else if (p_idx==PAGE_CLASS_DESC) { - // edited_class->set_pressed(true); - // class_list_button->set_pressed(false); - // tabs->set_current_tab(PAGE_CLASS_DESC); + //edited_class->set_pressed(true); + //class_list_button->set_pressed(false); + //tabs->set_current_tab(PAGE_CLASS_DESC); } else if (p_idx==PAGE_CLASS_PREV) { @@ -619,7 +621,7 @@ void EditorHelp::_class_desc_select(const String& p_select) { -// print_line("LINK: "+p_select); + //print_line("LINK: "+p_select); if (p_select.begins_with("#")) { //_goto_desc(p_select.substr(1,p_select.length())); emit_signal("go_to_help","class_name:"+p_select.substr(1,p_select.length())); @@ -824,7 +826,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->add_text(TTR("Members:")); class_desc->pop(); class_desc->pop(); -// class_desc->add_newline(); + //class_desc->add_newline(); class_desc->push_indent(1); class_desc->push_table(2); @@ -924,7 +926,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->pop(); //class_desc->add_newline(); -// class_desc->add_newline(); + //class_desc->add_newline(); class_desc->push_indent(1); class_desc->push_table(2); @@ -997,7 +999,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { } class_desc->pop();//monofont -// class_desc->add_newline(); + //class_desc->add_newline(); class_desc->pop(); //cell } @@ -1734,8 +1736,8 @@ void EditorHelp::_notification(int p_what) { case NOTIFICATION_READY: { -// forward->set_icon(get_icon("Forward","EditorIcons")); -// back->set_icon(get_icon("Back","EditorIcons")); + //forward->set_icon(get_icon("Forward","EditorIcons")); + //back->set_icon(get_icon("Back","EditorIcons")); _update_doc(); } break; @@ -1789,7 +1791,7 @@ void EditorHelp::_bind_methods() { ClassDB::bind_method("_class_list_select",&EditorHelp::_class_list_select); ClassDB::bind_method("_class_desc_select",&EditorHelp::_class_desc_select); ClassDB::bind_method("_class_desc_input",&EditorHelp::_class_desc_input); -// ClassDB::bind_method("_button_pressed",&EditorHelp::_button_pressed); + //ClassDB::bind_method("_button_pressed",&EditorHelp::_button_pressed); ClassDB::bind_method("_scroll_changed",&EditorHelp::_scroll_changed); ClassDB::bind_method("_request_help",&EditorHelp::_request_help); ClassDB::bind_method("_unhandled_key_input",&EditorHelp::_unhandled_key_input); @@ -1852,7 +1854,7 @@ EditorHelp::EditorHelp() { editor->get_gui_base()->add_child(class_search); class_search->connect("go_to_help",this,"_help_callback");*/ -// prev_search_page=-1; + //prev_search_page=-1; } EditorHelp::~EditorHelp() { @@ -1872,8 +1874,7 @@ void EditorHelpBit::_go_to_help(String p_what) { void EditorHelpBit::_meta_clicked(String p_select) { - - // print_line("LINK: "+p_select); + //print_line("LINK: "+p_select); if (p_select.begins_with("#")) { //_goto_desc(p_select.substr(1,p_select.length())); _go_to_help("class_name:"+p_select.substr(1,p_select.length())); @@ -1887,10 +1888,11 @@ void EditorHelpBit::_meta_clicked(String p_select) { _go_to_help("class_method:"+m.get_slice(".",0)+":"+m.get_slice(".",0)); } else { -// - // if (!method_line.has(m)) - // return; - //class_desc->scroll_to_line(method_line[m]); + /* + if (!method_line.has(m)) + return; + class_desc->scroll_to_line(method_line[m]); + */ } } diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index 0003e232c8..cf83052ee0 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -89,7 +89,7 @@ void EditorImportPlugin::_bind_methods() { ClassDB::add_virtual_method(get_class_static(),MethodInfo("reimport_multiple_files",PropertyInfo(Variant::POOL_STRING_ARRAY,"files"))); ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"can_reimport_multiple_files")); -// BIND_VMETHOD( mi ); + //BIND_VMETHOD( mi ); } String EditorImportPlugin::get_name() const { @@ -420,11 +420,12 @@ Vector<StringName> EditorExportPlatform::get_dependencies(bool p_bundles) const { List<String> l; - // SceneLoader::get_recognized_extensions(&l); - // for(List<String>::Element *E=l.front();E;E=E->next()) { - // - // scene_extensions.insert(E->get()); - // } + /* + SceneLoader::get_recognized_extensions(&l); + for(List<String>::Element *E=l.front();E;E=E->next()) { + scene_extensions.insert(E->get()); + } + */ ResourceLoader::get_recognized_extensions_for_type("",&l); for(List<String>::Element *E=l.front();E;E=E->next()) { @@ -921,7 +922,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func options["lossy_quality"]=group_lossy_quality; options["shrink"]=EditorImportExport::get_singleton()->image_export_group_get_shrink(E->get()); options["image_format"]=group_format; -// f->store_line(options.to_json()); + //f->store_line(options.to_json()); f->store_line(image_list_md5); } @@ -949,7 +950,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func return ERR_CANT_CREATE; } Vector<uint8_t> data = FileAccess::get_file_as_array(path); - String dst_path = F->get().operator String().basename()+".atex"; + String dst_path = F->get().operator String().get_basename()+".atex"; err = p_func(p_udata,dst_path,data,counter++,files.size()); saved.insert(dst_path); if (err) @@ -958,7 +959,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func if (f) { //recreating deps.. String depline; -// depline=String(F->get())+"::"+itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::get_md5(F->get()); name unneccesary by top md5 + //depline=String(F->get())+"::"+itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::get_md5(F->get()); name unneccesary by top md5 depline=itos(FileAccess::get_modified_time(F->get()))+"::"+FileAccess::get_md5(F->get()); depline+="::"+itos(region.pos.x)+"::"+itos(region.pos.y)+"::"+itos(region.size.x)+"::"+itos(region.size.y); depline+="::"+itos(margin.pos.x)+"::"+itos(margin.pos.y)+"::"+itos(margin.size.x)+"::"+itos(margin.size.y); diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp index 01068e78fc..fd2da2e4c0 100644 --- a/tools/editor/editor_log.cpp +++ b/tools/editor/editor_log.cpp @@ -44,8 +44,10 @@ void EditorLog::_error_handler(void *p_self, const char*p_func, const char*p_fil err_str=String(p_file)+":"+itos(p_line)+" - "+String(p_error); } -// if (!self->is_visible_in_tree()) -// self->emit_signal("show_request"); + /* + if (!self->is_visible_in_tree()) + self->emit_signal("show_request"); + */ err_str=" "+err_str; self->log->add_newline(); @@ -129,7 +131,7 @@ void EditorLog::add_message(const String& p_msg,bool p_error) { log->add_newline(); log->add_text(p_msg); -// button->set_text(p_msg); + //button->set_text(p_msg); if (p_error) log->pop(); diff --git a/tools/editor/editor_log.h b/tools/editor/editor_log.h index e59b877ea0..965d8d6420 100644 --- a/tools/editor/editor_log.h +++ b/tools/editor/editor_log.h @@ -36,7 +36,7 @@ //#include "scene/gui/empty_control.h" #include "scene/gui/box_container.h" #include "scene/gui/panel_container.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/tool_button.h" #include "pane_drag.h" #include "os/thread.h" @@ -48,7 +48,7 @@ class EditorLog : public VBoxContainer { Label *title; RichTextLabel *log; HBoxContainer *title_hb; -// PaneDrag *pd; + //PaneDrag *pd; Control *ec; PanelContainer *pc; @@ -58,7 +58,7 @@ class EditorLog : public VBoxContainer { Thread::ID current; -// void _dragged(const Point2& p_ofs); + //void _dragged(const Point2& p_ofs); void _clear_request(); static void _undo_redo_cbk(void *p_self,const String& p_name); protected: diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index b4a2da4833..bb33f19a2b 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -322,8 +322,8 @@ void EditorNode::_notification(int p_what) { } if (p_what==NOTIFICATION_READY) { - VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport(),true); - VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport(),true); + VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(),true); + VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(),true); VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(),true); _editor_select(EDITOR_3D); @@ -557,8 +557,10 @@ void EditorNode::save_resource_in_path(const Ref<Resource>& p_resource,const Str int flg=0; if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) flg|=ResourceSaver::FLAG_COMPRESS; - //if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) - // flg|=ResourceSaver::FLAG_RELATIVE_PATHS; + /* + if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) + flg|=ResourceSaver::FLAG_RELATIVE_PATHS; + */ String path = GlobalConfig::get_singleton()->localize_path(p_path); Error err = ResourceSaver::save(path,p_resource,flg|ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); @@ -568,7 +570,7 @@ void EditorNode::save_resource_in_path(const Ref<Resource>& p_resource,const Str accept->popup_centered_minsize(); return; } -// EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type()); + //EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type()); ((Resource*)p_resource.ptr())->set_path(path); emit_signal("resource_saved",p_resource); @@ -623,7 +625,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String& file->set_current_path(p_resource->get_path()); if (extensions.size()) { - String ext=p_resource->get_path().extension().to_lower(); + String ext=p_resource->get_path().get_extension().to_lower(); if (extensions.find(ext)==NULL) { file->set_current_path(p_resource->get_path().replacen("."+ext,"."+extensions.front()->get())); } @@ -666,11 +668,11 @@ void EditorNode::_dialog_display_file_error(String p_file,Error p_error) { case ERR_FILE_CANT_WRITE: { - accept->set_text(TTR("Can't open file for writing:")+" "+p_file.extension()); + accept->set_text(TTR("Can't open file for writing:")+" "+p_file.get_extension()); } break; case ERR_FILE_UNRECOGNIZED: { - accept->set_text(TTR("Requested file format unknown:")+" "+p_file.extension()); + accept->set_text(TTR("Requested file format unknown:")+" "+p_file.get_extension()); } break; default: { @@ -770,7 +772,7 @@ bool EditorNode::_find_and_save_resource(RES res,Map<RES,bool>& processed,int32_ bool subchanged = _find_and_save_edited_subresources(res.ptr(),processed,flags); -// print_line("checking if edited: "+res->get_type()+" :: "+res->get_name()+" :: "+res->get_path()+" :: "+itos(changed)+" :: SR "+itos(subchanged)); + //print_line("checking if edited: "+res->get_type()+" :: "+res->get_name()+" :: "+res->get_path()+" :: "+itos(changed)+" :: SR "+itos(subchanged)); if (res->get_path().is_resource_file()) { if (changed || subchanged) { @@ -890,10 +892,10 @@ void EditorNode::_save_scene_with_preview(String p_file) { RID viewport; bool is2d; if (c3d<c2d) { - viewport=scene_root->get_viewport(); + viewport=scene_root->get_viewport_rid(); is2d=true; } else { - viewport=SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_viewport(); + viewport=SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_viewport_rid(); is2d=false; } @@ -1005,8 +1007,10 @@ void EditorNode::_save_scene(String p_file, int idx) { int flg=0; if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) flg|=ResourceSaver::FLAG_COMPRESS; - //if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) - // flg|=ResourceSaver::FLAG_RELATIVE_PATHS; + /* + if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) + flg|=ResourceSaver::FLAG_RELATIVE_PATHS; + */ flg|=ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS; @@ -1245,7 +1249,7 @@ void EditorNode::_dialog_action(String p_file) { ml = Ref<MeshLibrary>( memnew( MeshLibrary )); } -// MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(),ml,true); + //MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(),ml,true); Error err = ResourceSaver::save(p_file,ml); if (err) { @@ -1344,9 +1348,11 @@ void EditorNode::_dialog_action(String p_file) { unzCloseCurrentFile(pkg); print_line(fname); - //for(int i=0;i<512;i++) { - // print_line(itos(data[i])); - //} + /* + for(int i=0;i<512;i++) { + print_line(itos(data[i])); + } + */ file=file.get_file(); @@ -2154,7 +2160,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { if (scene->get_filename()!="") { file->set_current_path(scene->get_filename()); if (extensions.size()) { - String ext=scene->get_filename().extension().to_lower(); + String ext=scene->get_filename().get_extension().to_lower(); if (extensions.find(ext)==NULL) { file->set_current_path(scene->get_filename().replacen("."+ext,"."+extensions.front()->get())); } @@ -2217,8 +2223,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { if (scene->get_filename()!="") { cpath = scene->get_filename(); - String fn = cpath.substr(0,cpath.length() - cpath.extension().size()); - String ext=cpath.extension(); + String fn = cpath.substr(0,cpath.length() - cpath.get_extension().size()); + String ext=cpath.get_extension(); cpath=fn+".pot"; @@ -2506,8 +2512,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { editor_data.get_undo_redo().add_undo_method(parent,"remove_child",instanced_scene); editor_data.get_undo_redo().commit_action(); -// parent->add_child(instanced_scene); -// instanced_scene->set_owner(edited_scene); + //parent->add_child(instanced_scene); + //instanced_scene->set_owner(edited_scene); _last_instanced_scene=instanced_scene; } break; @@ -3176,15 +3182,17 @@ void EditorNode::_remove_edited_scene() { _update_title(); _update_scene_tabs(); -// if (editor_data.get_edited_scene_count()==1) { -// //make new scene appear saved -// set_current_version(editor_data.get_undo_redo().get_version()); -// unsaved_cache=false; -// } + /* + if (editor_data.get_edited_scene_count()==1) { + //make new scene appear saved + set_current_version(editor_data.get_undo_redo().get_version()); + unsaved_cache=false; + } + */ } void EditorNode::_remove_scene(int index) { -// printf("Attempting to remove scene %d (current is %d)\n", index, editor_data.get_edited_scene()); + //printf("Attempting to remove scene %d (current is %d)\n", index, editor_data.get_edited_scene()); if (editor_data.get_edited_scene() == index) { //Scene to remove is current scene @@ -3278,8 +3286,8 @@ Error EditorNode::save_translatable_strings(const String& p_to_file) { f->store_line("msgstr \"\""); f->store_line("\"Report-Msgid-Bugs-To: <define>\\n\""); f->store_line("\"POT-Creation-Date: "+itos(date.year)+"-"+itos(date.month)+"-"+itos(date.day)+" "+itos(time.hour)+":"+itos(time.min)+"0000\\n\""); -// f->store_line("\"PO-Revision-Date: 2006-08-30 13:56-0700\\n\""); -// f->store_line("\"Last-Translator: Rubén C. DÃaz Alonso <outime@gmail.com>\\n\""); + //f->store_line("\"PO-Revision-Date: 2006-08-30 13:56-0700\\n\""); + //f->store_line("\"Last-Translator: Rubén C. DÃaz Alonso <outime@gmail.com>\\n\""); f->store_line("\"Language-Team: <define>\\n\""); f->store_line("\"MIME-Version: 1.0\\n\""); f->store_line("\"Content-Type: text/plain; charset=UTF-8\\n\""); @@ -3400,8 +3408,10 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres uint32_t flags=0; -// if (saver->is_bundle_scenes_enabled()) -// flags|=ResourceSaver::FLAG_BUNDLE_INSTANCED_SCENES; + /* + if (saver->is_bundle_scenes_enabled()) + flags|=ResourceSaver::FLAG_BUNDLE_INSTANCED_SCENES; + */ if (saver->is_bundle_resources_enabled()) flags|=ResourceSaver::FLAG_BUNDLE_RESOURCES; if (saver->is_remove_editor_data_enabled()) @@ -3784,8 +3794,10 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo state->set_path(lpath); new_scene->set_scene_inherited_state(state); new_scene->set_filename(String()); - //if (new_scene->get_scene_instance_state().is_valid()) - // new_scene->get_scene_instance_state()->set_path(String()); + /* + if (new_scene->get_scene_instance_state().is_valid()) + new_scene->get_scene_instance_state()->set_path(String()); + */ } new_scene->set_scene_instance_state(Ref<SceneState>()); @@ -3801,7 +3813,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo */ editor_data.set_edited_scene_import_metadata( sdata->get_import_metadata() ); -// editor_data.get_undo_redo().clear_history(); + //editor_data.get_undo_redo().clear_history(); saved_version=editor_data.get_undo_redo().get_version(); _update_title(); _update_scene_tabs(); @@ -3893,17 +3905,17 @@ void EditorNode::update_keying() { void EditorNode::_close_messages() { -// left_split->set_dragger_visible(false); + //left_split->set_dragger_visible(false); old_split_ofs = center_split->get_split_offset(); center_split->set_split_offset(0); -// scene_root_parent->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_END,0); + //scene_root_parent->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_END,0); } void EditorNode::_show_messages() { -// left_split->set_dragger_visible(true); + //left_split->set_dragger_visible(true); center_split->set_split_offset(old_split_ofs); -// scene_root_parent->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_END,log->get_margin(MARGIN_TOP)); + //scene_root_parent->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_END,log->get_margin(MARGIN_TOP)); } @@ -3934,7 +3946,7 @@ void EditorNode::animation_editor_make_visible(bool p_visible) { } else { //pd_anim->hide(); animation_editor->hide(); -// scene_root_parent->set_margin(MARGIN_TOP,0); + //scene_root_parent->set_margin(MARGIN_TOP,0); if (!animation_vb->get_parent_control()) return; animation_vb->get_parent_control()->minimum_size_changed(); @@ -3989,7 +4001,7 @@ void EditorNode::_open_recent_scene(int p_idx) { void EditorNode::_save_optimized() { -// save_optimized_copy(optimized_save->get_optimized_scene(),optimized_save->get_preset()); + //save_optimized_copy(optimized_save->get_optimized_scene(),optimized_save->get_preset()); #if 0 String path = optimized_save->get_optimized_scene(); @@ -4159,7 +4171,7 @@ void EditorNode::register_editor_types() { //ClassDB::register_type<EditorImporter>(); -// ClassDB::register_type<EditorPostImport>(); + //ClassDB::register_type<EditorPostImport>(); } void EditorNode::unregister_editor_types() { @@ -4217,7 +4229,7 @@ void EditorNode::progress_end_task_bg(const String& p_task) { Ref<Texture> EditorNode::_file_dialog_get_icon(const String& p_path) { - EditorFileSystemDirectory *efsd = EditorFileSystem::get_singleton()->get_path(p_path.get_base_dir()); + EditorFileSystemDirectory *efsd = EditorFileSystem::get_singleton()->get_filesystem_path(p_path.get_base_dir()); if (efsd) { String file = p_path.get_file(); @@ -5308,9 +5320,9 @@ void EditorNode::_bind_methods() { ClassDB::bind_method("_import_action",&EditorNode::_import_action); //ClassDB::bind_method("_import",&EditorNode::_import); -// ClassDB::bind_method("_import_conflicts_solved",&EditorNode::_import_conflicts_solved); + //ClassDB::bind_method("_import_conflicts_solved",&EditorNode::_import_conflicts_solved); ClassDB::bind_method("_open_recent_scene",&EditorNode::_open_recent_scene); -// ClassDB::bind_method("_open_recent_scene_confirm",&EditorNode::_open_recent_scene_confirm); + //ClassDB::bind_method("_open_recent_scene_confirm",&EditorNode::_open_recent_scene_confirm); ClassDB::bind_method("_save_optimized",&EditorNode::_save_optimized); @@ -5517,7 +5529,7 @@ EditorNode::EditorNode() { menu_hb = memnew( HBoxContainer ); main_vbox->add_child(menu_hb); -// top_dark_vb->add_child(scene_tabs); + //top_dark_vb->add_child(scene_tabs); //left left_l_hsplit = memnew( HSplitContainer ); main_vbox->add_child(left_l_hsplit); @@ -5696,12 +5708,12 @@ EditorNode::EditorNode() { //scene_root_base->add_child(scene_root); //scene_root->set_meta("_editor_disable_input",true); - VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport(),true); + VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(),true); scene_root->set_disable_input(true); scene_root->set_as_audio_listener_2d(true); //scene_root->set_size_override(true,Size2(GlobalConfig::get_singleton()->get("display/width"),GlobalConfig::get_singleton()->get("display/height"))); -// scene_root->set_world_2d( Ref<World2D>( memnew( World2D )) ); + //scene_root->set_world_2d( Ref<World2D>( memnew( World2D )) ); viewport = memnew( VBoxContainer ); @@ -5934,8 +5946,8 @@ EditorNode::EditorNode() { native_play_button->get_popup()->connect("id_pressed",this,"_run_in_device"); run_native->connect("native_run",this,"_menu_option",varray(RUN_PLAY_NATIVE)); -// VSeparator *s1 = memnew( VSeparator ); -// play_hb->add_child(s1); + //VSeparator *s1 = memnew( VSeparator ); + //play_hb->add_child(s1); play_scene_button = memnew( ToolButton ); play_hb->add_child(play_scene_button); @@ -6322,8 +6334,8 @@ EditorNode::EditorNode() { bottom_pc->add_child(bottom_hb);*/ -// center_vb->add_child( log->get_button() ); -// log->get_button()->set_h_size_flags(Control::SIZE_EXPAND_FILL); + //center_vb->add_child( log->get_button() ); + //log->get_button()->set_h_size_flags(Control::SIZE_EXPAND_FILL); //progress_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -6371,7 +6383,7 @@ EditorNode::EditorNode() { -// optimized_save = memnew( OptimizedSaveDialog(&editor_data) ); + //optimized_save = memnew( OptimizedSaveDialog(&editor_data) ); //gui_base->add_child(optimized_save); //optimized_save->connect("confirmed",this,"_save_optimized"); @@ -6524,8 +6536,8 @@ EditorNode::EditorNode() { Ref<EditorSceneImportPlugin> _scene_import = memnew(EditorSceneImportPlugin(this) ); Ref<EditorSceneImporterCollada> _collada_import = memnew( EditorSceneImporterCollada); _scene_import->add_importer(_collada_import); -// Ref<EditorSceneImporterFBXConv> _fbxconv_import = memnew( EditorSceneImporterFBXConv); -// _scene_import->add_importer(_fbxconv_import); + //Ref<EditorSceneImporterFBXConv> _fbxconv_import = memnew( EditorSceneImporterFBXConv); + //_scene_import->add_importer(_fbxconv_import); editor_import_export->add_import_plugin( _scene_import); // TODO: This plugin has no code, it should be either implemented or dropped (GH-3667) // editor_import_export->add_import_plugin( Ref<EditorSceneAnimationImportPlugin>( memnew(EditorSceneAnimationImportPlugin(this)))); @@ -6569,14 +6581,14 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( MeshInstanceEditorPlugin(this) ) ); add_editor_plugin( memnew( AnimationTreeEditorPlugin(this) ) ); //add_editor_plugin( memnew( SamplePlayerEditorPlugin(this) ) ); - this is kind of useless at this point -// add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) ); + //add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) ); //add_editor_plugin( memnew( StreamEditorPlugin(this) ) ); add_editor_plugin( memnew( StyleBoxEditorPlugin(this) ) ); //add_editor_plugin( memnew( ParticlesEditorPlugin(this) ) ); add_editor_plugin( memnew( ResourcePreloaderEditorPlugin(this) ) ); add_editor_plugin( memnew( ItemListEditorPlugin(this) ) ); //add_editor_plugin( memnew( RichTextEditorPlugin(this) ) ); -// add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) ); + //add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) ); add_editor_plugin( memnew( CollisionPolygon2DEditorPlugin(this) ) ); add_editor_plugin( memnew( TileSetEditorPlugin(this) ) ); add_editor_plugin( memnew( TileMapEditorPlugin(this) ) ); @@ -6585,7 +6597,7 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( Particles2DEditorPlugin(this) ) ); add_editor_plugin( memnew( GIProbeEditorPlugin(this) ) ); add_editor_plugin( memnew( Path2DEditorPlugin(this) ) ); -// add_editor_plugin( memnew( PathEditorPlugin(this) ) ); + //add_editor_plugin( memnew( PathEditorPlugin(this) ) ); //add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) ); add_editor_plugin( memnew( Polygon2DEditorPlugin(this) ) ); add_editor_plugin( memnew( LightOccluder2DEditorPlugin(this) ) ); @@ -6593,8 +6605,8 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( ColorRampEditorPlugin(this) ) ); add_editor_plugin( memnew( CollisionShape2DEditorPlugin(this) ) ); add_editor_plugin( memnew( TextureEditorPlugin(this) ) ); -// add_editor_plugin( memnew( MaterialEditorPlugin(this) ) ); -// add_editor_plugin( memnew( MeshEditorPlugin(this) ) ); + //add_editor_plugin( memnew( MaterialEditorPlugin(this) ) ); + //add_editor_plugin( memnew( MeshEditorPlugin(this) ) ); for(int i=0;i<EditorPlugins::get_plugin_count();i++) add_editor_plugin( EditorPlugins::create(i,this) ); @@ -6622,7 +6634,7 @@ EditorNode::EditorNode() { editor_plugin_screen=NULL; editor_plugins_over = memnew(EditorPluginList); -// force_top_viewport(true); + //force_top_viewport(true); _edit_current(); current=NULL; @@ -6631,7 +6643,7 @@ EditorNode::EditorNode() { ScriptServer::set_scripting_enabled(false); // no scripting by default if editor -// GlobalConfig::get_singleton()->set("render/room_cull_enabled",false); + //GlobalConfig::get_singleton()->set("render/room_cull_enabled",false); reference_resource_mem=true; save_external_resources_mem=true; @@ -6684,9 +6696,9 @@ EditorNode::EditorNode() { set_process_unhandled_input(true); _playing_edited=false; -// Panel *errors = memnew( Panel ); + //Panel *errors = memnew( Panel ); load_errors = memnew( RichTextLabel ); -// load_errors->set_readonly(true); + //load_errors->set_readonly(true); load_error_dialog = memnew( AcceptDialog ); load_error_dialog->add_child(load_errors); load_error_dialog->set_title(TTR("Load Errors")); @@ -6722,8 +6734,8 @@ EditorNode::EditorNode() { pick_main_scene->get_ok()->set_text("Select"); pick_main_scene->connect("confirmed",this,"_menu_option",varray(SETTINGS_PICK_MAIN_SCENE)); -// Ref<ImageTexture> it = gui_base->get_icon("logo","Icons"); -// OS::get_singleton()->set_icon( it->get_data() ); + //Ref<ImageTexture> it = gui_base->get_icon("logo","Icons"); + //OS::get_singleton()->set_icon( it->get_data() ); for(int i=0;i<_init_callbacks.size();i++) _init_callbacks[i](); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 2cb1cd00ab..dd5ff1e175 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -286,7 +286,7 @@ private: CreateDialog *create_dialog; -// CallDialog *call_dialog; + //CallDialog *call_dialog; ConfirmationDialog *confirmation; ConfirmationDialog *import_confirmation; ConfirmationDialog *open_recent_confirmation; diff --git a/tools/editor/editor_profiler.cpp b/tools/editor/editor_profiler.cpp index 8522012113..5279711b0f 100644 --- a/tools/editor/editor_profiler.cpp +++ b/tools/editor/editor_profiler.cpp @@ -724,7 +724,7 @@ EditorProfiler::EditorProfiler() int metric_size=CLAMP(int(EDITOR_DEF("debugger/profiler_frame_history_size",600)),60,1024); frame_metrics.resize(metric_size); last_metric=-1; -// cursor_metric=-1; + //cursor_metric=-1; hover_metric=-1; @@ -750,6 +750,6 @@ EditorProfiler::EditorProfiler() seeking=false; graph_height=1; -// activate->set_disabled(true); + //activate->set_disabled(true); } diff --git a/tools/editor/editor_profiler.h b/tools/editor/editor_profiler.h index ec1cd9fb5b..52b38cdae8 100644 --- a/tools/editor/editor_profiler.h +++ b/tools/editor/editor_profiler.h @@ -3,7 +3,7 @@ #include "scene/gui/box_container.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/button.h" #include "scene/gui/label.h" #include "scene/gui/tree.h" diff --git a/tools/editor/editor_run_script.cpp b/tools/editor/editor_run_script.cpp index c8f3f9fc5d..4a3cbfbccb 100644 --- a/tools/editor/editor_run_script.cpp +++ b/tools/editor/editor_run_script.cpp @@ -46,7 +46,7 @@ void EditorScript::add_root_node(Node *p_node) { return; } -// editor->set_edited_scene(p_node); + //editor->set_edited_scene(p_node); } Node *EditorScript::get_scene() { diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 50bd629b67..807183ae46 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -846,8 +846,8 @@ void EditorSettings::list_text_editor_themes() { d->list_dir_begin(); String file = d->get_next(); while(file != String()) { - if (file.extension() == "tet" && file.basename().to_lower() != "default") { - themes += "," + file.basename(); + if (file.get_extension() == "tet" && file.get_basename().to_lower() != "default") { + themes += "," + file.get_basename(); } file = d->get_next(); } @@ -1105,7 +1105,7 @@ EditorSettings::EditorSettings() { EditorSettings::~EditorSettings() { -// singleton=NULL; + //singleton=NULL; } Ref<ShortCut> ED_GET_SHORTCUT(const String& p_path) { diff --git a/tools/editor/editor_sub_scene.cpp b/tools/editor/editor_sub_scene.cpp index 5c40108f93..34c3d47006 100644 --- a/tools/editor/editor_sub_scene.cpp +++ b/tools/editor/editor_sub_scene.cpp @@ -203,7 +203,7 @@ EditorSubScene::EditorSubScene() { VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); -// set_child_rect(vb); + //set_child_rect(vb); HBoxContainer *hb = memnew( HBoxContainer ); path = memnew( LineEdit ); diff --git a/tools/editor/fileserver/editor_file_server.cpp b/tools/editor/fileserver/editor_file_server.cpp index d640b0ad1d..6330b06d3e 100644 --- a/tools/editor/fileserver/editor_file_server.cpp +++ b/tools/editor/fileserver/editor_file_server.cpp @@ -38,7 +38,7 @@ void EditorFileServer::_close_client(ClientData *cd) { - cd->connection->disconnect(); + cd->connection->disconnect_from_host(); cd->efs->wait_mutex->lock(); cd->efs->to_wait.insert(cd->thread); cd->efs->wait_mutex->unlock(); diff --git a/tools/editor/filesystem_dock.cpp b/tools/editor/filesystem_dock.cpp index 8a21b94eea..792eb54dd4 100644 --- a/tools/editor/filesystem_dock.cpp +++ b/tools/editor/filesystem_dock.cpp @@ -396,7 +396,7 @@ void FileSystemDock::_update_files(bool p_keep_selection) { current_path->set_text(path); - EditorFileSystemDirectory *efd = EditorFileSystem::get_singleton()->get_path(path); + EditorFileSystemDirectory *efd = EditorFileSystem::get_singleton()->get_filesystem_path(path); if (!efd) return; @@ -832,7 +832,7 @@ void FileSystemDock::_move_operation(const String& p_to_path) { return; } - EditorFileSystemDirectory *efsd=EditorFileSystem::get_singleton()->get_path(move_dirs[i]); + EditorFileSystemDirectory *efsd=EditorFileSystem::get_singleton()->get_filesystem_path(move_dirs[i]); if (!efsd) continue; _find_inside_move_files(efsd,inside_files); @@ -1015,7 +1015,7 @@ void FileSystemDock::_file_option(int p_option) { if (move_dirs.empty() && move_files.size()==1) { rename_dialog->clear_filters(); - rename_dialog->add_filter("*."+move_files[0].extension()); + rename_dialog->add_filter("*."+move_files[0].get_extension()); rename_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); rename_dialog->set_current_path(move_files[0]); rename_dialog->popup_centered_ratio(); @@ -1149,7 +1149,7 @@ void FileSystemDock::_open_pressed(){ current_path->set_text(path); _push_to_history(); -// emit_signal("open",path); + //emit_signal("open",path); } @@ -1242,8 +1242,10 @@ Variant FileSystemDock::get_drag_data_fw(const Point2& p_point,Control* p_from) if (seldirs.empty() && selfiles.empty()) return Variant(); - //if (seldirs.size() && selfiles.size()) - // return Variant(); //can't really mix files and dirs (i think?) - yes you can, commenting + /* + if (seldirs.size() && selfiles.size()) + return Variant(); //can't really mix files and dirs (i think?) - yes you can, commenting + */ /*if (selfiles.size()==1) { Ref<Resource> resource = ResourceLoader::load(files->get_item_metadata(selfiles.front()->get())); @@ -1622,7 +1624,7 @@ void FileSystemDock::_bind_methods() { ClassDB::bind_method(_MD("_update_tree"),&FileSystemDock::_update_tree); ClassDB::bind_method(_MD("_rescan"),&FileSystemDock::_rescan); ClassDB::bind_method(_MD("_favorites_pressed"),&FileSystemDock::_favorites_pressed); -// ClassDB::bind_method(_MD("_instance_pressed"),&ScenesDock::_instance_pressed); + //ClassDB::bind_method(_MD("_instance_pressed"),&ScenesDock::_instance_pressed); ClassDB::bind_method(_MD("_open_pressed"),&FileSystemDock::_open_pressed); ClassDB::bind_method(_MD("_dir_rmb_pressed"),&FileSystemDock::_dir_rmb_pressed); @@ -1700,7 +1702,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { button_favorite->set_focus_mode(FOCUS_NONE); -// Control *spacer = memnew( Control); + //Control *spacer = memnew( Control); diff --git a/tools/editor/icons/2x/icon_patch_9_frame.png b/tools/editor/icons/2x/icon_patch_9_rect.png Binary files differindex 5762a0392e..5762a0392e 100644 --- a/tools/editor/icons/2x/icon_patch_9_frame.png +++ b/tools/editor/icons/2x/icon_patch_9_rect.png diff --git a/tools/editor/icons/2x/icon_reference_frame.png b/tools/editor/icons/2x/icon_reference_rect.png Binary files differindex 63fe559fa7..63fe559fa7 100644 --- a/tools/editor/icons/2x/icon_reference_frame.png +++ b/tools/editor/icons/2x/icon_reference_rect.png diff --git a/tools/editor/icons/2x/icon_texture_frame.png b/tools/editor/icons/2x/icon_texture_rect.png Binary files differindex 50d715dd09..50d715dd09 100644 --- a/tools/editor/icons/2x/icon_texture_frame.png +++ b/tools/editor/icons/2x/icon_texture_rect.png diff --git a/tools/editor/icons/icon_patch_9_frame.png b/tools/editor/icons/icon_patch_9_rect.png Binary files differindex bdd1467144..bdd1467144 100644 --- a/tools/editor/icons/icon_patch_9_frame.png +++ b/tools/editor/icons/icon_patch_9_rect.png diff --git a/tools/editor/icons/icon_reference_frame.png b/tools/editor/icons/icon_reference_rect.png Binary files differindex b253af477f..b253af477f 100644 --- a/tools/editor/icons/icon_reference_frame.png +++ b/tools/editor/icons/icon_reference_rect.png diff --git a/tools/editor/icons/icon_texture_frame.png b/tools/editor/icons/icon_texture_rect.png Binary files differindex 84e4a90bfb..84e4a90bfb 100644 --- a/tools/editor/icons/icon_texture_frame.png +++ b/tools/editor/icons/icon_texture_rect.png diff --git a/tools/editor/icons/source/icon_patch_9_frame.svg b/tools/editor/icons/source/icon_patch_9_rect.svg index f12789c19e..c5a09603a6 100644 --- a/tools/editor/icons/source/icon_patch_9_frame.svg +++ b/tools/editor/icons/source/icon_patch_9_rect.svg @@ -18,7 +18,7 @@ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docname="icon_patch_9_frame.svg"> + sodipodi:docname="icon_patch_9_rect.svg"> <defs id="defs4" /> <sodipodi:namedview diff --git a/tools/editor/icons/source/icon_reference_frame.svg b/tools/editor/icons/source/icon_reference_rect.svg index 76c3247f1b..cee814360d 100644 --- a/tools/editor/icons/source/icon_reference_frame.svg +++ b/tools/editor/icons/source/icon_reference_rect.svg @@ -18,7 +18,7 @@ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docname="icon_reference_frame.svg"> + sodipodi:docname="icon_reference_rect.svg"> <defs id="defs4" /> <sodipodi:namedview diff --git a/tools/editor/icons/source/icon_texture_frame.svg b/tools/editor/icons/source/icon_texture_rect.svg index afab41de41..88d9b4081f 100644 --- a/tools/editor/icons/source/icon_texture_frame.svg +++ b/tools/editor/icons/source/icon_texture_rect.svg @@ -18,7 +18,7 @@ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docname="icon_texture_frame.svg"> + sodipodi:docname="icon_texture_rect.svg"> <defs id="defs4" /> <sodipodi:namedview diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp index b4e0c4b82a..722b02f77b 100644 --- a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp @@ -145,7 +145,7 @@ public: error_dialog->popup_centered(Size2(200, 100)*EDSCALE); } - dst = dst.plus_file(bitmasks[i].get_file().basename() + ".pbm"); + dst = dst.plus_file(bitmasks[i].get_file().get_basename() + ".pbm"); plugin->import(dst, imd); } @@ -167,7 +167,7 @@ public: ClassDB::bind_method("_import", &EditorBitMaskImportDialog::_import); ClassDB::bind_method("_browse", &EditorBitMaskImportDialog::_browse); ClassDB::bind_method("_browse_target", &EditorBitMaskImportDialog::_browse_target); - // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); + //ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); } EditorBitMaskImportDialog(EditorBitMaskImportPlugin *p_plugin) { @@ -225,7 +225,7 @@ public: save_select = memnew(EditorDirDialog); add_child(save_select); - // save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR); + //save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR); save_select->connect("dir_selected", this, "_choose_save_dir"); get_ok()->connect("pressed", this, "_import"); @@ -235,7 +235,7 @@ public: error_dialog = memnew(ConfirmationDialog); add_child(error_dialog); error_dialog->get_ok()->set_text(TTR("Accept")); - // error_dialog->get_cancel()->hide(); + //error_dialog->get_cancel()->hide(); set_hide_on_ok(false); } @@ -294,7 +294,7 @@ void EditorBitMaskImportPlugin::import_from_drop(const Vector<String>& p_drop, c ImageLoader::get_recognized_extensions(&valid_extensions); for(int i=0;i<p_drop.size();i++) { - String extension=p_drop[i].extension().to_lower(); + String extension=p_drop[i].get_extension().to_lower(); for (List<String>::Element *E=valid_extensions.front();E;E=E->next()) { diff --git a/tools/editor/io_plugins/editor_export_scene.cpp b/tools/editor/io_plugins/editor_export_scene.cpp index c2e037cfd7..ea67128f3c 100644 --- a/tools/editor/io_plugins/editor_export_scene.cpp +++ b/tools/editor/io_plugins/editor_export_scene.cpp @@ -42,7 +42,7 @@ Vector<uint8_t> EditorSceneExportPlugin::custom_export(String& p_path,const Ref< } - String extension = p_path.extension(); + String extension = p_path.get_extension(); //step 1 check if scene diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index bf9c9835f6..099535b1ef 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -439,7 +439,7 @@ class EditorFontImportDialog : public ConfirmationDialog { test_label->set_text(""); test_label->set_text(test_string->get_text()); - test_label->add_color_override("font_color",test_color->get_color()); + test_label->add_color_override("font_color",test_color->get_pick_color()); } void _update() { @@ -468,7 +468,7 @@ class EditorFontImportDialog : public ConfirmationDialog { Ref<ImageTexture> tex = font->get_texture(0); if (tex.is_null()) return; - FileAccessRef f=FileAccess::open(p_font.basename()+".inc",FileAccess::WRITE); + FileAccessRef f=FileAccess::open(p_font.get_basename()+".inc",FileAccess::WRITE); Vector<CharType> ck = font->get_char_keys(); f->store_line("static const int _builtin_font_height="+itos(font->get_height())+";"); @@ -499,7 +499,7 @@ class EditorFontImportDialog : public ConfirmationDialog { f->store_line("static const int _builtin_font_img_width="+itos(img.get_width())+";"); f->store_line("static const int _builtin_font_img_height="+itos(img.get_height())+";"); - String fname = p_font.basename()+".sv.png"; + String fname = p_font.get_basename()+".sv.png"; ResourceSaver::save(fname,tex); Vector<uint8_t> data=FileAccess::get_file_as_array(fname); @@ -533,14 +533,14 @@ class EditorFontImportDialog : public ConfirmationDialog { } if (dest->get_line_edit()->get_text().get_file()==".fnt") { - dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().basename() + ".fnt" ); + dest->get_line_edit()->set_text(dest->get_line_edit()->get_text().get_base_dir() + "/" + source->get_line_edit()->get_text().get_file().get_basename() + ".fnt" ); } - if (dest->get_line_edit()->get_text().extension() == dest->get_line_edit()->get_text()) { + if (dest->get_line_edit()->get_text().get_extension() == dest->get_line_edit()->get_text()) { dest->get_line_edit()->set_text(dest->get_line_edit()->get_text() + ".fnt"); } - if (dest->get_line_edit()->get_text().extension().to_lower() != "fnt") { + if (dest->get_line_edit()->get_text().get_extension().to_lower() != "fnt") { error_dialog->set_text(TTR("Invalid file extension.\nPlease use .fnt.")); error_dialog->popup_centered(Size2(200,100)); return; @@ -665,10 +665,12 @@ public: List<String> fl; Ref<BitmapFont> font= memnew(BitmapFont); dest->get_file_dialog()->add_filter("*.fnt ; Font" ); - //ResourceSaver::get_recognized_extensions(font,&fl); - //for(List<String>::Element *E=fl.front();E;E=E->next()) { - // dest->get_file_dialog()->add_filter("*."+E->get()); - //} + /* + ResourceSaver::get_recognized_extensions(font,&fl); + for(List<String>::Element *E=fl.front();E;E=E->next()) { + dest->get_file_dialog()->add_filter("*."+E->get()); + } + */ vbl->add_margin_child(TTR("Dest Resource:"),dest); HBoxContainer *testhb = memnew( HBoxContainer ); @@ -679,7 +681,7 @@ public: testhb->add_child(test_string); test_color = memnew( ColorPickerButton ); - test_color->set_color(get_color("font_color","Label")); + test_color->set_pick_color(get_color("font_color","Label")); test_color->set_h_size_flags(SIZE_EXPAND_FILL); test_color->set_stretch_ratio(1); test_color->connect("color_changed",this,"_update_text3"); @@ -689,7 +691,7 @@ public: vbl->add_margin_child(TTR("Test:")+" ",testhb); /* HBoxContainer *upd_hb = memnew( HBoxContainer ); -// vbl->add_child(upd_hb); + //vbl->add_child(upd_hb); upd_hb->add_spacer(); Button *update = memnew( Button); upd_hb->add_child(update); @@ -754,7 +756,7 @@ struct _EditorFontData { int texture; Image blit; Point2i blit_ofs; -// bool printable; + //bool printable; }; @@ -780,13 +782,13 @@ static unsigned char get_SDF_radial( int x, int y, int max_radius ) { - // hideous brute force method + //hideous brute force method float d2 = max_radius*max_radius+1.0; unsigned char v = fontmap[x+y*w]; for( int radius = 1; (radius <= max_radius) && (radius*radius < d2); ++radius ) { int line, lo, hi; - // north + //north line = y - radius; if( (line >= 0) && (line < h) ) { @@ -797,7 +799,7 @@ static unsigned char get_SDF_radial( int idx = line * w + lo; for( int i = lo; i <= hi; ++i ) { - // check this pixel + //check this pixel if( fontmap[idx] != v ) { float nx = i - x; @@ -808,11 +810,11 @@ static unsigned char get_SDF_radial( d2 = nd2; } } - // move on + //move on ++idx; } } - // south + //south line = y + radius; if( (line >= 0) && (line < h) ) { @@ -823,7 +825,7 @@ static unsigned char get_SDF_radial( int idx = line * w + lo; for( int i = lo; i <= hi; ++i ) { - // check this pixel + //check this pixel if( fontmap[idx] != v ) { float nx = i - x; @@ -834,11 +836,11 @@ static unsigned char get_SDF_radial( d2 = nd2; } } - // move on + //move on ++idx; } } - // west + //west line = x - radius; if( (line >= 0) && (line < w) ) { @@ -849,7 +851,7 @@ static unsigned char get_SDF_radial( int idx = lo * w + line; for( int i = lo; i <= hi; ++i ) { - // check this pixel + //check this pixel if( fontmap[idx] != v ) { float nx = line - x; @@ -860,11 +862,11 @@ static unsigned char get_SDF_radial( d2 = nd2; } } - // move on + //move on idx += w; } } - // east + //east line = x + radius; if( (line >= 0) && (line < w) ) { @@ -875,7 +877,7 @@ static unsigned char get_SDF_radial( int idx = lo * w + line; for( int i = lo; i <= hi; ++i ) { - // check this pixel + //check this pixel if( fontmap[idx] != v ) { float nx = line - x; @@ -886,7 +888,7 @@ static unsigned char get_SDF_radial( d2 = nd2; } } - // move on + //move on idx += w; } } @@ -913,7 +915,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe String src_path = EditorImportPlugin::expand_source_path(from->get_source_path(0)); - if (src_path.extension().to_lower()=="fnt") { + if (src_path.get_extension().to_lower()=="fnt") { if (ResourceLoader::load(src_path).is_valid()) { EditorNode::get_singleton()->show_warning(TTR("Path:")+" "+src_path+"\n"+TTR("This file is already a Godot font file, please supply a BMFont type file instead.")); @@ -981,14 +983,14 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe FT_GlyphSlot slot = face->glyph; -// error = FT_Set_Charmap(face,ft_encoding_unicode ); /* encoding.. */ + //error = FT_Set_Charmap(face,ft_encoding_unicode ); /* encoding.. */ /* PRINT CHARACTERS TO INDIVIDUAL BITMAPS */ -// int space_size=5; //size for space, if none found.. 5! -// int min_valign=500; //some ridiculous number + //int space_size=5; //size for space, if none found.. 5! + //int min_valign=500; //some ridiculous number FT_ULong charcode; FT_UInt gindex; @@ -1080,10 +1082,10 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe if (font_mode==_EditorFontImportOptions::FONT_DISTANCE_FIELD) { - // oversize the holding buffer so I can smooth it! + //oversize the holding buffer so I can smooth it! int sw = w + scaler * 4; int sh = h + scaler * 4; - // do the SDF + //do the SDF int sdfw = sw / scaler; int sdfh = sh / scaler; @@ -1139,7 +1141,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe if (font_mode==_EditorFontImportOptions::FONT_DISTANCE_FIELD) { - // oversize the holding buffer so I can smooth it! + //oversize the holding buffer so I can smooth it! int sw = w + scaler * 4; int sh = h + scaler * 4; @@ -1578,7 +1580,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe //debug the texture Ref<ImageTexture> atlast = memnew( ImageTexture ); atlast->create_from_image(atlas); -// atlast->create_from_image(font_data_list[5]->blit); + //atlast->create_from_image(font_data_list[5]->blit); TextureRect *tf = memnew( TextureRect ); tf->set_texture(atlast); dialog->add_child(tf); @@ -1682,12 +1684,12 @@ Error EditorFontImportPlugin::import(const String& p_path, const Ref<ResourceImp void EditorFontImportPlugin::import_from_drop(const Vector<String>& p_drop, const String &p_dest_path) { for(int i=0;i<p_drop.size();i++) { - String ext = p_drop[i].extension().to_lower(); + String ext = p_drop[i].get_extension().to_lower(); String file = p_drop[i].get_file(); if (ext=="ttf" || ext=="otf" || ext=="fnt") { import_dialog(); - dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.basename()+".fnt")); + dialog->set_source_and_dest(p_drop[i],p_dest_path.plus_file(file.get_basename()+".fnt")); break; } } diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp index 846a551121..1cbb594a51 100644 --- a/tools/editor/io_plugins/editor_import_collada.cpp +++ b/tools/editor/io_plugins/editor_import_collada.cpp @@ -236,20 +236,22 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { return OK; //well, it's an ambient light.. Light *l = memnew( DirectionalLight ); -// l->set_color(Light::COLOR_AMBIENT,ld.color); -// l->set_color(Light::COLOR_DIFFUSE,Color(0,0,0)); -// l->set_color(Light::COLOR_SPECULAR,Color(0,0,0)); + //l->set_color(Light::COLOR_AMBIENT,ld.color); + //l->set_color(Light::COLOR_DIFFUSE,Color(0,0,0)); + //l->set_color(Light::COLOR_SPECULAR,Color(0,0,0)); node = l; } else if (ld.mode==Collada::LightData::MODE_DIRECTIONAL) { //well, it's an ambient light.. Light *l = memnew( DirectionalLight ); - //if (found_ambient) //use it here - // l->set_color(Light::COLOR_AMBIENT,ambient); + /* + if (found_ambient) //use it here + l->set_color(Light::COLOR_AMBIENT,ambient); -// l->set_color(Light::COLOR_DIFFUSE,ld.color); -// l->set_color(Light::COLOR_SPECULAR,Color(1,1,1)); + l->set_color(Light::COLOR_DIFFUSE,ld.color); + l->set_color(Light::COLOR_SPECULAR,Color(1,1,1)); + */ node = l; } else { @@ -259,14 +261,14 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { l=memnew( OmniLight ); else { l=memnew( SpotLight ); -// l->set_parameter(Light::PARAM_SPOT_ANGLE,ld.spot_angle); -// l->set_parameter(Light::PARAM_SPOT_ATTENUATION,ld.spot_exp); + //l->set_parameter(Light::PARAM_SPOT_ANGLE,ld.spot_angle); + //l->set_parameter(Light::PARAM_SPOT_ATTENUATION,ld.spot_exp); } // -// l->set_color(Light::COLOR_DIFFUSE,ld.color); -// l->set_color(Light::COLOR_SPECULAR,Color(1,1,1)); -// l->approximate_opengl_attenuation(ld.constant_att,ld.linear_att,ld.quad_att); + //l->set_color(Light::COLOR_DIFFUSE,ld.color); + //l->set_color(Light::COLOR_SPECULAR,Color(1,1,1)); + //l->approximate_opengl_attenuation(ld.constant_att,ld.linear_att,ld.quad_att); node=l; } @@ -396,13 +398,13 @@ Error ColladaImport::_create_material(const String& p_target) { material->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,texture); material->set_albedo(Color(1,1,1,1)); -// material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1,1)); + //material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1,1)); } else { missing_textures.push_back(texfile.get_file()); } } } else { -// material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,effect.diffuse.color); + //material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,effect.diffuse.color); } // SPECULAR @@ -417,15 +419,15 @@ Error ColladaImport::_create_material(const String& p_target) { material->set_texture(FixedSpatialMaterial::TEXTURE_SPECULAR,texture); material->set_specular(Color(1,1,1,1)); -// material->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,texture); -// material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,Color(1,1,1,1)); + //material->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,texture); + //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,Color(1,1,1,1)); } else { missing_textures.push_back(texfile.get_file()); } } } else { -// material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,effect.specular.color); + //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,effect.specular.color); } // EMISSION @@ -441,14 +443,14 @@ Error ColladaImport::_create_material(const String& p_target) { material->set_texture(FixedSpatialMaterial::TEXTURE_EMISSION,texture); material->set_emission(Color(1,1,1,1)); -// material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,Color(1,1,1,1)); + //material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,Color(1,1,1,1)); }else { -// missing_textures.push_back(texfile.get_file()); + //missing_textures.push_back(texfile.get_file()); } } } else { -// material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,effect.emission.color); + //material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,effect.emission.color); } // NORMAL @@ -461,18 +463,18 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { material->set_texture(FixedSpatialMaterial::TEXTURE_NORMAL,texture); -// material->set_emission(Color(1,1,1,1)); + //material->set_emission(Color(1,1,1,1)); - // material->set_texture(FixedSpatialMaterial::PARAM_NORMAL,texture); + //material->set_texture(FixedSpatialMaterial::PARAM_NORMAL,texture); }else { -// missing_textures.push_back(texfile.get_file()); + //missing_textures.push_back(texfile.get_file()); } } } -// material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,effect.shininess); + //material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,effect.shininess); if (effect.double_sided) { material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); } @@ -1171,11 +1173,13 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con narrayw = PoolVector<Vector3>::Write(); final_normal_array=narray; - //PoolVector<Vector3> altnaray; - //_generate_normals(index_array,final_vertex_array,altnaray); + /* + PoolVector<Vector3> altnaray; + _generate_normals(index_array,final_vertex_array,altnaray); - //for(int i=0;i<altnaray.size();i++) - // print_line(rtos(altnaray[i].dot(final_normal_array[i]))); + for(int i=0;i<altnaray.size();i++) + print_line(rtos(altnaray[i].dot(final_normal_array[i]))); + */ } else if (primitive==Mesh::PRIMITIVE_TRIANGLES) { //generate normals (even if unused later) @@ -1257,8 +1261,10 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con } -// if (sum<0.8) -// COLLADA_PRINT("ERROR SUMMING INDEX "+itos(k)+" had weights: "+itos(vertex_array[k].weights.size())); + /* + if (sum<0.8) + COLLADA_PRINT("ERROR SUMMING INDEX "+itos(k)+" had weights: "+itos(vertex_array[k].weights.size())); + */ } @@ -1468,7 +1474,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con #endif for(int mi=0;mi<p_morph_meshes.size();mi++) { - // print_line("want surface "+itos(mi)+" has "+itos(p_morph_meshes[mi]->get_surface_count())); + //print_line("want surface "+itos(mi)+" has "+itos(p_morph_meshes[mi]->get_surface_count())); Array a = p_morph_meshes[mi]->surface_get_arrays(surface); //add valid weight and bone arrays if they exist, TODO check if they are unique to shape (generally not) @@ -2375,9 +2381,11 @@ Node* EditorSceneImporterCollada::import_scene(const String& p_path, uint32_t p_ if (state.missing_textures.size()) { - //for(int i=0;i<state.missing_textures.size();i++) { -// EditorNode::add_io_error("Texture Not Found: "+state.missing_textures[i]); -// } + /* + for(int i=0;i<state.missing_textures.size();i++) { + EditorNode::add_io_error("Texture Not Found: "+state.missing_textures[i]); + } + */ if (r_missing_deps) { @@ -2438,7 +2446,7 @@ Ref<Animation> EditorSceneImporterCollada::import_animation(const String& p_path Ref<Animation> anim=state.animations[0]; anim=state.animations[0]; print_line("Anim Load OK"); - String base = p_path.basename().to_lower(); + String base = p_path.get_basename().to_lower(); if (p_flags&IMPORT_ANIMATION_DETECT_LOOP) { if (base.begins_with("loop") || base.ends_with("loop") || base.begins_with("cycle") || base.ends_with("cycle")) { diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp index f33693c304..fa0c36be98 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -259,7 +259,7 @@ public: imd->add_source(EditorImportPlugin::validate_source_path(meshes[i])); - String file_path = dst.plus_file(meshes[i].get_file().basename()+".msh"); + String file_path = dst.plus_file(meshes[i].get_file().get_basename()+".msh"); plugin->import(file_path,imd); } @@ -568,7 +568,7 @@ void EditorMeshImportPlugin::import_from_drop(const Vector<String>& p_drop, cons Vector<String> files; for(int i=0;i<p_drop.size();i++) { - String ext = p_drop[i].extension().to_lower(); + String ext = p_drop[i].get_extension().to_lower(); String file = p_drop[i].get_file(); if (ext=="obj") { diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp index da4e24dc84..eeb61fc443 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -296,7 +296,7 @@ public: error_dialog->popup_centered(Size2(200,100)*EDSCALE); } - dst = dst.plus_file(samples[i].get_file().basename()+".smp"); + dst = dst.plus_file(samples[i].get_file().get_basename()+".smp"); plugin->import(dst,imd); } @@ -323,7 +323,7 @@ public: ClassDB::bind_method("_import",&EditorSampleImportDialog::_import); ClassDB::bind_method("_browse",&EditorSampleImportDialog::_browse); ClassDB::bind_method("_browse_target",&EditorSampleImportDialog::_browse_target); - // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); + //ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); } EditorSampleImportDialog(EditorSampleImportPlugin *p_plugin) { @@ -373,7 +373,7 @@ public: save_select = memnew( EditorDirDialog ); add_child(save_select); - // save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR); + //save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR); save_select->connect("dir_selected", this,"_choose_save_dir"); get_ok()->connect("pressed", this,"_import"); @@ -383,7 +383,7 @@ public: error_dialog = memnew ( ConfirmationDialog ); add_child(error_dialog); error_dialog->get_ok()->set_text(TTR("Accept")); - // error_dialog->get_cancel()->hide(); + //error_dialog->get_cancel()->hide(); set_hide_on_ok(false); options = memnew( _EditorSampleImportOptions ); @@ -648,7 +648,7 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI } } -// print_line("compressing ima-adpcm, resulting buffersize is "+itos(dst_data.size())+" from "+itos(data.size())); + //print_line("compressing ima-adpcm, resulting buffersize is "+itos(dst_data.size())+" from "+itos(data.size())); } else { @@ -758,12 +758,14 @@ void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,P xm_sample=CLAMP(in[i]*32767.0,-32768,32767); - //if (xm_sample==32767 || xm_sample==-32768) - // printf("clippy!\n",xm_sample); + /* + if (xm_sample==32767 || xm_sample==-32768) + printf("clippy!\n",xm_sample); + */ } - // xm_sample=xm_sample+xm_prev; - // xm_prev=xm_sample; + //xm_sample=xm_sample+xm_prev; + //xm_prev=xm_sample; diff = (int)xm_sample - prev ; @@ -828,7 +830,7 @@ void EditorSampleImportPlugin::import_from_drop(const Vector<String>& p_drop, co Vector<String> files; for(int i=0;i<p_drop.size();i++) { - String ext = p_drop[i].extension().to_lower(); + String ext = p_drop[i].get_extension().to_lower(); if (ext=="wav") { @@ -887,7 +889,7 @@ Vector<uint8_t> EditorSampleExportPlugin::custom_export(String& p_path,const Ref - if (EditorImportExport::get_singleton()->sample_get_action()==EditorImportExport::SAMPLE_ACTION_NONE || p_path.extension().to_lower()!="wav") { + if (EditorImportExport::get_singleton()->sample_get_action()==EditorImportExport::SAMPLE_ACTION_NONE || p_path.get_extension().to_lower()!="wav") { return Vector<uint8_t>(); } @@ -911,7 +913,7 @@ Vector<uint8_t> EditorSampleExportPlugin::custom_export(String& p_path,const Ref ERR_FAIL_COND_V(err!=OK,Vector<uint8_t>()); - p_path=p_path.basename()+".converted.smp"; + p_path=p_path.get_basename()+".converted.smp"; return FileAccess::get_file_as_array(savepath); } diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index 8fd78f11f3..79c88e7407 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -377,7 +377,7 @@ void EditorImportAnimationOptions::_bind_methods() { ClassDB::bind_method("_changed",&EditorImportAnimationOptions::_changed); ClassDB::bind_method("_item_edited",&EditorImportAnimationOptions::_item_edited); ClassDB::bind_method("_button_action",&EditorImportAnimationOptions::_button_action); -// ClassDB::bind_method("_changedp",&EditorImportAnimationOptions::_changedp); + //ClassDB::bind_method("_changedp",&EditorImportAnimationOptions::_changedp); ADD_SIGNAL(MethodInfo("changed")); } @@ -390,7 +390,7 @@ void EditorImportAnimationOptions::_notification(int p_what) { flags->connect("item_edited",this,"_changed"); clips_tree->connect("item_edited",this,"_item_edited"); clips_tree->connect("button_pressed",this,"_button_action",varray(),CONNECT_DEFERRED); -// format->connect("item_selected",this,"_changedp"); + //format->connect("item_selected",this,"_changedp"); } } @@ -659,7 +659,7 @@ void EditorSceneImportDialog::_choose_file(const String& p_path) { import_path->set_text(p_path); if (root_node_name->get_text().size()==0){ - root_node_name->set_text(import_path->get_text().get_file().basename()); + root_node_name->set_text(import_path->get_text().get_file().get_basename()); } } @@ -763,7 +763,7 @@ void EditorSceneImportDialog::_import(bool p_and_open) { // Scenes should always be imported as binary format since vertex data is large and would take // up a lot of space and time to load if imported as text format (GH-5778) - String save_file = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+".scn"); + String save_file = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+".scn"); print_line("Saving to: "+save_file); @@ -794,7 +794,7 @@ void EditorSceneImportDialog::_import(bool p_and_open) { rim->set_option("root_type",root_type->get_text()); } if (root_node_name->get_text().size()==0) { - root_node_name->set_text(import_path->get_text().get_file().basename()); + root_node_name->set_text(import_path->get_text().get_file().get_basename()); } rim->set_option("root_name",root_node_name->get_text()); @@ -1237,7 +1237,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce error_dialog = memnew ( ConfirmationDialog ); add_child(error_dialog); error_dialog->get_ok()->set_text(TTR("Accept")); -// error_dialog->get_cancel()->hide(); + //error_dialog->get_cancel()->hide(); HBoxContainer *custom_root_hb = memnew( HBoxContainer ); @@ -1302,7 +1302,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce add_child(confirm_import); VBoxContainer *cvb = memnew( VBoxContainer ); confirm_import->add_child(cvb); -// confirm_import->set_child_rect(cvb); + //confirm_import->set_child_rect(cvb); PanelContainer *pc = memnew( PanelContainer ); pc->add_style_override("panel",get_stylebox("normal","TextEdit")); @@ -1421,9 +1421,11 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag if (tex.is_valid()) { image_map.insert(tex,TEXTURE_ROLE_NORMALMAP); - //if (p_flags&SCENE_FLAG_CONVERT_NORMALMAPS_TO_XY) - // res->cast_to<FixedSpatialMaterial>()->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_XY_NORMALMAP,true); - }// + /* + if (p_flags&SCENE_FLAG_CONVERT_NORMALMAPS_TO_XY) + res->cast_to<FixedSpatialMaterial>()->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_XY_NORMALMAP,true); + */ + } } else { @@ -1531,10 +1533,10 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); if (fm.is_valid()) { - // fm->set_flag(Material::FLAG_UNSHADED,true); - // fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); - // fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - // fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + //fm->set_flag(Material::FLAG_UNSHADED,true); + //fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); + //fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); + //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); } } } @@ -1558,8 +1560,8 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> if (p_flags&SCENE_FLAG_DETECT_ALPHA && _teststr(mat->get_name(),"alpha")) { - // mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); - // mat->set_name(_fixstr(mat->get_name(),"alpha")); + //mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + //mat->set_name(_fixstr(mat->get_name(),"alpha")); } if (p_flags&SCENE_FLAG_DETECT_VCOLOR && _teststr(mat->get_name(),"vcol")) { @@ -1640,10 +1642,10 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); if (fm.is_valid()) { - // fm->set_flag(Material::FLAG_UNSHADED,true); - // fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); - // fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - // fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + //fm->set_flag(Material::FLAG_UNSHADED,true); + //fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); + //fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); + //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); } } } @@ -2124,7 +2126,7 @@ Error EditorSceneImportPlugin::import1(const Ref<ResourceImportMetadata>& p_from String src_path=EditorImportPlugin::expand_source_path(from->get_source_path(0)); Ref<EditorSceneImporter> importer; - String ext=src_path.extension().to_lower(); + String ext=src_path.get_extension().to_lower(); EditorProgress progress("import",TTR("Import Scene"),104); @@ -2172,8 +2174,10 @@ Error EditorSceneImportPlugin::import1(const Ref<ResourceImportMetadata>& p_from import_flags|=EditorSceneImporter::IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS; if (scene_flags&SCENE_FLAG_IMPORT_ANIMATIONS) import_flags|=EditorSceneImporter::IMPORT_ANIMATION; - //if (scene_flags&SCENE_FLAG_FAIL_ON_MISSING_IMAGES) - // import_flags|=EditorSceneImporter::IMPORT_FAIL_ON_MISSING_DEPENDENCIES; + /* + if (scene_flags&SCENE_FLAG_FAIL_ON_MISSING_IMAGES) + import_flags|=EditorSceneImporter::IMPORT_FAIL_ON_MISSING_DEPENDENCIES; + */ if (scene_flags&SCENE_FLAG_GENERATE_TANGENT_ARRAYS) import_flags|=EditorSceneImporter::IMPORT_GENERATE_TANGENT_ARRAYS; @@ -2821,7 +2825,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c { - target_path=target_path.basename()+".tex"; + target_path=target_path.get_basename()+".tex"; Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata ); @@ -2936,7 +2940,7 @@ void EditorSceneImportPlugin::import_from_drop(const Vector<String>& p_drop,cons //bool warn_compatible=false; for(int i=0;i<p_drop.size();i++) { - String extension = p_drop[i].extension().to_lower(); + String extension = p_drop[i].get_extension().to_lower(); for(List<String>::Element *E=extensions.front();E;E=E->next()) { diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index 3bf2551778..5ba7d0c417 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -344,7 +344,7 @@ void EditorTextureImportDialog::_choose_save_dir(const String& p_path) { void EditorTextureImportDialog::_import() { -// ImportMonitorBlock imb; + //ImportMonitorBlock imb; Vector<String> files=import_path->get_text().split(","); @@ -448,7 +448,7 @@ void EditorTextureImportDialog::_import() { for(int i=0;i<files.size();i++) { String dst_file = dst_path.plus_file(files[i].get_file()); - dst_file=dst_file.basename()+".tex"; + dst_file=dst_file.get_basename()+".tex"; Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata ); //imd->set_editor(); imd->add_source(EditorImportPlugin::validate_source_path(files[i])); @@ -539,7 +539,7 @@ void EditorTextureImportDialog::_notification(int p_what) { List<String> extensions; ImageLoader::get_recognized_extensions(&extensions); - // ResourceLoader::get_recognized_extensions_for_type("PackedTexture",&extensions); + //ResourceLoader::get_recognized_extensions_for_type("PackedTexture",&extensions); file_select->clear_filters(); for(int i=0;i<extensions.size();i++) { @@ -643,7 +643,7 @@ void EditorTextureImportDialog::_bind_methods() { ClassDB::bind_method("_browse",&EditorTextureImportDialog::_browse); ClassDB::bind_method("_browse_target",&EditorTextureImportDialog::_browse_target); ClassDB::bind_method("_mode_changed",&EditorTextureImportDialog::_mode_changed); -// ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); + //ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); } EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin* p_plugin) { @@ -760,20 +760,22 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin* save_select = memnew( EditorDirDialog ); add_child(save_select); -// save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR); + //save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR); save_select->connect("dir_selected", this,"_choose_save_dir"); get_ok()->connect("pressed", this,"_import"); get_ok()->set_text(TTR("Import")); //move stuff up - //for(int i=0;i<4;i++) - // vbc->move_child( vbc->get_child( vbc->get_child_count() -1), 0); + /* + for(int i=0;i<4;i++) + vbc->move_child( vbc->get_child( vbc->get_child_count() -1), 0); + */ error_dialog = memnew ( ConfirmationDialog ); add_child(error_dialog); error_dialog->get_ok()->set_text(TTR("Accept")); -// error_dialog->get_cancel()->hide(); + //error_dialog->get_cancel()->hide(); set_hide_on_ok(false); @@ -784,8 +786,8 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin* _mode_changed(EditorTextureImportPlugin::MODE_TEXTURE_3D); -// GLOBAL_DEF("import/shared_textures","res://"); -// Globals::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR)); + //GLOBAL_DEF("import/shared_textures","res://"); + //Globals::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR)); } @@ -944,10 +946,12 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur image.normalmap_to_xy(); } - //if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + /* + if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { - // image.srgb_to_linear(); - //} + image.srgb_to_linear(); + } + */ if (shrink>1) { @@ -1003,11 +1007,13 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur image.normalmap_to_xy(); } - //if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { -// - // print_line("CONVERT BECAUSE: "+itos(flags)); - // image.srgb_to_linear(); - //} + /* + if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + + print_line("CONVERT BECAUSE: "+itos(flags)); + image.srgb_to_linear(); + } + */ int orig_w=image.get_width(); int orig_h=image.get_height(); @@ -1307,9 +1313,9 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc String spath = from->get_source_path(E->get()).get_file(); if (p_external) { - apath = p_path.get_base_dir().plus_file(spath.basename()+"."+from->get_source_path(E->get()).md5_text()+".atex"); + apath = p_path.get_base_dir().plus_file(spath.get_basename()+"."+from->get_source_path(E->get()).md5_text()+".atex"); } else { - apath = p_path.get_base_dir().plus_file(spath.basename()+".atex"); + apath = p_path.get_base_dir().plus_file(spath.get_basename()+".atex"); } Ref<AtlasTexture> at; @@ -1425,10 +1431,12 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc image.normalmap_to_xy(); } - //if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + /* + if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { - // image.srgb_to_linear(); - //} + image.srgb_to_linear(); + } + */ if (shrink>1) { @@ -1484,11 +1492,13 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc image.normalmap_to_xy(); } - //if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { -// - // print_line("CONVERT BECAUSE: "+itos(flags)); - // image.srgb_to_linear(); - //} + /* + if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + + print_line("CONVERT BECAUSE: "+itos(flags)); + image.srgb_to_linear(); + } + */ int orig_w=image.get_width(); int orig_h=image.get_height(); @@ -1597,7 +1607,7 @@ Vector<uint8_t> EditorTextureImportPlugin::custom_export(const String& p_path, c rimd->set_option("shrink",group_shrink); rimd->add_source(validated_path,FileAccess::get_md5(p_path)); - } else if (EditorImportExport::get_singleton()->get_image_formats().has(p_path.extension().to_lower()) && EditorImportExport::get_singleton()->get_export_image_action()!=EditorImportExport::IMAGE_ACTION_NONE) { + } else if (EditorImportExport::get_singleton()->get_image_formats().has(p_path.get_extension().to_lower()) && EditorImportExport::get_singleton()->get_export_image_action()!=EditorImportExport::IMAGE_ACTION_NONE) { //handled by general image export settings rimd = Ref<ResourceImportMetadata>( memnew( ResourceImportMetadata ) ); @@ -1743,7 +1753,7 @@ void EditorTextureImportPlugin::import_from_drop(const Vector<String>& p_drop,co ImageLoader::get_recognized_extensions(&valid_extensions); for(int i=0;i<p_drop.size();i++) { - String extension=p_drop[i].extension().to_lower(); + String extension=p_drop[i].get_extension().to_lower(); for (List<String>::Element *E=valid_extensions.front();E;E=E->next()) { @@ -1851,21 +1861,21 @@ EditorTextureImportPlugin::EditorTextureImportPlugin(EditorNode *p_editor) { if (pl.is_valid()) { Vector<uint8_t> ce = pl->custom_export(p_path,p_platform); if (ce.size()) { - p_path=p_path.basename()+".converted.tex"; + p_path=p_path.get_basename()+".converted.tex"; return ce; } } } else if (EditorImportExport::get_singleton()->get_export_image_action()!=EditorImportExport::IMAGE_ACTION_NONE){ - String xt = p_path.extension().to_lower(); + String xt = p_path.get_extension().to_lower(); if (EditorImportExport::get_singleton()->get_image_formats().has(xt)) { //should check for more I guess? Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture"); if (pl.is_valid()) { Vector<uint8_t> ce = pl->custom_export(p_path,p_platform); if (ce.size()) { - p_path=p_path.basename()+".converted.tex"; + p_path=p_path.get_basename()+".converted.tex"; return ce; } } diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/tools/editor/io_plugins/editor_translation_import_plugin.cpp index 73d9e989ac..d9288f5990 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -255,7 +255,7 @@ public: imd->set_option("skip_first",ignore_first->is_pressed()); imd->set_option("compress",compress->is_pressed()); - String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+"."+locale+".xl"); + String savefile = save_path->get_text().plus_file(import_path->get_text().get_file().get_basename()+"."+locale+".xl"); Error err = plugin->import(savefile,imd); if (err!=OK) { error_dialog->set_text(TTR("Couldn't import!")); @@ -287,7 +287,7 @@ public: ClassDB::bind_method("_import",&EditorTranslationImportDialog::_import); ClassDB::bind_method("_browse",&EditorTranslationImportDialog::_browse); ClassDB::bind_method("_browse_target",&EditorTranslationImportDialog::_browse_target); - // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); + //ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); } EditorTranslationImportDialog(EditorTranslationImportPlugin *p_plugin) { @@ -356,7 +356,7 @@ public: save_select = memnew( EditorDirDialog ); add_child(save_select); - // save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR); + //save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR); save_select->connect("dir_selected", this,"_choose_save_dir"); get_ok()->connect("pressed", this,"_import"); @@ -366,7 +366,7 @@ public: error_dialog = memnew ( ConfirmationDialog ); add_child(error_dialog); error_dialog->get_ok()->set_text(TTR("Accept")); - // error_dialog->get_cancel()->hide(); + //error_dialog->get_cancel()->hide(); set_hide_on_ok(false); @@ -400,7 +400,7 @@ void EditorTranslationImportPlugin::import_from_drop(const Vector<String>& p_dro for(int i=0;i<p_drop.size();i++) { - String ext = p_drop[i].extension().to_lower(); + String ext = p_drop[i].get_extension().to_lower(); if (ext=="csv") { diff --git a/tools/editor/output_strings.cpp b/tools/editor/output_strings.cpp index 9ba97451c0..cb43bb9230 100644 --- a/tools/editor/output_strings.cpp +++ b/tools/editor/output_strings.cpp @@ -82,7 +82,7 @@ void OutputStrings::_notification(int p_what) { Ref<Texture> icon_error = get_icon("Error","EditorIcons"); Ref<Texture> icon_warning = get_icon("Warning","EditorIcons"); - // int lines = (size_height-(int)margin.y) / font_height; + //int lines = (size_height-(int)margin.y) / font_height; Point2 ofs=tree_st->get_offset(); LineMap::Element *E = line_map.find(v_scroll->get_value()); diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 9850298c67..59ab3bc467 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -94,7 +94,7 @@ void AnimationPlayerEditor::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { -// editor->connect("hide_animation_player_editors",this,"_hide_anim_editors"); + //editor->connect("hide_animation_player_editors",this,"_hide_anim_editors"); add_anim->set_icon( get_icon("New","EditorIcons") ); rename_anim->set_icon( get_icon("Rename","EditorIcons") ); duplicate_anim->set_icon( get_icon("Duplicate","EditorIcons") ); @@ -377,8 +377,10 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource>& p_resou int flg = 0; if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) flg |= ResourceSaver::FLAG_COMPRESS; - //if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) - // flg |= ResourceSaver::FLAG_RELATIVE_PATHS; + /* + if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) + flg |= ResourceSaver::FLAG_RELATIVE_PATHS; + */ String path = GlobalConfig::get_singleton()->localize_path(p_path); Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); @@ -388,7 +390,7 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource>& p_resou accept->popup_centered_minsize(); return; } - // EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type()); + //EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type()); ((Resource*)p_resource.ptr())->set_path(path); editor->emit_signal("resource_saved", p_resource); @@ -421,7 +423,7 @@ void AnimationPlayerEditor::_animation_save_as(const Ref<Resource>& p_resource) if (p_resource->get_path() != "") { file->set_current_path(p_resource->get_path()); if (extensions.size()) { - String ext = p_resource->get_path().extension().to_lower(); + String ext = p_resource->get_path().get_extension().to_lower(); if (extensions.find(ext) == NULL) { file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.front()->get())); } @@ -672,7 +674,7 @@ void AnimationPlayerEditor::set_state(const Dictionary& p_state) { show(); set_process(true); ensure_visibility(); -// EditorNode::get_singleton()->animation_panel_make_visible(true); + //EditorNode::get_singleton()->animation_panel_make_visible(true); if (p_state.has("animation")) { String anim = p_state["animation"]; @@ -768,7 +770,7 @@ void AnimationPlayerEditor::_dialog_action(String p_file) { void AnimationPlayerEditor::_scale_changed(const String& p_scale) { - player->set_speed(p_scale.to_double()); + player->set_speed_scale(p_scale.to_double()); } void AnimationPlayerEditor::_update_animation() { @@ -790,7 +792,7 @@ void AnimationPlayerEditor::_update_animation() { stop->set_pressed(true); } - scale->set_text( String::num(player->get_speed(),2) ); + scale->set_text( String::num(player->get_speed_scale(),2) ); String current=player->get_current_animation(); for (int i=0;i<animation->get_item_count();i++) { @@ -897,7 +899,7 @@ void AnimationPlayerEditor::edit(AnimationPlayer *p_player) { } else { key_editor->show_select_node_warning(true); -// hide(); + //hide(); } @@ -1128,7 +1130,7 @@ void AnimationPlayerEditor::_hide_anim_editors() { key_editor->set_animation(Ref<Animation>()); key_editor->set_root(NULL); key_editor->show_select_node_warning(true); -// editor->animation_editor_make_visible(false); + //editor->animation_editor_make_visible(false); } @@ -1267,7 +1269,7 @@ void AnimationPlayerEditor::_bind_methods() { ClassDB::bind_method(_MD("_seek_value_changed"),&AnimationPlayerEditor::_seek_value_changed,DEFVAL(true)); ClassDB::bind_method(_MD("_animation_player_changed"),&AnimationPlayerEditor::_animation_player_changed); ClassDB::bind_method(_MD("_blend_edited"),&AnimationPlayerEditor::_blend_edited); -// ClassDB::bind_method(_MD("_seek_frame_changed"),&AnimationPlayerEditor::_seek_frame_changed); + //ClassDB::bind_method(_MD("_seek_frame_changed"),&AnimationPlayerEditor::_seek_frame_changed); ClassDB::bind_method(_MD("_scale_changed"),&AnimationPlayerEditor::_scale_changed); //ClassDB::bind_method(_MD("_editor_store_all"),&AnimationPlayerEditor::_editor_store_all); ///jectTypeDB::bind_method(_MD("_editor_load_all"),&AnimationPlayerEditor::_editor_load_all); @@ -1552,11 +1554,11 @@ void AnimationPlayerEditorPlugin::make_visible(bool p_visible) { editor->make_bottom_panel_item_visible(anim_editor); anim_editor->set_process(true); anim_editor->ensure_visibility(); -// editor->animation_panel_make_visible(true); + //editor->animation_panel_make_visible(true); } else { -// anim_editor->hide(); -// anim_editor->set_idle_process(false); + //anim_editor->hide(); + //anim_editor->set_idle_process(false); } } diff --git a/tools/editor/plugins/animation_player_editor_plugin.h b/tools/editor/plugins/animation_player_editor_plugin.h index 9074eb127b..840c39ba49 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.h +++ b/tools/editor/plugins/animation_player_editor_plugin.h @@ -73,7 +73,7 @@ class AnimationPlayerEditor : public VBoxContainer { Button *play_bw; Button *play_bw_from; -// Button *pause; + //Button *pause; Button *add_anim; Button *autoplay; Button *rename_anim; diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp index 5a5660ae50..eedebab1c9 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.cpp +++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp @@ -621,9 +621,9 @@ void AnimationTreeEditor::_draw_node(const StringName& p_node) { #if 0 void AnimationTreeEditor::_node_param_changed() { -// anim_tree->node_set_param( click_node,property_editor->get_variant() ); -// update(); -// _write_anim_tree_graph(); + //anim_tree->node_set_param( click_node,property_editor->get_variant() ); + //update(); + //_write_anim_tree_graph(); } #endif @@ -792,7 +792,7 @@ void AnimationTreeEditor::_gui_input(InputEvent p_event) { renaming_edit=false; _popup_edit_dialog(); //open editor - // _node_edit_property(click_node); + //_node_edit_property(click_node); } break; default:{} } @@ -856,12 +856,12 @@ void AnimationTreeEditor::_gui_input(InputEvent p_event) { if (dst_click_type==CLICK_INPUT_SLOT && click_type==CLICK_OUTPUT_SLOT) { - anim_tree->connect(click_node,id,slot); + anim_tree->connect_nodes(click_node,id,slot); } if (click_type==CLICK_INPUT_SLOT && dst_click_type==CLICK_OUTPUT_SLOT) { - anim_tree->connect(id,click_node,click_slot); + anim_tree->connect_nodes(id,click_node,click_slot); } } break; @@ -1057,7 +1057,7 @@ void AnimationTreeEditor::_node_menu_item(int p_item) { if (rclick_type==CLICK_INPUT_SLOT) { - anim_tree->disconnect(rclick_node,rclick_slot); + anim_tree->disconnect_nodes(rclick_node,rclick_slot); update(); } @@ -1072,7 +1072,7 @@ void AnimationTreeEditor::_node_menu_item(int p_item) { const AnimationTreePlayer::Connection &c=E->get(); if( c.dst_node==rclick_node) { - anim_tree->disconnect(c.dst_node,c.dst_input); + anim_tree->disconnect_nodes(c.dst_node,c.dst_input); } } update(); @@ -1325,7 +1325,7 @@ void AnimationTreeEditor::_bind_methods() { ClassDB::bind_method( "_add_menu_item", &AnimationTreeEditor::_add_menu_item ); ClassDB::bind_method( "_node_menu_item", &AnimationTreeEditor::_node_menu_item ); ClassDB::bind_method( "_gui_input", &AnimationTreeEditor::_gui_input ); -// ClassDB::bind_method( "_node_param_changed", &AnimationTreeEditor::_node_param_changed ); + //ClassDB::bind_method( "_node_param_changed", &AnimationTreeEditor::_node_param_changed ); ClassDB::bind_method( "_scroll_moved", &AnimationTreeEditor::_scroll_moved ); ClassDB::bind_method( "_edit_dialog_changeds", &AnimationTreeEditor::_edit_dialog_changeds ); ClassDB::bind_method( "_edit_dialog_changede", &AnimationTreeEditor::_edit_dialog_changede ); @@ -1414,8 +1414,8 @@ AnimationTreeEditor::AnimationTreeEditor() { updating_edit=false; edit_dialog = memnew( PopupPanel ); -// edit_dialog->get_ok()->hide(); -// edit_dialog->get_cancel()->hide(); + //edit_dialog->get_ok()->hide(); + //edit_dialog->get_cancel()->hide(); add_child(edit_dialog); edit_option = memnew( OptionButton ); @@ -1502,8 +1502,8 @@ bool AnimationTreeEditorPlugin::handles(Object *p_object) const { void AnimationTreeEditorPlugin::make_visible(bool p_visible) { if (p_visible) { -// editor->hide_animation_player_editors(); -// editor->animation_panel_make_visible(true); + //editor->hide_animation_player_editors(); + //editor->animation_panel_make_visible(true); button->show(); editor->make_bottom_panel_item_visible(anim_tree_editor); anim_tree_editor->set_fixed_process(true); diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp index 2d91524ef9..0b12d080e4 100644 --- a/tools/editor/plugins/baked_light_baker.cpp +++ b/tools/editor/plugins/baked_light_baker.cpp @@ -1006,8 +1006,10 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c Triangle *triangle=NULL; - //for(int i=0;i<max_depth;i++) - // stack[i]=0; + /* + for(int i=0;i<max_depth;i++) + stack[i]=0; + */ int level=0; //AABB ray_aabb; @@ -1059,7 +1061,7 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c bool valid = b.aabb.smits_intersect_ray(p_begin,n,0,len); //bool valid = b.aabb.intersects_segment(p_begin,p_end); - // bool valid = b.aabb.intersects(ray_aabb); + //bool valid = b.aabb.intersects(ray_aabb); if (!valid) { @@ -1234,7 +1236,7 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c } //specular later -// _plot_light_point(r_point,octree,octree_aabb,p_light); + //_plot_light_point(r_point,octree,octree_aabb,p_light); Color plot_light=res_light.linear_interpolate(diffuse_at_point,tint); @@ -1678,7 +1680,7 @@ void BakedLightBaker::throw_rays(ThreadStack& thread_stack,int p_amount) { dl.rays_thrown++; baked_light_baker_add_64i(&total_rays,1); _throw_ray(thread_stack,dl.bake_direct,from,to,dl.radius,col,dl.attenuation_table.ptr(),0,dl.radius,max_bounces,true); -// _throw_ray(i,from,to,dl.radius,col,NULL,0,dl.radius,max_bounces,true); + //_throw_ray(i,from,to,dl.radius,col,NULL,0,dl.radius,max_bounces,true); } } break; @@ -1710,7 +1712,7 @@ void BakedLightBaker::throw_rays(ThreadStack& thread_stack,int p_amount) { dl.rays_thrown++; baked_light_baker_add_64i(&total_rays,1); _throw_ray(thread_stack,dl.bake_direct,from,to,dl.radius,col,dl.attenuation_table.ptr(),0,dl.radius,max_bounces,true); - // _throw_ray(i,from,to,dl.radius,col,NULL,0,dl.radius,max_bounces,true); + //_throw_ray(i,from,to,dl.radius,col,NULL,0,dl.radius,max_bounces,true); } } break; @@ -2010,8 +2012,10 @@ void BakedLightBaker::update_octree_images(PoolVector<uint8_t> &p_octree,PoolVec //write colors for(int j=0;j<8;j++) { - //if (!oct.children[j]) - // continue; + /* + if (!oct.children[j]) + continue; + */ uint8_t *iptr=&lptr[ofs+lchild_offsets[j]]; float r=oct.light_accum[j][0]*norm; @@ -2291,7 +2295,7 @@ void BakedLightBaker::_plot_pixel_to_lightmap(int x, int y, int width, int heigh bool valid = b.aabb.smits_intersect_ray(from,n,0,len); //bool valid = b.aabb.intersects_segment(p_begin,p_end); - // bool valid = b.aabb.intersects(ray_aabb); + //bool valid = b.aabb.intersects(ray_aabb); if (!valid) { @@ -2649,10 +2653,13 @@ void BakedLightBaker::clear() { /* * ??? for(int i=0;i<octant_pool.size();i++) { - //if (octant_pool[i].leaf) { - // memdelete_arr( octant_pool[i].light ); - //} Vector<double> norm_arr; - //norm_arr.resize(lights.size()); + /* + if (octant_pool[i].leaf) { + memdelete_arr( octant_pool[i].light ); + } + Vector<double> norm_arr; + norm_arr.resize(lights.size()); + */ for(int i=0;i<lights.size();i++) { norm_arr[i] = 1.0/get_normalization(i); diff --git a/tools/editor/plugins/baked_light_baker.h b/tools/editor/plugins/baked_light_baker.h index 6fcf78dd0a..89788338d9 100644 --- a/tools/editor/plugins/baked_light_baker.h +++ b/tools/editor/plugins/baked_light_baker.h @@ -45,10 +45,11 @@ public: OCTANT_POOL_CHUNK=1000000 }; - //struct OctantLight { - - // double accum[8][3]; - //}; + /* + struct OctantLight { + double accum[8][3]; + }; + */ struct Octant { bool leaf; diff --git a/tools/editor/plugins/baked_light_editor_plugin.cpp b/tools/editor/plugins/baked_light_editor_plugin.cpp index 8f564a3247..26c3144188 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.cpp +++ b/tools/editor/plugins/baked_light_editor_plugin.cpp @@ -105,8 +105,10 @@ void BakedLightEditor::_notification(int p_option) { colors[i].b=oct->light_accum[i][2]/norm; float lum = colors[i].get_v(); - //if (lum<0.05) - // color.a=0; + /* + if (lum<0.05) + color.a=0; + */ if (lum>max_lum) max_lum=lum; @@ -141,7 +143,7 @@ void BakedLightEditor::_notification(int p_option) { baker->update_octree_images(octree_texture,light_texture); baker->update_octree_sampler(octree_sampler); - // print_line("sampler size: "+itos(octree_sampler.size()*4)); + //print_line("sampler size: "+itos(octree_sampler.size()*4)); #if 1 //debug diff --git a/tools/editor/plugins/camera_editor_plugin.cpp b/tools/editor/plugins/camera_editor_plugin.cpp index 67f776ba0b..1c8c392d65 100644 --- a/tools/editor/plugins/camera_editor_plugin.cpp +++ b/tools/editor/plugins/camera_editor_plugin.cpp @@ -114,10 +114,8 @@ bool CameraEditorPlugin::handles(Object *p_object) const { void CameraEditorPlugin::make_visible(bool p_visible) { if (p_visible) { -// SpatialEditor::get_singleton()->set_can_preview(p_object->cast_to<Camera>()); - + //SpatialEditor::get_singleton()->set_can_preview(p_object->cast_to<Camera>()); } else { - SpatialEditor::get_singleton()->set_can_preview(NULL); } diff --git a/tools/editor/plugins/camera_editor_plugin.h b/tools/editor/plugins/camera_editor_plugin.h index 56702f174b..7e79d0ec74 100644 --- a/tools/editor/plugins/camera_editor_plugin.h +++ b/tools/editor/plugins/camera_editor_plugin.h @@ -60,7 +60,7 @@ class CameraEditorPlugin : public EditorPlugin { GDCLASS( CameraEditorPlugin, EditorPlugin ); -// CameraEditor *camera_editor; + //CameraEditor *camera_editor; EditorNode *editor; public: diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index c161e3cfa1..66dd98590d 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -41,7 +41,7 @@ #include "os/input.h" #include "tools/editor/editor_settings.h" #include "scene/gui/grid_container.h" -#include "scene/gui/patch_9_frame.h" +#include "scene/gui/patch_9_rect.h" #include "tools/editor/animation_editor.h" #include "tools/editor/plugins/animation_player_editor_plugin.h" #include "tools/editor/script_editor_debugger.h" @@ -79,7 +79,7 @@ public: container = memnew( VBoxContainer ); add_child(container); - // set_child_rect(container); + //set_child_rect(container); child_container = memnew( GridContainer ); child_container->set_columns(3); @@ -287,7 +287,7 @@ Dictionary CanvasItemEditor::get_state() const { Dictionary state; state["zoom"]=zoom; state["ofs"]=Point2(h_scroll->get_value(),v_scroll->get_value()); -// state["ofs"]=-transform.get_origin(); + //state["ofs"]=-transform.get_origin(); state["snap_offset"]=snap_offset; state["snap_step"]=snap_step; state["snap_rotation_offset"]=snap_rotation_offset; @@ -1187,8 +1187,10 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent& p_event) { } return; } - //if (!canvas_items.size()) - // return; + /* + if (!canvas_items.size()) + return; + */ if (b.button_index==BUTTON_LEFT && tool==TOOL_LIST_SELECT) { if (b.pressed) @@ -1417,7 +1419,7 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent& p_event) { Transform2D xform = transform * canvas_item->get_global_transform_with_canvas(); Rect2 rect=canvas_item->get_item_rect(); - // float handle_radius = handle_len * 1.4144; //magic number, guess what it means! + //float handle_radius = handle_len * 1.4144; //magic number, guess what it means! if (tool==TOOL_SELECT) { drag = _find_drag_type(xform,rect,click,drag_point_from); @@ -1652,7 +1654,7 @@ void CanvasItemEditor::_viewport_gui_input(const InputEvent& p_event) { Vector2 minsize = canvas_item->edit_get_minimum_size(); if (uniform) { - float aspect = local_rect.size.get_aspect(); + float aspect = local_rect.size.aspect(); switch(drag) { case DRAG_BOTTOM_LEFT: case DRAG_TOP_RIGHT: { @@ -2342,7 +2344,7 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, cons for (int i=p_node->get_child_count()-1;i>=0;i--) { -// CanvasItem *r=NULL; + //CanvasItem *r=NULL; if (c && !c->is_set_as_toplevel()) _find_canvas_items_span(p_node->get_child(i),r_rect,p_xform * c->get_transform()); @@ -2473,14 +2475,14 @@ void CanvasItemEditor::_update_scrollbars() { ofs.x=h_scroll->get_value(); } -// transform=Matrix32(); + //transform=Matrix32(); transform.elements[2]=-ofs*zoom; editor->get_scene_root()->set_global_canvas_transform(transform); updating_scroll=false; -// transform.scale_basis(Vector2(zoom,zoom)); + //transform.scale_basis(Vector2(zoom,zoom)); } @@ -2495,7 +2497,7 @@ void CanvasItemEditor::_update_scroll(float) { ofs.x=h_scroll->get_value(); ofs.y=v_scroll->get_value(); -// current_window->set_scroll(-ofs); + //current_window->set_scroll(-ofs); transform=Transform2D(); @@ -3004,8 +3006,10 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (key_pos) ctrl->set_pos(Point2()); - //if (key_scale) - // AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size()); + /* + if (key_scale) + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size()); + */ } } @@ -3615,14 +3619,14 @@ void CanvasItemEditorPlugin::make_visible(bool p_visible) { if (p_visible) { canvas_item_editor->show(); canvas_item_editor->set_fixed_process(true); - VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport(),false); + VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(),false); canvas_item_editor->viewport->grab_focus(); } else { canvas_item_editor->hide(); canvas_item_editor->set_fixed_process(false); - VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport(),true); + VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(),true); } } @@ -3734,7 +3738,7 @@ bool CanvasItemEditorViewport::_cyclical_dependency_exists(const String& p_targe } void CanvasItemEditorViewport::_create_nodes(Node* parent, Node* child, String& path, const Point2& p_point) { - child->set_name(path.get_file().basename()); + child->set_name(path.get_file().get_basename()); Ref<ImageTexture> texture=Ref<ImageTexture> ( ResourceCache::get(path)->cast_to<ImageTexture>() ); Size2 texture_size = texture->get_size(); @@ -3767,7 +3771,7 @@ void CanvasItemEditorViewport::_create_nodes(Node* parent, Node* child, String& editor_data->get_undo_redo().add_do_property(child,property,texture); // make visible for certain node type - if (default_type=="Patch9Frame") { + if (default_type=="Patch9Rect") { editor_data->get_undo_redo().add_do_property(child,"rect/size",texture_size); } else if (default_type=="Polygon2D") { PoolVector<Vector2> list; @@ -3785,7 +3789,7 @@ void CanvasItemEditorViewport::_create_nodes(Node* parent, Node* child, String& } Transform2D trans=canvas->get_canvas_transform(); Point2 target_pos = (p_point-trans.get_origin())/trans.get_scale().x-pos; - if (default_type=="Polygon2D" || default_type=="TouchScreenButton" || default_type=="TextureRect" || default_type=="Patch9Frame") { + if (default_type=="Polygon2D" || default_type=="TouchScreenButton" || default_type=="TextureRect" || default_type=="Patch9Rect") { target_pos -= texture_size/2; } editor_data->get_undo_redo().add_do_method(child,"set_pos",target_pos); @@ -3857,8 +3861,8 @@ void CanvasItemEditorViewport::_perform_drop_data(){ else if (default_type=="Particles2D") child=memnew(Particles2D); else if (default_type=="Polygon2D") child=memnew(Polygon2D); else if (default_type=="TouchScreenButton") child=memnew(TouchScreenButton); - else if (default_type=="TextureRect") child=memnew(TextureRect); - else if (default_type=="Patch9Frame") child=memnew(NinePatchRect); + else if (default_type=="TextureRect") child=memnew(TextureRect); + else if (default_type=="Patch9Rect") child=memnew(NinePatchRect); else child=memnew(Sprite); // default _create_nodes(target_node, child, path, drop_pos); @@ -3875,7 +3879,7 @@ void CanvasItemEditorViewport::_perform_drop_data(){ if (error_files.size()>0) { String files_str; for (int i=0;i<error_files.size();i++) { - files_str += error_files[i].get_file().basename() + ","; + files_str += error_files[i].get_file().get_basename() + ","; } files_str=files_str.substr(0,files_str.length()-1); accept->get_ok()->set_text(TTR("Ugh")); @@ -3993,7 +3997,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte types.push_back("TouchScreenButton"); // Control types.push_back("TextureRect"); - types.push_back("Patch9Frame"); + types.push_back("Patch9Rect"); target_node=NULL; editor=p_node; diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp index da5c07221e..563b8298eb 100644 --- a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp +++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp @@ -203,7 +203,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, it->create_from_image(img); p_library->set_item_preview(id,it); -// print_line("loaded image, size: "+rtos(m)+" dist: "+rtos(dist)+" empty?"+itos(img.empty())+" w: "+itos(it->get_width())+" h: "+itos(it->get_height())); + //print_line("loaded image, size: "+rtos(m)+" dist: "+rtos(dist)+" empty?"+itos(img.empty())+" w: "+itos(it->get_width())+" h: "+itos(it->get_height())); VS::get_singleton()->free(inst); } diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp index 9dcfc2fa94..478fa2308d 100644 --- a/tools/editor/plugins/editor_preview_plugins.cpp +++ b/tools/editor/plugins/editor_preview_plugins.cpp @@ -248,7 +248,7 @@ Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES& p_from) { VS::get_singleton()->viewport_queue_screen_capture(viewport); VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RENDER_TARGET_UPDATE_ONCE); //once used for capture -// print_line("queue capture!"); + //print_line("queue capture!"); Image img; int timeout=1000; @@ -825,7 +825,7 @@ Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) { VS::get_singleton()->viewport_queue_screen_capture(viewport); VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RENDER_TARGET_UPDATE_ONCE); //once used for capture -// print_line("queue capture!"); + //print_line("queue capture!"); Image img; int timeout=1000; @@ -867,7 +867,7 @@ EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() { camera = VS::get_singleton()->camera_create(); VS::get_singleton()->viewport_attach_camera(viewport,camera); VS::get_singleton()->camera_set_transform(camera,Transform(Matrix3(),Vector3(0,0,3))); -// VS::get_singleton()->camera_set_perspective(camera,45,0.1,10); + //VS::get_singleton()->camera_set_perspective(camera,45,0.1,10); VS::get_singleton()->camera_set_orthogonal(camera,1.0,0.01,1000.0); light = VS::get_singleton()->light_create(VS::LIGHT_DIRECTIONAL); @@ -881,7 +881,7 @@ EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() { VS::get_singleton()->instance_set_transform(light_instance2,Transform().looking_at(Vector3(0,1,0),Vector3(0,0,1))); -// sphere = VS::get_singleton()->mesh_create(); + //sphere = VS::get_singleton()->mesh_create(); mesh_instance = VS::get_singleton()->instance_create(); VS::get_singleton()->instance_set_scenario(mesh_instance,scenario); diff --git a/tools/editor/plugins/material_editor_plugin.cpp b/tools/editor/plugins/material_editor_plugin.cpp index d5ddd3804b..e9bcf063fd 100644 --- a/tools/editor/plugins/material_editor_plugin.cpp +++ b/tools/editor/plugins/material_editor_plugin.cpp @@ -355,11 +355,11 @@ void MaterialEditorPlugin::make_visible(bool p_visible) { if (p_visible) { material_editor->show(); -// material_editor->set_process(true); + //material_editor->set_process(true); } else { material_editor->hide(); -// material_editor->set_process(false); + //material_editor->set_process(false); } } diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp index db96a60808..49cb02c9d8 100644 --- a/tools/editor/plugins/mesh_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_editor_plugin.cpp @@ -218,11 +218,11 @@ void MeshEditorPlugin::make_visible(bool p_visible) { if (p_visible) { mesh_editor->show(); -// mesh_editor->set_process(true); + //mesh_editor->set_process(true); } else { mesh_editor->hide(); -// mesh_editor->set_process(false); + //mesh_editor->set_process(false); } } diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp index 4a3ea91ff6..8e475e56f7 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.cpp +++ b/tools/editor/plugins/path_2d_editor_plugin.cpp @@ -38,7 +38,7 @@ void Path2DEditor::_notification(int p_what) { case NOTIFICATION_READY: { -// button_create->set_icon( get_icon("Edit","EditorIcons")); + //button_create->set_icon( get_icon("Edit","EditorIcons")); //button_edit->set_icon( get_icon("MovePoint","EditorIcons")); //set_pressed_button(button_edit); //button_edit->set_pressed(true); diff --git a/tools/editor/plugins/path_editor_plugin.cpp b/tools/editor/plugins/path_editor_plugin.cpp index a69de2e78d..4f0afe9e94 100644 --- a/tools/editor/plugins/path_editor_plugin.cpp +++ b/tools/editor/plugins/path_editor_plugin.cpp @@ -449,7 +449,7 @@ void PathEditorPlugin::edit(Object *p_object) { pre->get_curve()->emit_signal("changed"); } } -// collision_polygon_editor->edit(p_object->cast_to<Node>()); + //collision_polygon_editor->edit(p_object->cast_to<Node>()); } bool PathEditorPlugin::handles(Object *p_object) const { @@ -543,7 +543,7 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { path_thin_material->set_flag(Material::FLAG_DOUBLE_SIDED,true); path_thin_material->set_flag(Material::FLAG_UNSHADED,true); -// SpatialEditor::get_singleton()->add_gizmo_plugin(this); + //SpatialEditor::get_singleton()->add_gizmo_plugin(this); sep = memnew( VSeparator); sep->hide(); diff --git a/tools/editor/plugins/path_editor_plugin.h b/tools/editor/plugins/path_editor_plugin.h index e446dfa7c7..79e978dc1d 100644 --- a/tools/editor/plugins/path_editor_plugin.h +++ b/tools/editor/plugins/path_editor_plugin.h @@ -83,7 +83,7 @@ public: Ref<FixedSpatialMaterial> path_thin_material; virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event); -// virtual bool forward_gui_input(const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); } + //virtual bool forward_gui_input(const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); } virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial); virtual String get_name() const { return "Path"; } bool has_main_screen() const { return false; } diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.cpp b/tools/editor/plugins/resource_preloader_editor_plugin.cpp index 92d9c070af..0799732e02 100644 --- a/tools/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -52,7 +52,7 @@ void ResourcePreloaderEditor::_notification(int p_what) { if (p_what==NOTIFICATION_READY) { -// NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true); + //NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true); } if (p_what==NOTIFICATION_DRAW) { @@ -79,7 +79,7 @@ void ResourcePreloaderEditor::_files_load_request(const Vector<String>& p_paths) } - String basename = path.get_file().basename(); + String basename = path.get_file().get_basename(); String name=basename; int counter=1; while(preloader->has_resource(name)) { @@ -347,7 +347,7 @@ void ResourcePreloaderEditor::drop_data_fw(const Point2& p_point,const Variant& if (r->get_name()!="") { basename=r->get_name(); } else if (r->get_path().is_resource_file()) { - basename = r->get_path().basename(); + basename = r->get_path().get_basename(); } else { basename="Resource"; } @@ -471,14 +471,14 @@ void ResourcePreloaderEditorPlugin::make_visible(bool p_visible) { //preloader_editor->show(); button->show(); editor->make_bottom_panel_item_visible(preloader_editor); -// preloader_editor->set_process(true); + //preloader_editor->set_process(true); } else { if (preloader_editor->is_visible_in_tree()) editor->hide_bottom_panel(); button->hide(); //preloader_editor->hide(); -// preloader_editor->set_process(false); + //preloader_editor->set_process(false); } } @@ -492,8 +492,8 @@ ResourcePreloaderEditorPlugin::ResourcePreloaderEditorPlugin(EditorNode *p_node) button=editor->add_bottom_panel_item("ResourcePreloader",preloader_editor); button->hide(); -// preloader_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END); -// preloader_editor->set_margin( MARGIN_TOP, 120 ); + //preloader_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END); + //preloader_editor->set_margin( MARGIN_TOP, 120 ); diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp index afc151b900..cbeaeb7d60 100644 --- a/tools/editor/plugins/sample_editor_plugin.cpp +++ b/tools/editor/plugins/sample_editor_plugin.cpp @@ -422,11 +422,11 @@ void SampleEditorPlugin::make_visible(bool p_visible) { if (p_visible) { sample_editor->show(); -// sample_editor->set_process(true); + //sample_editor->set_process(true); } else { sample_editor->hide(); -// sample_editor->set_process(false); + //sample_editor->set_process(false); } } diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/tools/editor/plugins/sample_library_editor_plugin.cpp index e470d0d2c2..c3e2481b5a 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.cpp +++ b/tools/editor/plugins/sample_library_editor_plugin.cpp @@ -58,7 +58,7 @@ void SampleLibraryEditor::_notification(int p_what) { if (p_what==NOTIFICATION_READY) { -// NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true); + //NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true); } if (p_what==NOTIFICATION_DRAW) { @@ -81,7 +81,7 @@ void SampleLibraryEditor::_file_load_request(const PoolVector<String>& p_path) { dialog->popup_centered_minsize(); return; ///beh should show an error i guess } - String basename = path.get_file().basename(); + String basename = path.get_file().get_basename(); String name=basename; int counter=0; while(sample_library->has_sample(name)) { @@ -376,7 +376,7 @@ void SampleLibraryEditor::drop_data_fw(const Point2& p_point,const Variant& p_da if (sample->get_name()!="") { basename=sample->get_name(); } else if (sample->get_path().is_resource_file()) { - basename = sample->get_path().basename(); + basename = sample->get_path().get_basename(); } else { basename="Sample"; } @@ -506,14 +506,14 @@ void SampleLibraryEditorPlugin::make_visible(bool p_visible) { //sample_library_editor->show(); button->show(); editor->make_bottom_panel_item_visible(sample_library_editor); -// sample_library_editor->set_process(true); + //sample_library_editor->set_process(true); } else { if (sample_library_editor->is_visible_in_tree()) editor->hide_bottom_panel(); button->hide(); -// sample_library_editor->set_process(false); + //sample_library_editor->set_process(false); } } @@ -529,8 +529,8 @@ SampleLibraryEditorPlugin::SampleLibraryEditorPlugin(EditorNode *p_node) { button->hide(); //sample_library_editor->set_area_as_parent_rect(); -// sample_library_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END); -// sample_library_editor->set_margin( MARGIN_TOP, 120 ); + //sample_library_editor->set_anchor( MARGIN_TOP, Control::ANCHOR_END); + //sample_library_editor->set_margin( MARGIN_TOP, 120 ); //sample_library_editor->hide(); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 45340f9366..fa53e87fad 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -278,7 +278,7 @@ ScriptEditor *ScriptEditor::script_editor=NULL; String ScriptEditor::_get_debug_tooltip(const String&p_text,Node *_se) { -// ScriptEditorBase *se=_se->cast_to<ScriptEditorBase>(); + //ScriptEditorBase *se=_se->cast_to<ScriptEditorBase>(); String val = debugger->get_var_value(p_text); if (val!=String()) { @@ -311,7 +311,7 @@ void ScriptEditor::_breaked(bool p_breaked,bool p_can_debug) { void ScriptEditor::_show_debugger(bool p_show) { -// debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW), p_show); + //debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW), p_show); } void ScriptEditor::_script_created(Ref<Script> p_script) { @@ -1104,7 +1104,7 @@ static const Node * _find_node_with_script(const Node* p_node, const RefPtr & p_ Dictionary ScriptEditor::get_state() const { -// apply_scripts(); + //apply_scripts(); Dictionary state; #if 0 @@ -2247,7 +2247,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { { VBoxContainer *vbc = memnew( VBoxContainer ); disk_changed->add_child(vbc); - // disk_changed->set_child_rect(vbc); + //disk_changed->set_child_rect(vbc); Label *dl = memnew( Label ); dl->set_text(TTR("The following files are newer on disk.\nWhat action should be taken?:")); @@ -2293,7 +2293,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { help_index->connect("open_class",this,"_help_class_open"); history_pos=-1; -// debugger_gui->hide(); + //debugger_gui->hide(); edit_pass=0; trim_trailing_whitespace_on_save = false; diff --git a/tools/editor/plugins/script_text_editor.cpp b/tools/editor/plugins/script_text_editor.cpp index a7cc1d4326..95e7afa04c 100644 --- a/tools/editor/plugins/script_text_editor.cpp +++ b/tools/editor/plugins/script_text_editor.cpp @@ -60,7 +60,7 @@ void ScriptTextEditor::apply_code() { if (script.is_null()) return; -// print_line("applying code"); + //print_line("applying code"); script->set_source_code(code_editor->get_text_edit()->get_text()); script->update_exports(); } @@ -1194,7 +1194,7 @@ void ScriptTextEditor::_text_edit_gui_input(const InputEvent& ev) { Vector<float> color = stripped.split_floats(","); if (color.size() > 2) { float alpha = color.size() > 3 ? color[3] : 1.0f; - color_picker->set_color(Color(color[0], color[1], color[2], alpha)); + color_picker->set_pick_color(Color(color[0], color[1], color[2], alpha)); } color_panel->set_pos(get_global_transform().xform(get_local_mouse_pos())); Size2 ms = Size2(300, color_picker->get_combined_minimum_size().height+10); diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index a42158c7b0..90d0f7fc93 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -127,7 +127,7 @@ void ShaderTextEditor::_load_theme_settings() { } //colorize core types -// Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0)); + //Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0)); //colorize comments @@ -253,9 +253,9 @@ void ShaderEditor::_menu_option(int p_option) { current->get_find_replace_bar()->popup_replace(); } break; -// case SEARCH_LOCATE_SYMBOL: { + //case SEARCH_LOCATE_SYMBOL: { -// } break; + //} break; case SEARCH_GOTO_LINE: { goto_line_dialog->popup_find_line(current->get_text_edit()); @@ -396,7 +396,7 @@ void ShaderEditor::_bind_methods() { ClassDB::bind_method("_menu_option",&ShaderEditor::_menu_option); ClassDB::bind_method("_params_changed",&ShaderEditor::_params_changed); ClassDB::bind_method("apply_shaders",&ShaderEditor::apply_shaders); -// ClassDB::bind_method("_close_current_tab",&ShaderEditor::_close_current_tab); + //ClassDB::bind_method("_close_current_tab",&ShaderEditor::_close_current_tab); } void ShaderEditor::ensure_select_current() { @@ -481,7 +481,7 @@ ShaderEditor::ShaderEditor() { search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_previous", TTR("Find Previous"), KEY_MASK_SHIFT|KEY_F3), SEARCH_FIND_PREV); search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/replace", TTR("Replace.."), KEY_MASK_CMD|KEY_R), SEARCH_REPLACE); search_menu->get_popup()->add_separator(); -// search_menu->get_popup()->add_item("Locate Symbol..",SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K); + //search_menu->get_popup()->add_item("Locate Symbol..",SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K); search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_line", TTR("Goto Line.."), KEY_MASK_CMD|KEY_L), SEARCH_GOTO_LINE); search_menu->get_popup()->connect("id_pressed", this,"_menu_option"); @@ -512,8 +512,10 @@ bool ShaderEditorPlugin::handles(Object *p_object) const { bool handles = true; Shader *shader=p_object->cast_to<Shader>(); - //if (!shader || shader->cast_to<ShaderGraph>()) // Dont handle ShaderGraph's - // handles = false; + /* + if (!shader || shader->cast_to<ShaderGraph>()) // Dont handle ShaderGraph's + handles = false; + */ return shader!=NULL; } diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index fa28129b6d..d989c5b30d 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -2933,9 +2933,9 @@ ShaderGraphEditorPlugin::ShaderGraphEditorPlugin(EditorNode *p_node, bool p_2d) SpatialEditor::get_singleton()->get_shader_split()->add_child(shader_editor); - // editor->get_viewport()->add_child(shader_editor); - // shader_editor->set_area_as_parent_rect(); - // shader_editor->hide(); + //editor->get_viewport()->add_child(shader_editor); + //shader_editor->set_area_as_parent_rect(); + //shader_editor->hide(); } diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 400627ca60..0f01f71294 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -278,7 +278,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b Set<Ref<SpatialEditorGizmo> > found_gizmos; //uint32_t closest=0; -// float closest_dist=0; + //float closest_dist=0; r_includes_current=false; @@ -468,7 +468,7 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3& p_pos) { CameraMatrix cm; - cm.set_perspective(get_fov(),get_size().get_aspect(),get_znear(),get_zfar()); + cm.set_perspective(get_fov(),get_size().aspect(),get_znear(),get_zfar()); float screen_w,screen_h; cm.get_viewport_size(screen_w,screen_h); @@ -580,8 +580,8 @@ void SpatialEditorViewport::_compute_edit(const Point2& p_point) { List<Node*> &selection = editor_selection->get_selected_node_list(); -// Vector3 center; -// int nc=0; + //Vector3 center; + //int nc=0; for(List<Node*>::Element *E=selection.front();E;E=E->next()) { Spatial *sp = E->get()->cast_to<Spatial>(); @@ -593,16 +593,14 @@ void SpatialEditorViewport::_compute_edit(const Point2& p_point) { continue; se->original=se->sp->get_global_transform(); -// center+=se->original.origin; -// nc++; + //center+=se->original.origin; + //nc++; } - -// if (nc) -// _edit.center=center/float(nc); - - - + /* + if (nc) + _edit.center=center/float(nc); + */ } static int _get_key_modifier(const String& p_property) { @@ -618,23 +616,6 @@ static int _get_key_modifier(const String& p_property) { return 0; } -SpatialEditorViewport::NavigationScheme SpatialEditorViewport::_get_navigation_schema(const String& p_property) { - switch(EditorSettings::get_singleton()->get(p_property).operator int()) { - case 0: return NAVIGATION_GODOT; - case 1: return NAVIGATION_MAYA; - case 2: return NAVIGATION_MODO; - } - return NAVIGATION_GODOT; -} - -SpatialEditorViewport::NavigationZoomStyle SpatialEditorViewport::_get_navigation_zoom_style(const String& p_property) { - switch(EditorSettings::get_singleton()->get(p_property).operator int()) { - case 0: return NAVIGATION_ZOOM_VERTICAL; - case 1: return NAVIGATION_ZOOM_HORIZONTAL; - } - return NAVIGATION_ZOOM_VERTICAL; -} - bool SpatialEditorViewport::_gizmo_select(const Vector2& p_screenpos,bool p_hilite_only) { if (!spatial_editor->is_gizmo_visible()) @@ -854,7 +835,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { } break; case BUTTON_RIGHT: { - NavigationScheme nav_scheme = _get_navigation_schema("editors/3d/navigation_scheme"); + NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int(); if (b.pressed && _edit.gizmo.is_valid()) { //restore @@ -1014,7 +995,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { if (b.pressed) { - NavigationScheme nav_scheme = _get_navigation_schema("editors/3d/navigation_scheme"); + NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int(); if ( (nav_scheme==NAVIGATION_MAYA || nav_scheme==NAVIGATION_MODO) && b.mod.alt) { break; } @@ -1251,7 +1232,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { } - NavigationScheme nav_scheme = _get_navigation_schema("editors/3d/navigation_scheme"); + NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation_scheme").operator int(); NavigationMode nav_mode = NAVIGATION_NONE; if (_edit.gizmo.is_valid()) { @@ -1558,7 +1539,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { nav_mode = NAVIGATION_PAN; } - } else if (EditorSettings::get_singleton()->get("editors/3d/emulate_3_button_mouse")) { + } else if (EditorSettings::get_singleton()->get("editors/3d/emulate_3_button_mouse")) { // Handle trackpad (no external mouse) use case int mod = 0; if (m.mod.shift) @@ -1606,7 +1587,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { if (nav_scheme==NAVIGATION_MAYA && m.mod.shift) zoom_speed *= zoom_speed_modifier; - NavigationZoomStyle zoom_style = _get_navigation_zoom_style("3d_editor/zoom_style"); + NavigationZoomStyle zoom_style = (NavigationZoomStyle)EditorSettings::get_singleton()->get("3d_editor/zoom_style").operator int(); if (zoom_style == NAVIGATION_ZOOM_HORIZONTAL) { if ( m.relative_x > 0) cursor.distance*=1-m.relative_x*zoom_speed; @@ -1915,7 +1896,7 @@ void SpatialEditorViewport::_draw() { Size2 ss = Size2( GlobalConfig::get_singleton()->get("display/width"), GlobalConfig::get_singleton()->get("display/height") ); - float aspect = ss.get_aspect(); + float aspect = ss.aspect(); Size2 s = get_size(); Rect2 draw_rect; @@ -2152,7 +2133,7 @@ void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) { previewing->disconnect("tree_exited",this,"_preview_exited_scene"); previewing=NULL; - VS::get_singleton()->viewport_attach_camera( viewport->get_viewport(), camera->get_camera() ); //restore + VS::get_singleton()->viewport_attach_camera( viewport->get_viewport_rid(), camera->get_camera() ); //restore if (!preview) preview_camera->hide(); view_menu->show(); @@ -2162,7 +2143,7 @@ void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) { previewing=preview; previewing->connect("tree_exited",this,"_preview_exited_scene"); - VS::get_singleton()->viewport_attach_camera( viewport->get_viewport(), preview->get_camera() ); //replace + VS::get_singleton()->viewport_attach_camera( viewport->get_viewport_rid(), preview->get_camera() ); //replace view_menu->hide(); surface->update(); @@ -2267,7 +2248,7 @@ void SpatialEditorViewport::set_state(const Dictionary& p_state) { if (pv && pv->cast_to<Camera>()) { previewing=pv->cast_to<Camera>(); previewing->connect("tree_exited",this,"_preview_exited_scene"); - VS::get_singleton()->viewport_attach_camera( viewport->get_viewport(), previewing->get_camera() ); //replace + VS::get_singleton()->viewport_attach_camera( viewport->get_viewport_rid(), previewing->get_camera() ); //replace view_menu->hide(); surface->update(); preview_camera->set_pressed(true); @@ -2515,7 +2496,7 @@ void SpatialEditor::update_transform_gizmo() { center.expand_to(xf.origin); gizmo_basis=Basis(); } -// count++; + //count++; } Vector3 pcenter = center.pos+center.size*0.5; @@ -2626,7 +2607,7 @@ Dictionary SpatialEditor::get_state() const { d["viewports"]=vpdata; d["default_light"]=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_LIGHT) );; - d["ambient_light_color"]=settings_ambient_color->get_color(); + d["ambient_light_color"]=settings_ambient_color->get_pick_color(); d["default_srgb"]=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB) );; d["show_grid"]=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_GRID) );; @@ -2715,7 +2696,7 @@ void SpatialEditor::set_state(const Dictionary& p_state) { } if (d.has("ambient_light_color")) { - settings_ambient_color->set_color(d["ambient_light_color"]); + settings_ambient_color->set_pick_color(d["ambient_light_color"]); //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,d["ambient_light_color"]); } @@ -2778,16 +2759,16 @@ void SpatialEditor::edit(Spatial *p_spatial) { } } + /* if (p_spatial) { - //_validate_selection(); - //if (selected.has(p_spatial->get_instance_ID()) && selected.size()==1) - // return; - //_select(p_spatial->get_instance_ID(),false,true); + _validate_selection(); + if (selected.has(p_spatial->get_instance_ID()) && selected.size()==1) + return; + _select(p_spatial->get_instance_ID(),false,true); // should become the selection } - - + */ } void SpatialEditor::_xform_dialog_action() { @@ -2854,8 +2835,8 @@ void SpatialEditor::_menu_item_pressed(int p_option) { tool_button[i]->set_pressed(i==p_option); tool_mode=(ToolMode)p_option; - // static const char *_mode[]={"Selection Mode.","Translation Mode.","Rotation Mode.","Scale Mode.","List Selection Mode."}; -// set_message(_mode[p_option],3); + //static const char *_mode[]={"Selection Mode.","Translation Mode.","Rotation Mode.","Scale Mode.","List Selection Mode."}; + //set_message(_mode[p_option],3); update_transform_gizmo(); } break; @@ -3231,9 +3212,9 @@ void SpatialEditor::_init_indicators() { VisualServer::get_singleton()->mesh_surface_set_material(origin,0,indicator_mat->get_rid()); -// origin = VisualServer::get_singleton()->poly_create(); -// VisualServer::get_singleton()->poly_add_primitive(origin,origin_points,Vector<Vector3>(),origin_colors,Vector<Vector3>()); -// VisualServer::get_singleton()->poly_set_material(origin,indicator_mat,true); + //origin = VisualServer::get_singleton()->poly_create(); + //VisualServer::get_singleton()->poly_add_primitive(origin,origin_points,Vector<Vector3>(),origin_colors,Vector<Vector3>()); + //VisualServer::get_singleton()->poly_set_material(origin,indicator_mat,true); origin_instance = VisualServer::get_singleton()->instance_create2(origin,get_tree()->get_root()->get_world()->get_scenario()); VS::get_singleton()->instance_set_layer_mask(origin_instance,1<<SpatialEditorViewport::GIZMO_GRID_LAYER); @@ -3691,7 +3672,7 @@ void SpatialEditor::_node_removed(Node* p_node) { void SpatialEditor::_bind_methods() { -// ClassDB::bind_method("_gui_input",&SpatialEditor::_gui_input); + //ClassDB::bind_method("_gui_input",&SpatialEditor::_gui_input); ClassDB::bind_method("_unhandled_key_input",&SpatialEditor::_unhandled_key_input); ClassDB::bind_method("_node_removed",&SpatialEditor::_node_removed); ClassDB::bind_method("_menu_item_pressed",&SpatialEditor::_menu_item_pressed); @@ -3743,7 +3724,7 @@ void SpatialEditor::clear() { settings_default_light_rot_y=Math_PI*0.2; //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15)); - settings_ambient_color->set_color(Color(0.15,0.15,0.15)); + settings_ambient_color->set_pick_color(Color(0.15,0.15,0.15)); if (!light_instance.is_valid()) _menu_item_pressed(MENU_VIEW_USE_DEFAULT_LIGHT); @@ -3755,7 +3736,7 @@ void SpatialEditor::clear() { void SpatialEditor::_update_ambient_light_color(const Color& p_color) { -// viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,settings_ambient_color->get_color()); + //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,settings_ambient_color->get_color()); } @@ -4024,10 +4005,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_ambient_color = memnew( ColorPickerButton ); settings_vbc->add_margin_child(TTR("Ambient Light Color:"),settings_ambient_color); settings_ambient_color->connect("color_changed",this,"_update_ambient_light_color"); - -// viewport_environment->set_enable_fx(Environment::FX_AMBIENT_LIGHT,true); -// viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15)); - settings_ambient_color->set_color(Color(0.15,0.15,0.15)); + settings_ambient_color->set_pick_color(Color(0.15,0.15,0.15)); settings_fov = memnew( SpinBox ); @@ -4171,7 +4149,7 @@ void SpatialEditorPlugin::set_state(const Dictionary& p_state) { void SpatialEditor::snap_cursor_to_plane(const Plane& p_plane) { -// cursor.pos=p_plane.project(cursor.pos); + //cursor.pos=p_plane.project(cursor.pos); } void SpatialEditorPlugin::_bind_methods() { diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h index b05b7d8545..6e5243e6ab 100644 --- a/tools/editor/plugins/spatial_editor_plugin.h +++ b/tools/editor/plugins/spatial_editor_plugin.h @@ -156,13 +156,11 @@ private: NAVIGATION_MAYA, NAVIGATION_MODO, }; - NavigationScheme _get_navigation_schema(const String& p_property); enum NavigationZoomStyle { NAVIGATION_ZOOM_VERTICAL, NAVIGATION_ZOOM_HORIZONTAL }; - NavigationZoomStyle _get_navigation_zoom_style(const String& p_property); enum NavigationMode { NAVIGATION_NONE, diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp index 7706b063a9..095b059836 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp @@ -56,7 +56,7 @@ void SpriteFramesEditor::_notification(int p_what) { if (p_what==NOTIFICATION_READY) { -// NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true); + //NodePath("/root")->connect("node_removed", this,"_node_removed",Vector<Variant>(),true); } if (p_what==NOTIFICATION_DRAW) { @@ -937,14 +937,14 @@ void SpriteFramesEditorPlugin::make_visible(bool p_visible) { if (p_visible) { button->show(); editor->make_bottom_panel_item_visible(frames_editor); -// frames_editor->set_process(true); + //frames_editor->set_process(true); } else { button->hide(); if (frames_editor->is_visible_in_tree()) editor->hide_bottom_panel(); -// frames_editor->set_process(false); + //frames_editor->set_process(false); } } diff --git a/tools/editor/plugins/style_box_editor_plugin.cpp b/tools/editor/plugins/style_box_editor_plugin.cpp index 171eac57d9..396ebd0052 100644 --- a/tools/editor/plugins/style_box_editor_plugin.cpp +++ b/tools/editor/plugins/style_box_editor_plugin.cpp @@ -49,9 +49,9 @@ void StyleBoxEditor::_sb_changed() { void StyleBoxEditor::_bind_methods() { ClassDB::bind_method("_sb_changed",&StyleBoxEditor::_sb_changed); -// ClassDB::bind_method("_import",&StyleBoxEditor::_import); -// ClassDB::bind_method("_import_accept",&StyleBoxEditor::_import_accept); -// ClassDB::bind_method("_preview_text_changed",&StyleBoxEditor::_preview_text_changed); + //ClassDB::bind_method("_import",&StyleBoxEditor::_import); + //ClassDB::bind_method("_import_accept",&StyleBoxEditor::_import_accept); + //ClassDB::bind_method("_preview_text_changed",&StyleBoxEditor::_preview_text_changed); } StyleBoxEditor::StyleBoxEditor() { diff --git a/tools/editor/plugins/style_box_editor_plugin.h b/tools/editor/plugins/style_box_editor_plugin.h index b2288b8e74..29e98efd8b 100644 --- a/tools/editor/plugins/style_box_editor_plugin.h +++ b/tools/editor/plugins/style_box_editor_plugin.h @@ -30,7 +30,7 @@ #define STYLE_BOX_EDITOR_PLUGIN_H #include "scene/resources/style_box.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/option_button.h" #include "tools/editor/editor_node.h" diff --git a/tools/editor/plugins/texture_editor_plugin.cpp b/tools/editor/plugins/texture_editor_plugin.cpp index 7ff7d0f2f7..a846a908d2 100644 --- a/tools/editor/plugins/texture_editor_plugin.cpp +++ b/tools/editor/plugins/texture_editor_plugin.cpp @@ -113,11 +113,11 @@ void TextureEditorPlugin::make_visible(bool p_visible) { if (p_visible) { texture_editor->show(); -// texture_editor->set_process(true); + //texture_editor->set_process(true); } else { texture_editor->hide(); -// texture_editor->set_process(false); + //texture_editor->set_process(false); } } diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp index ca49684063..1ad880c4d6 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.cpp +++ b/tools/editor/plugins/texture_region_editor_plugin.cpp @@ -935,7 +935,7 @@ void TextureRegionEditorPlugin::edit(Object *p_node) bool TextureRegionEditorPlugin::handles(Object *p_obj) const { - return p_obj->is_class("Sprite") || p_obj->is_class("Patch9Frame") || p_obj->is_class("StyleBoxTexture") || p_obj->is_class("AtlasTexture"); + return p_obj->is_class("Sprite") || p_obj->is_class("Patch9Rect") || p_obj->is_class("StyleBoxTexture") || p_obj->is_class("AtlasTexture"); } void TextureRegionEditorPlugin::make_visible(bool p_visible) diff --git a/tools/editor/plugins/texture_region_editor_plugin.h b/tools/editor/plugins/texture_region_editor_plugin.h index c529e54dd1..35c0f18efa 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.h +++ b/tools/editor/plugins/texture_region_editor_plugin.h @@ -36,7 +36,7 @@ #include "tools/editor/editor_plugin.h" #include "tools/editor/editor_node.h" #include "scene/2d/sprite.h" -#include "scene/gui/patch_9_frame.h" +#include "scene/gui/patch_9_rect.h" #include "scene/resources/style_box.h" #include "scene/resources/texture.h" diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index 84f711675b..027e91ade8 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -693,9 +693,9 @@ ThemeEditor::ThemeEditor() { -// main_panel->add_child(panel); -// panel->set_area_as_parent_rect(); -// panel->set_margin( MARGIN_TOP,20 ); + //main_panel->add_child(panel); + //panel->set_area_as_parent_rect(); + //panel->set_margin( MARGIN_TOP,20 ); first_vb->add_child(memnew( Label("Label") )); @@ -987,7 +987,7 @@ ThemeEditorPlugin::ThemeEditorPlugin(EditorNode *p_node) { theme_editor = memnew( ThemeEditor ); theme_editor->set_custom_minimum_size(Size2(0,200)); -// p_node->get_viewport()->add_child(theme_editor); + //p_node->get_viewport()->add_child(theme_editor); button=editor->add_bottom_panel_item("Theme",theme_editor); button->hide(); diff --git a/tools/editor/plugins/theme_editor_plugin.h b/tools/editor/plugins/theme_editor_plugin.h index 0af9128bf2..9251da8e07 100644 --- a/tools/editor/plugins/theme_editor_plugin.h +++ b/tools/editor/plugins/theme_editor_plugin.h @@ -30,7 +30,7 @@ #define THEME_EDITOR_PLUGIN_H #include "scene/resources/theme.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/option_button.h" #include "scene/gui/file_dialog.h" #include "scene/gui/check_box.h" diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 7a1b2c518c..10005b6850 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -67,14 +67,14 @@ bool ProjectExportDialog::_create_tree(TreeItem *p_parent,EditorFileSystemDirect has_items=true; } -// int cc = p_options.get_slice_count(","); + //int cc = p_options.get_slice_count(","); for (int i=0;i<p_dir->get_file_count();i++) { TreeItem *fitem = tree->create_item(item); //fitem->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); //fitem->set_editable(0,true); - // fitem->set_checked(0,isfave); + //fitem->set_checked(0,isfave); fitem->set_text(0,p_dir->get_file(i)); String path = p_dir->get_file_path(i); fitem->set_tooltip(0,path); @@ -164,8 +164,8 @@ void ProjectExportDialog::_platform_selected() { String p =platforms->get_selected()->get_metadata(0); _update_platform(); -// editor->save_import_export(); -// EditorFileSystem::get_singleton()->scan(); + //editor->save_import_export(); + //EditorFileSystem::get_singleton()->scan(); } @@ -313,7 +313,7 @@ void ProjectExportDialog::_notification(int p_what) { } EditorFileSystem::get_singleton()->connect("filesystem_changed",this,"_scan_finished"); -// _rescan(); + //_rescan(); _update_platform(); export_mode->select( EditorImportExport::get_singleton()->get_export_filter() ); convert_text_scenes->set_pressed( EditorImportExport::get_singleton()->get_convert_text_scenes() ); @@ -343,7 +343,7 @@ void ProjectExportDialog::_notification(int p_what) { } image_formats->connect("item_edited",this,"_format_toggled"); group_add->set_icon(get_icon("Add","EditorIcons")); -// group_del->set_icon(get_icon("Del","EditorIcons")); + //group_del->set_icon(get_icon("Del","EditorIcons")); _update_group_list(); _update_group(); @@ -921,7 +921,7 @@ bool ProjectExportDialog::_update_group_treef(TreeItem *p_parent,EditorFileSyste for(int i=0;i<p_dir->get_file_count();i++) { String fname = p_dir->get_file(i); - if (p_extensions.has(fname.to_lower().extension())) { + if (p_extensions.has(fname.to_lower().get_extension())) { String path = p_dir->get_file_path(i); if (filter!=String() && path.find(filter)==-1) @@ -1332,8 +1332,8 @@ void ProjectExportDialog::_bind_methods() { ClassDB::bind_method(_MD("_keystore_created"),&ProjectExportDialog::_keystore_created); -// ADD_SIGNAL(MethodInfo("instance")); -// ADD_SIGNAL(MethodInfo("open")); + //ADD_SIGNAL(MethodInfo("instance")); + //ADD_SIGNAL(MethodInfo("open")); } @@ -1775,11 +1775,13 @@ Error ProjectExport::export_project(const String& p_preset) { { List<String> l; -// SceneLoader::get_recognized_extensions(&l); -// for(List<String>::Element *E=l.front();E;E=E->next()) { -// -// scene_extensions.insert(E->get()); -// } + /* + SceneLoader::get_recognized_extensions(&l); + for(List<String>::Element *E=l.front();E;E=E->next()) { + + scene_extensions.insert(E->get()); + } + */ ResourceLoader::get_recognized_extensions_for_type("",&l); for(List<String>::Element *E=l.front();E;E=E->next()) { @@ -1994,8 +1996,10 @@ Error ProjectExport::export_project(const String& p_preset) { uint32_t flags=0; -// if (saver->is_bundle_scenes_enabled()) -// flags|=Reso::FLAG_BUNDLE_INSTANCED_SCENES; + /* + if (saver->is_bundle_scenes_enabled()) + flags|=Reso::FLAG_BUNDLE_INSTANCED_SCENES; + */ saver->set_bundle_exceptions(NULL); if (E->get().depaction>=ProjectExportSettings::DA_BUNDLE) { flags|=ResourceSaver::FLAG_BUNDLE_RESOURCES; @@ -2041,7 +2045,7 @@ Error ProjectExport::export_project(const String& p_preset) { ERR_FAIL_COND_V(err,ERR_CANT_OPEN); } source_file=write_file; - // project_settings->add_remapped_path(src_scene,path,platform); + //project_settings->add_remapped_path(src_scene,path,platform); } @@ -2093,7 +2097,7 @@ Error ProjectExport::export_project(const String& p_preset) { -// added_settings["remap/"+platform]=remaps;` + //added_settings["remap/"+platform]=remaps;` added_settings["remap/"+platform]=Variant(remaps).operator Array(); } diff --git a/tools/editor/project_export.h b/tools/editor/project_export.h index 433f4502a1..06992a7e34 100644 --- a/tools/editor/project_export.h +++ b/tools/editor/project_export.h @@ -99,7 +99,7 @@ private: bool _create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir); void _rescan(); -// void _confirmed(); + //void _confirmed(); void _scan_finished(); void _validate_platform(); diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index da12e8d671..2cf940a29a 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -42,7 +42,7 @@ #include "scene/gui/center_container.h" #include "io/stream_peer_ssl.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/margin_container.h" #include "io/resource_saver.h" @@ -404,7 +404,7 @@ public: VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); - // set_child_rect(vb); + //set_child_rect(vb); Label* l = memnew(Label); l->set_text(TTR("Project Path:")); @@ -1003,7 +1003,7 @@ void ProjectManager::_run_project_confirm() { Error err = OS::get_singleton()->execute(exec,args,false,&pid); ERR_FAIL_COND(err); } - // get_scene()->quit(); do not quit + //get_scene()->quit(); do not quit } void ProjectManager::_run_project() { diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index 968333d466..0396456c49 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -1357,7 +1357,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { message = memnew( ConfirmationDialog ); add_child(message); -// message->get_cancel()->hide(); + //message->get_cancel()->hide(); message->set_hide_on_ok(true); Control *input_base = memnew( Control ); @@ -1424,7 +1424,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { hbc = memnew( HBoxContainer ); device_input->add_child(hbc); -// device_input->set_child_rect(hbc); + //device_input->set_child_rect(hbc); VBoxContainer *vbc_left = memnew( VBoxContainer ); hbc->add_child(vbc_left); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index c1a01e0fd0..8f294a5102 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -824,7 +824,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty color_picker->show(); color_picker->set_edit_alpha(hint!=PROPERTY_HINT_COLOR_NO_ALPHA); - color_picker->set_color(v); + color_picker->set_pick_color(v); set_size( Size2(300*EDSCALE, color_picker->get_combined_minimum_size().height+10*EDSCALE)); color_picker->set_focus_on_line_edit(); /* @@ -2161,7 +2161,7 @@ bool PropertyEditor::_get_instanced_node_original_property(const StringName& p_p bool found=false; -// print_line("for prop - "+String(p_prop)); + //print_line("for prop - "+String(p_prop)); while(node) { @@ -2174,13 +2174,13 @@ bool PropertyEditor::_get_instanced_node_original_property(const StringName& p_p } else { ss=node->get_scene_instance_state(); } - // print_line("at - "+String(edited_scene->get_path_to(node))); + //print_line("at - "+String(edited_scene->get_path_to(node))); if (ss.is_valid()) { NodePath np = node->get_path_to(orig); int node_idx = ss->find_node_by_path(np); - // print_line("\t valid, nodeidx "+itos(node_idx)); + //print_line("\t valid, nodeidx "+itos(node_idx)); if (node_idx>=0) { bool lfound=false; Variant lvar; @@ -2189,7 +2189,7 @@ bool PropertyEditor::_get_instanced_node_original_property(const StringName& p_p found=true; value=lvar; - // print_line("\t found value "+String(value)); + //print_line("\t found value "+String(value)); } } } @@ -2215,7 +2215,7 @@ bool PropertyEditor::_is_property_different(const Variant& p_current, const Vari Node* edited_scene =EditorNode::get_singleton()->get_edited_scene(); bool found_state=false; - // print_line("for prop - "+String(p_prop)); + //print_line("for prop - "+String(p_prop)); while(node) { @@ -2867,7 +2867,7 @@ TreeItem *PropertyEditor::get_parent_node(String p_path,HashMap<String,TreeItem* item = item_paths.get(p_path); } else { -// printf("path %s parent path %s - item name %s\n",p_path.ascii().get_data(),p_path.left( p_path.find_last("/") ).ascii().get_data(),p_path.right( p_path.find_last("/") ).ascii().get_data() ); + //printf("path %s parent path %s - item name %s\n",p_path.ascii().get_data(),p_path.left( p_path.find_last("/") ).ascii().get_data(),p_path.right( p_path.find_last("/") ).ascii().get_data() ); TreeItem *parent = get_parent_node( p_path.left( p_path.find_last("/") ),item_paths,root ); item = tree->create_item( parent ); @@ -3174,8 +3174,10 @@ void PropertyEditor::update_tree() { //printf("property %s\n",basename.ascii().get_data()); TreeItem * parent = get_parent_node(path,item_path,current_category?current_category:root ); - //if (parent->get_parent()==root) - // parent=root; + /* + if (parent->get_parent()==root) + parent=root; + */ int level = 0; if (parent!=root) { level++; @@ -3359,7 +3361,7 @@ void PropertyEditor::update_tree() { item->set_range_config(1,min,max,step,p.hint==PROPERTY_HINT_EXP_RANGE); } else if (p.hint==PROPERTY_HINT_ENUM) { -// int c = p.hint_string.get_slice_count(","); + //int c = p.hint_string.get_slice_count(","); item->set_text(1,p.hint_string); if (show_type_icons) item->set_icon( 0,get_icon("Enum","EditorIcons") ); @@ -3368,7 +3370,7 @@ void PropertyEditor::update_tree() { break; } else if (p.hint==PROPERTY_HINT_OBJECT_ID) { -// int c = p.hint_string.get_slice_count(","); + //int c = p.hint_string.get_slice_count(","); item->set_cell_mode(1,TreeItem::CELL_MODE_CUSTOM); String type=p.hint_string; @@ -3704,7 +3706,7 @@ void PropertyEditor::update_tree() { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->set_editable( 1, !read_only ); -// item->set_text(1,obj->get(p.name)); + //item->set_text(1,obj->get(p.name)); item->set_custom_bg_color(1,obj->get(p.name)); if (show_type_icons) item->set_icon( 0,get_icon("Color","EditorIcons") ); @@ -3790,7 +3792,7 @@ void PropertyEditor::update_tree() { item->set_icon( 0, get_icon("Object","EditorIcons") ); } -// item->double_click_signal.connect( Method1<int>( Method2<int,String>( this, &Editoritem_obj_edited ), p.name ) ); + //item->double_click_signal.connect( Method1<int>( Method2<int,String>( this, &Editoritem_obj_edited ), p.name ) ); } break; default: {}; diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h index 305da055a4..900d06497f 100644 --- a/tools/editor/property_editor.h +++ b/tools/editor/property_editor.h @@ -37,7 +37,7 @@ #include "scene/gui/dialogs.h" #include "scene/gui/color_picker.h" #include "scene/gui/menu_button.h" -#include "scene/gui/texture_frame.h" +#include "scene/gui/texture_rect.h" #include "scene/gui/text_edit.h" #include "scene/gui/check_button.h" #include "scene/gui/split_container.h" diff --git a/tools/editor/reparent_dialog.cpp b/tools/editor/reparent_dialog.cpp index a8909b0772..4b6a032b64 100644 --- a/tools/editor/reparent_dialog.cpp +++ b/tools/editor/reparent_dialog.cpp @@ -88,7 +88,7 @@ ReparentDialog::ReparentDialog() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); -// set_child_rect(vbc); + //set_child_rect(vbc); tree = memnew( SceneTreeEditor(false) ); tree->set_show_enabled_subscene(true); diff --git a/tools/editor/resources_dock.cpp b/tools/editor/resources_dock.cpp index c8fa1eda77..ddd4a782e4 100644 --- a/tools/editor/resources_dock.cpp +++ b/tools/editor/resources_dock.cpp @@ -126,8 +126,10 @@ void ResourcesDock::save_resource(const String& p_path,const Ref<Resource>& p_re int flg=0; if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources")) flg|=ResourceSaver::FLAG_COMPRESS; - //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) - // flg|=ResourceSaver::FLAG_RELATIVE_PATHS; + /* + if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) + flg|=ResourceSaver::FLAG_RELATIVE_PATHS; + */ String path = GlobalConfig::get_singleton()->localize_path(p_path); Error err = ResourceSaver::save(path,p_resource,flg|ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); @@ -137,7 +139,7 @@ void ResourcesDock::save_resource(const String& p_path,const Ref<Resource>& p_re accept->popup_centered_minsize(); return; } -// EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type()); + //EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type()); ((Resource*)p_resource.ptr())->set_path(path); editor->emit_signal("resource_saved",p_resource); diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 762213787c..6a1d1ed3b2 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -295,10 +295,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { switch(p_tool) { case TOOL_NEW: { - - - //if (!_validate_no_foreign()) - // break; + /* + if (!_validate_no_foreign()) + break; + */ create_dialog->popup(true); } break; case TOOL_INSTANCE: { @@ -319,8 +319,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { break; } - //if (!_validate_no_foreign()) - // break; + /* + if (!_validate_no_foreign()) + break; + */ file->set_mode(EditorFileDialog::MODE_OPEN_FILE); List<String> extensions; @@ -345,10 +347,12 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!current) break; - //if (!_validate_no_foreign()) - // break; - //connect_dialog->popup_centered_ratio(); - //connect_dialog->set_node(current); + /* + if (!_validate_no_foreign()) + break; + connect_dialog->popup_centered_ratio(); + connect_dialog->set_node(current); + */ } break; case TOOL_GROUP: { @@ -356,10 +360,12 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { Node *current = scene_tree->get_selected(); if (!current) break; - //if (!_validate_no_foreign()) - // break; - //groups_editor->set_current(current); - //groups_editor->popup_centered_ratio(); + /* + if (!_validate_no_foreign()) + break; + groups_editor->set_current(current); + groups_editor->popup_centered_ratio(); + */ } break; case TOOL_ATTACH_SCRIPT: { @@ -367,8 +373,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!selected) break; - //if (!_validate_no_foreign()) - // break; + /* + if (!_validate_no_foreign()) + break; + */ Ref<Script> existing = selected->get_script(); if (existing.is_valid()) @@ -1556,8 +1564,10 @@ void SceneTreeDock::_new_scene_from(String p_file) { int flg=0; if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) flg|=ResourceSaver::FLAG_COMPRESS; - //if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) - // flg|=ResourceSaver::FLAG_RELATIVE_PATHS; + /* + if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) + flg|=ResourceSaver::FLAG_RELATIVE_PATHS; + */ err = ResourceSaver::save(p_file,sdata,flg); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index a1a8803b04..7b6a03e20e 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -671,8 +671,8 @@ void SceneTreeEditor::_notification(int p_what) { EditorSettings::get_singleton()->connect("settings_changed",this,"_editor_settings_changed"); -// get_scene()->connect("tree_changed",this,"_tree_changed",Vector<Variant>(),CONNECT_DEFERRED); -// get_scene()->connect("node_removed",this,"_node_removed",Vector<Variant>(),CONNECT_DEFERRED); + //get_scene()->connect("tree_changed",this,"_tree_changed",Vector<Variant>(),CONNECT_DEFERRED); + //get_scene()->connect("node_removed",this,"_node_removed",Vector<Variant>(),CONNECT_DEFERRED); _update_tree(); } if (p_what==NOTIFICATION_EXIT_TREE) { @@ -1081,7 +1081,7 @@ void SceneTreeEditor::_warning_changed(Node* p_for_node) { //should use a timer update_timer->start(); -// print_line("WARNING CHANGED "+String(p_for_node->get_name())); + //print_line("WARNING CHANGED "+String(p_for_node->get_name())); } @@ -1186,7 +1186,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open tree->connect("item_edited", this,"_renamed",varray(),CONNECT_DEFERRED); tree->connect("multi_selected",this,"_cell_multi_selected"); tree->connect("button_pressed",this,"_cell_button_pressed"); -// tree->connect("item_edited", this,"_renamed",Vector<Variant>(),true); + //tree->connect("item_edited", this,"_renamed",Vector<Variant>(),true); error = memnew( AcceptDialog ); add_child(error); diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h index 3cc1bd2388..5586f02c00 100644 --- a/tools/editor/scene_tree_editor.h +++ b/tools/editor/scene_tree_editor.h @@ -175,8 +175,8 @@ class SceneTreeDialog : public ConfirmationDialog { GDCLASS( SceneTreeDialog, ConfirmationDialog ); SceneTreeEditor *tree; -// Button *select; -// Button *cancel; + //Button *select; + //Button *cancel; void update_tree(); void _select(); diff --git a/tools/editor/script_create_dialog.cpp b/tools/editor/script_create_dialog.cpp index d1095271fc..2a76224e33 100644 --- a/tools/editor/script_create_dialog.cpp +++ b/tools/editor/script_create_dialog.cpp @@ -38,7 +38,7 @@ void ScriptCreateDialog::config(const String& p_base_name,const String&p_base_pa class_name->set_text(""); parent_name->set_text(p_base_name); if (p_base_path!="") { - initial_bp=p_base_path.basename(); + initial_bp=p_base_path.get_basename(); file_path->set_text(initial_bp+"."+ScriptServer::get_language( language_menu->get_selected() )->get_extension()); } else { initial_bp=""; @@ -182,7 +182,7 @@ void ScriptCreateDialog::_lang_changed(int l) { String path=file_path->get_text(); String extension=""; if (path.find(".")>=0) { - extension=path.extension(); + extension=path.get_extension(); } if (extension.length()==0) { @@ -199,7 +199,7 @@ void ScriptCreateDialog::_lang_changed(int l) { for(List<String>::Element *E=extensions.front();E;E=E->next()) { if (E->get().nocasecmp_to(extension)==0) { - path=path.basename()+selected_ext; + path=path.get_basename()+selected_ext; _path_changed(path); break; } @@ -288,7 +288,7 @@ void ScriptCreateDialog::_path_changed(const String& p_path) { create_new=!f->file_exists(p); memdelete(f); - String extension=p.extension(); + String extension=p.get_extension(); List<String> extensions; // get all possible extensions for script diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 47725896e6..e53e69d9e0 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -177,7 +177,7 @@ void ScriptEditorDebugger::debug_next() { ERR_FAIL_COND(!breaked); ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected()); + ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("next"); ppeer->put_var(msg); @@ -189,7 +189,7 @@ void ScriptEditorDebugger::debug_step() { ERR_FAIL_COND(!breaked); ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected()); + ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("step"); @@ -202,7 +202,7 @@ void ScriptEditorDebugger::debug_break() { ERR_FAIL_COND(breaked); ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected()); + ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("break"); @@ -214,7 +214,7 @@ void ScriptEditorDebugger::debug_continue() { ERR_FAIL_COND(!breaked); ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected()); + ERR_FAIL_COND(!connection->is_connected_to_host()); OS::get_singleton()->enable_for_stealing_focus(EditorNode::get_singleton()->get_child_process_id()); @@ -294,7 +294,7 @@ void ScriptEditorDebugger::_scene_tree_property_select_object(ObjectID p_object) void ScriptEditorDebugger::_scene_tree_request() { ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected()); + ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("request_scene_tree"); @@ -305,7 +305,7 @@ void ScriptEditorDebugger::_scene_tree_request() { void ScriptEditorDebugger::_video_mem_request() { ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected()); + ERR_FAIL_COND(!connection->is_connected_to_host()); Array msg; msg.push_back("request_video_mem"); @@ -520,7 +520,7 @@ void ScriptEditorDebugger::_parse_message(const String& p_msg,const Array& p_dat d["frame"]=i; s->set_metadata(0,d); -// String line = itos(i)+" - "+String(d["file"])+":"+itos(d["line"])+" - at func: "+d["function"]; + //String line = itos(i)+" - "+String(d["file"])+":"+itos(d["line"])+" - at func: "+d["function"]; String line = itos(i)+" - "+String(d["file"])+":"+itos(d["line"]); s->set_text(0,line); @@ -993,7 +993,7 @@ void ScriptEditorDebugger::_notification(int p_what) { } }; - if (!connection->is_connected()) { + if (!connection->is_connected_to_host()) { stop(); editor->notify_child_process_exited(); //somehow, exited break; @@ -1183,7 +1183,7 @@ void ScriptEditorDebugger::_profiler_activate(bool p_enable) { void ScriptEditorDebugger::_profiler_seeked() { - if (!connection.is_valid() || !connection->is_connected()) + if (!connection.is_valid() || !connection->is_connected_to_host()) return; if (breaked) @@ -1205,7 +1205,7 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() { emit_signal("goto_script_line",s,int(d["line"])-1); ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected()); + ERR_FAIL_COND(!connection->is_connected_to_host()); /// Array msg; @@ -1620,7 +1620,7 @@ void ScriptEditorDebugger::set_hide_on_stop(bool p_hide) { void ScriptEditorDebugger::_paused() { ERR_FAIL_COND(connection.is_null()); - ERR_FAIL_COND(!connection->is_connected()); + ERR_FAIL_COND(!connection->is_connected_to_host()); if (!breaked && EditorNode::get_singleton()->get_pause_button()->is_pressed()) { debug_break(); @@ -1986,7 +1986,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){ ScriptEditorDebugger::~ScriptEditorDebugger() { -// inspector->edit(NULL); + //inspector->edit(NULL); memdelete(variables); ppeer->set_stream_peer(Ref<StreamPeer>()); diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index 62de22a4b3..82dfa94c06 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/tools/editor/spatial_editor_gizmos.cpp @@ -3117,8 +3117,8 @@ void Generic6DOFJointSpatialGizmo::redraw() { float s = ll+i*(Math_PI*2.0)/points; float n = ll+(i+1)*(Math_PI*2.0)/points; -// Vector3 from=Vector3(0,Math::cos(s),-Math::sin(s) )*cs; -// Vector3 to=Vector3( 0,Math::cos(n),-Math::sin(n) )*cs; + //Vector3 from=Vector3(0,Math::cos(s),-Math::sin(s) )*cs; + //Vector3 to=Vector3( 0,Math::cos(n),-Math::sin(n) )*cs; Vector3 from; SET_VTX(from,0, Math::cos(s), -Math::sin(s) ); |