summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/os/copymem.cpp42
-rw-r--r--core/os/copymem.h87
-rw-r--r--doc/base/classes.xml2
-rw-r--r--modules/webm/libvpx/SCsub7
-rw-r--r--platform/server/detect.py1
-rw-r--r--platform/x11/detect.py1
-rwxr-xr-x[-rw-r--r--]platform/x11/os_x11.cpp21
-rw-r--r--scene/gui/file_dialog.cpp7
-rw-r--r--scene/main/instance_placeholder.cpp19
-rw-r--r--scene/main/instance_placeholder.h2
-rw-r--r--thirdparty/libvpx/vpx_config.h6
11 files changed, 63 insertions, 132 deletions
diff --git a/core/os/copymem.cpp b/core/os/copymem.cpp
deleted file mode 100644
index 49f53f1a51..0000000000
--- a/core/os/copymem.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*************************************************************************/
-/* copymem.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* http://www.godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2016 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 "copymem.h"
-
-#include <string.h>
-
-void movemem_system(void *to, void *from,int amount) {
-
- memmove(to,from,amount);
-
-}
-
-void zeromem(void* p_mem,size_t p_bytes) {
-
- memset(p_mem,0,p_bytes);
-}
diff --git a/core/os/copymem.h b/core/os/copymem.h
index d7fc46aae4..4b9554519a 100644
--- a/core/os/copymem.h
+++ b/core/os/copymem.h
@@ -31,89 +31,18 @@
#include "typedefs.h"
-///@TODO use optimized routines for this, depending on platform. these are just the standard ones
+#ifdef PLATFORM_COPYMEM
-#define copymem(m_to,m_from,m_count) \
- do { \
- unsigned char * _from=(unsigned char*)m_from; \
- unsigned char * _to=(unsigned char*)m_to; \
- int _count=m_count; \
- for (int _i=0;_i<_count;_i++) \
- _to[_i]=_from[_i]; \
- } while (0);
- /*
- case 0: *_dto++ = *_dfrom++; \
- case 7: *_dto++ = *_dfrom++; \
- case 6: *_dto++ = *_dfrom++; \
- case 5: *_dto++ = *_dfrom++; \
- case 4: *_dto++ = *_dfrom++; \
- case 3: *_dto++ = *_dfrom++; \
- case 2: *_dto++ = *_dfrom++; \
- case 1: *_dto++ = *_dfrom++; \
- */
-#define movemem_duff(m_to, m_from, m_count) \
- do { \
- if (m_to<m_from) { \
- unsigned char* _dto = (unsigned char*)m_to; \
- unsigned char* _dfrom = (unsigned char*)m_from; \
- int n = (m_count + 7) / 8; \
- switch (m_count % 8) { \
- do { \
- case 0: *_dto++ = *_dfrom++; \
- case 7: *_dto++ = *_dfrom++; \
- case 6: *_dto++ = *_dfrom++; \
- case 5: *_dto++ = *_dfrom++; \
- case 4: *_dto++ = *_dfrom++; \
- case 3: *_dto++ = *_dfrom++; \
- case 2: *_dto++ = *_dfrom++; \
- case 1: *_dto++ = *_dfrom++; \
- } while (--n > 0); \
- }; \
- } else if (m_to>m_from) { \
- unsigned char* _dto = &((unsigned char*)m_to)[m_count-1]; \
- unsigned char* _dfrom = &((unsigned char*)m_from)[m_count-1]; \
- int n = (m_count + 7) / 8; \
- switch (m_count % 8) { \
- do { \
- case 0: *_dto-- = *_dfrom--; \
- case 7: *_dto-- = *_dfrom--; \
- case 6: *_dto-- = *_dfrom--; \
- case 5: *_dto-- = *_dfrom--; \
- case 4: *_dto-- = *_dfrom--; \
- case 3: *_dto-- = *_dfrom--; \
- case 2: *_dto-- = *_dfrom--; \
- case 1: *_dto-- = *_dfrom--; \
- } while (--n > 0); \
- }; \
- } \
- } while(0) \
+#include "platform_copymem.h" // included from platform/<current_platform>/platform_copymem.h"
-#define movemem_conventional(m_to,m_from,m_count) \
- do { \
- if (m_to<m_from) { \
- unsigned char * _from=(unsigned char*)m_from; \
- unsigned char * _to=(unsigned char*)m_to; \
- int _count=m_count; \
- for (int _i=0;_i<_count;_i++) \
- _to[_i]=_from[_i]; \
- \
- } else if (m_to>m_from) { \
- unsigned char * _from=(unsigned char*)m_from; \
- unsigned char * _to=(unsigned char*)m_to; \
- int _count=m_count; \
- while (_count--) \
- _to[_count]=_from[_count]; \
- \
- \
- } \
- } while (0); \
+#else
-void movemem_system(void*,void*,int);
+#include <string.h>
-#define movemem movemem_system
-
-
-void zeromem(void* p_mem,size_t p_bytes);
+#define copymem(to,from,count) memcpy(to,from,count)
+#define zeromem(to, count) memset(to, 0, count)
+#define movemem(to, from, count) memmove(to, from, count)
#endif
+#endif
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index 246f8cdac6..edd1eca925 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -15526,7 +15526,7 @@
<return type="int">
</return>
<description>
- Returns a status string like STATUS_REQUESTING. Need to call [method poll] in order to get status updates.
+ Returns a STATUS_* enum constant. Need to call [method poll] in order to get status updates.
</description>
</method>
<method name="has_response" qualifiers="const">
diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub
index 365cabd072..a6b9e46ee8 100644
--- a/modules/webm/libvpx/SCsub
+++ b/modules/webm/libvpx/SCsub
@@ -263,14 +263,15 @@ if env["platform"] == 'uwp':
else:
webm_cpu_x86 = True
else:
+ is_ios_x86 = (env["platform"] == 'iphone' and env["ios_sim"] == "yes")
is_android_x86 = (env["platform"] == 'android' and env["android_arch"] == 'x86')
if is_android_x86:
cpu_bits = '32'
if osx_fat:
webm_cpu_x86 = True
else:
- webm_cpu_x86 = (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86)
- webm_cpu_arm = env["platform"] == 'iphone' or env["platform"] == 'bb10' or (env["platform"] == 'android' and env["android_arch"] != 'x86')
+ webm_cpu_x86 = (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86)
+ webm_cpu_arm = (not is_ios_x86 and env["platform"] == 'iphone') or env["platform"] == 'bb10' or (not is_android_x86 and env["platform"] == 'android')
if webm_cpu_x86:
import subprocess
@@ -308,7 +309,7 @@ if webm_cpu_x86:
else:
if env["platform"] == 'windows' or env["platform"] == 'uwp':
env_libvpx["ASFORMAT"] = 'win'
- elif env["platform"] == 'osx':
+ elif env["platform"] == 'osx' or env["platform"] == "iphone":
env_libvpx["ASFORMAT"] = 'macho'
else:
env_libvpx["ASFORMAT"] = 'elf'
diff --git a/platform/server/detect.py b/platform/server/detect.py
index 4d86ffd376..8bc85f342d 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -76,7 +76,6 @@ def configure(env):
env.ParseConfig('pkg-config libwebp --cflags --libs')
if (env['builtin_freetype'] == 'no'):
- env['builtin_libpng'] = 'no' # Freetype links against libpng
env.ParseConfig('pkg-config freetype2 --cflags --libs')
if (env['builtin_libpng'] == 'no'):
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index d8cd79297e..857b147e14 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -140,7 +140,6 @@ def configure(env):
env.ParseConfig('pkg-config libwebp --cflags --libs')
if (env['builtin_freetype'] == 'no'):
- env['builtin_libpng'] = 'no' # Freetype links against libpng
env.ParseConfig('pkg-config freetype2 --cflags --libs')
if (env['builtin_libpng'] == 'no'):
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 0172dca4c4..65f546e2ee 100644..100755
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -880,6 +880,9 @@ bool OS_X11::is_window_minimized() const {
}
void OS_X11::set_window_maximized(bool p_enabled) {
+
+ if (is_window_maximized() == p_enabled) return;
+
// Using EWMH -- Extended Window Manager Hints
XEvent xev;
Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False);
@@ -898,6 +901,23 @@ void OS_X11::set_window_maximized(bool p_enabled) {
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
maximized = p_enabled;
+
+ //wait until the window has been resized and update video mode
+ while (true) {
+ XEvent ev;
+ XNextEvent(x11_display, &ev);
+ if (ev.type == ConfigureNotify) {
+ XConfigureEvent &xc = ev.xconfigure;
+ if (xc.send_event == 1 &&
+ (xc.width == get_screen_size(get_current_screen()).width || (!p_enabled && xc.width < current_videomode.width))) {
+
+ current_videomode.width=xc.width;
+ current_videomode.height=xc.height;
+ break;
+ };
+ }
+ };
+
}
bool OS_X11::is_window_maximized() const {
@@ -1990,6 +2010,7 @@ OS_X11::OS_X11() {
AudioDriverManagerSW::add_driver(&driver_alsa);
#endif
+ maximized = false;
minimized = false;
xim_style=0L;
mouse_mode=MOUSE_MODE_VISIBLE;
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index f942f15ed0..b0214b8648 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -403,11 +403,12 @@ void FileDialog::update_file_list() {
while(!files.empty()) {
bool match=patterns.empty();
+ String match_str;
for(List<String>::Element *E=patterns.front();E;E=E->next()) {
if (files.front()->get().matchn(E->get())) {
-
+ match_str=E->get();
match=true;
break;
}
@@ -432,14 +433,14 @@ void FileDialog::update_file_list() {
d["dir"]=false;
ti->set_metadata(0,d);
- if (file->get_text()==files.front()->get())
+ if (file->get_text()==files.front()->get() || match_str==files.front()->get())
ti->select(0);
}
files.pop_front();
}
- if (tree->get_root() && tree->get_root()->get_children())
+ if (tree->get_root() && tree->get_root()->get_children() && tree->get_selected()==NULL)
tree->get_root()->get_children()->select(0);
files.clear();
diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp
index fb047ea5e4..15045a73d5 100644
--- a/scene/main/instance_placeholder.cpp
+++ b/scene/main/instance_placeholder.cpp
@@ -101,11 +101,28 @@ void InstancePlaceholder::replace_by_instance(const Ref<PackedScene> &p_custom_s
base->remove_child(this);
base->add_child(scene);
base->move_child(scene,pos);
-
}
+Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) {
+
+ Dictionary ret;
+ StringArray order;
+
+ for(List<PropSet>::Element *E=stored_values.front();E;E=E->next()) {
+ ret[E->get().name] = E->get().value;
+ if (p_with_order)
+ order.push_back(E->get().name);
+ };
+
+ if (p_with_order)
+ ret[".order"] = order;
+
+ return ret;
+};
+
void InstancePlaceholder::_bind_methods() {
+ ObjectTypeDB::bind_method(_MD("get_stored_values","with_order"),&InstancePlaceholder::get_stored_values,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("replace_by_instance","custom_scene:PackedScene"),&InstancePlaceholder::replace_by_instance,DEFVAL(Variant()));
ObjectTypeDB::bind_method(_MD("get_instance_path"),&InstancePlaceholder::get_instance_path);
}
diff --git a/scene/main/instance_placeholder.h b/scene/main/instance_placeholder.h
index ef76686196..cacba49b39 100644
--- a/scene/main/instance_placeholder.h
+++ b/scene/main/instance_placeholder.h
@@ -57,6 +57,8 @@ public:
void set_instance_path(const String& p_name);
String get_instance_path() const;
+ Dictionary get_stored_values(bool p_with_order = false);
+
void replace_by_instance(const Ref<PackedScene>& p_custom_scene=Ref<PackedScene>());
InstancePlaceholder();
diff --git a/thirdparty/libvpx/vpx_config.h b/thirdparty/libvpx/vpx_config.h
index 7058f0327b..9ed45d4006 100644
--- a/thirdparty/libvpx/vpx_config.h
+++ b/thirdparty/libvpx/vpx_config.h
@@ -9,7 +9,11 @@
#ifndef VPX_CONFIG_H
#define VPX_CONFIG_H
#define RESTRICT
-#define INLINE inline
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+ #define INLINE __inline
+#else
+ #define INLINE inline
+#endif
#define HAVE_MIPS32 0
#define HAVE_MEDIA 0