mirror of
https://github.com/godotengine/godot.git
synced 2024-12-04 01:52:56 +00:00
Fix various typos and code style issues
This commit is contained in:
parent
0eadbdb5d0
commit
88e81ee730
@ -842,7 +842,7 @@ typedef void (*GDExtensionInterfaceMemFree)(void *p_ptr);
|
||||
*
|
||||
* Logs an error to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the error.
|
||||
* @param p_description The code triggering the error.
|
||||
* @param p_function The function name where the error occurred.
|
||||
* @param p_file The file where the error occurred.
|
||||
* @param p_line The line where the error occurred.
|
||||
@ -856,7 +856,7 @@ typedef void (*GDExtensionInterfacePrintError)(const char *p_description, const
|
||||
*
|
||||
* Logs an error with a message to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the error.
|
||||
* @param p_description The code triggering the error.
|
||||
* @param p_message The message to show along with the error.
|
||||
* @param p_function The function name where the error occurred.
|
||||
* @param p_file The file where the error occurred.
|
||||
@ -871,7 +871,7 @@ typedef void (*GDExtensionInterfacePrintErrorWithMessage)(const char *p_descript
|
||||
*
|
||||
* Logs a warning to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the warning.
|
||||
* @param p_description The code triggering the warning.
|
||||
* @param p_function The function name where the warning occurred.
|
||||
* @param p_file The file where the warning occurred.
|
||||
* @param p_line The line where the warning occurred.
|
||||
@ -885,7 +885,7 @@ typedef void (*GDExtensionInterfacePrintWarning)(const char *p_description, cons
|
||||
*
|
||||
* Logs a warning with a message to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the warning.
|
||||
* @param p_description The code triggering the warning.
|
||||
* @param p_message The message to show along with the warning.
|
||||
* @param p_function The function name where the warning occurred.
|
||||
* @param p_file The file where the warning occurred.
|
||||
@ -900,7 +900,7 @@ typedef void (*GDExtensionInterfacePrintWarningWithMessage)(const char *p_descri
|
||||
*
|
||||
* Logs a script error to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the error.
|
||||
* @param p_description The code triggering the error.
|
||||
* @param p_function The function name where the error occurred.
|
||||
* @param p_file The file where the error occurred.
|
||||
* @param p_line The line where the error occurred.
|
||||
@ -914,7 +914,7 @@ typedef void (*GDExtensionInterfacePrintScriptError)(const char *p_description,
|
||||
*
|
||||
* Logs a script error with a message to Godot's built-in debugger and to the OS terminal.
|
||||
*
|
||||
* @param p_description The code trigging the error.
|
||||
* @param p_description The code triggering the error.
|
||||
* @param p_message The message to show along with the error.
|
||||
* @param p_function The function name where the error occurred.
|
||||
* @param p_file The file where the error occurred.
|
||||
|
@ -568,7 +568,7 @@ void ScriptLanguage::frame() {
|
||||
}
|
||||
|
||||
TypedArray<int> ScriptLanguage::CodeCompletionOption::get_option_characteristics(const String &p_base) {
|
||||
// Return characacteristics of the match found by order of importance.
|
||||
// Return characteristics of the match found by order of importance.
|
||||
// Matches will be ranked by a lexicographical order on the vector returned by this function.
|
||||
// The lower values indicate better matches and that they should go before in the order of appearance.
|
||||
if (last_matches == matches) {
|
||||
|
@ -483,6 +483,7 @@ void TranslationServer::setup() {
|
||||
main_domain->set_pseudolocalization_skip_placeholders_enabled(GLOBAL_DEF("internationalization/pseudolocalization/skip_placeholders", true));
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
ProjectSettings::get_singleton()->set_custom_property_info(PropertyInfo(Variant::STRING, "internationalization/locale/test", PROPERTY_HINT_LOCALE_ID, ""));
|
||||
ProjectSettings::get_singleton()->set_custom_property_info(PropertyInfo(Variant::STRING, "internationalization/locale/fallback", PROPERTY_HINT_LOCALE_ID, ""));
|
||||
#endif
|
||||
}
|
||||
|
@ -88,7 +88,7 @@
|
||||
The strength of the anisotropy effect. This is multiplied by [member anisotropy_flowmap]'s alpha channel if a texture is defined there and the texture contains an alpha channel.
|
||||
</member>
|
||||
<member name="anisotropy_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
|
||||
If [code]true[/code], anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium and hair reflections.
|
||||
If [code]true[/code], anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminum and hair reflections.
|
||||
[b]Note:[/b] Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken.
|
||||
[b]Note:[/b] Material anisotropy should not to be confused with anisotropic texture filtering, which can be enabled by setting [member texture_filter] to [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC].
|
||||
</member>
|
||||
|
@ -1316,7 +1316,7 @@
|
||||
Duplicate the node's script (also overriding the duplicated children's scripts, if combined with [constant DUPLICATE_USE_INSTANTIATION]).
|
||||
</constant>
|
||||
<constant name="DUPLICATE_USE_INSTANTIATION" value="8" enum="DuplicateFlags">
|
||||
Duplicate using [method PackedScene.instantiate]. If the node comes from a scene saved on disk, re-uses [method PackedScene.instantiate] as the base for the duplicated node and its children.
|
||||
Duplicate using [method PackedScene.instantiate]. If the node comes from a scene saved on disk, reuses [method PackedScene.instantiate] as the base for the duplicated node and its children.
|
||||
</constant>
|
||||
<constant name="INTERNAL_MODE_DISABLED" value="0" enum="InternalMode">
|
||||
The node will not be internal.
|
||||
|
@ -6,7 +6,7 @@
|
||||
<description>
|
||||
This is the built-in string Variant type (and the one used by GDScript). Strings may contain any number of Unicode characters, and expose methods useful for manipulating and generating strings. Strings are reference-counted and use a copy-on-write approach (every modification to a string returns a new [String]), so passing them around is cheap in resources.
|
||||
Some string methods have corresponding variations. Variations suffixed with [code]n[/code] ([method countn], [method findn], [method replacen], etc.) are [b]case-insensitive[/b] (they make no distinction between uppercase and lowercase letters). Method variations prefixed with [code]r[/code] ([method rfind], [method rsplit], etc.) are reversed, and start from the end of the string, instead of the beginning.
|
||||
To convert any Variant to or from a string, see [method @GlobalScope.str], [method @GlobalScope.str_to_var], and [method @GlobalScope.var_to_str].
|
||||
To convert any [Variant] to or from a string, see [method @GlobalScope.str], [method @GlobalScope.str_to_var], and [method @GlobalScope.var_to_str].
|
||||
[b]Note:[/b] In a boolean context, a string will evaluate to [code]false[/code] if it is empty ([code]""[/code]). Otherwise, a string will always evaluate to [code]true[/code].
|
||||
</description>
|
||||
<tutorials>
|
||||
|
@ -89,7 +89,7 @@
|
||||
[/codeblocks]
|
||||
Some [Tweener]s use transitions and eases. The first accepts a [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls where the [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best.
|
||||
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/tween_cheatsheet.webp]Tween easing and transition types cheatsheet[/url]
|
||||
[b]Note:[/b] Tweens are not designed to be re-used and trying to do so results in an undefined behavior. Create a new Tween for each animation and every time you replay an animation from start. Keep in mind that Tweens start immediately, so only create a Tween when you want to start animating.
|
||||
[b]Note:[/b] Tweens are not designed to be reused and trying to do so results in an undefined behavior. Create a new Tween for each animation and every time you replay an animation from start. Keep in mind that Tweens start immediately, so only create a Tween when you want to start animating.
|
||||
[b]Note:[/b] The tween is processed after all of the nodes in the current frame, i.e. node's [method Node._process] method would be called before the tween (or [method Node._physics_process] depending on the value passed to [method set_process_mode]).
|
||||
</description>
|
||||
<tutorials>
|
||||
|
@ -805,6 +805,7 @@
|
||||
<constant name="MODE_FULLSCREEN" value="3" enum="Mode">
|
||||
Full screen mode with full multi-window support.
|
||||
Full screen window covers the entire display area of a screen and has no decorations. The display's video mode is not changed.
|
||||
[b]On Android:[/b] This enables immersive mode.
|
||||
[b]On Windows:[/b] Multi-window full-screen mode has a 1px border of the [member ProjectSettings.rendering/environment/defaults/default_clear_color] color.
|
||||
[b]On macOS:[/b] A new desktop is used to display the running project.
|
||||
[b]Note:[/b] Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode.
|
||||
@ -812,6 +813,7 @@
|
||||
<constant name="MODE_EXCLUSIVE_FULLSCREEN" value="4" enum="Mode">
|
||||
A single window full screen mode. This mode has less overhead, but only one window can be open on a given screen at a time (opening a child window or application switching will trigger a full screen transition).
|
||||
Full screen window covers the entire display area of a screen and has no border or decorations. The display's video mode is not changed.
|
||||
[b]On Android:[/b] This enables immersive mode.
|
||||
[b]On Windows:[/b] Depending on video driver, full screen transition might cause screens to go black for a moment.
|
||||
[b]On macOS:[/b] A new desktop is used to display the running project. Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen.
|
||||
[b]On Linux (X11):[/b] Exclusive full screen mode bypasses compositor.
|
||||
|
@ -1298,12 +1298,12 @@ void AnimationTimelineEdit::_zoom_changed(double) {
|
||||
double timeline_right = timeline_left + timeline_width_seconds;
|
||||
double timeline_center = timeline_left + timeline_width_seconds / 2.0;
|
||||
|
||||
if (zoom_callback_occured) { // Zooming with scroll wheel will focus on the position of the mouse.
|
||||
if (zoom_callback_occurred) { // Zooming with scroll wheel will focus on the position of the mouse.
|
||||
double zoom_scroll_origin_norm = (zoom_scroll_origin.x - get_name_limit()) / timeline_width_pixels;
|
||||
zoom_scroll_origin_norm = MAX(zoom_scroll_origin_norm, 0);
|
||||
zoom_pivot = timeline_left + timeline_width_seconds * zoom_scroll_origin_norm;
|
||||
zoom_pivot_delta = updated_timeline_width_seconds * zoom_scroll_origin_norm;
|
||||
zoom_callback_occured = false;
|
||||
zoom_callback_occurred = false;
|
||||
} else { // Zooming with slider will depend on the current play position.
|
||||
// If the play position is not in range, or exactly in the center, zoom in on the center.
|
||||
if (get_play_position() < timeline_left || get_play_position() > timeline_left + timeline_width_seconds || get_play_position() == timeline_center) {
|
||||
@ -1952,7 +1952,7 @@ void AnimationTimelineEdit::_pan_callback(Vector2 p_scroll_vec, Ref<InputEvent>
|
||||
void AnimationTimelineEdit::_zoom_callback(float p_zoom_factor, Vector2 p_origin, Ref<InputEvent> p_event) {
|
||||
double current_zoom_value = get_zoom()->get_value();
|
||||
zoom_scroll_origin = p_origin;
|
||||
zoom_callback_occured = true;
|
||||
zoom_callback_occurred = true;
|
||||
get_zoom()->set_value(MAX(0.01, current_zoom_value - (1.0 - p_zoom_factor)));
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ class AnimationTimelineEdit : public Range {
|
||||
double hscroll_on_zoom_buffer = -1.0;
|
||||
|
||||
Vector2 zoom_scroll_origin;
|
||||
bool zoom_callback_occured = false;
|
||||
bool zoom_callback_occurred = false;
|
||||
|
||||
virtual void gui_input(const Ref<InputEvent> &p_event) override;
|
||||
void _track_added(int p_track);
|
||||
|
@ -145,11 +145,10 @@ private:
|
||||
Button *show_search_button = nullptr;
|
||||
LineEdit *search_box = nullptr;
|
||||
|
||||
// Reference to the "Output" button on the toolbar so we can update it's icon when
|
||||
// Warnings or Errors are encounetered.
|
||||
// Reference to the "Output" button on the toolbar so we can update its icon when warnings or errors are encountered.
|
||||
Button *tool_button = nullptr;
|
||||
|
||||
bool is_loading_state = false; // Used to disable saving requests while loading (some signals from buttons will try trigger a save, which happens during loading).
|
||||
bool is_loading_state = false; // Used to disable saving requests while loading (some signals from buttons will try to trigger a save, which happens during loading).
|
||||
Timer *save_state_timer = nullptr;
|
||||
|
||||
static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type);
|
||||
|
@ -3364,169 +3364,169 @@ void VisualShaderEditor::_setup_node(VisualShaderNode *p_node, const Vector<Vari
|
||||
|
||||
// FLOAT_OP
|
||||
{
|
||||
VisualShaderNodeFloatOp *floatOp = Object::cast_to<VisualShaderNodeFloatOp>(p_node);
|
||||
VisualShaderNodeFloatOp *float_op = Object::cast_to<VisualShaderNodeFloatOp>(p_node);
|
||||
|
||||
if (floatOp) {
|
||||
if (float_op) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
floatOp->set_operator((VisualShaderNodeFloatOp::Operator)(int)p_ops[0]);
|
||||
float_op->set_operator((VisualShaderNodeFloatOp::Operator)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// FLOAT_FUNC
|
||||
{
|
||||
VisualShaderNodeFloatFunc *floatFunc = Object::cast_to<VisualShaderNodeFloatFunc>(p_node);
|
||||
VisualShaderNodeFloatFunc *float_func = Object::cast_to<VisualShaderNodeFloatFunc>(p_node);
|
||||
|
||||
if (floatFunc) {
|
||||
if (float_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
floatFunc->set_function((VisualShaderNodeFloatFunc::Function)(int)p_ops[0]);
|
||||
float_func->set_function((VisualShaderNodeFloatFunc::Function)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// VECTOR_OP
|
||||
{
|
||||
VisualShaderNodeVectorOp *vecOp = Object::cast_to<VisualShaderNodeVectorOp>(p_node);
|
||||
VisualShaderNodeVectorOp *vec_op = Object::cast_to<VisualShaderNodeVectorOp>(p_node);
|
||||
|
||||
if (vecOp) {
|
||||
if (vec_op) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
ERR_FAIL_COND(p_ops[1].get_type() != Variant::INT);
|
||||
vecOp->set_operator((VisualShaderNodeVectorOp::Operator)(int)p_ops[0]);
|
||||
vecOp->set_op_type((VisualShaderNodeVectorOp::OpType)(int)p_ops[1]);
|
||||
vec_op->set_operator((VisualShaderNodeVectorOp::Operator)(int)p_ops[0]);
|
||||
vec_op->set_op_type((VisualShaderNodeVectorOp::OpType)(int)p_ops[1]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// VECTOR_FUNC
|
||||
{
|
||||
VisualShaderNodeVectorFunc *vecFunc = Object::cast_to<VisualShaderNodeVectorFunc>(p_node);
|
||||
VisualShaderNodeVectorFunc *vec_func = Object::cast_to<VisualShaderNodeVectorFunc>(p_node);
|
||||
|
||||
if (vecFunc) {
|
||||
if (vec_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
ERR_FAIL_COND(p_ops[1].get_type() != Variant::INT);
|
||||
vecFunc->set_function((VisualShaderNodeVectorFunc::Function)(int)p_ops[0]);
|
||||
vecFunc->set_op_type((VisualShaderNodeVectorFunc::OpType)(int)p_ops[1]);
|
||||
vec_func->set_function((VisualShaderNodeVectorFunc::Function)(int)p_ops[0]);
|
||||
vec_func->set_op_type((VisualShaderNodeVectorFunc::OpType)(int)p_ops[1]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// COLOR_OP
|
||||
{
|
||||
VisualShaderNodeColorOp *colorOp = Object::cast_to<VisualShaderNodeColorOp>(p_node);
|
||||
VisualShaderNodeColorOp *color_op = Object::cast_to<VisualShaderNodeColorOp>(p_node);
|
||||
|
||||
if (colorOp) {
|
||||
if (color_op) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
colorOp->set_operator((VisualShaderNodeColorOp::Operator)(int)p_ops[0]);
|
||||
color_op->set_operator((VisualShaderNodeColorOp::Operator)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// COLOR_FUNC
|
||||
{
|
||||
VisualShaderNodeColorFunc *colorFunc = Object::cast_to<VisualShaderNodeColorFunc>(p_node);
|
||||
VisualShaderNodeColorFunc *color_func = Object::cast_to<VisualShaderNodeColorFunc>(p_node);
|
||||
|
||||
if (colorFunc) {
|
||||
if (color_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
colorFunc->set_function((VisualShaderNodeColorFunc::Function)(int)p_ops[0]);
|
||||
color_func->set_function((VisualShaderNodeColorFunc::Function)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// INT_OP
|
||||
{
|
||||
VisualShaderNodeIntOp *intOp = Object::cast_to<VisualShaderNodeIntOp>(p_node);
|
||||
VisualShaderNodeIntOp *int_op = Object::cast_to<VisualShaderNodeIntOp>(p_node);
|
||||
|
||||
if (intOp) {
|
||||
if (int_op) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
intOp->set_operator((VisualShaderNodeIntOp::Operator)(int)p_ops[0]);
|
||||
int_op->set_operator((VisualShaderNodeIntOp::Operator)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// INT_FUNC
|
||||
{
|
||||
VisualShaderNodeIntFunc *intFunc = Object::cast_to<VisualShaderNodeIntFunc>(p_node);
|
||||
VisualShaderNodeIntFunc *int_func = Object::cast_to<VisualShaderNodeIntFunc>(p_node);
|
||||
|
||||
if (intFunc) {
|
||||
if (int_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
intFunc->set_function((VisualShaderNodeIntFunc::Function)(int)p_ops[0]);
|
||||
int_func->set_function((VisualShaderNodeIntFunc::Function)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// UINT_OP
|
||||
{
|
||||
VisualShaderNodeUIntOp *uintOp = Object::cast_to<VisualShaderNodeUIntOp>(p_node);
|
||||
VisualShaderNodeUIntOp *uint_op = Object::cast_to<VisualShaderNodeUIntOp>(p_node);
|
||||
|
||||
if (uintOp) {
|
||||
if (uint_op) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
uintOp->set_operator((VisualShaderNodeUIntOp::Operator)(int)p_ops[0]);
|
||||
uint_op->set_operator((VisualShaderNodeUIntOp::Operator)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// UINT_FUNC
|
||||
{
|
||||
VisualShaderNodeUIntFunc *uintFunc = Object::cast_to<VisualShaderNodeUIntFunc>(p_node);
|
||||
VisualShaderNodeUIntFunc *uint_func = Object::cast_to<VisualShaderNodeUIntFunc>(p_node);
|
||||
|
||||
if (uintFunc) {
|
||||
if (uint_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
uintFunc->set_function((VisualShaderNodeUIntFunc::Function)(int)p_ops[0]);
|
||||
uint_func->set_function((VisualShaderNodeUIntFunc::Function)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// TRANSFORM_OP
|
||||
{
|
||||
VisualShaderNodeTransformOp *matOp = Object::cast_to<VisualShaderNodeTransformOp>(p_node);
|
||||
VisualShaderNodeTransformOp *mat_op = Object::cast_to<VisualShaderNodeTransformOp>(p_node);
|
||||
|
||||
if (matOp) {
|
||||
if (mat_op) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
matOp->set_operator((VisualShaderNodeTransformOp::Operator)(int)p_ops[0]);
|
||||
mat_op->set_operator((VisualShaderNodeTransformOp::Operator)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// TRANSFORM_FUNC
|
||||
{
|
||||
VisualShaderNodeTransformFunc *matFunc = Object::cast_to<VisualShaderNodeTransformFunc>(p_node);
|
||||
VisualShaderNodeTransformFunc *mat_func = Object::cast_to<VisualShaderNodeTransformFunc>(p_node);
|
||||
|
||||
if (matFunc) {
|
||||
if (mat_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
matFunc->set_function((VisualShaderNodeTransformFunc::Function)(int)p_ops[0]);
|
||||
mat_func->set_function((VisualShaderNodeTransformFunc::Function)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// VECTOR_COMPOSE
|
||||
{
|
||||
VisualShaderNodeVectorCompose *vecCompose = Object::cast_to<VisualShaderNodeVectorCompose>(p_node);
|
||||
VisualShaderNodeVectorCompose *vec_compose = Object::cast_to<VisualShaderNodeVectorCompose>(p_node);
|
||||
|
||||
if (vecCompose) {
|
||||
if (vec_compose) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
vecCompose->set_op_type((VisualShaderNodeVectorCompose::OpType)(int)p_ops[0]);
|
||||
vec_compose->set_op_type((VisualShaderNodeVectorCompose::OpType)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// VECTOR_DECOMPOSE
|
||||
{
|
||||
VisualShaderNodeVectorDecompose *vecDecompose = Object::cast_to<VisualShaderNodeVectorDecompose>(p_node);
|
||||
VisualShaderNodeVectorDecompose *vec_decompose = Object::cast_to<VisualShaderNodeVectorDecompose>(p_node);
|
||||
|
||||
if (vecDecompose) {
|
||||
if (vec_decompose) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
vecDecompose->set_op_type((VisualShaderNodeVectorDecompose::OpType)(int)p_ops[0]);
|
||||
vec_decompose->set_op_type((VisualShaderNodeVectorDecompose::OpType)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// UV_FUNC
|
||||
{
|
||||
VisualShaderNodeUVFunc *uvFunc = Object::cast_to<VisualShaderNodeUVFunc>(p_node);
|
||||
VisualShaderNodeUVFunc *uv_func = Object::cast_to<VisualShaderNodeUVFunc>(p_node);
|
||||
|
||||
if (uvFunc) {
|
||||
if (uv_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
uvFunc->set_function((VisualShaderNodeUVFunc::Function)(int)p_ops[0]);
|
||||
uv_func->set_function((VisualShaderNodeUVFunc::Function)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -3566,13 +3566,13 @@ void VisualShaderEditor::_setup_node(VisualShaderNode *p_node, const Vector<Vari
|
||||
|
||||
// DERIVATIVE
|
||||
{
|
||||
VisualShaderNodeDerivativeFunc *derFunc = Object::cast_to<VisualShaderNodeDerivativeFunc>(p_node);
|
||||
VisualShaderNodeDerivativeFunc *der_func = Object::cast_to<VisualShaderNodeDerivativeFunc>(p_node);
|
||||
|
||||
if (derFunc) {
|
||||
if (der_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
ERR_FAIL_COND(p_ops[1].get_type() != Variant::INT);
|
||||
derFunc->set_function((VisualShaderNodeDerivativeFunc::Function)(int)p_ops[0]);
|
||||
derFunc->set_op_type((VisualShaderNodeDerivativeFunc::OpType)(int)p_ops[1]);
|
||||
der_func->set_function((VisualShaderNodeDerivativeFunc::Function)(int)p_ops[0]);
|
||||
der_func->set_op_type((VisualShaderNodeDerivativeFunc::OpType)(int)p_ops[1]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -3590,32 +3590,32 @@ void VisualShaderEditor::_setup_node(VisualShaderNode *p_node, const Vector<Vari
|
||||
|
||||
// CLAMP
|
||||
{
|
||||
VisualShaderNodeClamp *clampFunc = Object::cast_to<VisualShaderNodeClamp>(p_node);
|
||||
VisualShaderNodeClamp *clamp_func = Object::cast_to<VisualShaderNodeClamp>(p_node);
|
||||
|
||||
if (clampFunc) {
|
||||
if (clamp_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
clampFunc->set_op_type((VisualShaderNodeClamp::OpType)(int)p_ops[0]);
|
||||
clamp_func->set_op_type((VisualShaderNodeClamp::OpType)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// SWITCH
|
||||
{
|
||||
VisualShaderNodeSwitch *switchFunc = Object::cast_to<VisualShaderNodeSwitch>(p_node);
|
||||
VisualShaderNodeSwitch *switch_func = Object::cast_to<VisualShaderNodeSwitch>(p_node);
|
||||
|
||||
if (switchFunc) {
|
||||
if (switch_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
switchFunc->set_op_type((VisualShaderNodeSwitch::OpType)(int)p_ops[0]);
|
||||
switch_func->set_op_type((VisualShaderNodeSwitch::OpType)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// FACEFORWARD
|
||||
{
|
||||
VisualShaderNodeFaceForward *faceForward = Object::cast_to<VisualShaderNodeFaceForward>(p_node);
|
||||
if (faceForward) {
|
||||
VisualShaderNodeFaceForward *face_forward = Object::cast_to<VisualShaderNodeFaceForward>(p_node);
|
||||
if (face_forward) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
faceForward->set_op_type((VisualShaderNodeFaceForward::OpType)(int)p_ops[0]);
|
||||
face_forward->set_op_type((VisualShaderNodeFaceForward::OpType)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -3632,33 +3632,33 @@ void VisualShaderEditor::_setup_node(VisualShaderNode *p_node, const Vector<Vari
|
||||
|
||||
// SMOOTHSTEP
|
||||
{
|
||||
VisualShaderNodeSmoothStep *smoothStepFunc = Object::cast_to<VisualShaderNodeSmoothStep>(p_node);
|
||||
VisualShaderNodeSmoothStep *smooth_step_func = Object::cast_to<VisualShaderNodeSmoothStep>(p_node);
|
||||
|
||||
if (smoothStepFunc) {
|
||||
if (smooth_step_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
smoothStepFunc->set_op_type((VisualShaderNodeSmoothStep::OpType)(int)p_ops[0]);
|
||||
smooth_step_func->set_op_type((VisualShaderNodeSmoothStep::OpType)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// STEP
|
||||
{
|
||||
VisualShaderNodeStep *stepFunc = Object::cast_to<VisualShaderNodeStep>(p_node);
|
||||
VisualShaderNodeStep *step_func = Object::cast_to<VisualShaderNodeStep>(p_node);
|
||||
|
||||
if (stepFunc) {
|
||||
if (step_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
stepFunc->set_op_type((VisualShaderNodeStep::OpType)(int)p_ops[0]);
|
||||
step_func->set_op_type((VisualShaderNodeStep::OpType)(int)p_ops[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// MULTIPLY_ADD
|
||||
{
|
||||
VisualShaderNodeMultiplyAdd *fmaFunc = Object::cast_to<VisualShaderNodeMultiplyAdd>(p_node);
|
||||
VisualShaderNodeMultiplyAdd *fma_func = Object::cast_to<VisualShaderNodeMultiplyAdd>(p_node);
|
||||
|
||||
if (fmaFunc) {
|
||||
if (fma_func) {
|
||||
ERR_FAIL_COND(p_ops[0].get_type() != Variant::INT);
|
||||
fmaFunc->set_op_type((VisualShaderNodeMultiplyAdd::OpType)(int)p_ops[0]);
|
||||
fma_func->set_op_type((VisualShaderNodeMultiplyAdd::OpType)(int)p_ops[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
2
misc/dist/html/editor.html
vendored
2
misc/dist/html/editor.html
vendored
@ -710,7 +710,7 @@ function startEditor(zip) {
|
||||
} else if (typeof err === 'string') {
|
||||
setStatusNotice(err);
|
||||
} else {
|
||||
setStatusNotice('An unknown error occured');
|
||||
setStatusNotice('An unknown error occurred.');
|
||||
}
|
||||
setStatusMode('notice');
|
||||
initializing = false;
|
||||
|
2
misc/dist/html/full-size.html
vendored
2
misc/dist/html/full-size.html
vendored
@ -140,7 +140,7 @@ const engine = new Engine(GODOT_CONFIG);
|
||||
} else if (typeof err === 'string') {
|
||||
setStatusNotice(err);
|
||||
} else {
|
||||
setStatusNotice('An unknown error occured');
|
||||
setStatusNotice('An unknown error occurred.');
|
||||
}
|
||||
setStatusMode('notice');
|
||||
initializing = false;
|
||||
|
@ -1879,7 +1879,7 @@ void GDScriptByteCodeGenerator::end_block() {
|
||||
|
||||
void GDScriptByteCodeGenerator::clear_temporaries() {
|
||||
for (int slot_idx : temporaries_pending_clear) {
|
||||
// The temporary may have been re-used as something else since it was added to the list.
|
||||
// The temporary may have been reused as something else since it was added to the list.
|
||||
// In that case, there's **no** need to clear it.
|
||||
if (temporaries[slot_idx].can_contain_object) {
|
||||
clear_address(Address(Address::TEMPORARY, slot_idx)); // Can contain `RefCounted`, so clear it.
|
||||
@ -1928,7 +1928,7 @@ void GDScriptByteCodeGenerator::clear_address(const Address &p_address) {
|
||||
}
|
||||
}
|
||||
|
||||
// Returns `true` if the local has been re-used and not cleaned up with `clear_address()`.
|
||||
// Returns `true` if the local has been reused and not cleaned up with `clear_address()`.
|
||||
bool GDScriptByteCodeGenerator::is_local_dirty(const Address &p_address) const {
|
||||
ERR_FAIL_COND_V(p_address.mode != Address::LOCAL_VARIABLE, false);
|
||||
return dirty_locals.has(p_address.address);
|
||||
|
@ -2188,7 +2188,7 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Sui
|
||||
initialized = true;
|
||||
} else if ((local_type.has_type && local_type.kind == GDScriptDataType::BUILTIN) || codegen.generator->is_local_dirty(local)) {
|
||||
// Initialize with default for the type. Built-in types must always be cleared (they cannot be `null`).
|
||||
// Objects and untyped variables are assigned to `null` only if the stack address has been re-used and not cleared.
|
||||
// Objects and untyped variables are assigned to `null` only if the stack address has been reused and not cleared.
|
||||
codegen.generator->clear_address(local);
|
||||
initialized = true;
|
||||
}
|
||||
|
@ -468,7 +468,7 @@ static void _rest_cbk_result(const Vector3 &p_point_A, int p_index_A, const Vect
|
||||
real_t tested_len = is_best_result ? rd->best_result.len : len;
|
||||
for (; result_index < prev_result_count - 1; ++result_index) {
|
||||
if (tested_len > rd->other_results[result_index].len) {
|
||||
// Re-using a previous result.
|
||||
// Reusing a previous result.
|
||||
rd->result_count--;
|
||||
break;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ void GodotPinJoint3D::solve(real_t p_step) {
|
||||
|
||||
Vector3 rel_pos1 = pivotAInW - A->get_transform().origin;
|
||||
Vector3 rel_pos2 = pivotBInW - B->get_transform().origin;
|
||||
//this jacobian entry could be re-used for all iterations
|
||||
//this jacobian entry could be reused for all iterations
|
||||
|
||||
Vector3 vel1 = A->get_velocity_in_local_point(rel_pos1);
|
||||
Vector3 vel2 = B->get_velocity_in_local_point(rel_pos2);
|
||||
|
@ -370,7 +370,7 @@ void LineBuilder::build() {
|
||||
}
|
||||
|
||||
if (!is_intersecting) {
|
||||
// In this case the joint is too corrupted to be re-used,
|
||||
// In this case the joint is too corrupted to be reused,
|
||||
// start again the strip with fallback points
|
||||
strip_begin(pos_up0, pos_down0, color1, uvx1);
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ void VehicleBody3D::_resolve_single_bilateral(PhysicsDirectBodyState3D *s, const
|
||||
if (body2) {
|
||||
rel_pos2 = pos2 - body2->get_global_transform().origin;
|
||||
}
|
||||
//this jacobian entry could be re-used for all iterations
|
||||
// This Jacobian entry could be reused for all iterations.
|
||||
|
||||
Vector3 vel1 = s->get_linear_velocity() + (s->get_angular_velocity()).cross(rel_pos1); // * mPos);
|
||||
Vector3 vel2;
|
||||
|
@ -3545,13 +3545,13 @@ void CodeEdit::_filter_code_completion_candidates_impl() {
|
||||
|
||||
for (int i = 1; *string_to_complete_char_lower && (all_possible_subsequence_matches.size() > 0); i++, string_to_complete_char_lower++) {
|
||||
// find all occurrences of ssq_lower to avoid looking everywhere each time
|
||||
Vector<int> all_ocurence;
|
||||
Vector<int> all_occurrences;
|
||||
if (long_option) {
|
||||
all_ocurence.push_back(target_lower.find_char(*string_to_complete_char_lower));
|
||||
all_occurrences.push_back(target_lower.find_char(*string_to_complete_char_lower));
|
||||
} else {
|
||||
for (int j = i; j < target_lower.length(); j++) {
|
||||
if (target_lower[j] == *string_to_complete_char_lower) {
|
||||
all_ocurence.push_back(j);
|
||||
all_occurrences.push_back(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3569,7 +3569,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
for (int index : all_ocurence) {
|
||||
for (int index : all_occurrences) {
|
||||
if (index > next_index) {
|
||||
Vector<Pair<int, int>> new_match = subsequence_match;
|
||||
new_match.push_back({ index, 1 });
|
||||
|
@ -125,7 +125,7 @@ Ref<AudioEffectInstance> AudioEffectRecord::instantiate() {
|
||||
ins.instantiate();
|
||||
ins->is_recording = false;
|
||||
|
||||
//Re-using the buffer size calculations from audio_effect_delay.cpp
|
||||
// Reusing the buffer size calculations from audio_effect_delay.cpp.
|
||||
float ring_buffer_max_size = IO_BUFFER_SIZE_MS;
|
||||
ring_buffer_max_size /= 1000.0; //convert to seconds
|
||||
ring_buffer_max_size *= AudioServer::get_singleton()->get_mix_rate();
|
||||
|
@ -39,34 +39,34 @@ void AudioEffectStereoEnhanceInstance::process(const AudioFrame *p_src_frames, A
|
||||
unsigned int delay_frames = (base->time_pullout / 1000.0) * AudioServer::get_singleton()->get_mix_rate();
|
||||
|
||||
for (int i = 0; i < p_frame_count; i++) {
|
||||
float l = p_src_frames[i].left;
|
||||
float r = p_src_frames[i].right;
|
||||
float left = p_src_frames[i].left;
|
||||
float right = p_src_frames[i].right;
|
||||
|
||||
float center = (l + r) / 2.0f;
|
||||
float center = (left + right) / 2.0f;
|
||||
|
||||
l = (center + (l - center) * intensity);
|
||||
r = (center + (r - center) * intensity);
|
||||
left = (center + (left - center) * intensity);
|
||||
right = (center + (right - center) * intensity);
|
||||
|
||||
if (surround_mode) {
|
||||
float val = (l + r) / 2.0;
|
||||
float val = (left + right) / 2.0;
|
||||
|
||||
delay_ringbuff[ringbuff_pos & ringbuff_mask] = val;
|
||||
|
||||
float out = delay_ringbuff[(ringbuff_pos - delay_frames) & ringbuff_mask] * surround_amount;
|
||||
|
||||
l += out;
|
||||
r += -out;
|
||||
left += out;
|
||||
right += -out;
|
||||
} else {
|
||||
float val = r;
|
||||
float val = right;
|
||||
|
||||
delay_ringbuff[ringbuff_pos & ringbuff_mask] = val;
|
||||
|
||||
//r is delayed
|
||||
r = delay_ringbuff[(ringbuff_pos - delay_frames) & ringbuff_mask];
|
||||
// The right channel is delayed.
|
||||
right = delay_ringbuff[(ringbuff_pos - delay_frames) & ringbuff_mask];
|
||||
}
|
||||
|
||||
p_dst_frames[i].left = l;
|
||||
p_dst_frames[i].right = r;
|
||||
p_dst_frames[i].left = left;
|
||||
p_dst_frames[i].right = right;
|
||||
ringbuff_pos++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user