removed duplicated functions in class hierarchy that were bound more than once

added a check to detect this case in the future
This commit is contained in:
Juan Linietsky 2017-01-14 11:07:57 -03:00
parent 93ab45b6b5
commit dcb95ec147
46 changed files with 179 additions and 210 deletions

View file

@ -2508,22 +2508,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);

View file

@ -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....");

View file

@ -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);

View file

@ -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;

View file

@ -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 );

View file

@ -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();

View file

@ -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 );

View file

@ -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;

View file

@ -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);

View file

@ -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);
}

View file

@ -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,8 +217,8 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent,
if (errno != EAGAIN) {
perror("shit?");
disconnect();
ERR_PRINT("Server disconnected!\n");
disconnect_from_host();
ERR_PRINT("Server disconnect_from_hosted!\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,8 +274,8 @@ Error StreamPeerTCPPosix::read(uint8_t* p_buffer, int p_bytes,int &r_received, b
if (errno != EAGAIN) {
perror("shit?");
disconnect();
ERR_PRINT("Server disconnected!\n");
disconnect_from_host();
ERR_PRINT("Server disconnect_from_hosted!\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

View file

@ -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);

View file

@ -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() {

View file

@ -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);

View file

@ -149,8 +149,8 @@ Error StreamPeerWinsock::write(const uint8_t* p_data,int p_bytes, int &r_sent, b
if (WSAGetLastError() != WSAEWOULDBLOCK) {
perror("shit?");
disconnect();
ERR_PRINT("Server disconnected!\n");
disconnect_from_host();
ERR_PRINT("Server disconnect_from_hosted!\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,8 +206,8 @@ Error StreamPeerWinsock::read(uint8_t* p_buffer, int p_bytes,int &r_received, bo
if (WSAGetLastError() != WSAEWOULDBLOCK) {
perror("shit?");
disconnect();
ERR_PRINT("Server disconnected!\n");
disconnect_from_host();
ERR_PRINT("Server disconnect_from_hosted!\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();
};

View file

@ -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);

View file

@ -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());
@ -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);

View file

@ -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) {

View file

@ -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);

View file

@ -823,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" ) );

View file

@ -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"));
@ -1496,7 +1496,7 @@ 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);
@ -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);

View file

@ -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;

View file

@ -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") );
}

View file

@ -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;

View file

@ -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();

View file

@ -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;

View file

@ -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;

View file

@ -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);
}

View file

@ -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();
};

View file

@ -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);

View file

@ -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) {

View file

@ -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;
}
@ -736,7 +736,7 @@ void Viewport::_notification(int p_what) {
}
}
RID Viewport::get_viewport() const {
RID Viewport::get_viewport_rid() const {
return viewport;
}
@ -2754,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);

View file

@ -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);

View file

@ -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);

View file

@ -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") );

View file

@ -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;

View file

@ -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);
@ -892,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;
}
@ -4229,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();
@ -5708,7 +5708,7 @@ 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")));

View file

@ -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();

View file

@ -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);

View file

@ -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() {
@ -681,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");

View file

@ -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();

View file

@ -3619,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);
}
}

View file

@ -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);

View file

@ -2133,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();
@ -2143,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();
@ -2248,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);
@ -2607,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) );;
@ -2696,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"]);
}
@ -3724,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);
@ -4005,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 );

View file

@ -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();
/*

View file

@ -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");
@ -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();