Files
GhostEngine/src/Editor/Ghost.Editor/ActivationHandler.cs
Misaki 37f4795b4f feat(engine)!: refactor graphics, ECS, and logging APIs
Major refactor of graphics and ECS infrastructure:
- Removed IResourceManager, IRenderSystem, IFenceSynchronizer interfaces; ResourceManager and RenderSystem are now concrete classes.
- Updated all render graph, pipeline, and context code to use concrete ResourceManager.
- Refactored camera/frustum math and render extraction for clarity and correctness; frustum now uses inline arrays.
- RenderingLayerMask is now an immutable struct with bitwise operators.
- Meshlet and meshlet group data structures improved; meshlet build callback signature updated.
- Logging system overhauled: LogMessage is now a class, LogCollection supports change events, and Logger is used directly in the debug console.
- ECS query API: ChunkView.Count renamed to EntityCount; query builder/iterators use VirtualStack.Scope.
- Updated render pipeline and passes for new resource manager and render list APIs.
- Cleaned up obsolete files, improved code style, and updated documentation.
- HLSL meshlet shader updated for new struct layout.
- Debug console now uses new logger and log collection.

BREAKING CHANGE: Public APIs for resource management, rendering, ECS queries, and logging have changed. Interfaces removed; use new concrete types and updated method signatures.
2026-03-21 22:10:28 +09:00

77 lines
2.7 KiB
C#

using Ghost.Editor.Core.Utilities;
using Ghost.Editor.Models;
using Ghost.Engine;
using Misaki.HighPerformance.LowLevel.Buffer;
using System.Reflection;
namespace Ghost.Editor;
internal static class ActivationHandler
{
public static LaunchArguments ParseArguments(ReadOnlySpan<char> args)
{
var arguments = new LaunchArguments();
var properties = typeof(LaunchArguments).GetProperties();
var split = args.Split(' ');
while (split.MoveNext())
{
var range = split.Current;
var arg = args[range.Start..range.End];
if (arg.Length > 2)
{
if (arg[0] == '-' && arg[1] == '-')
{
var argName = arg[2..];
foreach (var property in properties)
{
var propName = property.Name;
var attr = property.GetCustomAttributes<ArgumentNameAttribute>(false).FirstOrDefault();
if (attr != null)
{
propName = attr.Name;
}
if (argName.Equals(propName, StringComparison.OrdinalIgnoreCase))
{
if (split.MoveNext())
{
var valueRange = split.Current;
var value = args[valueRange.Start..valueRange.End];
var convertedValue = Convert.ChangeType(value.ToString(), property.PropertyType);
property.SetValue(arguments, convertedValue);
break;
}
}
}
}
}
}
return arguments;
}
public static async Task HandleAsync(LaunchArguments args)
{
var opts = new AllocationManagerInitOpts
{
ArenaCapacity = 1024 * 1024 * 1024, // 1 GB. Arena using virtual memory, so this is just a reservation and won't actually consume physical memory until used.
StackCapacity = 1024 * 1024 * 32, // 32 MB. Stack using virtual memory, so this is just a reservation and won't actually consume physical memory until used.
FreeListConcurrencyLevel = Environment.ProcessorCount
};
AllocationManager.Initialize(opts);
await Task.Run(() =>
{
TypeCache.Init();
App.GetService<EngineCore>();
});
// await ((Core.AssetHandle.AssetService)App.GetService<IAssetService>()).Init();
// TODO: Init other subsystems here.
// await Task.Delay(10000); // Wait 10 seconds to simulate work.
}
}