1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-26 06:28:35 +01:00

banish MonoGame.Extended from everything but MLEM.Extended

This commit is contained in:
Ellpeck 2020-01-30 00:55:02 +01:00
parent 14bce69521
commit 074fea5fd0
5 changed files with 9 additions and 11 deletions

View file

@ -5,7 +5,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MLEM.Extended\MLEM.Extended.csproj" />
<ProjectReference Include="..\MLEM.Startup\MLEM.Startup.csproj" /> <ProjectReference Include="..\MLEM.Startup\MLEM.Startup.csproj" />
<ProjectReference Include="..\MLEM.Ui\MLEM.Ui.csproj" /> <ProjectReference Include="..\MLEM.Ui\MLEM.Ui.csproj" />
<ProjectReference Include="..\MLEM\MLEM.csproj" /> <ProjectReference Include="..\MLEM\MLEM.csproj" />

View file

@ -5,9 +5,10 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Extensions;
using MLEM.Input; using MLEM.Input;
using MLEM.Misc;
using MLEM.Pathfinding; using MLEM.Pathfinding;
using MLEM.Startup; using MLEM.Startup;
using MonoGame.Extended; using MLEM.Textures;
namespace Demos { namespace Demos {
public class PathfindingDemo : Demo { public class PathfindingDemo : Demo {
@ -17,7 +18,6 @@ namespace Demos {
private List<Point> path; private List<Point> path;
public PathfindingDemo(MlemGame game) : base(game) { public PathfindingDemo(MlemGame game) : base(game) {
} }
private void Init() { private void Init() {
@ -75,11 +75,12 @@ namespace Demos {
this.GraphicsDevice.Clear(Color.White); this.GraphicsDevice.Clear(Color.White);
this.SpriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, transformMatrix: Matrix.CreateScale(14)); this.SpriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, transformMatrix: Matrix.CreateScale(14));
var tex = this.SpriteBatch.GetBlankTexture();
// draw the world with simple shapes // draw the world with simple shapes
for (var x = 0; x < 50; x++) { for (var x = 0; x < 50; x++) {
for (var y = 0; y < 50; y++) { for (var y = 0; y < 50; y++) {
if (!this.world[x, y]) { if (!this.world[x, y]) {
this.SpriteBatch.FillRectangle(new Vector2(x, y), new Size2(1, 1), Color.Black); this.SpriteBatch.Draw(tex, new Rectangle(x, y, 1, 1), Color.Black);
} }
} }
} }
@ -89,7 +90,8 @@ namespace Demos {
for (var i = 1; i < this.path.Count; i++) { for (var i = 1; i < this.path.Count; i++) {
var first = this.path[i - 1]; var first = this.path[i - 1];
var second = this.path[i]; var second = this.path[i];
this.SpriteBatch.DrawLine(new Vector2(first.X + 0.5F, first.Y + 0.5F), new Vector2(second.X + 0.5F, second.Y + 0.5F), Color.Blue, 0.25F); Vector2 firstPos = new Vector2(first.X + 0.25F, first.Y + 0.25F);
this.SpriteBatch.Draw(tex, new RectangleF(firstPos, new Vector2(second.X + 0.75F, second.Y + 0.75F) - firstPos), Color.Blue);
} }
} }
this.SpriteBatch.End(); this.SpriteBatch.End();

View file

@ -22,7 +22,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\MLEM.Extended\MLEM.Extended.csproj" />
<ProjectReference Include="..\MLEM.Ui\MLEM.Ui.csproj" /> <ProjectReference Include="..\MLEM.Ui\MLEM.Ui.csproj" />
<ProjectReference Include="..\MLEM\MLEM.csproj" /> <ProjectReference Include="..\MLEM\MLEM.csproj" />
</ItemGroup> </ItemGroup>

View file

@ -5,7 +5,6 @@ using Microsoft.Xna.Framework.Input;
using MLEM.Input; using MLEM.Input;
using MLEM.Ui; using MLEM.Ui;
using MLEM.Ui.Style; using MLEM.Ui.Style;
using MonoGame.Extended;
namespace MLEM.Startup { namespace MLEM.Startup {
public class MlemGame : Game { public class MlemGame : Game {
@ -45,7 +44,7 @@ namespace MLEM.Startup {
protected sealed override void Update(GameTime gameTime) { protected sealed override void Update(GameTime gameTime) {
this.DoUpdate(gameTime); this.DoUpdate(gameTime);
this.OnUpdate?.Invoke(this, gameTime); this.OnUpdate?.Invoke(this, gameTime);
CoroutineHandler.Tick(gameTime.GetElapsedSeconds()); CoroutineHandler.Tick(gameTime.ElapsedGameTime.TotalSeconds);
CoroutineHandler.RaiseEvent(CoroutineEvents.Update); CoroutineHandler.RaiseEvent(CoroutineEvents.Update);
} }

View file

@ -1,4 +1,3 @@
using System.Diagnostics.Tracing;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Extensions;