daily update on 20240828 by nitload youmu, autotexture added

This commit is contained in:
Nitload
2024-08-28 10:58:31 +08:00
parent d082071f2d
commit 1ee4e4a42f
586 changed files with 60910 additions and 123106 deletions
+4 -4
View File
@@ -29,7 +29,7 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Graphics;
using StgSharp.Logic;
using StgSharp.Timing;
using StgSharp.Math;
using StgSharp.MVVM.ViewModel;
@@ -155,7 +155,7 @@ namespace StgSharp.MVVM.View
return InternalIO.glfwGetKey(context.ViewPortID, (int)key);
}
public void InternalInitialize(string name,(int,int,int) cubeSize, ViewModelBase viewModelBinding)
public void InternalInitialize(string name, (int, int, int) cubeSize, ViewModelBase viewModelBinding)
{
SelfName = name;
unitCubeSize = cubeSize;
@@ -175,7 +175,7 @@ namespace StgSharp.MVVM.View
if (!ValidateInitialization())
{
throw new InvalidOperationException("This view is not correctly initialized before rendering.");
}
}
}
Show();
}
@@ -183,7 +183,7 @@ namespace StgSharp.MVVM.View
public bool ValidateInitialization()
{
return (_design != null) && (_render != null) && (getDataBindingEntry != null) && (_responder != null)
&& (_design.ValidateInitializing()) && (_responder.ValidateInitializing()) && (_render.ValidateInitializing())
&& _design.ValidateInitializing() && _responder.ValidateInitializing() && _render.ValidateInitializing()
;
}
+3 -3
View File
@@ -46,9 +46,9 @@ namespace StgSharp.MVVM.View
{
public interface IViewDesigner<out TView> where TView : ViewBase
{
abstract void Initialize();
abstract void CustomizedInitialize();
abstract void Initialize();
abstract bool ValidateInitializing();
@@ -128,13 +128,13 @@ namespace StgSharp.MVVM.View
return ret;
}
public abstract void CustomizedInitialize();
public void Initialize()
{
CustomizedInitialize();
}
public abstract void CustomizedInitialize();
public abstract bool ValidateInitializing();
}//---------------------------------- End of Class -----------------------------------------
+15 -14
View File
@@ -29,7 +29,7 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Graphics;
using StgSharp.Logic;
using StgSharp.Math;
using StgSharp.MVVM.ViewModel;
@@ -65,11 +65,6 @@ namespace StgSharp.MVVM.View
where TView : ViewBase
{
#pragma warning disable CS8618
private Dictionary<string, RenderStream> _render;
private TView _binding;
#pragma warning restore CS8618
protected ViewRender(TView binding)
{
_binding = binding;
@@ -77,7 +72,7 @@ namespace StgSharp.MVVM.View
public RenderStream this[string renderName]
{
get => _render.TryGetValue(renderName, out RenderStream stream) ? stream : null!;
get => _render.TryGetValue(renderName, out RenderStream stream) ? stream : (null!);
protected set
{
@@ -105,13 +100,6 @@ namespace StgSharp.MVVM.View
protected ViewResponder<TView> Responder => (_binding.Responder as ViewResponder<TView>)!;
public T CreateRenderStream<T>(ViewPort vp, (int x, int y, int z) unitCubeSize) where T : RenderStream, new()
{
T ret = new T();
ret.Initialize(vp, unitCubeSize, Binding.TimeProvider);
return ret;
}
public T CreateRenderStream<T>((int x, int y, int z) unitCubeSize) where T : RenderStream, new()
{
T ret = new T();
@@ -119,6 +107,13 @@ namespace StgSharp.MVVM.View
return ret;
}
public T CreateRenderStream<T>(ViewPort vp, (int x, int y, int z) unitCubeSize) where T : RenderStream, new()
{
T ret = new T();
ret.Initialize(vp, unitCubeSize, Binding.TimeProvider);
return ret;
}
public abstract void CustomizedInitialize();
public void Initialize()
@@ -128,6 +123,12 @@ namespace StgSharp.MVVM.View
public abstract bool ValidateInitializing();
#pragma warning disable CS8618
private Dictionary<string, RenderStream> _render;
private TView _binding;
#pragma warning restore CS8618
}
}
}
+15 -15
View File
@@ -47,12 +47,12 @@ namespace StgSharp.MVVM.View
void CustomizedInitialize(Func<ITrigger, string, Action> keyRegister);
void Initialize(Func<string, Action> keyGetter);
void ProcessUserInput();
bool ValidateInitializing();
void Initialize(Func<string, Action> keyGetter);
}
protected abstract class ViewResponder<TView> : IViewResponder<TView> where TView : ViewBase
@@ -90,19 +90,6 @@ namespace StgSharp.MVVM.View
public abstract void CustomizedInitialize(Func<ITrigger, string, Action> keyRegister);
public void ProcessUserInput()
{
foreach (KeyValuePair<ITrigger, Action> pair in keyCallbackIndex)
{
if (InternalIO.glfwGetKey(_binding.ViewHandle, pair.Key.TargetKeyOrButtonID) == pair.Key.TriggeredStatus)
{
pair.Value();
}
}
}
public abstract bool ValidateInitializing();
public void Initialize(Func<string, Action> keyGetter)
{
if (_isInitialized)
@@ -123,6 +110,19 @@ namespace StgSharp.MVVM.View
);
}
public void ProcessUserInput()
{
foreach (KeyValuePair<ITrigger, Action> pair in keyCallbackIndex)
{
if (InternalIO.glfwGetKey(_binding.ViewHandle, pair.Key.TargetKeyOrButtonID) == pair.Key.TriggeredStatus)
{
pair.Value();
}
}
}
public abstract bool ValidateInitializing();
}
}