Skip to content

Commit a6adfbb

Browse files
committed
fix merge conflict
1 parent 822120e commit a6adfbb

File tree

11 files changed

+330
-158
lines changed

11 files changed

+330
-158
lines changed

DSAnimStudio/Environment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static class Environment
1919
public static float FlverSceneContrast = 0.6f;
2020
public static float FlverEmissiveMult = 1.0f;
2121

22-
public static float MotionBlurStrength = 1;
22+
//public static float MotionBlurStrength = 1;
2323

2424
public static float LightRotationH = -0.75f;
2525
public static float LightRotationV = -0.75f;

DSAnimStudio/GFX.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ public static void Apply()
5959
}
6060
}
6161

62+
public static void ClampAntialiasingOptions()
63+
{
64+
if (SSAA > 4)
65+
SSAA = 4;
66+
67+
if (MSAA > 32)
68+
MSAA = 32;
69+
70+
if (SSAA < 1)
71+
SSAA = 1;
72+
73+
if (MSAA < 1)
74+
MSAA = 1;
75+
}
76+
6277
public static int SSAA = 1;
6378

6479
public static int EffectiveSSAA = 1;
@@ -86,7 +101,7 @@ public static void InitShaders()
86101
FlverShader.Effect.EnvironmentMap = Environment.CurrentCubemap;
87102
SkyboxShader.Effect.EnvironmentMap = Environment.CurrentCubemap;
88103

89-
SkyboxShader.Effect.NumMotionBlurSamples = 0;
104+
//SkyboxShader.Effect.NumMotionBlurSamples = 0;
90105

91106
//GFX.FlverOpacity = 0.15f;
92107
}
@@ -511,7 +526,7 @@ public static void BeginDraw()
511526
//}
512527
//SkyboxShader_PrevFrameLookDir = curForw;
513528

514-
SkyboxShader.Effect.MotionBlurVector = Vector3.Transform(Vector3.Right, World.CameraLookDirection) * Environment.MotionBlurStrength;
529+
//SkyboxShader.Effect.MotionBlurVector = Vector3.Transform(Vector3.Right, World.CameraLookDirection) * Environment.MotionBlurStrength;
515530

516531
SkyboxShader.Effect.EyePosition = Vector3.Zero;
517532

DSAnimStudio/GFXShaders/SkyboxShader.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ public Vector3 EyePosition
4242
set => Parameters[nameof(EyePosition)].SetValue(value);
4343
}
4444

45-
public Vector3 MotionBlurVector
46-
{
47-
get => Parameters[nameof(MotionBlurVector)].GetValueVector3();
48-
set => Parameters[nameof(MotionBlurVector)].SetValue(value);
49-
}
50-
51-
public int NumMotionBlurSamples
52-
{
53-
get => Parameters[nameof(NumMotionBlurSamples)].GetValueInt32();
54-
set => Parameters[nameof(NumMotionBlurSamples)].SetValue(value);
55-
}
45+
//public Vector3 MotionBlurVector
46+
//{
47+
// get => Parameters[nameof(MotionBlurVector)].GetValueVector3();
48+
// set => Parameters[nameof(MotionBlurVector)].SetValue(value);
49+
//}
50+
51+
//public int NumMotionBlurSamples
52+
//{
53+
// get => Parameters[nameof(NumMotionBlurSamples)].GetValueInt32();
54+
// set => Parameters[nameof(NumMotionBlurSamples)].SetValue(value);
55+
//}
5656

5757
public TextureCube EnvironmentMap
5858
{

DSAnimStudio/Main.cs

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ protected override void Dispose(bool disposing)
2828
base.Dispose(disposing);
2929
}
3030

31+
public static bool IgnoreSizeChanges = false;
32+
33+
public static Rectangle LastBounds = Rectangle.Empty;
34+
private static Rectangle lastActualBounds = Rectangle.Empty;
35+
3136
public static ColorConfig Colors = new ColorConfig();
3237

3338
public static Form WinForm;
@@ -175,19 +180,19 @@ public static void ApplyPresentationParameters(int width, int height, SurfaceFor
175180
graphics.IsFullScreen = fullscreen;
176181
graphics.SynchronizeWithVerticalRetrace = vsync;
177182

178-
//if (GFX.MSAA > 0)
179-
//{
180-
// graphics.PreferMultiSampling = true;
181-
// graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = GFX.MSAA;
182-
//}
183-
//else
184-
//{
185-
// graphics.PreferMultiSampling = false;
186-
// graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = 1;
187-
//}
183+
if (GFX.MSAA > 0)
184+
{
185+
graphics.PreferMultiSampling = true;
186+
graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = GFX.MSAA;
187+
}
188+
else
189+
{
190+
graphics.PreferMultiSampling = false;
191+
graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = 1;
192+
}
188193

189-
graphics.PreferMultiSampling = false;
190-
graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = 1;
194+
//graphics.PreferMultiSampling = false;
195+
//graphics.GraphicsDevice.PresentationParameters.MultiSampleCount = 1;
191196

192197
graphics.ApplyChanges();
193198
}
@@ -307,21 +312,27 @@ private void Main_Activated(object sender, EventArgs e)
307312
UpdateActiveState();
308313
}
309314

310-
private Rectangle prevClientBounds = Rectangle.Empty;
311315
private void Window_ClientSizeChanged(object sender, EventArgs e)
312316
{
317+
if (IgnoreSizeChanges)
318+
return;
319+
313320
RequestHideOSD = RequestHideOSD_MAX;
314321
UpdateActiveState();
315322

316-
TAE_EDITOR?.HandleWindowResize(prevClientBounds, Window.ClientBounds);
323+
TAE_EDITOR?.HandleWindowResize(lastActualBounds, Window.ClientBounds);
317324

318-
prevClientBounds = Window.ClientBounds;
325+
if (Window.ClientBounds.Width > 0 && Window.ClientBounds.Height > 0)
326+
LastBounds = Window.ClientBounds;
327+
lastActualBounds = Window.ClientBounds;
319328
}
320329

321330
public void RebuildRenderTarget()
322331
{
323332
if (TimeBeforeNextRenderTargetUpdate <= 0)
324333
{
334+
GFX.ClampAntialiasingOptions();
335+
325336
int msaa = GFX.MSAA;
326337
int ssaa = GFX.SSAA;
327338

@@ -914,7 +925,7 @@ protected override void Draw(GameTime gameTime)
914925

915926
GFX.Device.SetRenderTarget(SceneRenderTarget);
916927

917-
GFX.Device.Clear(Color.Transparent);
928+
GFX.Device.Clear(Colors.MainColorViewportBackground);
918929

919930
GFX.Device.Viewport = new Viewport(0, 0, SceneRenderTarget.Width, SceneRenderTarget.Height);
920931

DSAnimStudio/NewAnimSkeleton.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ public void DrawPrim(Matrix world)
503503
{
504504
//BonePrim.Transform = new Transform(Matrix.CreateScale(Length) * CurrentMatrix);
505505
//BonePrim.Draw(null, world);
506+
BoundingBoxPrim.OverrideColor = DBG.COLOR_FLVER_BONE_BBOX;
506507
BoundingBoxPrim.UpdateTransform(new Transform(CurrentMatrix));
507508
BoundingBoxPrim.Draw(null, world);
508509
}
@@ -526,6 +527,7 @@ void DrawToEndPoint(Vector3 endPoint)
526527
float boneLength = (endPoint - boneStart).Length();
527528

528529
GlobalBonePrim.Transform = new Transform(Matrix.CreateRotationY(-MathHelper.PiOver2) * Matrix.CreateScale(boneLength) * hitboxMatrix);
530+
GlobalBonePrim.OverrideColor = DBG.COLOR_FLVER_BONE;
529531
GlobalBonePrim.Draw(null, world);
530532

531533
//using (var tempBone = new DbgPrimWireBone(Name, new Transform(Matrix.CreateRotationY(-MathHelper.PiOver2) * hitboxMatrix), DBG.COLOR_FLVER_BONE, boneLength, boneLength * 0.2f))

DSAnimStudio/NewDummyPolyManager.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,13 @@ public void DrawAllHitPrims()
761761

762762
foreach (var dmy in DummyPoly)
763763
{
764-
if ((GlobalForceDummyPolyIDVisible < 0 && DummyPolyVisibleByRefID.ContainsKey(dmy.ReferenceID) && DummyPolyVisibleByRefID[dmy.ReferenceID]) || GlobalForceDummyPolyIDVisible == (GlobalDummyPolyIDOffset + dmy.ReferenceID))
765-
dmy.DrawPrim(MODEL.CurrentTransform.WorldMatrix, GlobalForceDummyPolyIDVisible == (GlobalDummyPolyIDOffset + dmy.ReferenceID));
764+
bool isVis = (GlobalForceDummyPolyIDVisible < 0 && DummyPolyVisibleByRefID.ContainsKey(dmy.ReferenceID)
765+
&& (DummyPolyVisibleByRefID[dmy.ReferenceID] ||
766+
dmy.ShowAttack != null || dmy.BulletSpawnIDs.Count > 0 || dmy.MiscSpawnTexts.Count > 0 || dmy.SFXSpawnIDs.Count > 0));
767+
bool isForce = GlobalForceDummyPolyIDVisible == (GlobalDummyPolyIDOffset + dmy.ReferenceID);
768+
769+
if (isVis || isForce)
770+
dmy.DrawPrim(MODEL.CurrentTransform.WorldMatrix, isForce);
766771
}
767772
}
768773

@@ -774,8 +779,12 @@ public void DrawAllHitPrimTexts()
774779
{
775780
foreach (var dmy in DummyPoly)
776781
{
777-
if ((GlobalForceDummyPolyIDVisible < 0 && DummyPolyVisibleByRefID.ContainsKey(dmy.ReferenceID) && DummyPolyVisibleByRefID[dmy.ReferenceID]) || GlobalForceDummyPolyIDVisible == (GlobalDummyPolyIDOffset + dmy.ReferenceID))
778-
dmy.DrawPrimText(MODEL.CurrentTransform.WorldMatrix, GlobalForceDummyPolyIDVisible == (GlobalDummyPolyIDOffset + dmy.ReferenceID), ShowGlobalIDOffset ? GlobalDummyPolyIDOffset : 0);
782+
bool isVis = (GlobalForceDummyPolyIDVisible < 0 && DummyPolyVisibleByRefID.ContainsKey(dmy.ReferenceID)
783+
&& (DummyPolyVisibleByRefID[dmy.ReferenceID] ||
784+
dmy.ShowAttack != null || dmy.BulletSpawnIDs.Count > 0 || dmy.MiscSpawnTexts.Count > 0 || dmy.SFXSpawnIDs.Count > 0));
785+
bool isForce = GlobalForceDummyPolyIDVisible == (GlobalDummyPolyIDOffset + dmy.ReferenceID);
786+
if (isVis || isForce)
787+
dmy.DrawPrimText(MODEL.CurrentTransform.WorldMatrix, isForce, ShowGlobalIDOffset ? GlobalDummyPolyIDOffset : 0);
779788
}
780789
}
781790

0 commit comments

Comments
 (0)