summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.appveyor.yml24
-rw-r--r--.travis.yml18
-rw-r--r--README.md3
-rw-r--r--core/safe_refcount.cpp169
-rw-r--r--core/safe_refcount.h102
-rw-r--r--doc/classes/AnimatedSprite.xml14
-rw-r--r--drivers/gles3/shaders/scene.glsl8
-rw-r--r--editor/editor_autoload_settings.cpp2
-rw-r--r--editor/editor_settings.cpp6
-rw-r--r--editor/editor_settings.h5
-rw-r--r--editor/editor_themes.cpp55
-rw-r--r--editor/settings_config_dialog.cpp2
-rwxr-xr-xmisc/dist/osx_tools.app/Contents/Info.plist4
-rw-r--r--modules/gdscript/gd_function.cpp2
-rw-r--r--platform/windows/detect.py5
-rw-r--r--platform/x11/detect.py5
-rw-r--r--scene/audio/audio_player.cpp9
-rw-r--r--scene/gui/base_button.cpp4
18 files changed, 302 insertions, 135 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 0000000000..dbd56ab7e0
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,24 @@
+os: Visual Studio 2015
+
+environment:
+ PYTHON: C:\Python27
+ matrix:
+ - VS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
+ GD_PLATFORM: windows
+ TOOLS: yes
+ TARGET: release_debug
+ ARCH: amd64
+
+install:
+ - SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
+ - pip install --egg scons # it will fail on AppVeyor without --egg flag
+ - if defined VS call "%VS%" %ARCH% # if defined - so we can also use mingw
+
+before_build:
+ - echo %GD_PLATFORM%
+ - python --version
+ - scons --version
+ - cl.exe
+
+build_script:
+- scons platform=%GD_PLATFORM% target=%TARGET% tools=%TOOLS% progress=no
diff --git a/.travis.yml b/.travis.yml
index 602152374a..a2c3417412 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,7 +19,7 @@ env:
- GODOT_TARGET=osx
- GODOT_TARGET=x11
#- GODOT_TARGET=android
- - GODOT_TARGET=windows
+ #- GODOT_TARGET=windows
matrix:
include:
@@ -66,13 +66,13 @@ addons:
- libxrandr-dev
# For cross-compiling to Windows.
- - binutils-mingw-w64-i686
- - binutils-mingw-w64-x86-64
- - gcc-mingw-w64-i686
- - gcc-mingw-w64-x86-64
- - g++-mingw-w64-i686
- - g++-mingw-w64-x86-64
- - mingw-w64
+ #- binutils-mingw-w64-i686
+ #- binutils-mingw-w64-x86-64
+ #- gcc-mingw-w64-i686
+ #- gcc-mingw-w64-x86-64
+ #- g++-mingw-w64-i686
+ #- g++-mingw-w64-x86-64
+ #- mingw-w64
# For style checks.
- clang-format-3.9
@@ -92,5 +92,5 @@ script:
- if [ "$STATIC_CHECKS" = "yes" ]; then
sh ./misc/travis/clang-format.sh;
else
- scons -j 2 platform=$GODOT_TARGET progress=no verbose=yes CXX=$CXX builtin_openssl=yes;
+ scons -j 2 platform=$GODOT_TARGET progress=no verbose=yes CXX=$CXX;
fi
diff --git a/README.md b/README.md
index dc0dad6b90..675e666ce6 100644
--- a/README.md
+++ b/README.md
@@ -62,5 +62,6 @@ There are also a number of other learning resources provided by the community,
such as text and video tutorials, demos, etc. Consult the [community channels](https://godotengine.org/community)
for more info.
-[![Build Status](https://travis-ci.org/godotengine/godot.svg?branch=master)](https://travis-ci.org/godotengine/godot)
+[![Travis Build Status](https://travis-ci.org/godotengine/godot.svg?branch=master)](https://travis-ci.org/godotengine/godot)
+[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/bfiihqq6byxsjxxh/branch/master?svg=true)](https://ci.appveyor.com/project/akien-mga/godot)
[![Code Triagers Badge](https://www.codetriage.com/godotengine/godot/badges/users.svg)](https://www.codetriage.com/godotengine/godot)
diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp
new file mode 100644
index 0000000000..c9acdb7970
--- /dev/null
+++ b/core/safe_refcount.cpp
@@ -0,0 +1,169 @@
+/*************************************************************************/
+/* safe_refcount.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* 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 "safe_refcount.h"
+
+#if defined(_MSC_VER)
+
+/* Implementation for MSVC-Windows */
+
+// don't pollute my namespace!
+#include <windows.h>
+
+#define ATOMIC_CONDITIONAL_INCREMENT_BODY(m_pw, m_win_type, m_win_cmpxchg, m_cpp_type) \
+ /* try to increment until it actually works */ \
+ /* taken from boost */ \
+ while (true) { \
+ m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \
+ if (tmp == 0) \
+ return 0; /* if zero, can't add to it anymore */ \
+ if (m_win_cmpxchg((m_win_type volatile *)(m_pw), tmp + 1, tmp) == tmp) \
+ return tmp + 1; \
+ }
+
+#define ATOMIC_EXCHANGE_IF_GREATER_BODY(m_pw, m_val, m_win_type, m_win_cmpxchg, m_cpp_type) \
+ while (true) { \
+ m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \
+ if (tmp >= m_val) \
+ return tmp; /* already greater, or equal */ \
+ if (m_win_cmpxchg((m_win_type volatile *)(m_pw), m_val, tmp) == tmp) \
+ return m_val; \
+ }
+
+_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw) {
+
+ ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t)
+}
+
+_ALWAYS_INLINE_ uint32_t _atomic_decrement_impl(register uint32_t *pw) {
+
+ return InterlockedDecrement((LONG volatile *)pw);
+}
+
+_ALWAYS_INLINE_ uint32_t _atomic_increment_impl(register uint32_t *pw) {
+
+ return InterlockedIncrement((LONG volatile *)pw);
+}
+
+_ALWAYS_INLINE_ uint32_t _atomic_sub_impl(register uint32_t *pw, register uint32_t val) {
+
+ return InterlockedExchangeAdd((LONG volatile *)pw, -(int32_t)val) - val;
+}
+
+_ALWAYS_INLINE_ uint32_t _atomic_add_impl(register uint32_t *pw, register uint32_t val) {
+
+ return InterlockedAdd((LONG volatile *)pw, val);
+}
+
+_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val) {
+
+ ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t)
+}
+
+_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw) {
+
+ ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t)
+}
+
+_ALWAYS_INLINE_ uint64_t _atomic_decrement_impl(register uint64_t *pw) {
+
+ return InterlockedDecrement64((LONGLONG volatile *)pw);
+}
+
+_ALWAYS_INLINE_ uint64_t _atomic_increment_impl(register uint64_t *pw) {
+
+ return InterlockedIncrement64((LONGLONG volatile *)pw);
+}
+
+_ALWAYS_INLINE_ uint64_t _atomic_sub_impl(register uint64_t *pw, register uint64_t val) {
+
+ return InterlockedExchangeAdd64((LONGLONG volatile *)pw, -(int64_t)val) - val;
+}
+
+_ALWAYS_INLINE_ uint64_t _atomic_add_impl(register uint64_t *pw, register uint64_t val) {
+
+ return InterlockedAdd64((LONGLONG volatile *)pw, val);
+}
+
+_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val) {
+
+ ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t)
+}
+
+// The actual advertised functions; they'll call the right implementation
+
+uint32_t atomic_conditional_increment(register uint32_t *counter) {
+ return _atomic_conditional_increment_impl(counter);
+}
+
+uint32_t atomic_decrement(register uint32_t *pw) {
+ return _atomic_decrement_impl(pw);
+}
+
+uint32_t atomic_increment(register uint32_t *pw) {
+ return _atomic_increment_impl(pw);
+}
+
+uint32_t atomic_sub(register uint32_t *pw, register uint32_t val) {
+ return _atomic_sub_impl(pw, val);
+}
+
+uint32_t atomic_add(register uint32_t *pw, register uint32_t val) {
+ return _atomic_add_impl(pw, val);
+}
+
+uint32_t atomic_exchange_if_greater(register uint32_t *pw, register uint32_t val) {
+ return _atomic_exchange_if_greater_impl(pw, val);
+}
+
+uint64_t atomic_conditional_increment(register uint64_t *counter) {
+ return _atomic_conditional_increment_impl(counter);
+}
+
+uint64_t atomic_decrement(register uint64_t *pw) {
+ return _atomic_decrement_impl(pw);
+}
+
+uint64_t atomic_increment(register uint64_t *pw) {
+ return _atomic_increment_impl(pw);
+}
+
+uint64_t atomic_sub(register uint64_t *pw, register uint64_t val) {
+ return _atomic_sub_impl(pw, val);
+}
+
+uint64_t atomic_add(register uint64_t *pw, register uint64_t val) {
+ return _atomic_add_impl(pw, val);
+}
+
+uint64_t atomic_exchange_if_greater(register uint64_t *pw, register uint64_t val) {
+ return _atomic_exchange_if_greater_impl(pw, val);
+}
+#endif
diff --git a/core/safe_refcount.h b/core/safe_refcount.h
index 05126cc319..39967d5ac4 100644
--- a/core/safe_refcount.h
+++ b/core/safe_refcount.h
@@ -150,97 +150,25 @@ static _ALWAYS_INLINE_ T atomic_exchange_if_greater(register T *pw, register V v
}
#elif defined(_MSC_VER)
-
-/* Implementation for MSVC-Windows */
-
-// don't pollute my namespace!
-#include <windows.h>
-
-#define ATOMIC_CONDITIONAL_INCREMENT_BODY(m_pw, m_win_type, m_win_cmpxchg, m_cpp_type) \
- /* try to increment until it actually works */ \
- /* taken from boost */ \
- while (true) { \
- m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \
- if (tmp == 0) \
- return 0; /* if zero, can't add to it anymore */ \
- if (m_win_cmpxchg((m_win_type volatile *)(m_pw), tmp + 1, tmp) == tmp) \
- return tmp + 1; \
- }
-
-#define ATOMIC_EXCHANGE_IF_GREATER_BODY(m_pw, m_val, m_win_type, m_win_cmpxchg, m_cpp_type) \
- while (true) { \
- m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \
- if (tmp >= m_val) \
- return tmp; /* already greater, or equal */ \
- if (m_win_cmpxchg((m_win_type volatile *)(m_pw), m_val, tmp) == tmp) \
- return m_val; \
- }
-
-static _ALWAYS_INLINE_ uint32_t atomic_conditional_increment(register uint32_t *pw) {
-
- ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t)
-}
-
-static _ALWAYS_INLINE_ uint32_t atomic_decrement(register uint32_t *pw) {
-
- return InterlockedDecrement((LONG volatile *)pw);
-}
-
-static _ALWAYS_INLINE_ uint32_t atomic_increment(register uint32_t *pw) {
-
- return InterlockedIncrement((LONG volatile *)pw);
-}
-
-static _ALWAYS_INLINE_ uint32_t atomic_sub(register uint32_t *pw, register uint32_t val) {
-
- return InterlockedExchangeAdd((LONG volatile *)pw, -(int32_t)val) - val;
-}
-
-static _ALWAYS_INLINE_ uint32_t atomic_add(register uint32_t *pw, register uint32_t val) {
-
- return InterlockedAdd((LONG volatile *)pw, val);
-}
-
-static _ALWAYS_INLINE_ uint32_t atomic_exchange_if_greater(register uint32_t *pw, register uint32_t val) {
-
- ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t)
-}
-
-static _ALWAYS_INLINE_ uint64_t atomic_conditional_increment(register uint64_t *pw) {
-
- ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t)
-}
-
-static _ALWAYS_INLINE_ uint64_t atomic_decrement(register uint64_t *pw) {
-
- return InterlockedDecrement64((LONGLONG volatile *)pw);
-}
-
-static _ALWAYS_INLINE_ uint64_t atomic_increment(register uint64_t *pw) {
-
- return InterlockedIncrement64((LONGLONG volatile *)pw);
-}
-
-static _ALWAYS_INLINE_ uint64_t atomic_sub(register uint64_t *pw, register uint64_t val) {
-
- return InterlockedExchangeAdd64((LONGLONG volatile *)pw, -(int64_t)val) - val;
-}
-
-static _ALWAYS_INLINE_ uint64_t atomic_add(register uint64_t *pw, register uint64_t val) {
-
- return InterlockedAdd64((LONGLONG volatile *)pw, val);
-}
-
-static _ALWAYS_INLINE_ uint64_t atomic_exchange_if_greater(register uint64_t *pw, register uint64_t val) {
-
- ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t)
-}
+// For MSVC use a separate compilation unit to prevent windows.h from polluting
+// the global namespace.
+uint32_t atomic_conditional_increment(register uint32_t *pw);
+uint32_t atomic_decrement(register uint32_t *pw);
+uint32_t atomic_increment(register uint32_t *pw);
+uint32_t atomic_sub(register uint32_t *pw, register uint32_t val);
+uint32_t atomic_add(register uint32_t *pw, register uint32_t val);
+uint32_t atomic_exchange_if_greater(register uint32_t *pw, register uint32_t val);
+
+uint64_t atomic_conditional_increment(register uint64_t *pw);
+uint64_t atomic_decrement(register uint64_t *pw);
+uint64_t atomic_increment(register uint64_t *pw);
+uint64_t atomic_sub(register uint64_t *pw, register uint64_t val);
+uint64_t atomic_add(register uint64_t *pw, register uint64_t val);
+uint64_t atomic_exchange_if_greater(register uint64_t *pw, register uint64_t val);
#else
-
//no threads supported?
#error Must provide atomic functions for this platform or compiler!
-
#endif
struct SafeRefCount {
diff --git a/doc/classes/AnimatedSprite.xml b/doc/classes/AnimatedSprite.xml
index f8663e90e0..809890bea1 100644
--- a/doc/classes/AnimatedSprite.xml
+++ b/doc/classes/AnimatedSprite.xml
@@ -4,7 +4,7 @@
Sprite node that can use multiple textures for animation.
</brief_description>
<description>
- Sprite node that can use multiple textures for animation.
+ Sprite node that can use multiple textures for animation. Animations are created using a [SpriteFrames] resource, which can be configured in the editor via the SpriteFrames panel.
</description>
<tutorials>
</tutorials>
@@ -149,31 +149,39 @@
</methods>
<members>
<member name="animation" type="String" setter="set_animation" getter="get_animation">
+ The current animation from the [code]frames[/code] resource. If this value is changed, the [code]frame[/code] counter is reset.
</member>
<member name="centered" type="bool" setter="set_centered" getter="is_centered">
+ If [code]true[/code] texture will be centered. Default value: [code]true[/code].
</member>
<member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h">
+ If [code]true[/code] texture is flipped horizontally. Default value: [code]false[/code].
</member>
<member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v">
+ If [code]true[/code] texture is flipped vertically. Default value: [code]false[/code].
</member>
<member name="frame" type="int" setter="set_frame" getter="get_frame">
+ The current frame index.
</member>
<member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames">
+ The [SpriteFrames] resource containing the animation(s).
</member>
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset">
+ The texture's drawing offset.
</member>
<member name="playing" type="bool" setter="_set_playing" getter="_is_playing">
+ If [code]true[/code] the [code]animation[/code] is currently playing.
</member>
</members>
<signals>
<signal name="animation_finished">
<description>
- Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn, before looping.
+ Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn.
</description>
</signal>
<signal name="frame_changed">
<description>
- Emitted when frame is changed.
+ Emitted when [code]frame[/code] changes.
</description>
</signal>
</signals>
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index 25115bc18a..7692a0932a 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -941,12 +941,12 @@ LIGHT_SHADER_CODE
vec3 H = normalize(V + L);
float NoL = max(0.0,dot(N, L));
- float VoH = max(0.0,dot(L, H));
+ float LoH = max(0.0,dot(L, H));
float NoV = max(0.0,dot(N, V));
- float FD90 = 0.5 + 2.0 * VoH * VoH * roughness;
- float FdV = 1.0 + (FD90 - 1.0) * pow( 1.0 - NoV, 5.0 );
- float FdL = 1.0 + (FD90 - 1.0) * pow( 1.0 - NoL, 5.0 );
+ float FD90 = 0.5 + 2.0 * LoH * LoH * roughness;
+ float FdV = 1.0 + (FD90 - 1.0) * SchlickFresnel(NoV);
+ float FdL = 1.0 + (FD90 - 1.0) * SchlickFresnel(NoL);
light_amount = ( (1.0 / M_PI) * FdV * FdL );
/*
float energyBias = mix(roughness, 0.0, 0.5);
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index ee537f4228..efa9572bf5 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -364,7 +364,7 @@ void EditorAutoloadSettings::update_autoload() {
item->add_button(3, get_icon("MoveUp", "EditorIcons"), BUTTON_MOVE_UP);
item->add_button(3, get_icon("MoveDown", "EditorIcons"), BUTTON_MOVE_DOWN);
- item->add_button(3, get_icon("Del", "EditorIcons"), BUTTON_DELETE);
+ item->add_button(3, get_icon("Remove", "EditorIcons"), BUTTON_DELETE);
item->set_selectable(3, false);
}
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index e1333d9d82..325f30a453 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -54,7 +54,7 @@ EditorSettings *EditorSettings::get_singleton() {
return singleton.ptr();
}
-bool EditorSettings::_set(const StringName &p_name, const Variant &p_value) {
+bool EditorSettings::_set(const StringName &p_name, const Variant &p_value, bool p_emit_signal) {
_THREAD_SAFE_METHOD_
@@ -90,7 +90,9 @@ bool EditorSettings::_set(const StringName &p_name, const Variant &p_value) {
}
}
- emit_signal("settings_changed");
+ if (p_emit_signal) {
+ emit_signal("settings_changed");
+ }
return true;
}
diff --git a/editor/editor_settings.h b/editor/editor_settings.h
index 6a814c41a5..19cf367d57 100644
--- a/editor/editor_settings.h
+++ b/editor/editor_settings.h
@@ -85,7 +85,7 @@ private:
HashMap<String, VariantContainer> props;
String resource_path;
- bool _set(const StringName &p_name, const Variant &p_value);
+ bool _set(const StringName &p_name, const Variant &p_value, bool p_emit_signal = true);
bool _get(const StringName &p_name, Variant &r_ret) const;
void _get_property_list(List<PropertyInfo> *p_list) const;
@@ -126,6 +126,9 @@ public:
NOTIFICATION_EDITOR_SETTINGS_CHANGED = 10000
};
+ void set_manually(const StringName &p_name, const Variant &p_value, bool p_emit_signal = false) {
+ _set(p_name, p_value, p_emit_signal);
+ }
bool has(String p_var) const;
static EditorSettings *get_singleton();
void erase(String p_var);
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index c38d357cea..b33c36867a 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -227,8 +227,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const float default_contrast = 0.25;
//Theme settings
- Color accent_color = EDITOR_DEF("interface/theme/accent_color", Color::html("#000000"));
- Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#000000"));
+ Color accent_color = EDITOR_DEF("interface/theme/accent_color", Color::html("#699ce8"));
+ Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#323b4f"));
float contrast = EDITOR_DEF("interface/theme/contrast", default_contrast);
int preset = EDITOR_DEF("interface/theme/preset", 0);
@@ -240,33 +240,54 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
Color script_bg_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0));
+ Color preset_accent_color;
+ Color preset_base_color;
+ float preset_contrast;
switch (preset) {
case 0: { // Default
- accent_color = Color::html("#699ce8");
- base_color = Color::html("#323b4f");
- contrast = default_contrast;
+ preset_accent_color = Color::html("#699ce8");
+ preset_base_color = Color::html("#323b4f");
+ preset_contrast = default_contrast;
} break;
case 1: { // Grey
- accent_color = Color::html("#3e3e3e");
- base_color = Color::html("#3d3d3d");
- contrast = 0.2;
+ preset_accent_color = Color::html("#3e3e3e");
+ preset_base_color = Color::html("#3d3d3d");
+ preset_contrast = 0.2;
} break;
case 2: { // Godot 2
- accent_color = Color::html("#86ace2");
- base_color = Color::html("#3C3A44");
- contrast = 0.25;
+ preset_accent_color = Color::html("#86ace2");
+ preset_base_color = Color::html("#3C3A44");
+ preset_contrast = 0.25;
} break;
case 3: { // Arc
- accent_color = Color::html("#5294e2");
- base_color = Color::html("#383c4a");
- contrast = 0.25;
+ preset_accent_color = Color::html("#5294e2");
+ preset_base_color = Color::html("#383c4a");
+ preset_contrast = 0.25;
} break;
case 4: { // Light
- accent_color = Color::html("#2070ff");
- base_color = Color::html("#ffffff");
- contrast = 0.08;
+ preset_accent_color = Color::html("#2070ff");
+ preset_base_color = Color::html("#ffffff");
+ preset_contrast = 0.08;
} break;
+ default: { // Custom
+ accent_color = EDITOR_DEF("interface/theme/accent_color", Color::html("#699ce8"));
+ base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#323b4f"));
+ contrast = EDITOR_DEF("interface/theme/contrast", default_contrast);
+ }
+ }
+
+ if (preset != 5) {
+ accent_color = preset_accent_color;
+ base_color = preset_base_color;
+ contrast = preset_contrast;
+ EditorSettings::get_singleton()->set_initial_value("interface/theme/accent_color", accent_color);
+ EditorSettings::get_singleton()->set_initial_value("interface/theme/base_color", base_color);
+ EditorSettings::get_singleton()->set_initial_value("interface/theme/contrast", contrast);
}
+ EditorSettings::get_singleton()->set_manually("interface/theme/preset", preset);
+ EditorSettings::get_singleton()->set_manually("interface/theme/accent_color", accent_color);
+ EditorSettings::get_singleton()->set_manually("interface/theme/base_color", base_color);
+ EditorSettings::get_singleton()->set_manually("interface/theme/contrast", contrast);
//Colors
int AUTO_COLOR = 0;
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index c90626976d..aada90173a 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -58,6 +58,8 @@ void EditorSettingsDialog::_settings_property_edited(const String &p_name) {
// color theme is changed
if (full_name == "text_editor/theme/color_theme") {
property_editor->get_property_editor()->update_tree();
+ } else if (full_name == "interface/theme/accent_color" || full_name == "interface/theme/base_color" || full_name == "interface/theme/contrast") {
+ EditorSettings::get_singleton()->set_manually("interface/theme/preset", 5); // set preset to Custom
}
}
diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist
index 4d88e97503..5012d17c37 100755
--- a/misc/dist/osx_tools.app/Contents/Info.plist
+++ b/misc/dist/osx_tools.app/Contents/Info.plist
@@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>2.2-dev</string>
+ <string>3.0-dev</string>
<key>CFBundleSignature</key>
<string>godot</string>
<key>CFBundleVersion</key>
- <string>2.2-dev</string>
+ <string>3.0-dev</string>
<key>NSHumanReadableCopyright</key>
<string>© 2007-2017 Juan Linietsky, Ariel Manzur</string>
<key>LSMinimumSystemVersion</key>
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index d39e967ac9..767ea29f3c 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -909,7 +909,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
gds = gds->base.ptr();
E = gds->member_functions.find(*methodname);
if (E)
- OPCODE_BREAK;
+ break;
}
Variant::CallError err;
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 92f2e078c8..031b397988 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -265,7 +265,10 @@ def configure(env):
if env['use_lto']:
env.Append(CCFLAGS=['-flto'])
- env.Append(LINKFLAGS=['-flto'])
+ if not env['use_llvm'] and env.GetOption("num_jobs") > 1:
+ env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))])
+ else:
+ env.Append(LINKFLAGS=['-flto'])
## Compile flags
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index c8d9930af1..1f7f67fe10 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -120,7 +120,10 @@ def configure(env):
if env['use_lto']:
env.Append(CCFLAGS=['-flto'])
- env.Append(LINKFLAGS=['-flto'])
+ if not env['use_llvm'] and env.GetOption("num_jobs") > 1:
+ env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))])
+ else:
+ env.Append(LINKFLAGS=['-flto'])
if not env['use_llvm']:
env['RANLIB'] = 'gcc-ranlib'
env['AR'] = 'gcc-ar'
diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp
index 14dd39a491..058b162e83 100644
--- a/scene/audio/audio_player.cpp
+++ b/scene/audio/audio_player.cpp
@@ -122,7 +122,6 @@ void AudioStreamPlayer::_notification(int p_what) {
void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) {
- ERR_FAIL_COND(!p_stream.is_valid());
AudioServer::get_singleton()->lock();
mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size());
@@ -134,12 +133,14 @@ void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) {
setseek = -1;
}
- stream = p_stream;
- stream_playback = p_stream->instance_playback();
+ if (p_stream.is_valid()) {
+ stream = p_stream;
+ stream_playback = p_stream->instance_playback();
+ }
AudioServer::get_singleton()->unlock();
- if (stream_playback.is_null()) {
+ if (p_stream.is_valid() && stream_playback.is_null()) {
stream.unref();
ERR_FAIL_COND(stream_playback.is_null());
}
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 04c0817b15..148277f2dd 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -39,7 +39,9 @@ void BaseButton::_unpress_group() {
if (!button_group.is_valid())
return;
- status.pressed = false;
+ if (toggle_mode) {
+ status.pressed = true;
+ }
for (Set<BaseButton *>::Element *E = button_group->buttons.front(); E; E = E->next()) {
if (E->get() == this)