Refactor Vector3Field and update project structure
Changed Vector3Field.cs to derive from ValueControl<Vector3> and use NumberBox controls for better UI handling. Changed EditorControls.xaml to update resource paths for new controls. Changed InternalControls.xaml to simplify the resource dictionary by removing unnecessary references. Changed IComponentEditor.cs to reflect updates in the component editor's lifecycle methods. Changed project files for Ghost.Editor and Ghost.Core to include new dependencies and project references. Changed FileExtensions.cs and IInspectorService.cs to align with the new namespace structure. Changed Result.cs to enhance error handling and success checking methods. Changed TypeHandle.cs to improve type handling compatibility. Changed AssemblyInfo.cs files to include new assembly visibility attributes for better encapsulation. Added new graphics-related classes and interfaces in the Ghost.Engine project, including IGraphicsDevice and DX12GraphicsDevice. Added a new Mesh class to handle 3D mesh data and provide methods for creating geometric shapes. Added GraphicsPipeline.cs to manage the graphics rendering loop and device initialization. Added ScenePage.xaml and ScenePage.xaml.cs to create a new page for rendering scenes. Updated HierarchyPage.xaml.cs and InspectorPage.xaml.cs to use the new service locator pattern for service retrieval. Updated LandingWindow.xaml.cs and EngineEditorWindow.xaml.cs to utilize the new service locator pattern for better service access. Updated Logger.cs to enhance logging capabilities with optional stack traces and assertion logging. Updated QueryFilter.cs and QueryEnumerable.cs to use the new TypeHandle structure for improved efficiency. Updated WorldNode.cs and WorldNodeSerializer.cs to enhance serialization and management of world nodes. Updated AssetDatabase and related classes to improve asset management and metadata generation. Updated Ghost.UnitTest.csproj to include new project references and package dependencies for unit tests.
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
using Ghost.Engine.Models;
|
||||
using Ghost.Engine.Services;
|
||||
using Ghost.Graphics;
|
||||
using Ghost.Graphics.Data;
|
||||
|
||||
namespace Ghost.Engine;
|
||||
|
||||
internal class EngineCore : IDisposable, IAsyncDisposable
|
||||
internal class EngineCore
|
||||
{
|
||||
public async Task StartAsync(LaunchArgument args)
|
||||
{
|
||||
ActivationHandler.Handle(args);
|
||||
GraphicsPipeline.Initialize(GraphicsAPI.DX12);
|
||||
|
||||
Logger.LogInfo("Engine started successfully.");
|
||||
|
||||
@@ -16,16 +19,7 @@ internal class EngineCore : IDisposable, IAsyncDisposable
|
||||
|
||||
public async Task ShutDownAsync()
|
||||
{
|
||||
GraphicsPipeline.Shutdown();
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
ShutDownAsync().GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
await ShutDownAsync();
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,14 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Ghost.Entities\Ghost.Entities.csproj" />
|
||||
<ProjectReference Include="..\Ghost.Graphics\Ghost.Graphics.csproj" />
|
||||
<!--<ProjectReference Include="..\Ghost.Generator\Ghost.Generator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />-->
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Misaki.HighPerformance.Unsafe">
|
||||
<HintPath>..\..\Class\Misaki.HighPerformance\Misaki.HighPerformance.Unsafe\bin\Release\net9.0\Misaki.HighPerformance.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -14,7 +14,7 @@ internal class LogMessage
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Message
|
||||
public string? Message
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ internal class LogMessage
|
||||
get; set;
|
||||
}
|
||||
|
||||
public LogMessage(LogLevel level, string message, string? stackTrace = null)
|
||||
public LogMessage(LogLevel level, string? message, string? stackTrace = null)
|
||||
{
|
||||
Level = level;
|
||||
Message = message;
|
||||
|
||||
@@ -25,7 +25,7 @@ public static class Logger
|
||||
get; set;
|
||||
}
|
||||
|
||||
private static void LogInternal(LogLevel level, string message, int skipFrame)
|
||||
private static void LogInternal(LogLevel level, string? message, int skipFrame)
|
||||
{
|
||||
if (_logs.Count >= _MAX_LOGS)
|
||||
{
|
||||
@@ -59,22 +59,22 @@ public static class Logger
|
||||
OnLogsUpdate?.Invoke(LogChangeType.LogAdded);
|
||||
}
|
||||
|
||||
public static void Log(LogLevel level, string message)
|
||||
public static void Log(LogLevel level, string? message)
|
||||
{
|
||||
LogInternal(level, message, 2);
|
||||
}
|
||||
|
||||
public static void LogInfo(string message)
|
||||
public static void LogInfo(string? message)
|
||||
{
|
||||
LogInternal(LogLevel.Info, message, 3);
|
||||
}
|
||||
|
||||
public static void LogWarning(string message)
|
||||
public static void LogWarning(string? message)
|
||||
{
|
||||
LogInternal(LogLevel.Warning, message, 3);
|
||||
}
|
||||
|
||||
public static void LogError(string message)
|
||||
public static void LogError(string? message)
|
||||
{
|
||||
LogInternal(LogLevel.Error, message, 3);
|
||||
}
|
||||
@@ -84,6 +84,14 @@ public static class Logger
|
||||
LogExceptionInternal(ex);
|
||||
}
|
||||
|
||||
public static void Assert(bool condition, string? message = null)
|
||||
{
|
||||
if (!condition)
|
||||
{
|
||||
LogInternal(LogLevel.Error, message ?? "Assertion failed", 3);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void Clear()
|
||||
{
|
||||
_logs.Clear();
|
||||
|
||||
Reference in New Issue
Block a user