summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/math/math_funcs.cpp9
-rw-r--r--core/math/math_funcs.h1
-rw-r--r--core/object.h6
-rw-r--r--core/os/dir_access.cpp8
-rw-r--r--core/os/dir_access.h1
5 files changed, 14 insertions, 11 deletions
diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp
index 7a2e74a413..f04e40cb6c 100644
--- a/core/math/math_funcs.cpp
+++ b/core/math/math_funcs.cpp
@@ -79,6 +79,15 @@ int Math::step_decimals(double p_step) {
return 0;
}
+// Only meant for editor usage in float ranges, where a step of 0
+// means that decimal digits should not be limited in String::num.
+int Math::range_step_decimals(double p_step) {
+ if (p_step < 0.0000000000001) {
+ return 16; // Max value hardcoded in String::num
+ }
+ return step_decimals(p_step);
+}
+
double Math::dectime(double p_value, double p_amount, double p_step) {
double sgn = p_value < 0 ? -1.0 : 1.0;
double val = Math::abs(p_value);
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index b8b5151802..a712356ddc 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -270,6 +270,7 @@ public:
// double only, as these functions are mainly used by the editor and not performance-critical,
static double ease(double p_x, double p_c);
static int step_decimals(double p_step);
+ static int range_step_decimals(double p_step);
static double stepify(double p_value, double p_step);
static double dectime(double p_value, double p_amount, double p_step);
diff --git a/core/object.h b/core/object.h
index e6c5b7c5b9..dce1cc74ae 100644
--- a/core/object.h
+++ b/core/object.h
@@ -58,7 +58,7 @@ enum PropertyHint {
PROPERTY_HINT_ENUM, ///< hint_text= "val1,val2,val3,etc"
PROPERTY_HINT_EXP_EASING, /// exponential easing function (Math::ease) use "attenuation" hint string to revert (flip h), "full" to also include in/out. (ie: "attenuation,inout")
PROPERTY_HINT_LENGTH, ///< hint_text= "length" (as integer)
- PROPERTY_HINT_SPRITE_FRAME,
+ PROPERTY_HINT_SPRITE_FRAME, // FIXME: Obsolete: drop whenever we can break compat. Keeping now for GDNative compat.
PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer)
PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags)
PROPERTY_HINT_LAYERS_2D_RENDER,
@@ -104,7 +104,8 @@ enum PropertyUsageFlags {
PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings
PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor
PROPERTY_USAGE_CATEGORY = 256,
- //those below are deprecated thanks to ClassDB's now class value cache
+ // FIXME: Drop in 4.0, possibly reorder other flags?
+ // Those below are deprecated thanks to ClassDB's now class value cache
//PROPERTY_USAGE_STORE_IF_NONZERO = 512, //only store if nonzero
//PROPERTY_USAGE_STORE_IF_NONONE = 1024, //only store if false
PROPERTY_USAGE_NO_INSTANCE_STATE = 2048,
@@ -121,6 +122,7 @@ enum PropertyUsageFlags {
PROPERTY_USAGE_HIGH_END_GFX = 1 << 22,
PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT = 1 << 23,
PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT = 1 << 24,
+ PROPERTY_USAGE_KEYING_INCREMENTS = 1 << 25, // Used in inspector to increment property when keyed in animation player
PROPERTY_USAGE_DEFAULT = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK,
PROPERTY_USAGE_DEFAULT_INTL = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK | PROPERTY_USAGE_INTERNATIONALIZED,
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index 0cdb5b41b7..b444f0ae1e 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -179,14 +179,6 @@ Error DirAccess::make_dir_recursive(String p_dir) {
return OK;
}
-String DirAccess::get_next(bool *p_is_dir) {
-
- String next = get_next();
- if (p_is_dir)
- *p_is_dir = current_is_dir();
- return next;
-}
-
String DirAccess::fix_path(String p_path) const {
switch (_access_type) {
diff --git a/core/os/dir_access.h b/core/os/dir_access.h
index bde19bd5ae..704eedae5b 100644
--- a/core/os/dir_access.h
+++ b/core/os/dir_access.h
@@ -71,7 +71,6 @@ protected:
public:
virtual Error list_dir_begin() = 0; ///< This starts dir listing
- virtual String get_next(bool *p_is_dir); // compatibility
virtual String get_next() = 0;
virtual bool current_is_dir() const = 0;
virtual bool current_is_hidden() const = 0;