diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 5 | ||||
-rw-r--r-- | core/bind/core_bind.h | 1 | ||||
-rw-r--r-- | core/io/http_client.cpp | 8 | ||||
-rw-r--r-- | core/io/resource_format_xml.cpp | 1 | ||||
-rw-r--r-- | core/os/memory.h | 8 | ||||
-rw-r--r-- | core/os/os.cpp | 4 | ||||
-rw-r--r-- | core/os/os.h | 1 | ||||
-rw-r--r-- | core/typedefs.h | 2 |
8 files changed, 21 insertions, 9 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index b291ee396b..229640ba11 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -689,6 +689,10 @@ void _OS::native_video_pause() { OS::get_singleton()->native_video_pause(); }; +void _OS::native_video_unpause() { + OS::get_singleton()->native_video_unpause(); +}; + void _OS::native_video_stop() { OS::get_singleton()->native_video_stop(); @@ -874,6 +878,7 @@ void _OS::_bind_methods() { ObjectTypeDB::bind_method(_MD("native_video_is_playing"),&_OS::native_video_is_playing); ObjectTypeDB::bind_method(_MD("native_video_stop"),&_OS::native_video_stop); ObjectTypeDB::bind_method(_MD("native_video_pause"),&_OS::native_video_pause); + ObjectTypeDB::bind_method(_MD("native_video_unpause"),&_OS::native_video_unpause); ObjectTypeDB::bind_method(_MD("get_scancode_string","code"),&_OS::get_scancode_string); ObjectTypeDB::bind_method(_MD("is_scancode_unicode","code"),&_OS::is_scancode_unicode); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 30cc93fa11..4a9bb2a961 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -131,6 +131,7 @@ public: Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track); bool native_video_is_playing(); void native_video_pause(); + void native_video_unpause(); void native_video_stop(); void set_iterations_per_second(int p_ips); diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 19a7286dcf..b070e52f0a 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -306,8 +306,8 @@ Error HTTPClient::poll(){ for(int i=0;i<responses.size();i++) { - String s = responses[i].strip_edges(); - s = s.to_lower(); + String header = responses[i].strip_edges(); + String s = header.to_lower(); if (s.length()==0) continue; if (s.begins_with("content-length:")) { @@ -316,7 +316,7 @@ Error HTTPClient::poll(){ } if (s.begins_with("transfer-encoding:")) { - String encoding = s.substr(s.find(":")+1,s.length()).strip_edges(); + String encoding = header.substr(header.find(":")+1,header.length()).strip_edges(); //print_line("TRANSFER ENCODING: "+encoding); if (encoding=="chunked") { chunked=true; @@ -330,7 +330,7 @@ Error HTTPClient::poll(){ response_num=num.to_int(); } else { - response_headers.push_back(s); + response_headers.push_back(header); } } diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp index 8c8d79948a..03b77a4aab 100644 --- a/core/io/resource_format_xml.cpp +++ b/core/io/resource_format_xml.cpp @@ -1796,6 +1796,7 @@ Error ResourceInteractiveLoaderXML::rename_dependencies(FileAccess *p_f, const S fw->store_8(c); c=f->get_8(); } + f->close(); bool all_ok = fw->get_error()==OK; diff --git a/core/os/memory.h b/core/os/memory.h index 98b973bc06..8eb5ceccb6 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -308,11 +308,11 @@ T* memnew_arr_template(size_t p_elements,const char *p_descr="") { same strategy used by std::vector, and the DVector class, so it should be safe.*/ size_t len = sizeof(T) * p_elements; - unsigned int *mem = (unsigned int*)Memory::alloc_static( len + DEFAULT_ALIGNMENT, p_descr ); + unsigned int *mem = (unsigned int*)Memory::alloc_static( len + MAX(sizeof(size_t), DEFAULT_ALIGNMENT), p_descr ); T *failptr=0; //get rid of a warning ERR_FAIL_COND_V( !mem, failptr ); *mem=p_elements; - mem = (unsigned int *)( ((uint8_t*)mem) + DEFAULT_ALIGNMENT); + mem = (unsigned int *)( ((uint8_t*)mem) + MAX(sizeof(size_t), DEFAULT_ALIGNMENT)); T* elems = (T*)mem; /* call operator new */ @@ -331,14 +331,14 @@ T* memnew_arr_template(size_t p_elements,const char *p_descr="") { template<typename T> size_t memarr_len(const T *p_class) { - uint8_t* ptr = ((uint8_t*)p_class) - DEFAULT_ALIGNMENT; + uint8_t* ptr = ((uint8_t*)p_class) - MAX(sizeof(size_t), DEFAULT_ALIGNMENT); return *(size_t*)ptr; } template<typename T> void memdelete_arr(T *p_class) { - unsigned int * elems = (unsigned int*)(((uint8_t*)p_class) - DEFAULT_ALIGNMENT); + unsigned int * elems = (unsigned int*)(((uint8_t*)p_class) - MAX(sizeof(size_t), DEFAULT_ALIGNMENT)); for (unsigned int i=0;i<*elems;i++) { diff --git a/core/os/os.cpp b/core/os/os.cpp index 0bc06c8375..1aee6d9aa2 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -478,6 +478,10 @@ void OS::native_video_pause() { }; +void OS::native_video_unpause() { + +}; + void OS::native_video_stop() { }; diff --git a/core/os/os.h b/core/os/os.h index 0d4edb035d..a80b81bfa2 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -376,6 +376,7 @@ public: virtual Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track); virtual bool native_video_is_playing() const; virtual void native_video_pause(); + virtual void native_video_unpause(); virtual void native_video_stop(); virtual bool can_use_threads() const; diff --git a/core/typedefs.h b/core/typedefs.h index 91d4b8f81d..48acca326e 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -74,7 +74,7 @@ #endif #ifndef DEFAULT_ALIGNMENT -#define DEFAULT_ALIGNMENT 16 +#define DEFAULT_ALIGNMENT 1 #endif |