diff options
-rw-r--r-- | .github/workflows/main.yml | 126 | ||||
-rw-r--r-- | SConstruct | 1 | ||||
-rw-r--r-- | core/project_settings.cpp | 22 | ||||
-rw-r--r-- | editor/editor_audio_buses.cpp | 4 | ||||
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | editor/icons/GuiTabMenu.svg | 2 | ||||
-rw-r--r-- | editor/icons/GuiTabMenuHl.svg | 2 | ||||
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | modules/enet/doc_classes/NetworkedMultiplayerENet.xml | 4 | ||||
-rw-r--r-- | scene/2d/camera_2d.cpp | 19 | ||||
-rw-r--r-- | scene/2d/camera_2d.h | 1 |
13 files changed, 160 insertions, 31 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..2ef335fe02 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,126 @@ +# Engine build CI +name: Godot CI + +on: + # will build EVERY pull request + pull_request: + + # will only build explicit branches + push: + branches: [ master, 3.2, 3.1, 3.0 ] + +# Global Cache Settings +# SCONS_CACHE for windows must be set in the build environment +env: + SCONS_CACHE_MSVC_CONFIG: true + SCONS_CACHE_LIMIT: 8192 +jobs: + windows-editor: + # Windows 10 with latest image + runs-on: "windows-latest" + + # Windows Editor - checkout with the plugin + name: Windows Editor (target=release_debug, tools=yes) + + steps: + - uses: actions/checkout@v2 + + # Upload cache on completion and check it out now + # Editing this is pretty dangerous for windows since it can break and needs properly tested with a fresh cache. + # Linux with this will work reliably, so not as bad to edit for Linux. + - name: Load .scons_cache directory + id: windows-editor-cache + uses: RevoluPowered/cache@v2.1 + with: + path: /.scons_cache/ + key: ${{runner.os}}-editor-${{github.sha}} + restore-keys: | + ${{runner.os}}-editor-${{github.sha}} + ${{runner.os}}-editor + ${{runner.os}} + + # Use python 3.x release (works cross platform; best to keep self contained in it's own step) + - name: Set up Python 3.x + uses: actions/setup-python@v2 + with: + # Semantic version range syntax or exact version of a Python version + python-version: '3.x' + # Optional - x64 or x86 architecture, defaults to x64 + architecture: 'x64' + + # Setup scons, print python version and scons version info, so if anything is broken it won't run the build. + - name: Configuring Python packages + run: | + python -c "import sys; print(sys.version)" + python -m pip install scons pywin32 + python --version + scons --version + + # We should always be explicit with our flags usage here since it's gonna be sure to always set those flags + - name: Compilation + env: + SCONS_CACHE: /.scons_cache/ + run: | + scons -j2 verbose=yes warnings=all werror=yes platform=windows tools=yes target=release_debug + +# Build Product Upload (tested and working) +# sorry this is disabled until github can give us some more space as we would hit our limit very quickly +# tested this code and it works fine so just enable it to get them back +# - name: publishing godot windows-editor +# uses: actions/upload-artifact@v1 +# with: +# name: windows-editor (x64) +# path: bin/godot.windows.opt.tools.64.exe + + + windows-template: + runs-on: "windows-latest" + name: Windows Template (target=release, tools=no) + + steps: + - uses: actions/checkout@v2 + + # Upload cache on completion and check it out now + # Editing this is pretty dangerous for windows since it can break and needs properly tested with a fresh cache. + # Linux with this will work reliably, so not as bad to edit for Linux. + - name: Load .scons_cache directory + id: windows-template-cache + uses: RevoluPowered/cache@v2.1 + with: + path: /.scons_cache/ + key: ${{runner.os}}-template-${{github.sha}} + restore-keys: | + ${{runner.os}}-template-${{github.sha}} + ${{runner.os}}-template + ${{runner.os}} + + # Use python 3.x release (works cross platform) + - name: Set up Python 3.x + uses: actions/setup-python@v2 + with: + # Semantic version range syntax or exact version of a Python version + python-version: '3.x' + # Optional - x64 or x86 architecture, defaults to x64 + architecture: 'x64' + + # You can test your matrix by printing the current Python version + - name: Configuring Python packages + run: | + python -c "import sys; print(sys.version)" + python -m pip install scons pywin32 + python --version + scons --version + - name: Compilation + env: + SCONS_CACHE: /.scons_cache/ + run: | + scons -j2 verbose=yes warnings=all werror=yes platform=windows target=release tools=no + +# Build Product Upload (tested and working) +# sorry this is disabled until github can give us some more space as we would hit our limit very quickly +# tested this code and it works fine so just enable it to get them back +# - name: publishing godot windows-template +# uses: actions/upload-artifact@v1 +# with: +# name: windows-template (x64) +# path: bin/godot.windows.opt.64.exe diff --git a/SConstruct b/SConstruct index 9496595a26..ef74ce7736 100644 --- a/SConstruct +++ b/SConstruct @@ -455,6 +455,7 @@ if selected_platform in platform_list: all_plus_warnings = ["-Wwrite-strings"] if methods.using_gcc(env): + env.Append(CCFLAGS=["-Wno-misleading-indentation"]) if cc_version_major >= 7: shadow_local_warning = ["-Wshadow-local"] diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 3f9585c03c..638987bb2f 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -488,6 +488,14 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bo _load_settings_text(custom_settings); } } + // Using GLOBAL_GET on every block for compressing can be slow, so assigning here. + Compression::zstd_long_distance_matching = GLOBAL_GET("compression/formats/zstd/long_distance_matching"); + Compression::zstd_level = GLOBAL_GET("compression/formats/zstd/compression_level"); + Compression::zstd_window_log_size = GLOBAL_GET("compression/formats/zstd/window_log_size"); + + Compression::zlib_level = GLOBAL_GET("compression/formats/zlib/compression_level"); + + Compression::gzip_level = GLOBAL_GET("compression/formats/gzip/compression_level"); return err; } @@ -1007,6 +1015,9 @@ void ProjectSettings::_bind_methods() { } ProjectSettings::ProjectSettings() { + // Initialization of engine variables should be done in the setup() method, + // so that the values can be overridden from project.godot or project.binary. + singleton = this; Array events; @@ -1206,18 +1217,17 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF("debug/settings/profiler/max_functions", 16384); custom_prop_info["debug/settings/profiler/max_functions"] = PropertyInfo(Variant::INT, "debug/settings/profiler/max_functions", PROPERTY_HINT_RANGE, "128,65535,1"); - //assigning here, because using GLOBAL_GET on every block for compressing can be slow - Compression::zstd_long_distance_matching = GLOBAL_DEF("compression/formats/zstd/long_distance_matching", false); + GLOBAL_DEF("compression/formats/zstd/long_distance_matching", Compression::zstd_long_distance_matching); custom_prop_info["compression/formats/zstd/long_distance_matching"] = PropertyInfo(Variant::BOOL, "compression/formats/zstd/long_distance_matching"); - Compression::zstd_level = GLOBAL_DEF("compression/formats/zstd/compression_level", 3); + GLOBAL_DEF("compression/formats/zstd/compression_level", Compression::zstd_level); custom_prop_info["compression/formats/zstd/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/zstd/compression_level", PROPERTY_HINT_RANGE, "1,22,1"); - Compression::zstd_window_log_size = GLOBAL_DEF("compression/formats/zstd/window_log_size", 27); + GLOBAL_DEF("compression/formats/zstd/window_log_size", Compression::zstd_window_log_size); custom_prop_info["compression/formats/zstd/window_log_size"] = PropertyInfo(Variant::INT, "compression/formats/zstd/window_log_size", PROPERTY_HINT_RANGE, "10,30,1"); - Compression::zlib_level = GLOBAL_DEF("compression/formats/zlib/compression_level", Z_DEFAULT_COMPRESSION); + GLOBAL_DEF("compression/formats/zlib/compression_level", Compression::zlib_level); custom_prop_info["compression/formats/zlib/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/zlib/compression_level", PROPERTY_HINT_RANGE, "-1,9,1"); - Compression::gzip_level = GLOBAL_DEF("compression/formats/gzip/compression_level", Z_DEFAULT_COMPRESSION); + GLOBAL_DEF("compression/formats/gzip/compression_level", Compression::gzip_level); custom_prop_info["compression/formats/gzip/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/gzip/compression_level", PROPERTY_HINT_RANGE, "-1,9,1"); } diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 10825973ae..669868c632 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -84,7 +84,7 @@ void EditorAudioBus::_notification(int p_what) { bypass->set_icon(get_theme_icon("AudioBusBypass", "EditorIcons")); bypass->add_theme_color_override("icon_color_pressed", bypass_color); - bus_options->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); + bus_options->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons")); update_bus(); set_process(true); @@ -172,7 +172,7 @@ void EditorAudioBus::_notification(int p_what) { mute->set_icon(get_theme_icon("AudioBusMute", "EditorIcons")); bypass->set_icon(get_theme_icon("AudioBusBypass", "EditorIcons")); - bus_options->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); + bus_options->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons")); } break; case NOTIFICATION_MOUSE_EXIT: case NOTIFICATION_DRAG_END: { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f768a2cacf..fe68797483 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -456,6 +456,8 @@ void EditorNode::_notification(int p_what) { editor_selection->update(); + //scene_root->set_size_override(true, Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"))); + { //TODO should only happen on settings changed int current_filter = GLOBAL_GET("rendering/canvas_textures/default_texture_filter"); if (current_filter != scene_root->get_default_canvas_item_texture_filter()) { diff --git a/editor/icons/GuiTabMenu.svg b/editor/icons/GuiTabMenu.svg index 8bf5ef2f7d..55e98143a6 100644 --- a/editor/icons/GuiTabMenu.svg +++ b/editor/icons/GuiTabMenu.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 6 16" width="6" xmlns="http://www.w3.org/2000/svg"><path d="m3 0a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2zm0 6a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2zm0 6a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2z" fill="#fff" fill-opacity=".39216"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m8 0a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2zm0 6a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2zm0 6a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2z" fill="#fff" fill-opacity=".39216"/></svg>
\ No newline at end of file diff --git a/editor/icons/GuiTabMenuHl.svg b/editor/icons/GuiTabMenuHl.svg index 42d58a5abf..e4c5b7bf1e 100644 --- a/editor/icons/GuiTabMenuHl.svg +++ b/editor/icons/GuiTabMenuHl.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 6 16" width="6" xmlns="http://www.w3.org/2000/svg"><path d="m3 0a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2zm0 6a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2zm0 6a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2z" fill="#e0e0e0"/></svg>
\ No newline at end of file +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m8 0a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2zm0 6a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2zm0 6a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0 -2-2z" fill="#e0e0e0"/></svg>
\ No newline at end of file diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index de04a299fb..be220fb30c 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -117,7 +117,7 @@ void AnimationPlayerEditor::_notification(int p_what) { stop->set_icon(get_theme_icon("Stop", "EditorIcons")); onion_toggle->set_icon(get_theme_icon("Onion", "EditorIcons")); - onion_skinning->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); + onion_skinning->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons")); pin->set_icon(get_theme_icon("Pin", "EditorIcons")); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 3af0b0d4e1..9392734ea3 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3982,7 +3982,7 @@ void CanvasItemEditor::_notification(int p_what) { rotate_button->set_icon(get_theme_icon("ToolRotate", "EditorIcons")); smart_snap_button->set_icon(get_theme_icon("Snap", "EditorIcons")); grid_snap_button->set_icon(get_theme_icon("SnapGrid", "EditorIcons")); - snap_config_menu->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); + snap_config_menu->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons")); skeleton_menu->set_icon(get_theme_icon("Bone", "EditorIcons")); override_camera_button->set_icon(get_theme_icon("Camera2D", "EditorIcons")); pan_button->set_icon(get_theme_icon("ToolPan", "EditorIcons")); @@ -3999,7 +3999,7 @@ void CanvasItemEditor::_notification(int p_what) { key_scale_button->set_icon(get_theme_icon("KeyScale", "EditorIcons")); key_insert_button->set_icon(get_theme_icon("Key", "EditorIcons")); key_auto_insert_button->set_icon(get_theme_icon("AutoKey", "EditorIcons")); - animation_menu->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); + animation_menu->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons")); zoom_minus->set_icon(get_theme_icon("ZoomLess", "EditorIcons")); zoom_plus->set_icon(get_theme_icon("ZoomMore", "EditorIcons")); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index b51ea9e1c6..6165f39561 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -2551,7 +2551,7 @@ void Node3DEditorViewport::_notification(int p_what) { } if (p_what == NOTIFICATION_THEME_CHANGED) { - view_menu->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons")); + view_menu->set_icon(get_theme_icon("GuiTabMenuHl", "EditorIcons")); preview_camera->set_icon(get_theme_icon("Camera3D", "EditorIcons")); view_menu->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles")); diff --git a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml index 860da32a22..c908af7479 100644 --- a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml +++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml @@ -128,7 +128,7 @@ Enforce ordered packets when using [constant NetworkedMultiplayerPeer.TRANSFER_MODE_UNRELIABLE] (thus behaving similarly to [constant NetworkedMultiplayerPeer.TRANSFER_MODE_UNRELIABLE_ORDERED]). This is the only way to use ordering with the RPC system. </member> <member name="channel_count" type="int" setter="set_channel_count" getter="get_channel_count" default="3"> - The number of channels to be used by ENet. Channels are used to separate different kinds of data. In reliable or ordered mode, for example, the packet delivery order is ensured on a per channel basis. + The number of channels to be used by ENet. Channels are used to separate different kinds of data. In reliable or ordered mode, for example, the packet delivery order is ensured on a per-channel basis. This is done to combat latency and reduces ordering restrictions on packets. The delivery status of a packet in one channel won't stall the delivery of other packets in another channel. </member> <member name="compression_mode" type="int" setter="set_compression_mode" getter="get_compression_mode" enum="NetworkedMultiplayerENet.CompressionMode" default="0"> The compression method used for network packets. These have different tradeoffs of compression speed versus bandwidth, you may need to test which one works best for your use case if you use compression at all. @@ -141,7 +141,7 @@ Enable or disable the server feature that notifies clients of other peers' connection/disconnection, and relays messages between them. When this option is [code]false[/code], clients won't be automatically notified of other peers and won't be able to send them packets through the server. </member> <member name="transfer_channel" type="int" setter="set_transfer_channel" getter="get_transfer_channel" default="-1"> - Set the default channel to be used to transfer data. By default, this value is [code]-1[/code] which means that ENet will only use 2 channels, one for reliable and one for unreliable packets. Channel [code]0[/code] is reserved, and cannot be used. Setting this member to any value between [code]0[/code] and [member channel_count] (excluded) will force ENet to use that channel for sending data. + Set the default channel to be used to transfer data. By default, this value is [code]-1[/code] which means that ENet will only use 2 channels: one for reliable packets, and one for unreliable packets. The channel [code]0[/code] is reserved and cannot be used. Setting this member to any value between [code]0[/code] and [member channel_count] (excluded) will force ENet to use that channel for sending data. See [member channel_count] for more information about ENet channels. </member> <member name="transfer_mode" type="int" setter="set_transfer_mode" getter="get_transfer_mode" override="true" enum="NetworkedMultiplayerPeer.TransferMode" default="2" /> <member name="use_dtls" type="bool" setter="set_dtls_enabled" getter="is_dtls_enabled" default="false"> diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 992c86d632..68e99445d8 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -32,7 +32,6 @@ #include "core/engine.h" #include "core/math/math_funcs.h" -#include "editor/editor_node.h" #include "scene/scene_string_names.h" #include "servers/rendering_server.h" @@ -57,7 +56,7 @@ void Camera2D::_update_scroll() { viewport->set_canvas_transform(xform); - Size2 screen_size = get_camera_screen_size(); + Size2 screen_size = viewport->get_visible_rect().size; Point2 screen_offset = (anchor_mode == ANCHOR_MODE_DRAG_CENTER ? (screen_size * 0.5) : Point2()); get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME, group_name, "_camera_moved", xform, screen_offset); @@ -95,7 +94,7 @@ Transform2D Camera2D::get_camera_transform() { ERR_FAIL_COND_V(custom_viewport && !ObjectDB::get_instance(custom_viewport_id), Transform2D()); - Size2 screen_size = get_camera_screen_size(); + Size2 screen_size = viewport->get_visible_rect().size; Point2 new_camera_pos = get_global_transform().get_origin(); Point2 ret_camera_pos; @@ -275,7 +274,7 @@ void Camera2D::_notification(int p_what) { } Transform2D inv_camera_transform = get_camera_transform().affine_inverse(); - Size2 screen_size = get_camera_screen_size(); + Size2 screen_size = get_viewport_rect().size; Vector2 screen_endpoints[4] = { inv_camera_transform.xform(Vector2(0, 0)), @@ -322,7 +321,7 @@ void Camera2D::_notification(int p_what) { } Transform2D inv_camera_transform = get_camera_transform().affine_inverse(); - Size2 screen_size = get_camera_screen_size(); + Size2 screen_size = get_viewport_rect().size; Vector2 margin_endpoints[4] = { inv_camera_transform.xform(Vector2((screen_size.width / 2) - ((screen_size.width / 2) * drag_margin[MARGIN_LEFT]), (screen_size.height / 2) - ((screen_size.height / 2) * drag_margin[MARGIN_TOP]))), @@ -470,7 +469,7 @@ void Camera2D::reset_smoothing() { void Camera2D::align() { ERR_FAIL_COND(custom_viewport && !ObjectDB::get_instance(custom_viewport_id)); - Size2 screen_size = get_camera_screen_size(); + Size2 screen_size = viewport->get_visible_rect().size; Point2 current_camera_pos = get_global_transform().get_origin(); if (anchor_mode == ANCHOR_MODE_DRAG_CENTER) { @@ -508,14 +507,6 @@ Point2 Camera2D::get_camera_screen_center() const { return camera_screen_center; } -Size2 Camera2D::get_camera_screen_size() const { - // special case if the camera2D is in the root viewport - if (Engine::get_singleton()->is_editor_hint() && get_viewport() == EditorNode::get_singleton()->get_scene_root()) { - return Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height")); - } - return get_viewport_rect().size; -} - void Camera2D::set_h_drag_enabled(bool p_enabled) { h_drag_enabled = p_enabled; } diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h index 4d34b51e97..0a4e269c40 100644 --- a/scene/2d/camera_2d.h +++ b/scene/2d/camera_2d.h @@ -147,7 +147,6 @@ public: Vector2 get_zoom() const; Point2 get_camera_screen_center() const; - Size2 get_camera_screen_size() const; void set_custom_viewport(Node *p_viewport); Node *get_custom_viewport() const; |