Compare commits

...

2 Commits

Author SHA1 Message Date
b98bb61bd9 rewrap to fit line length 2021-07-14 17:19:31 -04:00
bd8df00305 LinesOfSight: FNA compatibility. 2021-07-14 17:18:08 -04:00
2 changed files with 8 additions and 2 deletions

View File

@ -2,6 +2,10 @@
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using System; using System;
// Disables "GraphicsDevice.DrawIndexedPrimitives(...) is obsolete." warning.
// MonoGame has obsoleted this function, but FNA needs it.
#pragma warning disable CS0618
namespace SemiColinGames { namespace SemiColinGames {
public sealed class LinesOfSight : IDisposable { public sealed class LinesOfSight : IDisposable {
@ -119,7 +123,8 @@ namespace SemiColinGames {
foreach (EffectPass pass in lightingEffect.CurrentTechnique.Passes) { foreach (EffectPass pass in lightingEffect.CurrentTechnique.Passes) {
pass.Apply(); pass.Apply();
graphics.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, indices.Length, 0, indices.Length / 3); graphics.DrawIndexedPrimitives(
PrimitiveType.TriangleList, 0, 0, indices.Length, 0, indices.Length / 3);
} }
} }

View File

@ -109,7 +109,8 @@ namespace SemiColinGames {
// Draw in-world UI on top of everything. // Draw in-world UI on top of everything.
spriteBatch.Begin( spriteBatch.Begin(
SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, Matrix.Identity); SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null,
Matrix.Identity);
for (int i = 0; i < world.Player.MaxHealth; i++) { for (int i = 0; i < world.Player.MaxHealth; i++) {
Vector2 pos = new Vector2(16 + 15 * i, 8); Vector2 pos = new Vector2(16 + 15 * i, 8);
if (world.Player.Health > i) { if (world.Player.Health > i) {