Skip to content

Commit

Permalink
Merge branch 'Redot-Engine:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdubhghlas authored Oct 16, 2024
2 parents 52affed + 19fb23d commit db82f9a
Show file tree
Hide file tree
Showing 107 changed files with 19,304 additions and 3,067 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ jobs:
fail-fast: false
matrix:
include:
- name: Editor (target=editor tests=yes)
cache-name: linux-editor
target: editor
bin: ./bin/redot.linuxbsd.editor.x86_64
build-mono: false
tests: true
doc-test: true
proj-conv: true
api-compat: true
artifact: true

- name: Editor w/ Mono (target=editor)
cache-name: linux-editor-mono
target: editor
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ jobs:
bin: ./bin/redot.windows.editor.x86_64.exe
compiler: msvc

- name: Editor w/ Mono (target=editor)
cache-name: windows-editor-mono
target: editor
sconsflags: module_mono_enabled=yes
bin: ./bin/redot.windows.editor.x86_64.mono.exe
build-mono: true
tests: false # Disabled due freeze caused by mix Mono build and CI
doc-test: true
proj-conv: true
api-compat: true
compiler: msvc

- name: Editor w/ clang-cl (target=editor, tests=yes, use_llvm=yes)
cache-name: windows-editor-clang
target: editor
Expand Down
47 changes: 33 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@
This document summarizes the most important points for people interested in
contributing to Redot, especially via bug reports or pull requests.

The [Redot Discord](https://discord.gg/redot) documentation has a dedicated Contributing section
The [Redot Documentation](https://docs-stable.redotengine.org/contributing/development) has a dedicated Contributing section
which details these points and more, and is a recommended read.

## Table of contents

- [Reporting bugs](#reporting-bugs)
- [Proposing features or improvements](#proposing-features-or-improvements)
- [Contributing pull requests](#contributing-pull-requests)
- [Contributing to Godot translations](#contributing-to-godot-translations)
- [Contributing to Redot translations](#contributing-to-redot-translations)
- [Communicating with developers](#communicating-with-developers)

## Reporting bugs

If you are reporting a bug with an unstable development build, it helps us greatly
if you open your project in Godot's current dev builds to ensure that it is not
a bug we've inherited from their upstream work process, as we must let them
work on those bugs to minimize merge conflicts on our end.

Report bugs [here](https://github.com/Redot-Engine/redot-engine/issues/new?assignees=&labels=&template=bug_report.yml).
Please follow the instructions in the template when you do.

Expand All @@ -25,7 +30,8 @@ Be sure to not include the `.godot` folder in the archive to save space.

Make sure that the bug you are experiencing is reproducible in the latest Redot
releases. It's worth testing against both the latest stable release and the
latest dev snapshot for the next Redot release.
latest dev snapshot for the next Redot release, as well as the latest Godot
dev snapshot.

If you run into a bug which wasn't present in an earlier Redot version (what we
call a _regression_), please mention it and clarify which versions you tested
Expand All @@ -35,10 +41,21 @@ call a _regression_), please mention it and clarify which versions you tested

**The main issue tracker is for bug reports and does not accept feature proposals.**

Instead, head to the [Redot Discord](https://discord.gg/redot).
Visit the [Redot Proposals Repo](https://github.com/Redot-Engine/redot-proposals)
to suggest features or improvements to the engine.

## Contributing pull requests

Please refer to these links for detailed guides on workflow:
(credit to Godot for these fantastic workflow guides)
- [Code Style](https://docs.redotengine.org/en/stable/contributing/development/code_style_guidelines.html)
- [PR Workflow](https://docs.redotengine.org/en/latest/contributing/workflow/pr_workflow.html)
- [PR Review](https://docs.redotengine.org/en/latest/contributing/workflow/pr_review_guidelines.html)

Additionally, we expect all PR contributors to be using [Pre-Commit](https://pre-commit.com/) to
speed up PR workflow. See the Code Style doc above for more information.


If you want to add new engine features, please make sure that:

- This functionality is desired, which means that it solves a common use case
Expand All @@ -52,7 +69,8 @@ Similar rules can be applied when contributing bug fixes - it's always best to
discuss the implementation in the bug report first if you are not 100% about
what would be the best fix.

Visit the [Redot Discord](https://discord.gg/redot) for information and guides related to contribution and pull requests.
Read the [Redot Documentation](https://docs-stable.redotengine.org/contributing/development)
for information and guides related to contribution and pull requests.

### Be mindful of your commits

Expand Down Expand Up @@ -128,10 +146,10 @@ scripting APIs, you **must** update the class reference to document those.
This is to ensure the documentation coverage doesn't decrease as contributions
are merged.

[Update documentation XML files](https://docs.godotengine.org/en/latest/contributing/documentation/updating_the_class_reference.html)
[Update documentation XML files](https://docs.redotengine.org/en/latest/contributing/documentation/updating_the_class_reference.html)
using your compiled binary, then fill in the descriptions.
Follow the style guide described in the
[Documentation writing guidelines](https://docs.godotengine.org/en/latest/contributing/documentation/docs_writing_guidelines.html).
[Documentation writing guidelines](https://docs.redotengine.org/en/latest/contributing/documentation/docs_writing_guidelines.html).

If your pull request modifies parts of the code in a non-obvious way, make sure
to add comments in the code as well. This helps other people understand the
Expand All @@ -157,15 +175,15 @@ applicable.
Feel free to contribute standalone pull requests to add new tests or improve
existing tests as well.

See [Unit testing](https://docs.godotengine.org/en/latest/contributing/development/core_and_modules/unit_testing.html)
for information on writing tests in Godot's C++ codebase.
See [Unit testing](https://docs.redotengine.org/en/latest/contributing/development/core_and_modules/unit_testing.html)
for information on writing tests in Redot's C++ codebase.

## Contributing to Godot translations
## Contributing to Redot translations

You can contribute to Godot translations on [Hosted Weblate](https://hosted.weblate.org/projects/godot-engine/),
an open source and web-based translation platform.
You can contribute to Redot translations by leaving a volunteer application
on the [Redot Discord](https://discord.gg/redot) for us to review.

Please refer to Godot's [editor and documentation localization guidelines](https://docs.godotengine.org/en/latest/contributing/documentation/editor_and_docs_localization.html)
Please refer to Redot's [editor and documentation localization guidelines](https://docs.redotengine.org/en/latest/contributing/documentation/editor_and_docs_localization.html)
for an overview of the translation resources and what they correspond to.

## Communicating with developers
Expand All @@ -180,7 +198,8 @@ or a bug you want to fix), the following channels can be used:
existing issue about a topic you want to discuss, you can participate directly.
If not, you can open a new issue. Please mind the guidelines outlined above
for bug reporting.
- Feature Proposals should be made on the [Redot Discord](https://discord.gg/redot) for now.
- [Redot Proposals Repo](https://github.com/Redot-Engine/redot-proposals): Feature
or improvement proposals.
- [Redot](https://x.com/redotengine) on Twitter

Thanks for your interest in contributing!
Expand Down
2 changes: 1 addition & 1 deletion core/io/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2753,7 +2753,7 @@ Error Image::compress_from_channels(CompressMode p_mode, UsedChannels p_channels

case COMPRESS_S3TC: {
// BC3 is unsupported currently.
if ((p_channels == USED_CHANNELS_RGB || p_channels == USED_CHANNELS_L) && _image_compress_bc_rd_func) {
if ((p_channels == USED_CHANNELS_R || p_channels == USED_CHANNELS_RGB || p_channels == USED_CHANNELS_L) && _image_compress_bc_rd_func) {
Error result = _image_compress_bc_rd_func(this, p_channels);

// If the image was compressed successfully, we return here. If not, we fall back to the default compression scheme.
Expand Down
6 changes: 6 additions & 0 deletions doc/classes/CPUParticles3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
<link title="Particle systems (3D)">$DOCS_URL/tutorials/3d/particles/index.html</link>
</tutorials>
<methods>
<method name="capture_aabb" qualifiers="const">
<return type="AABB" />
<description>
Returns the axis-aligned bounding box that contains all the particles that are active in the current frame.
</description>
</method>
<method name="convert_from_particles">
<return type="void" />
<param index="0" name="particles" type="Node" />
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2900,8 +2900,8 @@
</member>
<member name="rendering/textures/vram_compression/compress_with_gpu" type="bool" setter="" getter="" default="true">
If [code]true[/code], the texture importer will utilize the GPU for compressing textures, improving the import time of large images.
[b]Note:[/b] This setting requires either Vulkan or D3D12 available as a rendering backend.
[b]Note:[/b] Currently this only affects BC1 and BC6H compression, which are used on Desktop and Console for fully opaque and HDR images respectively.
[b]Note:[/b] This only functions on a device which supports either Vulkan, D3D12, or Metal available as a rendering backend.
[b]Note:[/b] Currently this only affects certain compressed formats (BC1, BC4, and BC6), all of which are exclusive to desktop platforms and consoles.
</member>
<member name="rendering/textures/vram_compression/import_etc2_astc" type="bool" setter="" getter="" default="false">
If [code]true[/code], the texture importer will import VRAM-compressed textures using the Ericsson Texture Compression 2 algorithm for lower quality textures and normal maps and Adaptable Scalable Texture Compression algorithm for high quality textures (in 4×4 block size).
Expand Down
12 changes: 7 additions & 5 deletions editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

constexpr double FPS_DECIMAL = 1.0;
constexpr double SECOND_DECIMAL = 0.0001;
constexpr double FACTOR = 0.0625;
constexpr double FPS_STEP_FRACTION = 0.0625;

void AnimationTrackKeyEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_obj"), &AnimationTrackKeyEdit::_update_obj);
Expand Down Expand Up @@ -5030,6 +5030,8 @@ void AnimationTrackEditor::_snap_mode_changed(int p_mode) {
key_edit->set_use_fps(use_fps);
}
marker_edit->set_use_fps(use_fps);
// To ensure that the conversion results are consistent between serialization and load, the value is snapped with 0.0625 to be a rational number when FPS mode is used.
step->set_step(use_fps ? FPS_STEP_FRACTION : SECOND_DECIMAL);
_update_step_spinbox();
}

Expand Down Expand Up @@ -5157,12 +5159,12 @@ void AnimationTrackEditor::_update_step(double p_new_step) {

EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Change Animation Step"));
// To ensure that the conversion results are consistent between serialization and load, the value is snapped with 0.0625 to be a rational number.
// step_value must also be less than or equal to 1000 to ensure that no error accumulates due to interactions with retrieving values from inner range.
double step_value = MIN(1000.0, Math::snapped(p_new_step, FACTOR));
double step_value = p_new_step;
if (timeline->is_using_fps()) {
if (step_value != 0.0) {
step_value = 1.0 / step_value;
// step_value must also be less than or equal to 1000 to ensure that no error accumulates due to interactions with retrieving values from inner range.
step_value = 1.0 / MIN(1000.0, p_new_step);
;
}
timeline->queue_redraw();
}
Expand Down
4 changes: 0 additions & 4 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6739,10 +6739,6 @@ EditorNode::EditorNode() {
ED_SHORTCUT("editor/group_selected_nodes", TTR("Group Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::G);
ED_SHORTCUT("editor/ungroup_selected_nodes", TTR("Ungroup Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::G);

// Used in the GPUParticles/CPUParticles 2D/3D editor plugins.
// The shortcut is Ctrl + R even on macOS, as Cmd + R is used to run the current scene on macOS.
ED_SHORTCUT("particles/restart_emission", TTR("Restart Emission"), KeyModifierMask::CTRL | Key::R);

FileAccess::set_backup_save(EDITOR_GET("filesystem/on_save/safe_save_on_backup_then_rename"));

_update_vsync_mode();
Expand Down
2 changes: 1 addition & 1 deletion editor/icons/GuiToggleOffMirrored.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions editor/import/resource_importer_layered_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ void ResourceImporterLayeredTexture::_save_tex(Vector<Ref<Image>> p_images, cons
f->store_32(0);
f->store_32(0);

if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_images[0]->get_format() >= Image::FORMAT_RF) {
p_compress_mode = COMPRESS_VRAM_UNCOMPRESSED; // These can't go as lossy.
}

for (int i = 0; i < p_images.size(); i++) {
ResourceImporterTexture::save_to_ctex_format(f, p_images[i], ResourceImporterTexture::CompressMode(p_compress_mode), used_channels, p_vram_compression, p_lossy);
}
Expand Down Expand Up @@ -337,11 +341,6 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const
return err;
}

if (compress_mode == COMPRESS_BASIS_UNIVERSAL && image->get_format() >= Image::FORMAT_RF) {
//basis universal does not support float formats, fall back
compress_mode = COMPRESS_VRAM_COMPRESSED;
}

if (compress_mode == COMPRESS_VRAM_COMPRESSED) {
//if using video ram, optimize
if (channel_pack == 0) {
Expand Down
7 changes: 1 addition & 6 deletions editor/import/resource_importer_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ void ResourceImporterTexture::_save_ctex(const Ref<Image> &p_image, const String
f->store_32(0);
f->store_32(0);

if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_image->get_format() > Image::FORMAT_RGBA8) {
if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_image->get_format() >= Image::FORMAT_RF) {
p_compress_mode = COMPRESS_VRAM_UNCOMPRESSED; //these can't go as lossy
}

Expand Down Expand Up @@ -595,11 +595,6 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
}
}

if (compress_mode == COMPRESS_BASIS_UNIVERSAL && image->get_format() >= Image::FORMAT_RF) {
// Basis universal does not support float formats, fallback.
compress_mode = COMPRESS_VRAM_COMPRESSED;
}

bool detect_3d = int(p_options["detect_3d/compress_to"]) > 0;
bool detect_roughness = roughness == 0;
bool detect_normal = normal == 0;
Expand Down
4 changes: 2 additions & 2 deletions editor/plugins/animation_library_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ void AnimationLibraryEditor::_button_pressed(TreeItem *p_item, int p_column, int
file_popup->add_separator();
file_popup->add_item(TTR("Open in Inspector"), FILE_MENU_EDIT_LIBRARY);
Rect2 pos = tree->get_item_rect(p_item, 1, 0);
Vector2 popup_pos = tree->get_screen_transform().xform(pos.position + Vector2(0, pos.size.height));
Vector2 popup_pos = tree->get_screen_transform().xform(pos.position + Vector2(0, pos.size.height)) - tree->get_scroll();
file_popup->popup(Rect2(popup_pos, Size2()));

file_dialog_animation = StringName();
Expand Down Expand Up @@ -640,7 +640,7 @@ void AnimationLibraryEditor::_button_pressed(TreeItem *p_item, int p_column, int
file_popup->add_separator();
file_popup->add_item(TTR("Open in Inspector"), FILE_MENU_EDIT_ANIMATION);
Rect2 pos = tree->get_item_rect(p_item, 1, 0);
Vector2 popup_pos = tree->get_screen_transform().xform(pos.position + Vector2(0, pos.size.height));
Vector2 popup_pos = tree->get_screen_transform().xform(pos.position + Vector2(0, pos.size.height)) - tree->get_scroll();
file_popup->popup(Rect2(popup_pos, Size2()));

file_dialog_animation = anim_name;
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/asset_library_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ void EditorAssetLibrary::_notification(int p_what) {
void EditorAssetLibrary::_update_repository_options() {
// TODO: Move to editor_settings.cpp
Dictionary default_urls;
default_urls["godotengine.org (Official)"] = "https://godotengine.org/asset-library/api";
default_urls["godotengine.org"] = "https://godotengine.org/asset-library/api";
Dictionary available_urls = _EDITOR_DEF("asset_library/available_urls", default_urls, true);
repository->clear();
Array keys = available_urls.keys();
Expand Down
4 changes: 3 additions & 1 deletion editor/plugins/control_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "control_editor_plugin.h"

#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/editor_undo_redo_manager.h"
#include "editor/plugins/canvas_item_editor_plugin.h"
Expand Down Expand Up @@ -513,6 +512,9 @@ void ControlEditorPopupButton::_notification(int p_what) {
case NOTIFICATION_DRAW: {
if (arrow_icon.is_valid()) {
Vector2 arrow_pos = Point2(26, 0) * EDSCALE;
if (is_layout_rtl()) {
arrow_pos.x = get_size().x - arrow_pos.x - arrow_icon->get_width();
}
arrow_pos.y = get_size().y / 2 - arrow_icon->get_height() / 2;
draw_texture(arrow_icon, arrow_pos);
}
Expand Down
Loading

0 comments on commit db82f9a

Please sign in to comment.