Code style formatting and minor tweaks

#2800
This commit is contained in:
2026-02-11 17:15:15 +01:00
parent 0bea701a83
commit 273b110db4
41 changed files with 108 additions and 116 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
"Major": 1, "Major": 1,
"Minor": 12, "Minor": 12,
"Revision": 0, "Revision": 0,
"Build": 6904 "Build": 6905
}, },
"Company": "Flax", "Company": "Flax",
"Copyright": "Copyright (c) 2012-2026 Wojciech Figat. All rights reserved.", "Copyright": "Copyright (c) 2012-2026 Wojciech Figat. All rights reserved.",
+1 -1
View File
@@ -188,7 +188,7 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String> <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_CASE_STATEMENT_ON_SAME_LINE/@EntryValue">ALWAYS</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_EMBEDDED_STATEMENT_ON_SAME_LINE/@EntryValue">NEVER</s:String> <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_EMBEDDED_STATEMENT_ON_SAME_LINE/@EntryValue">NEVER</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_CASE_STATEMENT_STYLE/@EntryValue">ON_SINGLE_LINE</s:String> <s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_CASE_STATEMENT_STYLE/@EntryValue">ON_SINGLE_LINE</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>
@@ -195,7 +195,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
filesCount += files.Length; filesCount += files.Length;
foreach (var file in files) foreach (var file in files)
FindNewKeysCpp(file, newKeys, allKeys); FindNewKeysCpp(file, newKeys, allKeys);
files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.h", SearchOption.AllDirectories).Concat(Directory.GetFiles(Globals.ProjectSourceFolder, "*.hpp", SearchOption.AllDirectories)).ToArray();; files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.h", SearchOption.AllDirectories).Concat(Directory.GetFiles(Globals.ProjectSourceFolder, "*.hpp", SearchOption.AllDirectories)).ToArray();
filesCount += files.Length; filesCount += files.Length;
foreach (var file in files) foreach (var file in files)
FindNewKeysCpp(file, newKeys, allKeys); FindNewKeysCpp(file, newKeys, allKeys);
+1
View File
@@ -193,6 +193,7 @@ namespace FlaxEditor.GUI.Docking
{ {
CreateFloating(Float2.Zero, Float2.Zero); CreateFloating(Float2.Zero, Float2.Zero);
} }
/// <summary> /// <summary>
/// Creates the window in a floating state. /// Creates the window in a floating state.
/// </summary> /// </summary>
+2 -2
View File
@@ -322,7 +322,7 @@ namespace FlaxEditor.GUI.Input
#else #else
/// <inheritdoc /> /// <inheritdoc />
public override void OnMouseMoveRelative(Float2 mouseMotion) public override void OnMouseMoveRelative(Float2 motion)
{ {
var location = Root.TrackingMouseOffset; var location = Root.TrackingMouseOffset;
if (_isSliding) if (_isSliding)
@@ -344,7 +344,7 @@ namespace FlaxEditor.GUI.Input
_cursorChanged = false; _cursorChanged = false;
} }
base.OnMouseMoveRelative(mouseMotion); base.OnMouseMoveRelative(motion);
} }
#endif #endif
-3
View File
@@ -1,8 +1,5 @@
// Copyright (c) Wojciech Figat. All rights reserved. // Copyright (c) Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.Docking;
using FlaxEditor.Options;
using FlaxEngine; using FlaxEngine;
using FlaxEngine.GUI; using FlaxEngine.GUI;
+2 -2
View File
@@ -549,7 +549,7 @@ namespace FlaxEditor.Modules
public void SaveCustomViewportScalingOptions() public void SaveCustomViewportScalingOptions()
{ {
var customOptions = JsonSerializer.Serialize(CustomViewportScaleOptions); var customOptions = JsonSerializer.Serialize(CustomViewportScaleOptions);
Editor.Instance.ProjectCache.SetCustomData("CustomViewportScalingOptions", customOptions); Editor.Instance.ProjectCache.SetCustomData("CustomViewportScalingOptions", customOptions);
} }
/// <inheritdoc /> /// <inheritdoc />
@@ -778,7 +778,7 @@ namespace FlaxEditor.Modules
MenuWindow = MainMenu.AddButton("Window"); MenuWindow = MainMenu.AddButton("Window");
cm = MenuWindow.ContextMenu; cm = MenuWindow.ContextMenu;
cm.VisibleChanged += OnMenuWindowVisibleChanged; cm.VisibleChanged += OnMenuWindowVisibleChanged;
cm.AddButton("Content", inputOptions.ContentWindow,Editor.Windows.ContentWin.FocusOrShow); cm.AddButton("Content", inputOptions.ContentWindow, Editor.Windows.ContentWin.FocusOrShow);
cm.AddButton("Scene", inputOptions.SceneWindow, Editor.Windows.SceneWin.FocusOrShow); cm.AddButton("Scene", inputOptions.SceneWindow, Editor.Windows.SceneWin.FocusOrShow);
cm.AddButton("Toolbox", inputOptions.ToolboxWindow, Editor.Windows.ToolboxWin.FocusOrShow); cm.AddButton("Toolbox", inputOptions.ToolboxWindow, Editor.Windows.ToolboxWin.FocusOrShow);
cm.AddButton("Properties", inputOptions.PropertiesWindow, Editor.Windows.PropertiesWin.FocusOrShow); cm.AddButton("Properties", inputOptions.PropertiesWindow, Editor.Windows.PropertiesWin.FocusOrShow);
+4 -2
View File
@@ -85,10 +85,12 @@ namespace FlaxEditor.Options
/// Never show the close button. /// Never show the close button.
/// </summary> /// </summary>
Never, Never,
/// <summary> /// <summary>
/// Show the close button on tabs that are currently selected. /// Show the close button on tabs that are currently selected.
/// </summary> /// </summary>
SelectedTab, SelectedTab,
/// <summary> /// <summary>
/// Show the close button on all tabs that can be closed. /// Show the close button on all tabs that can be closed.
/// </summary> /// </summary>
@@ -322,7 +324,7 @@ namespace FlaxEditor.Options
#endif #endif
/// <summary> /// <summary>
/// Gets or sets a value indicating wether the minum tab width should be used. Editor restart required. /// Gets or sets a value indicating whether the minimum tab width should be used. Editor restart required.
/// </summary> /// </summary>
[DefaultValue(false)] [DefaultValue(false)]
[EditorDisplay("Tabs & Windows"), EditorOrder(99)] [EditorDisplay("Tabs & Windows"), EditorOrder(99)]
@@ -533,7 +535,7 @@ namespace FlaxEditor.Options
public float ConnectionCurvature { get; set; } = 1.0f; public float ConnectionCurvature { get; set; } = 1.0f;
/// <summary> /// <summary>
/// Gets or sets a value that indicates wether the context menu description panel is shown or not. /// Gets or sets a value that indicates whether the context menu description panel is shown or not.
/// </summary> /// </summary>
[DefaultValue(true)] [DefaultValue(true)]
[EditorDisplay("Visject"), EditorOrder(550), Tooltip("Shows/hides the description panel in visual scripting context menu.")] [EditorDisplay("Visject"), EditorOrder(550), Tooltip("Shows/hides the description panel in visual scripting context menu.")]
@@ -2,4 +2,5 @@
#pragma once #pragma once
// [Deprecated in v1.12]
#include "Engine/Platform/ScreenUtilities.h" #include "Engine/Platform/ScreenUtilities.h"
+6
View File
@@ -1586,6 +1586,7 @@ namespace FlaxEditor.Utilities
internal static bool UseCustomWindowDecorations(bool isMainWindow = false) internal static bool UseCustomWindowDecorations(bool isMainWindow = false)
{ {
#if PLATFORM_SDL
return Editor.Instance.Options.Options.Interface.WindowDecorations switch return Editor.Instance.Options.Options.Interface.WindowDecorations switch
{ {
Options.InterfaceOptions.WindowDecorationsType.Auto => !Platform.SupportsNativeDecorations, Options.InterfaceOptions.WindowDecorationsType.Auto => !Platform.SupportsNativeDecorations,
@@ -1594,6 +1595,11 @@ namespace FlaxEditor.Utilities
Options.InterfaceOptions.WindowDecorationsType.ClientSide => true, Options.InterfaceOptions.WindowDecorationsType.ClientSide => true,
_ => throw new ArgumentOutOfRangeException() _ => throw new ArgumentOutOfRangeException()
}; };
#elif PLATFORM_WINDOWS
return !Editor.Instance.Options.Options.Interface.UseNativeWindowSystem;
#else
return false;
#endif
} }
internal static bool HideSingleTabWindowTabBars() internal static bool HideSingleTabWindowTabBars()
+2 -3
View File
@@ -1923,10 +1923,9 @@ namespace FlaxEditor.Viewport
_input.MouseWheelDelta = 0; _input.MouseWheelDelta = 0;
} }
/// <inheritdoc /> private void OnMouseMoveRelative(ref Float2 motion)
public void OnMouseMoveRelative(ref Float2 mouseMotion)
{ {
_mouseDelta += mouseMotion; _mouseDelta += motion;
} }
/// <inheritdoc /> /// <inheritdoc />
@@ -9,8 +9,6 @@
// Support more backbuffers in case driver decides to use more // Support more backbuffers in case driver decides to use more
#define VULKAN_BACK_BUFFERS_COUNT_MAX 8 #define VULKAN_BACK_BUFFERS_COUNT_MAX 8
class GPUDeviceVulkan;
/// <summary> /// <summary>
/// The implementation for the Vulkan API support for Android platform. /// The implementation for the Vulkan API support for Android platform.
/// </summary> /// </summary>
@@ -5,7 +5,6 @@
#include "LinuxVulkanPlatform.h" #include "LinuxVulkanPlatform.h"
#include "../RenderToolsVulkan.h" #include "../RenderToolsVulkan.h"
#include "Engine/Platform/Window.h" #include "Engine/Platform/Window.h"
#include "Engine/Platform/Linux/IncludeX11.h" #include "Engine/Platform/Linux/IncludeX11.h"
#define Display X11::Display #define Display X11::Display
#define Window X11::Window #define Window X11::Window
@@ -14,7 +13,6 @@
#undef Display #undef Display
#undef Window #undef Window
#undef VisualID #undef VisualID
#include "vulkan/vulkan_wayland.h" #include "vulkan/vulkan_wayland.h"
// Export extension from volk // Export extension from volk
@@ -12,8 +12,6 @@
// Prevent wierd error 'Invalid VkValidationCacheEXT Object' // Prevent wierd error 'Invalid VkValidationCacheEXT Object'
#define VULKAN_USE_VALIDATION_CACHE 0 #define VULKAN_USE_VALIDATION_CACHE 0
class GPUDeviceVulkan;
/// <summary> /// <summary>
/// The implementation for the Vulkan API support for Linux platform. /// The implementation for the Vulkan API support for Linux platform.
/// </summary> /// </summary>
@@ -11,8 +11,6 @@
// General/Validation Error:0 VK_ERROR_INITIALIZATION_FAILED: Could not create MTLCounterSampleBuffer for query pool of type VK_QUERY_TYPE_TIMESTAMP. Reverting to emulated behavior. (Error code 0): Cannot allocate sample buffer // General/Validation Error:0 VK_ERROR_INITIALIZATION_FAILED: Could not create MTLCounterSampleBuffer for query pool of type VK_QUERY_TYPE_TIMESTAMP. Reverting to emulated behavior. (Error code 0): Cannot allocate sample buffer
#define VULKAN_USE_TIMER_QUERIES 0 #define VULKAN_USE_TIMER_QUERIES 0
class GPUDeviceVulkan;
/// <summary> /// <summary>
/// The implementation for the Vulkan API support for Mac platform. /// The implementation for the Vulkan API support for Mac platform.
/// </summary> /// </summary>
@@ -17,6 +17,8 @@ enum class VulkanValidationLevel
All = 5, All = 5,
}; };
class GPUDeviceVulkan;
/// <summary> /// <summary>
/// The base implementation for the Vulkan API platform support. /// The base implementation for the Vulkan API platform support.
/// </summary> /// </summary>
@@ -16,11 +16,10 @@ void Win32VulkanPlatform::GetInstanceExtensions(Array<const char*>& extensions,
void Win32VulkanPlatform::CreateSurface(Window* window, GPUDeviceVulkan* device, VkInstance instance, VkSurfaceKHR* surface) void Win32VulkanPlatform::CreateSurface(Window* window, GPUDeviceVulkan* device, VkInstance instance, VkSurfaceKHR* surface)
{ {
void* windowHandle = window->GetNativePtr();
VkWin32SurfaceCreateInfoKHR surfaceCreateInfo; VkWin32SurfaceCreateInfoKHR surfaceCreateInfo;
RenderToolsVulkan::ZeroStruct(surfaceCreateInfo, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR); RenderToolsVulkan::ZeroStruct(surfaceCreateInfo, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR);
surfaceCreateInfo.hinstance = GetModuleHandle(nullptr); surfaceCreateInfo.hinstance = GetModuleHandle(nullptr);
surfaceCreateInfo.hwnd = static_cast<HWND>(windowHandle); surfaceCreateInfo.hwnd = static_cast<HWND>(window->GetNativePtr());
VALIDATE_VULKAN_RESULT(vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, nullptr, surface)); VALIDATE_VULKAN_RESULT(vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, nullptr, surface));
} }
@@ -10,8 +10,6 @@
#define VULKAN_USE_PLATFORM_WIN32_KHX 1 #define VULKAN_USE_PLATFORM_WIN32_KHX 1
#define VULKAN_USE_CREATE_WIN32_SURFACE 1 #define VULKAN_USE_CREATE_WIN32_SURFACE 1
class GPUDeviceVulkan;
/// <summary> /// <summary>
/// The implementation for the Vulkan API support for Win32 platform. /// The implementation for the Vulkan API support for Win32 platform.
/// </summary> /// </summary>
@@ -17,6 +17,7 @@ void iOSVulkanPlatform::GetInstanceExtensions(Array<const char*>& extensions, Ar
void iOSVulkanPlatform::CreateSurface(Window* window, GPUDeviceVulkan* device, VkInstance instance, VkSurfaceKHR* surface) void iOSVulkanPlatform::CreateSurface(Window* window, GPUDeviceVulkan* device, VkInstance instance, VkSurfaceKHR* surface)
{ {
void* windowHandle = window->GetNativePtr(); void* windowHandle = window->GetNativePtr();
// Create surface on a main UI Thread // Create surface on a main UI Thread
Function<void()> func = [&windowHandle, &instance, &surface]() Function<void()> func = [&windowHandle, &instance, &surface]()
{ {
@@ -11,8 +11,6 @@
// General/Validation Error:0 VK_ERROR_INITIALIZATION_FAILED: Could not create MTLCounterSampleBuffer for query pool of type VK_QUERY_TYPE_TIMESTAMP. Reverting to emulated behavior. (Error code 0): Cannot allocate sample buffer // General/Validation Error:0 VK_ERROR_INITIALIZATION_FAILED: Could not create MTLCounterSampleBuffer for query pool of type VK_QUERY_TYPE_TIMESTAMP. Reverting to emulated behavior. (Error code 0): Cannot allocate sample buffer
#define VULKAN_USE_TIMER_QUERIES 0 #define VULKAN_USE_TIMER_QUERIES 0
class GPUDeviceVulkan;
/// <summary> /// <summary>
/// The implementation for the Vulkan API support for iOS platform. /// The implementation for the Vulkan API support for iOS platform.
/// </summary> /// </summary>
@@ -599,6 +599,11 @@ void WindowBase::Close(ClosingReason reason)
OnClosed(); OnClosed();
} }
bool WindowBase::IsClosed() const
{
return _isClosing || EnumHasAnyFlags(Flags, ObjectFlags::WasMarkedToDelete);
}
bool WindowBase::IsForegroundWindow() const bool WindowBase::IsForegroundWindow() const
{ {
return _focused; return _focused;
+1 -4
View File
@@ -242,10 +242,7 @@ public:
/// <summary> /// <summary>
/// Checks if window is closed. /// Checks if window is closed.
/// </summary> /// </summary>
API_PROPERTY() virtual bool IsClosed() const API_PROPERTY() virtual bool IsClosed() const;
{
return _isClosing;
}
/// <summary> /// <summary>
/// Checks if window is foreground (the window with which the user is currently working). /// Checks if window is foreground (the window with which the user is currently working).
@@ -146,6 +146,7 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(CreateWindowSettings);
/// <summary> /// <summary>
/// True if it's a regular window, false for tooltips, context menu and other utility windows. /// True if it's a regular window, false for tooltips, context menu and other utility windows.
/// [Deprecated in v1.12]
/// </summary> /// </summary>
API_FIELD() DEPRECATED("Use Type instead") bool IsRegularWindow = true; API_FIELD() DEPRECATED("Use Type instead") bool IsRegularWindow = true;
@@ -374,11 +374,6 @@ void LinuxWindow::BringToFront(bool force)
X11::XFlush(display); X11::XFlush(display);
} }
bool LinuxWindow::IsClosed() const
{
return _isClosing;
}
bool LinuxWindow::IsForegroundWindow() const bool LinuxWindow::IsForegroundWindow() const
{ {
return _focused || _focusOnMapped; return _focused || _focusOnMapped;
@@ -72,7 +72,6 @@ public:
void Minimize() override; void Minimize() override;
void Maximize() override; void Maximize() override;
void Restore() override; void Restore() override;
bool IsClosed() const override;
bool IsForegroundWindow() const override; bool IsForegroundWindow() const override;
void BringToFront(bool force = false) override; void BringToFront(bool force = false) override;
void SetClientBounds(const Rectangle& clientArea) override; void SetClientBounds(const Rectangle& clientArea) override;
-5
View File
@@ -364,11 +364,6 @@ void UWPWindow::Restore()
// Not supported // Not supported
} }
bool UWPWindow::IsClosed() const
{
return _isClosing;
}
void UWPWindow::BringToFront(bool force) void UWPWindow::BringToFront(bool force)
{ {
Focus(); Focus();
-1
View File
@@ -160,7 +160,6 @@ public:
void Minimize() override; void Minimize() override;
void Maximize() override; void Maximize() override;
void Restore() override; void Restore() override;
bool IsClosed() const override;
void BringToFront(bool force = false) override; void BringToFront(bool force = false) override;
void SetClientBounds(const Rectangle& clientArea) override; void SetClientBounds(const Rectangle& clientArea) override;
void SetPosition(const Float2& position) override; void SetPosition(const Float2& position) override;
+5 -5
View File
@@ -38,8 +38,8 @@ namespace FlaxEngine
/// <summary> /// <summary>
/// Perform mouse move action in relative mode. /// Perform mouse move action in relative mode.
/// </summary> /// </summary>
/// <param name="mouseMotion">The relative mouse motion.</param> /// <param name="motion">The relative mouse motion.</param>
public delegate void MouseMoveRelativeDelegate(ref Float2 mouseMotion); public delegate void MouseMoveRelativeDelegate(ref Float2 motion);
/// <summary> /// <summary>
/// Perform mouse wheel action. /// Perform mouse wheel action.
@@ -285,10 +285,10 @@ namespace FlaxEngine
GUI.OnMouseMove(pos); GUI.OnMouseMove(pos);
} }
internal void Internal_OnMouseMoveRelative(ref Float2 mouseMotion) internal void Internal_OnMouseMoveRelative(ref Float2 motion)
{ {
MouseMoveRelative?.Invoke(ref mouseMotion); MouseMoveRelative?.Invoke(ref motion);
GUI.OnMouseMoveRelative(mouseMotion); GUI.OnMouseMoveRelative(motion);
} }
internal void Internal_OnMouseLeave() internal void Internal_OnMouseLeave()
@@ -352,7 +352,7 @@ void WindowsWindow::Restore()
bool WindowsWindow::IsClosed() const bool WindowsWindow::IsClosed() const
{ {
return !HasHWND(); return !HasHWND() || EnumHasAnyFlags(Flags, ObjectFlags::WasMarkedToDelete);
} }
bool WindowsWindow::IsForegroundWindow() const bool WindowsWindow::IsForegroundWindow() const
+2 -2
View File
@@ -777,9 +777,9 @@ namespace FlaxEngine.GUI
/// <summary> /// <summary>
/// When mouse moves over control's area while mouse is in relative mode /// When mouse moves over control's area while mouse is in relative mode
/// </summary> /// </summary>
/// <param name="mouseMotion">Mouse relative motion</param> /// <param name="motion">Mouse relative motion</param>
[NoAnimate] [NoAnimate]
public virtual void OnMouseMoveRelative(Float2 mouseMotion) public virtual void OnMouseMoveRelative(Float2 motion)
{ {
} }
+2 -2
View File
@@ -213,7 +213,7 @@ namespace FlaxEngine.GUI
var rightBottomLocationSS = locationSS + dpiSize; var rightBottomLocationSS = locationSS + dpiSize;
// Prioritize tooltip placement within parent window, fall back to virtual desktop // Prioritize tooltip placement within parent window, fall back to virtual desktop
/*if (rightBottomMonitorBounds.Y < rightBottomLocationSS.Y) if (rightBottomMonitorBounds.Y < rightBottomLocationSS.Y)
{ {
// Direction: up // Direction: up
locationSS.Y -= dpiSize.Y + flipOffset; locationSS.Y -= dpiSize.Y + flipOffset;
@@ -222,7 +222,7 @@ namespace FlaxEngine.GUI
{ {
// Direction: left // Direction: left
locationSS.X -= dpiSize.X + flipOffset * 2; locationSS.X -= dpiSize.X + flipOffset * 2;
}*/ }
} }
/// <inheritdoc /> /// <inheritdoc />
+3 -3
View File
@@ -340,15 +340,15 @@ namespace FlaxEngine.GUI
} }
/// <inheritdoc /> /// <inheritdoc />
public override void OnMouseMoveRelative(Float2 mouseMotion) public override void OnMouseMoveRelative(Float2 motion)
{ {
if (_trackingControl != null) if (_trackingControl != null)
{ {
_trackingControl.OnMouseMoveRelative(mouseMotion); _trackingControl.OnMouseMoveRelative(motion);
return; return;
} }
base.OnMouseMoveRelative(mouseMotion); base.OnMouseMoveRelative(motion);
} }
} }
} }
+9 -4
View File
@@ -288,6 +288,7 @@ namespace Flax.Build
[CommandLine("useLogInRelease", "Can be used to disable logging in Release game builds")] [CommandLine("useLogInRelease", "Can be used to disable logging in Release game builds")]
public static bool UseLogInRelease = true; public static bool UseLogInRelease = true;
/// <summary>
/// True if SDL support should be enabled. /// True if SDL support should be enabled.
/// </summary> /// </summary>
[CommandLine("useSdl", "1 to enable SDL support in build")] [CommandLine("useSdl", "1 to enable SDL support in build")]
@@ -311,10 +312,14 @@ namespace Flax.Build
public static bool WithSDL(NativeCpp.BuildOptions options) public static bool WithSDL(NativeCpp.BuildOptions options)
{ {
bool supportedPlatform = options.Platform.Target == TargetPlatform.Windows || switch (options.Platform.Target)
options.Platform.Target == TargetPlatform.Linux || {
options.Platform.Target == TargetPlatform.Mac; case TargetPlatform.Windows:
return UseSDL && supportedPlatform; case TargetPlatform.Linux:
case TargetPlatform.Mac:
return UseSDL;
default: return false;
}
} }
} }
} }
@@ -175,7 +175,7 @@ namespace Flax.Deps.Dependencies
RunCmake(cmakeFolder, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + cmakeArgs, envVars); RunCmake(cmakeFolder, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + cmakeArgs, envVars);
// Run build // Run build
BuildCmake(cmakeFolder, envVars: envVars); BuildCmake(cmakeFolder, envVars);
// Deploy binaries // Deploy binaries
var libs = new[] var libs = new[]
@@ -3,15 +3,12 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.IO.Compression;
using System.Linq;
using Flax.Build; using Flax.Build;
using Flax.Build.Platforms;
namespace Flax.Deps.Dependencies namespace Flax.Deps.Dependencies
{ {
/// <summary> /// <summary>
/// /// Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.
/// </summary> /// </summary>
/// <seealso cref="Flax.Deps.Dependency" /> /// <seealso cref="Flax.Deps.Dependency" />
class SDL : Dependency class SDL : Dependency
@@ -53,13 +53,16 @@ namespace Flax.Build.Platforms
options.LinkEnv.InputLibraries.Add("QuartzCore.framework"); options.LinkEnv.InputLibraries.Add("QuartzCore.framework");
options.LinkEnv.InputLibraries.Add("AVFoundation.framework"); options.LinkEnv.InputLibraries.Add("AVFoundation.framework");
// SDL3 requires the following frameworks: if (EngineConfiguration.WithSDL(options))
options.LinkEnv.InputLibraries.Add("Foundation.framework"); {
options.LinkEnv.InputLibraries.Add("GameController.framework"); // SDL3 requires the following frameworks:
options.LinkEnv.InputLibraries.Add("Carbon.framework"); options.LinkEnv.InputLibraries.Add("Foundation.framework");
options.LinkEnv.InputLibraries.Add("ForceFeedback.framework"); options.LinkEnv.InputLibraries.Add("GameController.framework");
options.LinkEnv.InputLibraries.Add("UniformTypeIdentifiers.framework"); options.LinkEnv.InputLibraries.Add("Carbon.framework");
options.LinkEnv.InputLibraries.Add("CoreHaptics.framework"); options.LinkEnv.InputLibraries.Add("ForceFeedback.framework");
options.LinkEnv.InputLibraries.Add("UniformTypeIdentifiers.framework");
options.LinkEnv.InputLibraries.Add("CoreHaptics.framework");
}
} }
protected override void AddArgsCommon(BuildOptions options, List<string> args) protected override void AddArgsCommon(BuildOptions options, List<string> args)