Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/EmberExample/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@
"isRoot": true,
"tools": {
"dotnet-mgcb": {
"version": "3.8.4",
"version": "3.8.4.1",
"commands": [
"mgcb"
]
},
"dotnet-mgcb-editor": {
"version": "3.8.4",
"version": "3.8.4.1",
"commands": [
"mgcb-editor"
]
},
"dotnet-mgcb-editor-linux": {
"version": "3.8.4",
"version": "3.8.4.1",
"commands": [
"mgcb-editor-linux"
]
},
"dotnet-mgcb-editor-windows": {
"version": "3.8.4",
"version": "3.8.4.1",
"commands": [
"mgcb-editor-windows"
]
},
"dotnet-mgcb-editor-mac": {
"version": "3.8.4",
"version": "3.8.4.1",
"commands": [
"mgcb-editor-mac"
]
}
}
}
}
6 changes: 5 additions & 1 deletion examples/EmberExample/Content/Content.mgcb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#-------------------------------- References --------------------------------#

/reference:..\..\..\external\monogame-extended\.artifacts\source\bin\MonoGame.Extended.Content.Pipeline\release\MonoGame.Extended.Content.Pipeline.dll

#---------------------------------- Content ---------------------------------#

Expand All @@ -20,7 +21,9 @@
/copy:loadtest/Pixel.png

#begin ring/ring.ember
/copy:ring/ring.ember
/importer:
/processor:
/build:ring/ring.ember

#begin ring/Ring.png
/copy:ring/Ring.png
Expand All @@ -36,3 +39,4 @@

#begin spark/spark.ember
/copy:spark/spark.ember

4 changes: 2 additions & 2 deletions examples/EmberExample/EmberExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hexa.NET.ImGui" Version="2.2.8.5" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.*" />
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.*" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.4.1" />
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.4.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\external\monogame-extended\source\MonoGame.Extended\MonoGame.Extended.csproj" />
Expand Down
22 changes: 14 additions & 8 deletions examples/EmberExample/Game1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ private void DrawDebugWindow(GameTime gameTime)
ImGui.TableNextColumn();
if (ImGui.Button("Ring"u8, new System.Numerics.Vector2(-1, 0)))
{
string fileName = Path.Combine(_contentPath, "ring", "ring.ember");
LoadParticleEffect(fileName);
LoadParticleEffect("ring/ring", true);
}

ImGui.TableNextColumn();
Expand Down Expand Up @@ -156,7 +155,7 @@ private void DrawDebugWindow(GameTime gameTime)
ImGui.Text("Auto Trigger: ");
ImGui.TableNextColumn();
bool autoTrigger = _particleEffect.AutoTrigger;
if(ImGui.Checkbox("##auto_trigger"u8, ref autoTrigger))
if (ImGui.Checkbox("##auto_trigger"u8, ref autoTrigger))
{
_particleEffect.AutoTrigger = autoTrigger;
}
Expand Down Expand Up @@ -213,17 +212,24 @@ private void DrawDebugWindow(GameTime gameTime)
ImGuiRenderer.AfterLayout();
}

private void LoadParticleEffect(string fileName)
private void LoadParticleEffect(string fileName, bool useContentPipeline = false)
{
if (_particleEffect != null)
{
_particleEffect.Dispose();
_particleEffect = null;
}

using ParticleEffectReader reader = new(fileName, Content);
_particleEffect = reader.ReadParticleEffect();
_particleEffect.Position = GraphicsDevice.Viewport.Bounds.Center.ToVector2();
_particleEffect.AutoTrigger = false;
if (useContentPipeline)
{
_particleEffect = Content.Load<ParticleEffect>(fileName);
}
else
{
using ParticleEffectReader reader = new(fileName, Content);
_particleEffect = reader.ReadParticleEffect();
_particleEffect.Position = GraphicsDevice.Viewport.Bounds.Center.ToVector2();
_particleEffect.AutoTrigger = false;
}
}
}
2 changes: 1 addition & 1 deletion external/monogame-extended
Submodule monogame-extended updated 97 files
+20 −27 .github/workflows/create-release.yml
+43 −0 .github/workflows/good-first-issue.yml
+36 −3 .github/workflows/pull-request-test.yml
+215 −64 CONTRIBUTING.md
+8 −17 Directory.Build.props
+1 −1 README.md
+123 −0 TRIAGE.md
+0 −45 benchmarks/Directory.Build.props
+20 −0 ...oGame.Extended.Benchmarks.Triangulation/Baseline/MonoGame.Extended.Benchmarks.Triangulation.Baseline.csproj
+4 −0 benchmarks/MonoGame.Extended.Benchmarks.Triangulation/Baseline/Program.cs
+1 −0 benchmarks/MonoGame.Extended.Benchmarks.Triangulation/Directory.Build.props
+80 −0 benchmarks/MonoGame.Extended.Benchmarks.Triangulation/Shared/TriangulatorBenchmarks.cs
+23 −0 .../MonoGame.Extended.Benchmarks.Triangulation/Source/MonoGame.Extended.Benchmarks.Triangulation.Source.csproj
+4 −0 benchmarks/MonoGame.Extended.Benchmarks.Triangulation/Source/Program.cs
+0 −15 benchmarks/MonoGame.Extended.Benchmarks/FNA.Extended.Benchmarks.csproj
+0 −15 benchmarks/MonoGame.Extended.Benchmarks/KNI.Extended.Benchmarks.csproj
+0 −195 benchmarks/MonoGame.Extended.Benchmarks/Matrix3x2Benchmarks.cs
+0 −14 benchmarks/MonoGame.Extended.Benchmarks/MonoGame.Extended.Benchmarks.csproj
+0 −7 benchmarks/MonoGame.Extended.Benchmarks/Program.cs
+16 −13 source/Directory.Build.props
+70 −0 source/MonoGame.Extended.Content.Pipeline/BitmapFonts/BitmapFontProcessor.cs
+2 −0 source/MonoGame.Extended.Content.Pipeline/BitmapFonts/BitmapFontWriter.cs
+2 −2 source/MonoGame.Extended.Content.Pipeline/KNI.Extended.Content.Pipeline.csproj
+1 −1 source/MonoGame.Extended.Content.Pipeline/MonoGame.Extended.Content.Pipeline.csproj
+6 −1 source/MonoGame.Extended/Animations/AnimationController.cs
+6 −0 source/MonoGame.Extended/Animations/IAnimationController.cs
+18 −5 source/MonoGame.Extended/BitmapFonts/BitmapFont.cs
+157 −2 source/MonoGame.Extended/Camera.cs
+4 −1 source/MonoGame.Extended/Collisions/CollisionComponent.cs
+3 −3 source/MonoGame.Extended/Content/BitmapFonts/BitmapFontFileContent.cs
+30 −7 source/MonoGame.Extended/Content/BitmapFonts/BitmapFontFileReader.cs
+26 −2 source/MonoGame.Extended/Content/ContentReaders/BitmapFontContentReader.cs
+18 −0 source/MonoGame.Extended/Content/ContentReaders/JsonContentTypeReader.cs
+23 −1 source/MonoGame.Extended/Content/ContentReaders/ParticleEffectContentReader.cs
+16 −1 source/MonoGame.Extended/Content/ContentReaders/Texture2DAtlasReader.cs
+80 −17 source/MonoGame.Extended/Content/ExtendedContentManager.cs
+1 −1 source/MonoGame.Extended/ECS/ComponentMapper.cs
+0 −2 source/MonoGame.Extended/ECS/EntityManager.cs
+172 −17 source/MonoGame.Extended/ECS/World.cs
+7 −1 source/MonoGame.Extended/Graphics/AnimatedSprite.cs
+1 −0 source/MonoGame.Extended/Graphics/Batcher.cs
+1 −0 source/MonoGame.Extended/Graphics/Batcher2D.cs
+1 −0 source/MonoGame.Extended/Graphics/Geometry/GeometryBuilder.cs
+1 −0 source/MonoGame.Extended/Graphics/Geometry/GeometryBuilder2D.cs
+3 −0 source/MonoGame.Extended/Graphics/IBatchDrawCallInfo.cs
+44 −1 source/MonoGame.Extended/Graphics/Sprite.cs
+127 −49 source/MonoGame.Extended/Math/RectangleF.cs
+84 −1 source/MonoGame.Extended/Math/ShapeExtensions.cs
+2 −1 source/MonoGame.Extended/Math/Triangulation/IndexableCyclicalLinkedList.cs
+16 −22 source/MonoGame.Extended/Math/Triangulation/Triangulator.cs
+1 −1 source/MonoGame.Extended/Math/Triangulation/Vertex.cs
+370 −79 source/MonoGame.Extended/OrthographicCamera.cs
+20 −2 source/MonoGame.Extended/Particles/Data/ParticleVector2Parameter.cs
+3 −2 source/MonoGame.Extended/Particles/ParticleEffectReader.cs
+7 −1 source/MonoGame.Extended/Particles/ParticleEffectSerializer.cs
+5 −0 source/MonoGame.Extended/Particles/ParticleEffectWriter.cs
+52 −0 source/MonoGame.Extended/Rectangle.Extensions.cs
+45 −12 source/MonoGame.Extended/Screens/GameScreen.cs
+129 −13 source/MonoGame.Extended/Screens/Screen.cs
+303 −42 source/MonoGame.Extended/Screens/ScreenManager.cs
+26 −0 source/MonoGame.Extended/Serialization/Xml/XmlNode.Extensions.cs
+15 −0 source/MonoGame.Extended/Tiled/TiledMapReader.cs
+18 −2 source/MonoGame.Extended/Tiled/TiledMapTilesetReader.cs
+7 −0 source/MonoGame.Extended/Tweening/ColorTween.cs
+251 −3 source/MonoGame.Extended/Tweening/EasingFunctions.cs
+21 −0 source/MonoGame.Extended/Tweening/LinearOperations.cs
+15 −0 source/MonoGame.Extended/Tweening/LinearTween.cs
+167 −2 source/MonoGame.Extended/Tweening/Tween.cs
+17 −0 source/MonoGame.Extended/Tweening/TweenFieldMember.cs
+32 −0 source/MonoGame.Extended/Tweening/TweenMember.cs
+17 −0 source/MonoGame.Extended/Tweening/TweenPropertyMember.cs
+87 −1 source/MonoGame.Extended/Tweening/Tweener.cs
+107 −57 source/MonoGame.Extended/VectorDraw/PrimitiveBatch.cs
+281 −62 source/MonoGame.Extended/VectorDraw/PrimitiveDrawing.cs
+7 −4 tests/Directory.Build.props
+2 −2 tests/MonoGame.Extended.Content.Pipeline.Tests/KNI.Extended.Content.Pipeline.Tests.csproj
+1 −1 tests/MonoGame.Extended.Content.Pipeline.Tests/MonoGame.Extended.Content.Pipeline.Tests.csproj
+0 −95 tests/MonoGame.Extended.Content.Pipeline.Tests/TexturePackerJsonImporterProcessorTests.cs
+0 −204 tests/MonoGame.Extended.Content.Pipeline.Tests/TiledMapImporterProcessorTests.cs
+41 −0 tests/MonoGame.Extended.Tests/Animations/AnimationTests.cs
+23 −0 tests/MonoGame.Extended.Tests/AssertExtensions.cs
+19 −0 tests/MonoGame.Extended.Tests/BitmapFonts/BitmapFontFileReaderTests.cs
+15 −0 tests/MonoGame.Extended.Tests/BitmapFonts/files/bmfont/test-font-xml-utf8-bom.fnt
+0 −97 tests/MonoGame.Extended.Tests/Camera2DTests.cs
+45 −1 tests/MonoGame.Extended.Tests/Collisions/CollisionComponentTests.cs
+5 −1 tests/MonoGame.Extended.Tests/ECS/ComponentMapperTests.cs
+17 −0 tests/MonoGame.Extended.Tests/ECS/WorldManagerTests.cs
+32 −0 tests/MonoGame.Extended.Tests/Fixtures/GraphicsTestCollection.cs
+126 −0 tests/MonoGame.Extended.Tests/Fixtures/GraphicsTestFixture.cs
+83 −0 tests/MonoGame.Extended.Tests/Math/RectangleFTests.cs
+95 −0 tests/MonoGame.Extended.Tests/Math/TriangulatorTests.cs
+1,031 −0 tests/MonoGame.Extended.Tests/OrthographicCameraTests.cs
+62 −0 tests/MonoGame.Extended.Tests/RectangleExtensionsTests.cs
+15 −0 tests/MonoGame.Extended.Tests/Screens/GameScreenTests.cs
+483 −0 tests/MonoGame.Extended.Tests/Screens/ScreenManagerTests.cs
+77 −0 tests/MonoGame.Extended.Tests/Screens/TestScreens.cs
+74 −0 tests/MonoGame.Extended.Tests/Tweening/TweenerTests.cs
66 changes: 65 additions & 1 deletion src/Ember/Architecture/Components/PropertyTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,37 @@ public static bool ReleaseParameter(ReadOnlySpan<byte> label, ReadOnlySpan<byte>
}
else if (value.Kind == ParticleValueKind.Random)
{
if (ReleaseParameterRandomVector2(ref value.RandomMin, ref value.RandomMax))
TableNextColumn();
bool uniform = value.Uniform;
if (Checkbox("Uniform##uniform"u8, ref uniform))
{
value.Uniform = uniform;
if (uniform)
{
value.RandomMin.Y = value.RandomMin.X;
value.RandomMax.Y = value.RandomMax.X;
}
changed = true;
}

TableNextRow();
TableNextColumn();
TableNextColumn();

if (value.Uniform)
{
if (ReleaseParameterUniformRandomVector2(ref value.RandomMin, ref value.RandomMax))
{
changed = true;
}
}
else
{
if (ReleaseParameterRandomVector2(ref value.RandomMin, ref value.RandomMax))
{
changed = true;
}
}
}

PopID();
Expand Down Expand Up @@ -657,6 +684,43 @@ private static bool ReleaseParameterConstantVector2(ref XnaVec2 value)
return changed;
}

private static bool ReleaseParameterUniformRandomVector2(ref XnaVec2 min, ref XnaVec2 max)
{
bool changed = false;

ImGuiStylePtr stylePtr = GetStyle();
TableNextColumn();

float availWidth = GetContentRegionAvail().X;
float toWidth = CalcTextSize(" to "u8).X;
float spacing = stylePtr.ItemSpacing.X * 2.0f;
float dragWidth = (availWidth - toWidth - spacing) * 0.5f;

SetNextItemWidth(dragWidth);
float minVal = min.X;
if (DragFloat("##uniform-min"u8, ref minVal, 0.1f, 0.0f, max.X, "%.2f"u8))
{
min.X = minVal;
min.Y = minVal;
changed = true;
}

SameLine();
Text(" to "u8);

SameLine();
SetNextItemWidth(dragWidth);
float maxVal = max.X;
if (DragFloat("##uniform-max"u8, ref maxVal, 0.1f, min.X, float.MaxValue, "%.2f"u8))
{
max.X = maxVal;
max.Y = maxVal;
changed = true;
}

return changed;
}

private static bool ReleaseParameterRandomVector2(ref XnaVec2 min, ref XnaVec2 max)
{
bool changed = false;
Expand Down
Loading