summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/io/pck_packer.cpp2
-rw-r--r--core/register_core_types.cpp1
-rw-r--r--doc/classes/Control.xml8
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp210
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.h1
-rw-r--r--drivers/gles2/shaders/canvas.glsl20
-rw-r--r--drivers/gles2/shaders/cubemap_filter.glsl8
-rw-r--r--drivers/gles2/shaders/scene.glsl20
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp4
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp10
-rw-r--r--editor/editor_sectioned_inspector.cpp2
-rw-r--r--platform/windows/detect.py8
-rw-r--r--platform/windows/os_windows.cpp17
-rw-r--r--scene/gui/base_button.cpp12
-rw-r--r--scene/resources/dynamic_font.cpp2
-rw-r--r--thirdparty/README.md3
-rw-r--r--thirdparty/libtheora/decode.c8
-rw-r--r--thirdparty/libtheora/patches/theora.git-0ae66d565e6bead8604d312bc1a4e9dccf245c88.patch38
18 files changed, 345 insertions, 29 deletions
diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp
index 36bd429bc0..8920bbfb81 100644
--- a/core/io/pck_packer.cpp
+++ b/core/io/pck_packer.cpp
@@ -175,7 +175,7 @@ Error PCKPacker::flush(bool p_verbose) {
printf("\n");
file->close();
- memdelete(buf);
+ memdelete_arr(buf);
return OK;
};
diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp
index 666384b093..a31aa9cb01 100644
--- a/core/register_core_types.cpp
+++ b/core/register_core_types.cpp
@@ -142,6 +142,7 @@ void register_core_types() {
ClassDB::register_virtual_class<InputEventGesture>();
ClassDB::register_class<InputEventMagnifyGesture>();
ClassDB::register_class<InputEventPanGesture>();
+ ClassDB::register_class<InputEventMIDI>();
ClassDB::register_class<FuncRef>();
ClassDB::register_virtual_class<StreamPeer>();
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index f067b50c72..d27839e0a6 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -681,7 +681,7 @@
[b]Note:[/b] On Linux, shapes may vary depending on the cursor theme of the system.
</member>
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" enum="Control.MouseFilter">
- Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. See the constants to learn what each does.
+ Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does.
</member>
<member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents">
Enables whether rendering of children should be clipped to this control's rectangle. If true, parts of a child which would be visibly outside of this control's rectangle will not be rendered.
@@ -929,13 +929,13 @@
Tells the parent [Container] to align the node with its end, either the bottom or the right edge. It doesn't work with the fill or expand size flags. Use with [member size_flags_horizontal] and [member size_flags_vertical].
</constant>
<constant name="MOUSE_FILTER_STOP" value="0" enum="MouseFilter">
- The control will receive mouse button input events through [method _gui_input] if clicked on. These events are automatically marked as handled and they will not propagate further to other controls.
+ The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. These events are automatically marked as handled and they will not propagate further to other controls. This also results in blocking signals in other controls.
</constant>
<constant name="MOUSE_FILTER_PASS" value="1" enum="MouseFilter">
- The control will receive mouse button input events through [method _gui_input] if clicked on. If this control does not handle the event, the parent control (if any) will be considered for a mouse click, and so on until there is no more parent control to potentially handle it. Even if no control handled it at all, the event will still be handled automatically, so unhandled input will not be fired.
+ The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. Even if no control handled it at all, the event will still be handled automatically, so unhandled input will not be fired.
</constant>
<constant name="MOUSE_FILTER_IGNORE" value="2" enum="MouseFilter">
- The control will not receive mouse button input events through [method _gui_input] and will not block other controls from receiving these events. These events will also not be handled automatically.
+ The control will not receive mouse button input events through [method _gui_input]. Also the control will not receive the [signal mouse_entered] nor [signal mouse_exited] signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically.
</constant>
<constant name="GROW_DIRECTION_BEGIN" value="0" enum="GrowDirection">
The control will grow to the left or top to make up if its minimum size is changed to be greater than its current size on the respective axis.
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 0d643370e0..22c05d9d77 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -1715,8 +1715,196 @@ RID RasterizerStorageGLES2::mesh_create() {
return mesh_owner.make_rid(mesh);
}
+static PoolVector<uint8_t> _unpack_half_floats(const PoolVector<uint8_t> &array, uint32_t &format, int p_vertices) {
+
+ uint32_t p_format = format;
+
+ static int src_size[VS::ARRAY_MAX];
+ static int dst_size[VS::ARRAY_MAX];
+ static int to_convert[VS::ARRAY_MAX];
+
+ int src_stride = 0;
+ int dst_stride = 0;
+
+ for (int i = 0; i < VS::ARRAY_MAX; i++) {
+
+ to_convert[i] = 0;
+ if (!(p_format & (1 << i))) {
+ src_size[i] = 0;
+ dst_size[i] = 0;
+ continue;
+ }
+
+ switch (i) {
+
+ case VS::ARRAY_VERTEX: {
+
+ if (p_format & VS::ARRAY_COMPRESS_VERTEX) {
+
+ if (p_format & VS::ARRAY_FLAG_USE_2D_VERTICES) {
+ src_size[i] = 4;
+ dst_size[i] = 8;
+ to_convert[i] = 2;
+ } else {
+ src_size[i] = 8;
+ dst_size[i] = 12;
+ to_convert[i] = 3;
+ }
+
+ format &= ~VS::ARRAY_COMPRESS_VERTEX;
+ } else {
+
+ if (p_format & VS::ARRAY_FLAG_USE_2D_VERTICES) {
+ src_size[i] = 8;
+ dst_size[i] = 8;
+ } else {
+ src_size[i] = 12;
+ dst_size[i] = 12;
+ }
+ }
+
+ } break;
+ case VS::ARRAY_NORMAL: {
+
+ if (p_format & VS::ARRAY_COMPRESS_NORMAL) {
+ src_size[i] = 4;
+ dst_size[i] = 4;
+ } else {
+ src_size[i] = 12;
+ dst_size[i] = 12;
+ }
+
+ } break;
+ case VS::ARRAY_TANGENT: {
+
+ if (p_format & VS::ARRAY_COMPRESS_TANGENT) {
+ src_size[i] = 4;
+ dst_size[i] = 4;
+ } else {
+ src_size[i] = 16;
+ dst_size[i] = 16;
+ }
+
+ } break;
+ case VS::ARRAY_COLOR: {
+
+ if (p_format & VS::ARRAY_COMPRESS_COLOR) {
+ src_size[i] = 4;
+ dst_size[i] = 4;
+ } else {
+ src_size[i] = 16;
+ dst_size[i] = 16;
+ }
+
+ } break;
+ case VS::ARRAY_TEX_UV: {
+
+ if (p_format & VS::ARRAY_COMPRESS_TEX_UV) {
+ src_size[i] = 4;
+ to_convert[i] = 2;
+ format &= ~VS::ARRAY_COMPRESS_TEX_UV;
+ } else {
+ src_size[i] = 8;
+ }
+
+ dst_size[i] = 8;
+
+ } break;
+ case VS::ARRAY_TEX_UV2: {
+
+ if (p_format & VS::ARRAY_COMPRESS_TEX_UV2) {
+ src_size[i] = 4;
+ to_convert[i] = 2;
+ format &= ~VS::ARRAY_COMPRESS_TEX_UV2;
+ } else {
+ src_size[i] = 8;
+ }
+
+ dst_size[i] = 8;
+
+ } break;
+ case VS::ARRAY_BONES: {
+
+ if (p_format & VS::ARRAY_FLAG_USE_16_BIT_BONES) {
+ src_size[i] = 8;
+ dst_size[i] = 8;
+ } else {
+ src_size[i] = 4;
+ dst_size[i] = 4;
+ }
+
+ } break;
+ case VS::ARRAY_WEIGHTS: {
+
+ if (p_format & VS::ARRAY_COMPRESS_WEIGHTS) {
+ src_size[i] = 8;
+ dst_size[i] = 8;
+ } else {
+ src_size[i] = 16;
+ dst_size[i] = 16;
+ }
+
+ } break;
+ case VS::ARRAY_INDEX: {
+
+ src_size[i] = 0;
+ dst_size[i] = 0;
+
+ } break;
+ }
+
+ src_stride += src_size[i];
+ dst_stride += dst_size[i];
+ }
+
+ PoolVector<uint8_t> ret;
+ ret.resize(p_vertices * dst_stride);
+
+ PoolVector<uint8_t>::Read r = array.read();
+ PoolVector<uint8_t>::Write w = ret.write();
+
+ int src_offset = 0;
+ int dst_offset = 0;
+
+ for (int i = 0; i < VS::ARRAY_MAX; i++) {
+
+ if (src_size[i] == 0) {
+ continue; //no go
+ }
+ const uint8_t *rptr = r.ptr();
+ uint8_t *wptr = w.ptr();
+ if (to_convert[i]) { //converting
+
+ for (int j = 0; j < p_vertices; j++) {
+ const uint16_t *src = (const uint16_t *)&rptr[src_stride * j + src_offset];
+ float *dst = (float *)&wptr[dst_stride * j + dst_offset];
+
+ for (int k = 0; k < to_convert[i]; k++) {
+
+ dst[k] = Math::half_to_float(src[k]);
+ }
+ }
+
+ } else {
+ //just copy
+ for (int j = 0; j < p_vertices; j++) {
+ for (int k = 0; k < src_size[i]; k++) {
+ wptr[dst_stride * j + dst_offset + k] = rptr[src_stride * j + src_offset + k];
+ }
+ }
+ }
+
+ src_offset += src_size[i];
+ dst_offset += dst_size[i];
+ }
+
+ r = PoolVector<uint8_t>::Read();
+ w = PoolVector<uint8_t>::Write();
+
+ return ret;
+}
+
void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS::PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes, const Vector<AABB> &p_bone_aabbs) {
- PoolVector<uint8_t> array = p_array;
Mesh *mesh = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!mesh);
@@ -1735,6 +1923,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
Surface::Attrib attribs[VS::ARRAY_MAX];
int stride = 0;
+ bool uses_half_float = false;
for (int i = 0; i < VS::ARRAY_MAX; i++) {
@@ -1763,6 +1952,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
if (p_format & VS::ARRAY_COMPRESS_VERTEX) {
attribs[i].type = _GL_HALF_FLOAT_OES;
stride += attribs[i].size * 2;
+ uses_half_float = true;
} else {
attribs[i].type = GL_FLOAT;
stride += attribs[i].size * 4;
@@ -1823,6 +2013,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
if (p_format & VS::ARRAY_COMPRESS_TEX_UV) {
attribs[i].type = _GL_HALF_FLOAT_OES;
stride += 4;
+ uses_half_float = true;
} else {
attribs[i].type = GL_FLOAT;
stride += 8;
@@ -1838,6 +2029,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
if (p_format & VS::ARRAY_COMPRESS_TEX_UV2) {
attribs[i].type = _GL_HALF_FLOAT_OES;
stride += 4;
+ uses_half_float = true;
} else {
attribs[i].type = GL_FLOAT;
stride += 8;
@@ -1900,6 +2092,7 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
}
//validate sizes
+ PoolVector<uint8_t> array = p_array;
int array_size = stride * p_vertex_count;
int index_array_size = 0;
@@ -1931,6 +2124,15 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
ERR_FAIL_COND(array.size() != array_size);
+ if (!config.support_half_float_vertices && uses_half_float) {
+
+ uint32_t new_format = p_format;
+ PoolVector<uint8_t> unpacked_array = _unpack_half_floats(array, new_format, p_vertex_count);
+
+ mesh_add_surface(p_mesh, new_format, p_primitive, unpacked_array, p_vertex_count, p_index_array, p_index_count, p_aabb, p_blend_shapes, p_bone_aabbs);
+ return; //do not go any further, above function used unpacked stuff will be used instead.
+ }
+
if (p_format & VS::ARRAY_FORMAT_INDEX) {
index_array_size = attribs[VS::ARRAY_INDEX].stride * p_index_count;
@@ -4679,6 +4881,12 @@ void RasterizerStorageGLES2::initialize() {
config.support_write_depth = config.extensions.has("GL_EXT_frag_depth");
#endif
+#ifdef JAVASCRIPT_ENABLED
+ config.support_half_float_vertices = false;
+#else
+ //every other platform, be it mobile or desktop, supports this (even if not in the GLES2 spec).
+ config.support_half_float_vertices = true;
+#endif
frame.count = 0;
frame.delta = 0;
diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h
index 0e0804eef2..ed21238db6 100644
--- a/drivers/gles2/rasterizer_storage_gles2.h
+++ b/drivers/gles2/rasterizer_storage_gles2.h
@@ -81,6 +81,7 @@ public:
bool support_32_bits_indices;
bool support_write_depth;
+ bool support_half_float_vertices;
} config;
struct Resources {
diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl
index d483659e4d..45d26e7254 100644
--- a/drivers/gles2/shaders/canvas.glsl
+++ b/drivers/gles2/shaders/canvas.glsl
@@ -215,6 +215,26 @@ VERTEX_SHADER_CODE
/* clang-format off */
[fragment]
+#ifndef USE_GLES_OVER_GL
+
+#ifdef GL_EXT_shader_texture_lod
+#extension GL_EXT_shader_texture_lod : enable
+#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
+#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
+#endif
+
+#ifdef GL_ARB_shader_texture_lod
+#extension GL_ARB_shader_texture_lod : enable
+#endif
+
+#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
+#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
+#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
+#endif
+
+#endif
+
+
#ifdef USE_GLES_OVER_GL
#define lowp
#define mediump
diff --git a/drivers/gles2/shaders/cubemap_filter.glsl b/drivers/gles2/shaders/cubemap_filter.glsl
index f551cdb52b..c9a0fd4ba2 100644
--- a/drivers/gles2/shaders/cubemap_filter.glsl
+++ b/drivers/gles2/shaders/cubemap_filter.glsl
@@ -25,6 +25,8 @@ void main() {
/* clang-format off */
[fragment]
+#ifndef USE_GLES_OVER_GL
+
#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
@@ -36,8 +38,10 @@ void main() {
#endif
#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
-#define texture2DLod(img, coord, lod) texture2D(img, coord)
-#define textureCubeLod(img, coord, lod) textureCube(img, coord)
+#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
+#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
+#endif
+
#endif
#ifdef USE_GLES_OVER_GL
diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index b2b9458ed2..148b5ae7ef 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -655,13 +655,27 @@ VERTEX_SHADER_CODE
/* clang-format off */
[fragment]
+
+#ifndef USE_GLES_OVER_GL
+
+#ifdef GL_EXT_shader_texture_lod
+#extension GL_EXT_shader_texture_lod : enable
+#define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod)
+#define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod)
+#endif
+
+#ifdef GL_ARB_shader_texture_lod
#extension GL_ARB_shader_texture_lod : enable
+#endif
+
+#if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod)
+#define texture2DLod(img, coord, lod) texture2D(img, coord, lod)
+#define textureCubeLod(img, coord, lod) textureCube(img, coord, lod)
+#endif
-#ifndef GL_ARB_shader_texture_lod
-#define texture2DLod(img, coord, lod) texture2D(img, coord)
-#define textureCubeLod(img, coord, lod) textureCube(img, coord)
#endif
+
#ifdef USE_GLES_OVER_GL
#define lowp
#define mediump
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 02dbe096c5..b831197759 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -3114,7 +3114,7 @@ void RasterizerSceneGLES3::_copy_screen(bool p_invalidate_color, bool p_invalida
GLenum attachments[2] = {
GL_COLOR_ATTACHMENT0,
- GL_DEPTH_STENCIL_ATTACHMENT
+ GL_DEPTH_ATTACHMENT
};
glInvalidateFramebuffer(GL_FRAMEBUFFER, p_invalidate_depth ? 2 : 1, attachments);
@@ -4164,7 +4164,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo);
glReadBuffer(GL_COLOR_ATTACHMENT0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->fbo);
- glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
+ glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
//bind depth for read
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 24673c8755..4818fd4927 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -6931,7 +6931,12 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
glGenTextures(1, &rt->exposure.color);
glBindTexture(GL_TEXTURE_2D, rt->exposure.color);
+#ifdef IPHONE_ENABLED
+ ///@TODO ugly hack to get around iOS not supporting 32bit single channel floating point textures...
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, 1, 1, 0, GL_RED, GL_FLOAT, NULL);
+#else
glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, 1, 1, 0, GL_RED, GL_FLOAT, NULL);
+#endif
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->exposure.color, 0);
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
@@ -7163,7 +7168,12 @@ RID RasterizerStorageGLES3::canvas_light_shadow_buffer_create(int p_width) {
if (config.use_rgba_2d_shadows) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, cls->size, cls->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
} else {
+#ifdef IPHONE_ENABLED
+ ///@TODO ugly hack to get around iOS not supporting 32bit single channel floating point textures...
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, cls->size, cls->height, 0, GL_RED, GL_FLOAT, NULL);
+#else
glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, cls->size, cls->height, 0, GL_RED, GL_FLOAT, NULL);
+#endif
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp
index a2883690da..acc7637c0b 100644
--- a/editor/editor_sectioned_inspector.cpp
+++ b/editor/editor_sectioned_inspector.cpp
@@ -241,7 +241,7 @@ void SectionedInspector::update_category_list() {
int sp = pi.name.find("/");
if (sp == -1)
- pi.name = "Global/" + pi.name;
+ pi.name = "global/" + pi.name;
Vector<String> sectionarr = pi.name.split("/");
String metasection;
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index e14db9a201..0662bc2edc 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -208,8 +208,8 @@ def configure_msvc(env, manual_msvc_config):
'RTAUDIO_ENABLED', 'WASAPI_ENABLED',
'WINMIDI_ENABLED', 'TYPED_METHOD_BIND',
'WIN32', 'MSVC',
- 'WINVER=$target_win_version',
- '_WIN32_WINNT=$target_win_version'])
+ 'WINVER=%s' % env["target_win_version"],
+ '_WIN32_WINNT=%s' % env["target_win_version"]])
env.AppendUnique(CPPDEFINES=['NOMINMAX']) # disable bogus min/max WinDef.h macros
if env["bits"] == "64":
env.AppendUnique(CPPDEFINES=['_WIN64'])
@@ -218,7 +218,7 @@ def configure_msvc(env, manual_msvc_config):
LIBS = ['winmm', 'opengl32', 'dsound', 'kernel32', 'ole32', 'oleaut32',
'user32', 'gdi32', 'IPHLPAPI', 'Shlwapi', 'wsock32', 'Ws2_32',
- 'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32', 'bcrypt']
+ 'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32', 'bcrypt','Avrt']
env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS])
if manual_msvc_config:
@@ -329,7 +329,7 @@ def configure_mingw(env):
env.Append(CCFLAGS=['-DRTAUDIO_ENABLED'])
env.Append(CCFLAGS=['-DWASAPI_ENABLED'])
env.Append(CCFLAGS=['-DWINVER=%s' % env['target_win_version'], '-D_WIN32_WINNT=%s' % env['target_win_version']])
- env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt'])
+ env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt','avrt'])
env.Append(CPPFLAGS=['-DMINGW_ENABLED'])
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index d1693cb0b4..5cba34ac62 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -50,6 +50,7 @@
#include "servers/visual/visual_server_raster.h"
#include "servers/visual/visual_server_wrap_mt.h"
#include "windows_terminal_logger.h"
+#include <avrt.h>
#include <process.h>
#include <regstr.h>
@@ -1373,6 +1374,19 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
set_ime_active(false);
+ if (!OS::get_singleton()->is_in_low_processor_usage_mode()) {
+ //SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS);
+ SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS);
+ DWORD index = 0;
+ HANDLE handle = AvSetMmThreadCharacteristics("Games", &index);
+ if (handle)
+ AvSetMmThreadPriority(handle, AVRT_PRIORITY_CRITICAL);
+
+ // This is needed to make sure that background work does not starve the main thread.
+ // This is only setting priority of this thread, not the whole process.
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
+ }
+
return OK;
}
@@ -2321,6 +2335,9 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap
iconinfo.hbmMask = hAndMask;
iconinfo.hbmColor = hXorMask;
+ if (cursors[p_shape])
+ DestroyIcon(cursors[p_shape]);
+
cursors[p_shape] = CreateIconIndirect(&iconinfo);
if (p_shape == cursor_shape) {
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index a6b4d475ba..806c8afa5b 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -82,16 +82,16 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
}
- emit_signal("pressed");
_unpress_group();
+ emit_signal("pressed");
} else {
status.pressed = !status.pressed;
pressed();
- emit_signal("pressed");
_unpress_group();
+ emit_signal("pressed");
toggled(status.pressed);
if (get_script_instance()) {
@@ -135,6 +135,7 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
}
+ _unpress_group();
emit_signal("pressed");
} else {
@@ -142,6 +143,7 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
status.pressed = !status.pressed;
pressed();
+ _unpress_group();
emit_signal("pressed");
toggled(status.pressed);
@@ -150,8 +152,6 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
}
emit_signal("toggled", status.pressed);
}
-
- _unpress_group();
}
status.press_attempt = false;
@@ -215,12 +215,14 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce);
}
+ _unpress_group();
emit_signal("pressed");
} else {
status.pressed = !status.pressed;
pressed();
+ _unpress_group();
emit_signal("pressed");
toggled(status.pressed);
@@ -229,8 +231,6 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
}
emit_signal("toggled", status.pressed);
}
-
- _unpress_group();
}
accept_event();
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index 5660f0a1b9..fd7b67a218 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -1009,7 +1009,7 @@ void DynamicFont::_bind_methods() {
ADD_GROUP("Settings", "");
ADD_PROPERTY(PropertyInfo(Variant::INT, "size"), "set_size", "get_size");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "outline_size"), "set_outline_size", "get_outline_size");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "outline_size", PROPERTY_HINT_RANGE, "0,255,1"), "set_outline_size", "get_outline_size");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "outline_color"), "set_outline_color", "get_outline_color");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_mipmaps"), "set_use_mipmaps", "get_use_mipmaps");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_filter"), "set_use_filter", "get_use_filter");
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 186f183ea2..738835c70a 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -202,6 +202,9 @@ Files extracted from upstream source:
- all .h files in include/theora/ as theora/
- COPYING and LICENSE
+Upstream patches included in the `patches` directory have been applied
+on top of the 1.1.1 source (not included in any stable release yet).
+
## libvorbis
diff --git a/thirdparty/libtheora/decode.c b/thirdparty/libtheora/decode.c
index 7be66463d8..bde967b794 100644
--- a/thirdparty/libtheora/decode.c
+++ b/thirdparty/libtheora/decode.c
@@ -397,10 +397,10 @@ static int oc_dec_init(oc_dec_ctx *_dec,const th_info *_info,
int qsum;
qsum=0;
for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){
- qsum+=_dec->state.dequant_tables[qti][pli][qi][12]+
- _dec->state.dequant_tables[qti][pli][qi][17]+
- _dec->state.dequant_tables[qti][pli][qi][18]+
- _dec->state.dequant_tables[qti][pli][qi][24]<<(pli==0);
+ qsum+=_dec->state.dequant_tables[qi][pli][qti][12]+
+ _dec->state.dequant_tables[qi][pli][qti][17]+
+ _dec->state.dequant_tables[qi][pli][qti][18]+
+ _dec->state.dequant_tables[qi][pli][qti][24]<<(pli==0);
}
_dec->pp_sharp_mod[qi]=-(qsum>>11);
}
diff --git a/thirdparty/libtheora/patches/theora.git-0ae66d565e6bead8604d312bc1a4e9dccf245c88.patch b/thirdparty/libtheora/patches/theora.git-0ae66d565e6bead8604d312bc1a4e9dccf245c88.patch
new file mode 100644
index 0000000000..1b9c8e20be
--- /dev/null
+++ b/thirdparty/libtheora/patches/theora.git-0ae66d565e6bead8604d312bc1a4e9dccf245c88.patch
@@ -0,0 +1,38 @@
+From 0ae66d565e6bead8604d312bc1a4e9dccf245c88 Mon Sep 17 00:00:00 2001
+From: Tim Terriberry <tterribe@xiph.org>
+Date: Tue, 8 May 2012 02:51:57 +0000
+Subject: [PATCH] Fix pp_sharp_mod calculation.
+
+This was broken when the dequant_tables indexing changed in commit
+ r16102, but it only affected post-processing quality, so we never
+ noticed.
+With gcc 4.8.0, this can now trigger a segfault during decoder
+ initialization.
+
+svn path=/trunk/theora/; revision=18268
+---
+ decode.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/decode.c b/decode.c
+index b803505..9f2516a 100644
+--- a/decode.c
++++ b/decode.c
+@@ -400,10 +400,10 @@ static int oc_dec_init(oc_dec_ctx *_dec,const th_info *_info,
+ int qsum;
+ qsum=0;
+ for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){
+- qsum+=_dec->state.dequant_tables[qti][pli][qi][12]+
+- _dec->state.dequant_tables[qti][pli][qi][17]+
+- _dec->state.dequant_tables[qti][pli][qi][18]+
+- _dec->state.dequant_tables[qti][pli][qi][24]<<(pli==0);
++ qsum+=_dec->state.dequant_tables[qi][pli][qti][12]+
++ _dec->state.dequant_tables[qi][pli][qti][17]+
++ _dec->state.dequant_tables[qi][pli][qti][18]+
++ _dec->state.dequant_tables[qi][pli][qti][24]<<(pli==0);
+ }
+ _dec->pp_sharp_mod[qi]=-(qsum>>11);
+ }
+--
+2.11.0
+