summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/color.cpp12
-rw-r--r--core/color.h2
-rw-r--r--core/math/math_funcs.cpp2
-rw-r--r--core/variant_call.cpp1
-rw-r--r--doc/classes/Color.xml17
-rw-r--r--modules/gdnative/gdnative/color.cpp7
-rw-r--r--modules/gdnative/gdnative_api.json7
-rw-r--r--modules/gdnative/include/gdnative/color.h2
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs14
-rw-r--r--platform/iphone/detect.py2
-rw-r--r--platform/windows/os_windows.cpp10
-rw-r--r--scene/gui/gradient_edit.cpp2
-rw-r--r--scene/resources/material.cpp2
-rw-r--r--tests/test_color.h3
14 files changed, 10 insertions, 73 deletions
diff --git a/core/color.cpp b/core/color.cpp
index c61ee0e64a..4047ca5037 100644
--- a/core/color.cpp
+++ b/core/color.cpp
@@ -217,12 +217,6 @@ void Color::invert() {
b = 1.0 - b;
}
-void Color::contrast() {
- r = Math::fmod(r + 0.5, 1.0);
- g = Math::fmod(g + 0.5, 1.0);
- b = Math::fmod(b + 0.5, 1.0);
-}
-
Color Color::hex(uint32_t p_hex) {
float a = (p_hex & 0xFF) / 255.0;
p_hex >>= 8;
@@ -284,12 +278,6 @@ Color Color::inverted() const {
return c;
}
-Color Color::contrasted() const {
- Color c = *this;
- c.contrast();
- return c;
-}
-
Color Color::html(const String &p_rgba) {
String color = p_rgba;
if (color.length() == 0) {
diff --git a/core/color.h b/core/color.h
index 2dbbc52905..8980efe74a 100644
--- a/core/color.h
+++ b/core/color.h
@@ -91,9 +91,7 @@ struct Color {
bool is_equal_approx(const Color &p_color) const;
void invert();
- void contrast();
Color inverted() const;
- Color contrasted() const;
_FORCE_INLINE_ Color lerp(const Color &p_b, float p_t) const {
Color res = *this;
diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp
index 1585c96b38..4154713a87 100644
--- a/core/math/math_funcs.cpp
+++ b/core/math/math_funcs.cpp
@@ -34,8 +34,6 @@
RandomPCG Math::default_rand(RandomPCG::DEFAULT_SEED, RandomPCG::DEFAULT_INC);
-#define PHI 0x9e3779b9
-
uint32_t Math::rand_from_seed(uint64_t *seed) {
RandomPCG rng = RandomPCG(*seed, RandomPCG::DEFAULT_INC);
uint32_t r = rng.rand();
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index b1a046a72c..d2b626a942 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -1614,7 +1614,6 @@ void register_variant_methods() {
bind_method(Color, to_rgba64, sarray(), varray());
bind_method(Color, inverted, sarray(), varray());
- bind_method(Color, contrasted, sarray(), varray());
bind_method(Color, lerp, sarray("b", "t"), varray());
bind_method(Color, lightened, sarray("amount"), varray());
bind_method(Color, darkened, sarray("amount"), varray());
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index ffa0fa54c9..ca52d27a52 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -159,23 +159,6 @@
[/codeblocks]
</description>
</method>
- <method name="contrasted">
- <return type="Color">
- </return>
- <description>
- Returns the most contrasting color.
- [codeblocks]
- [gdscript]
- var color = Color(0.3, 0.4, 0.9)
- var contrasted_color = color.contrasted() # Equivalent to RGBA(204, 229, 102, 255)
- [/gdscript]
- [csharp]
- var color = new Color(0.3f, 0.4f, 0.9f);
- Color contrastedColor = color.Contrasted(); // Equivalent to RGBA(204, 229, 102, 255)
- [/csharp]
- [/codeblocks]
- </description>
- </method>
<method name="darkened">
<return type="Color">
</return>
diff --git a/modules/gdnative/gdnative/color.cpp b/modules/gdnative/gdnative/color.cpp
index c75e74daba..e08183ab63 100644
--- a/modules/gdnative/gdnative/color.cpp
+++ b/modules/gdnative/gdnative/color.cpp
@@ -148,13 +148,6 @@ godot_color GDAPI godot_color_inverted(const godot_color *p_self) {
return dest;
}
-godot_color GDAPI godot_color_contrasted(const godot_color *p_self) {
- godot_color dest;
- const Color *self = (const Color *)p_self;
- *((Color *)&dest) = self->contrasted();
- return dest;
-}
-
godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t) {
godot_color dest;
const Color *self = (const Color *)p_self;
diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json
index 82bfbd23de..40d0f75871 100644
--- a/modules/gdnative/gdnative_api.json
+++ b/modules/gdnative/gdnative_api.json
@@ -1255,13 +1255,6 @@
]
},
{
- "name": "godot_color_contrasted",
- "return_type": "godot_color",
- "arguments": [
- ["const godot_color *", "p_self"]
- ]
- },
- {
"name": "godot_color_lerp",
"return_type": "godot_color",
"arguments": [
diff --git a/modules/gdnative/include/gdnative/color.h b/modules/gdnative/include/gdnative/color.h
index e7737bf8e1..e64097ef57 100644
--- a/modules/gdnative/include/gdnative/color.h
+++ b/modules/gdnative/include/gdnative/color.h
@@ -93,8 +93,6 @@ godot_int GDAPI godot_color_to_argb32(const godot_color *p_self);
godot_color GDAPI godot_color_inverted(const godot_color *p_self);
-godot_color GDAPI godot_color_contrasted(const godot_color *p_self);
-
godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t);
godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over);
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
index 3700a6194f..d0add835c0 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
@@ -257,20 +257,6 @@ namespace Godot
}
/// <summary>
- /// Returns the most contrasting color.
- /// </summary>
- /// <returns>The most contrasting color</returns>
- public Color Contrasted()
- {
- return new Color(
- (r + 0.5f) % 1.0f,
- (g + 0.5f) % 1.0f,
- (b + 0.5f) % 1.0f,
- a
- );
- }
-
- /// <summary>
/// Returns a new color resulting from making this color darker
/// by the specified ratio (on the range of 0 to 1).
/// </summary>
diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py
index 5ebabdd3dc..ab453c353f 100644
--- a/platform/iphone/detect.py
+++ b/platform/iphone/detect.py
@@ -119,7 +119,7 @@ def configure(env):
arch_flag = "i386" if env["arch"] == "x86" else env["arch"]
env.Append(
CCFLAGS=(
- "-arch "
+ "-fobjc-arc -arch "
+ arch_flag
+ " -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fblocks"
" -fasm-blocks -isysroot $IPHONESDK -mios-simulator-version-min=13.0"
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index f73516b370..b108d74b2e 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -244,7 +244,7 @@ void OS_Windows::finalize_core() {
}
Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {
- String path = p_path;
+ String path = p_path.replace("/", "\\");
if (!FileAccess::exists(path)) {
//this code exists so gdnative can load .dll files from within the executable path
@@ -412,8 +412,10 @@ String OS_Windows::_quote_command_line_argument(const String &p_text) const {
}
Error OS_Windows::execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id, String *r_pipe, int *r_exitcode, bool read_stderr, Mutex *p_pipe_mutex) {
+ String path = p_path.replace("/", "\\");
+
if (p_blocking && r_pipe) {
- String argss = _quote_command_line_argument(p_path);
+ String argss = _quote_command_line_argument(path);
for (const List<String>::Element *E = p_arguments.front(); E; E = E->next()) {
argss += " " + _quote_command_line_argument(E->get());
}
@@ -446,7 +448,7 @@ Error OS_Windows::execute(const String &p_path, const List<String> &p_arguments,
return OK;
}
- String cmdline = _quote_command_line_argument(p_path);
+ String cmdline = _quote_command_line_argument(path);
const List<String>::Element *I = p_arguments.front();
while (I) {
cmdline += " " + _quote_command_line_argument(I->get());
@@ -509,7 +511,7 @@ Error OS_Windows::set_cwd(const String &p_cwd) {
String OS_Windows::get_executable_path() const {
WCHAR bufname[4096];
GetModuleFileNameW(nullptr, bufname, 4096);
- String s = String::utf16((const char16_t *)bufname);
+ String s = String::utf16((const char16_t *)bufname).replace("\\", "/");
return s;
}
diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp
index ecd4ad17ea..53d7ead548 100644
--- a/scene/gui/gradient_edit.cpp
+++ b/scene/gui/gradient_edit.cpp
@@ -357,7 +357,7 @@ void GradientEdit::_notification(int p_what) {
//Draw point markers
for (int i = 0; i < points.size(); i++) {
- Color col = points[i].color.contrasted();
+ Color col = points[i].color.inverted();
col.a = 0.9;
draw_line(Vector2(points[i].offset * total_w, 0), Vector2(points[i].offset * total_w, h / 2), col);
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index a5f8cdaf88..5953942c44 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -2637,6 +2637,8 @@ BaseMaterial3D::BaseMaterial3D(bool p_orm) :
orm = p_orm;
// Initialize to the same values as the shader
shading_mode = SHADING_MODE_PER_PIXEL;
+ transparency = TRANSPARENCY_DISABLED;
+ alpha_antialiasing_mode = ALPHA_ANTIALIASING_OFF;
set_albedo(Color(1.0, 1.0, 1.0, 1.0));
set_specular(0.5);
set_roughness(1.0);
diff --git a/tests/test_color.h b/tests/test_color.h
index dfdc29ec7d..e5b6899908 100644
--- a/tests/test_color.h
+++ b/tests/test_color.h
@@ -185,9 +185,6 @@ TEST_CASE("[Color] Manipulation methods") {
CHECK_MESSAGE(
blue.inverted().is_equal_approx(Color(1, 1, 0, 0.4)),
"Inverted color should have its red, green and blue components inverted.");
- CHECK_MESSAGE(
- blue.contrasted().is_equal_approx(Color(0.5, 0.5, 0.5, 0.4)),
- "Contrasted pure blue should be fully gray.");
const Color purple = Color(0.5, 0.2, 0.5, 0.25);