Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
9f1fe28
Add 3D drawables: World, Camera, Model, Primitive (Quad)
WilliamQiufeng May 10, 2024
202c25c
Add pivot and origin. Make Rotation consistently in radians.
WilliamQiufeng Jun 16, 2024
a13d5b3
Attempt to implement rotation for Drawable
WilliamQiufeng Jun 17, 2024
9240efa
Merge remote-tracking branch 'refs/remotes/origin/master' into animation
WilliamQiufeng Jun 17, 2024
dfc7ddf
Fix rotation problems, add documentations and cleanup
WilliamQiufeng Jun 17, 2024
f5c44a8
Add tests for rotation
WilliamQiufeng Jun 17, 2024
eff9914
Drawable now calculates a minimum bounding box of the rotated rectang…
WilliamQiufeng Jun 17, 2024
01f9160
Optimize screen minimum bounding rect calculation, fix incorrect boun…
WilliamQiufeng Jun 18, 2024
88b53bb
Cache AbsoluteRotation
WilliamQiufeng Jun 19, 2024
cba13dc
Add Sprite.IndependentRotation to allow the sprite to not follow its …
WilliamQiufeng Jun 19, 2024
f86cbe8
Add scaling, change from using Matrix to using Matrix2D
WilliamQiufeng Jun 19, 2024
389e36e
Add a text to ensure it scales too
WilliamQiufeng Jun 20, 2024
4a33765
Allow RenderTargetContainer to take any dimensions
WilliamQiufeng Jun 23, 2024
1362c52
Support additional (more than 1) shaders to be attached to a sprite
WilliamQiufeng Jun 24, 2024
596de7b
Pass GameTime to GameBase.Game.ScheduledRenderTargetDraws callbacks
WilliamQiufeng Jun 24, 2024
5a726d5
Merge RenderTargetContainer into Container
WilliamQiufeng Jun 25, 2024
cd359e2
Fix RenderTarget null check
WilliamQiufeng Jun 25, 2024
510d125
Allow casting to stop, and fix positioning issues when casting/uncasting
WilliamQiufeng Jun 27, 2024
72f7afc
Scale the children of render target containers
WilliamQiufeng Jun 27, 2024
616d2bb
* Add RenderTargetOptions
WilliamQiufeng Jun 28, 2024
1e18ae8
Fix rapid allocation of RenderTarget2D in Sprite.Image setter
WilliamQiufeng Jul 1, 2024
56aec53
Fix draw clipping for projecting containers
WilliamQiufeng Jul 1, 2024
bca7315
Draw DefaultProjectionSprite if the container's parent is null
WilliamQiufeng Jul 1, 2024
6632c3b
Set parameters in shaders for texture size conversions (p_rendertarge…
WilliamQiufeng Jul 1, 2024
d2cb6d3
Fix scaling problem and allow negative scaling
WilliamQiufeng Jul 3, 2024
7bc8167
Add lerp function to ScalableVector2
WilliamQiufeng Jul 4, 2024
d0c9c12
Add layering
WilliamQiufeng Jul 6, 2024
87f6ca3
Make ClearColor nullable
WilliamQiufeng Jul 7, 2024
1211e1d
End batching at the end of draw calls
WilliamQiufeng Jul 7, 2024
2d10b09
Add dialog layer
WilliamQiufeng Jul 7, 2024
8ca2904
Stop drawing if the layer order has changed midway
WilliamQiufeng Jul 7, 2024
0e606c0
Destroy better for layers
WilliamQiufeng Jul 7, 2024
b05b927
Split GlobalLayerManager from LayerManager
WilliamQiufeng Jul 7, 2024
3424ab9
Remove NewGlobalLayer and use NewLayer(string) only
WilliamQiufeng Jul 7, 2024
06922d9
Revert using layering system globally
WilliamQiufeng Jul 8, 2024
851b507
Allow sprites to have its own rotation, not affecting their children
WilliamQiufeng Jul 8, 2024
345dca3
Move container's render target draw ability to Drawable. Add WrappedD…
WilliamQiufeng Jul 12, 2024
7541b35
Add a shortcut variable _isCasting to tell if we are currently castin…
WilliamQiufeng Jul 12, 2024
3bdeb1b
Notify RenderProjectionSprites to update shader's size parameters whe…
WilliamQiufeng Jul 12, 2024
354698e
Cache draw mask
WilliamQiufeng Jul 13, 2024
50de2a1
SpriteTextPlusLine: schedule Cache instead of _ => Cache(gameTime) to…
WilliamQiufeng Jul 13, 2024
f9d82a4
Optimise rectangle recalculation
WilliamQiufeng Jul 13, 2024
2b9bb98
Make Alpha a Drawable property, and allow alphas to be multiplied dow…
WilliamQiufeng Jul 14, 2024
609b87b
Fix text tint, make alpha animation able to be applied to all drawables
WilliamQiufeng Jul 16, 2024
4166b32
Add Layer.Wrap and Layer.Isolate for more convenient operations
WilliamQiufeng Jul 17, 2024
3c2be11
Add Layer.Visible for visibility toggle.
WilliamQiufeng Jul 17, 2024
2134bf1
Expose sorted layers
WilliamQiufeng Jul 17, 2024
46bb812
Add LayerManager.ResetOrder for constraint reset
WilliamQiufeng Jul 17, 2024
c3aab36
Merge remote-tracking branch 'origin/animation' into animation
WilliamQiufeng Jul 17, 2024
de6e8dd
Merge remote-tracking branch 'fork/animation' into animation
WilliamQiufeng Jul 19, 2024
616d21d
Update csproj:
WilliamQiufeng Jun 9, 2024
e1f3b20
Update and add binaries
WilliamQiufeng Jul 25, 2024
9b3c023
Update API usage
WilliamQiufeng Jun 9, 2024
d93c4fb
Fix ImGui access violation
WilliamQiufeng Jun 28, 2024
8f7aee1
Recompile shaders
WilliamQiufeng Jul 25, 2024
d644d10
Fix MonoGame.Extended dependency issue
WilliamQiufeng Jul 25, 2024
78ccc4d
Suppress concurrent list updating error when drawing. Instead, log them.
WilliamQiufeng Jul 25, 2024
85d232e
Add runtime.osx.10.10-x64.CoreCompat.System.Drawing as dependency of …
WilliamQiufeng Jun 28, 2024
843e9da
Make 1 box only instead of 5000 in ImGui test
WilliamQiufeng Jun 29, 2024
9394483
Fix gaussian blur calling sprite batch begin before end
WilliamQiufeng Jun 17, 2024
fbc3e03
Add Fps counter and wayland toggle (visible on linux only)
WilliamQiufeng Jun 17, 2024
179599b
Perfer wayland for wobble tests
WilliamQiufeng Jun 17, 2024
7fe21fd
Add UIAlpha and UITint which are inherited by the drawable's descende…
WilliamQiufeng Jul 26, 2024
3218098
Merge branch 'master' into new-monogame-3.8
WilliamQiufeng Aug 18, 2024
b9e7290
Update Quaver MonoGame
WilliamQiufeng Aug 21, 2024
93dd0f8
Add WobbleTransforms
WilliamQiufeng Aug 25, 2024
83c8d3a
Merge branch 'new-monogame-3.8-3d' into animation
WilliamQiufeng Aug 25, 2024
1820eb6
Use Matrix2 instead of Matrix2D
WilliamQiufeng Aug 25, 2024
dc8209d
Update grey.mgfxo
WilliamQiufeng Aug 26, 2024
d8181b0
Reduce rotation text updating in the test to 60/s
WilliamQiufeng Aug 26, 2024
2bb9332
Fix ScrollContainer giving NaN y values
WilliamQiufeng Aug 26, 2024
a4e4471
Add initial support for 3d quad rendering in SpriteBatch
WilliamQiufeng Aug 26, 2024
13d60fd
SpriteTextPlusLine clear color Black->Transparent
WilliamQiufeng Aug 26, 2024
65afbf2
Avoid y value NaN completely in ScrollContainer
WilliamQiufeng Aug 27, 2024
b8b785b
Optimize RecalculateLocalMatrix
WilliamQiufeng Aug 27, 2024
a4eecd3
Remove CullNone from Default SpriteBatch options
WilliamQiufeng Aug 27, 2024
74cc577
Separate self and child matrices
WilliamQiufeng Aug 28, 2024
7cac950
Add IndependentRotation
WilliamQiufeng Aug 28, 2024
d87ad93
Split transforms into separate files
WilliamQiufeng Aug 30, 2024
95355a1
Call Update() before invoking events for WindowManager
WilliamQiufeng Sep 2, 2024
34475bc
Add Transform3D
WilliamQiufeng Sep 2, 2024
1f33784
Wrap Drawable position/scale/size/rotation/rect related properties to…
WilliamQiufeng Sep 2, 2024
c778f29
Fix Primitive drawing
WilliamQiufeng Sep 7, 2024
ef49647
Fix blur container being on top of others
WilliamQiufeng Sep 7, 2024
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
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "MonoGame"]
path = MonoGame
url = https://github.com/Quaver/MonoGame
[submodule "SpriteFontPlus"]
path = SpriteFontPlus
url = https://github.com/Quaver/SpriteFontPlus
1 change: 0 additions & 1 deletion MonoGame
Submodule MonoGame deleted from 314446
Binary file added MonoGame.Framework.dll
Binary file not shown.
1 change: 0 additions & 1 deletion SpriteFontPlus
Submodule SpriteFontPlus deleted from bae26a
9 changes: 7 additions & 2 deletions Wobble.Extended/Wobble.Extended.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../MonoGame/MonoGame.Framework/MonoGame.Framework.DesktopGL.csproj" />
<ProjectReference Include="../Wobble/Wobble.csproj" />
</ItemGroup>

Expand All @@ -17,4 +16,10 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
<Reference Include="MonoGame.Framework">
<HintPath>..\MonoGame.Framework.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
Binary file modified Wobble.Resources/Wobble.Resources/Shaders/fast-blur.mgfxo
Binary file not shown.
Binary file not shown.
Binary file modified Wobble.Resources/Wobble.Resources/Shaders/frosty-blur.mgfxo
Binary file not shown.
Binary file modified Wobble.Resources/Wobble.Resources/Shaders/gaussian-blur.mgfxo
Binary file not shown.
8 changes: 7 additions & 1 deletion Wobble.Tests.Hotload/Wobble.Tests.Hotload.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../Wobble.Extended/Wobble.Extended.csproj" />
<ProjectReference Include="../Wobble.Tests/Wobble.Tests.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="MonoGame.Framework">
<HintPath>..\MonoGame.Framework.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions Wobble.Tests.Resources/Wobble.Tests.Resources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
<EmbeddedResource Include="Wobble.Tests.Resources/**\*" />
</ItemGroup>

<ItemGroup>
<ClCompile Include="Wobble.Tests.Resources\Shaders\semi-transparent.fx" />
</ItemGroup>

</Project>
45 changes: 45 additions & 0 deletions Wobble.Tests.Resources/Wobble.Tests.Resources/Shaders/grey.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#if OPENGL
#define SV_POSITION POSITION
#define VS_SHADERMODEL vs_3_0
#define PS_SHADERMODEL ps_3_0
#else
#define VS_SHADERMODEL vs_5_0
#define PS_SHADERMODEL ps_5_0
#endif

Texture2D SpriteTexture;

sampler2D SpriteTextureSampler = sampler_state
{
Texture = <SpriteTexture>;
};

struct VertexShaderOutput
{
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};


float p_strength;


float4 MainPS(VertexShaderOutput input) : COLOR
{
float4 color = tex2D(SpriteTextureSampler,input.TextureCoordinates) * input.Color;

float4 greyColor;
greyColor.rgb = (color.r + color.g + color.b) / 3.0f;
greyColor.a = color.a;

return lerp(color, greyColor, p_strength);
}

technique SpriteDrawing
{
pass P0
{
PixelShader = compile PS_SHADERMODEL MainPS();
}
};
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#if OPENGL
#define SV_POSITION POSITION
#define VS_SHADERMODEL vs_3_0
#define PS_SHADERMODEL ps_3_0
#else
#define VS_SHADERMODEL vs_4_0_level_9_1
#define PS_SHADERMODEL ps_4_0_level_9_1
#endif

Texture2D SpriteTexture;

sampler2D SpriteTextureSampler = sampler_state
{
Texture = <SpriteTexture>;
};

struct VertexShaderOutput
{
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};


float2 p_dimensions;

float2 p_position;
float2 p_rectangle;

float p_alpha;


float4 MainPS(VertexShaderOutput input) : COLOR
{

float2 coord = input.TextureCoordinates * p_dimensions;

if (coord.x <= p_position.x + p_rectangle.x && coord.x >= p_position.x &&
coord.y <= p_position.y + p_rectangle.y && coord.y >= p_position.y)
{
input.Color.a = p_alpha;
}

return tex2D(SpriteTextureSampler,input.TextureCoordinates) * input.Color;
}

technique SpriteDrawing
{
pass P0
{
PixelShader = compile PS_SHADERMODEL MainPS();
}
};
Binary file not shown.
8 changes: 7 additions & 1 deletion Wobble.Tests.Unit/Wobble.Tests.Unit.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -17,4 +17,10 @@
<ProjectReference Include="../Wobble/Wobble.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="MonoGame.Framework">
<HintPath>..\MonoGame.Framework.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
Binary file added Wobble.Tests/Content/gotham.xnb
Binary file not shown.
Binary file added Wobble.Tests/Content/gotham_0.xnb
Binary file not shown.
10 changes: 10 additions & 0 deletions Wobble.Tests/Screens/Selection/SelectionScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ public class SelectionScreen : Screen
public Dictionary<ScreenType, string> TestCasesScreens { get; } = new Dictionary<ScreenType, string>
{
{ScreenType.DrawingSprites, "Drawing Sprites"},
{ScreenType.Rotation, "Rotation"},
{ScreenType.DrawableScaling, "Drawable Scaling"},
{ScreenType.MatrixDrawing, "Matrix Drawing"},
{ScreenType.EasingAnimations, "Easing Animations"},
{ScreenType.Layering, "Layering"},
{ScreenType.Audio, "Audio"},
{ScreenType.Discord, "Discord Rich Pr."},
{ScreenType.Background, "Background Sprite"},
{ScreenType.Scrolling, "Scroll Container"},
{ScreenType.BlurContainer, "Blur Container"},
{ScreenType.RenderTarget, "Render Target"},
{ScreenType.BlurredBackgroundImage, "Blurred BG Image"},
{ScreenType.TextInput, "Text Input"},
{ScreenType.SpriteMaskContainer, "Sprite Masking"},
Expand All @@ -48,11 +53,16 @@ public class SelectionScreen : Screen
public enum ScreenType
{
DrawingSprites,
Rotation,
DrawableScaling,
MatrixDrawing,
EasingAnimations,
Layering,
Audio,
Discord,
Background,
Scrolling,
RenderTarget,
BlurContainer,
BlurredBackgroundImage,
TextInput,
Expand Down
20 changes: 20 additions & 0 deletions Wobble.Tests/Screens/Selection/SelectionScreenView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@
using Wobble.Tests.Screens.Tests.BlurContainer;
using Wobble.Tests.Screens.Tests.BlurredBgImage;
using Wobble.Tests.Screens.Tests.Discord;
using Wobble.Tests.Screens.Tests.DrawableScaling;
using Wobble.Tests.Screens.Tests.DrawingSprites;
using Wobble.Tests.Screens.Tests.EasingAnimations;
using Wobble.Tests.Screens.Tests.Joystick;
using Wobble.Tests.Screens.Tests.Imgui;
using Wobble.Tests.Screens.Tests.Layering;
using Wobble.Tests.Screens.Tests.MatrixDrawing;
using Wobble.Tests.Screens.Tests.Primitives;
using Wobble.Tests.Screens.Tests.RenderTarget;
using Wobble.Tests.Screens.Tests.Rotation;
using Wobble.Tests.Screens.Tests.Scaling;
using Wobble.Tests.Screens.Tests.ScheduledUpdates;
using Wobble.Tests.Screens.Tests.Scrolling;
Expand Down Expand Up @@ -103,9 +108,21 @@ private void CreateSelectionButtons()
case ScreenType.DrawingSprites:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestDrawingSpritesScreen());
break;
case ScreenType.Rotation:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestRotationScreen());
break;
case ScreenType.DrawableScaling:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestDrawableScalingScreen());
break;
case ScreenType.MatrixDrawing:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestMatrixDrawingScreen());
break;
case ScreenType.EasingAnimations:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestEasingAnimationsScreen());
break;
case ScreenType.Layering:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestLayerScreen());
break;
case ScreenType.Audio:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestAudioScreen());
break;
Expand All @@ -121,6 +138,9 @@ private void CreateSelectionButtons()
case ScreenType.BlurContainer:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestBlurContainerScreen());
break;
case ScreenType.RenderTarget:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestRenderTargetScreen());
break;
case ScreenType.BlurredBackgroundImage:
button.Clicked += (o, e) => ScreenManager.ChangeScreen(new TestBlurredBackgroundImageScreen());
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Wobble.Screens;
using Wobble.Tests.Screens.Tests.Rotation;

namespace Wobble.Tests.Screens.Tests.DrawableScaling
{
public class TestDrawableScalingScreen : Screen
{
/// <inheritdoc />
/// <summary>
/// </summary>
public sealed override ScreenView View { get; protected set; }

/// <summary>
/// </summary>
public TestDrawableScalingScreen() => View = new TestDrawableScalingScreenView(this);
}
}
Loading