summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-05-24 01:35:47 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-05-24 01:35:47 -0300
commit1cad087969efefa401a11051343cd0689f660770 (patch)
tree1595dd049bdb7289752012dca4398b2251fb08fa /core/io
parentf9ff086235cd4ff406b136f62fff77b85c0873f9 (diff)
Making Godot Easier to Use..
-=-=-=-=-=-=-=-=-=-=-=-=-=-= -Auto indenter in code editor, this makes it much easier to paste external code. -Zoom in 2D viewport now uses the mouse pointer as reference. -Obscure hack to see where code/line of GDScript in C++ backtrace. -Fixed a bug where keys would get stuck on X11 if pressed simultaneously -Added Api on IP singleton to request local IPs. -Premultiplied alpha support when importing texture, editing PNGs and as a blend mode.
Diffstat (limited to 'core/io')
-rw-r--r--core/io/file_access_encrypted.cpp5
-rw-r--r--core/io/ip.cpp13
-rw-r--r--core/io/ip.h3
3 files changed, 21 insertions, 0 deletions
diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp
index bcd4197e11..29f27dcbda 100644
--- a/core/io/file_access_encrypted.cpp
+++ b/core/io/file_access_encrypted.cpp
@@ -25,6 +25,7 @@ Error FileAccessEncrypted::open_and_parse(FileAccess *p_base,const Vector<uint8_
} else if (p_mode==MODE_READ) {
+ writing=false;
key=p_key;
uint32_t magic = p_base->get_32();
print_line("MAGIC: "+itos(magic));
@@ -278,6 +279,10 @@ uint64_t FileAccessEncrypted::_get_modified_time(const String& p_file){
FileAccessEncrypted::FileAccessEncrypted() {
file=NULL;
+ pos=0;
+ eofed=false;
+ mode=MODE_MAX;
+ writing=false;
}
diff --git a/core/io/ip.cpp b/core/io/ip.cpp
index 503a009444..d2a685f6b0 100644
--- a/core/io/ip.cpp
+++ b/core/io/ip.cpp
@@ -188,6 +188,18 @@ void IP::erase_resolve_item(ResolverID p_id) {
}
+Array IP::_get_local_addresses() const {
+
+ Array addresses;
+ List<IP_Address> ip_addresses;
+ get_local_addresses(&ip_addresses);
+ for(List<IP_Address>::Element *E=ip_addresses.front();E;E=E->next()) {
+ addresses.push_back(E->get());
+ }
+
+ return addresses;
+}
+
void IP::_bind_methods() {
ObjectTypeDB::bind_method(_MD("resolve_hostname","host"),&IP::resolve_hostname);
@@ -195,6 +207,7 @@ void IP::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_resolve_item_status","id"),&IP::get_resolve_item_status);
ObjectTypeDB::bind_method(_MD("get_resolve_item_address","id"),&IP::get_resolve_item_address);
ObjectTypeDB::bind_method(_MD("erase_resolve_item","id"),&IP::erase_resolve_item);
+ ObjectTypeDB::bind_method(_MD("get_local_addresses"),&IP::_get_local_addresses);
BIND_CONSTANT( RESOLVER_STATUS_NONE );
BIND_CONSTANT( RESOLVER_STATUS_WAITING );
diff --git a/core/io/ip.h b/core/io/ip.h
index f1ef5fe794..0181dc7d12 100644
--- a/core/io/ip.h
+++ b/core/io/ip.h
@@ -66,16 +66,19 @@ protected:
static void _bind_methods();
virtual IP_Address _resolve_hostname(const String& p_hostname)=0;
+ Array _get_local_addresses() const;
static IP* (*_create)();
public:
+
IP_Address resolve_hostname(const String& p_hostname);
// async resolver hostname
ResolverID resolve_hostname_queue_item(const String& p_hostname);
ResolverStatus get_resolve_item_status(ResolverID p_id) const;
IP_Address get_resolve_item_address(ResolverID p_id) const;
+ virtual void get_local_addresses(List<IP_Address> *r_addresses) const=0;
void erase_resolve_item(ResolverID p_id);
static IP* get_singleton();