Description:
Temporary fix for overlap issue.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -186,6 +186,7 | |||||
|
186 | - Trees jump around when pressing show/hide grid @done(2022-01-23) |
|
186 | - Trees jump around when pressing show/hide grid @done(2022-01-23) |
|
187 | - Grids sometimes overlap trees, including area overlays |
|
187 | - Grids sometimes overlap trees, including area overlays |
|
188 | - Trees sometimes overlap each other @done(2022-01-23) |
|
188 | - Trees sometimes overlap each other @done(2022-01-23) |
|
|
189 | - Area overlays overlap trees @done(2022-01-24) | ||
|
189 | - Sometimes framerate jumps to 180-200 fps. (Better than reverse, but kinda weird) |
|
190 | - Sometimes framerate jumps to 180-200 fps. (Better than reverse, but kinda weird) |
|
190 | - Graphics don't adjust for the resolution |
|
191 | - Graphics don't adjust for the resolution |
|
191 | - Scroll area @done(2021-06-23) |
|
192 | - Scroll area @done(2021-06-23) |
@@ -43,6 +43,7 | |||||
|
43 | private MouseState mousePrev = new MouseState(); |
|
43 | private MouseState mousePrev = new MouseState(); |
|
44 |
|
44 | ||
|
45 | private SpriteBatch batch; |
|
45 | private SpriteBatch batch; |
|
|
46 | private SpriteBatch tileBatch; | ||
|
46 | #if DEBUG |
|
47 | #if DEBUG |
|
47 | private SoundEffect sound; |
|
48 | private SoundEffect sound; |
|
48 | #endif |
|
49 | #endif |
@@ -188,7 +189,8 | |||||
|
188 | protected override void LoadContent() |
|
189 | protected override void LoadContent() |
|
189 | { |
|
190 | { |
|
190 | // Create the batch... |
|
191 | // Create the batch... |
|
191 | batch = new SpriteBatch(GraphicsDevice); |
|
192 | this.batch = new SpriteBatch(GraphicsDevice); |
|
|
193 | this.tileBatch = new SpriteBatch(GraphicsDevice); | ||
|
192 |
|
194 | ||
|
193 | #if DEBUG |
|
195 | #if DEBUG |
|
194 | sound = Content.Load<SoundEffect>("FNASound"); |
|
196 | sound = Content.Load<SoundEffect>("FNASound"); |
@@ -288,7 +290,7 | |||||
|
288 | WorldBuilder.AddEngine(new SimulationGameRateBridgeEngine(this.simulation)); |
|
290 | WorldBuilder.AddEngine(new SimulationGameRateBridgeEngine(this.simulation)); |
|
289 |
|
291 | ||
|
290 |
|
292 | ||
|
291 |
WorldBuilder.AddGeneralRenderer(new AreaRenderer(this. |
|
293 | WorldBuilder.AddGeneralRenderer(new AreaRenderer(this.tileBatch, this.monoFont), 1); |
|
292 | WorldBuilder.AddGeneralRenderer(new ImGuiWindowRenderer(this, this.simulation, this.imGuiWindowBridgeEngine, this.gdm), 2); |
|
294 | WorldBuilder.AddGeneralRenderer(new ImGuiWindowRenderer(this, this.simulation, this.imGuiWindowBridgeEngine, this.gdm), 2); |
|
293 | var contractWindow = WorldBuilder.CreateEntity(); |
|
295 | var contractWindow = WorldBuilder.CreateEntity(); |
|
294 | WorldBuilder.SetComponent(contractWindow, new VisibilityComponent { visible = false }); |
|
296 | WorldBuilder.SetComponent(contractWindow, new VisibilityComponent { visible = false }); |
@@ -527,7 +529,7 | |||||
|
527 |
|
529 | ||
|
528 | float depthOffset = 0.7f - ((x + (y * Tile.TileWidth)) / maxdepth); |
|
530 | float depthOffset = 0.7f - ((x + (y * Tile.TileWidth)) / maxdepth); |
|
529 |
|
531 | ||
|
530 |
Tile.drawTileAt(this. |
|
532 | Tile.drawTileAt(this.tileBatch, x, y, tileIndex, height, depthOffset); |
|
531 | } |
|
533 | } |
|
532 |
|
534 | ||
|
533 |
|
535 | ||
@@ -682,7 +684,7 | |||||
|
682 |
|
684 | ||
|
683 | } |
|
685 | } |
|
684 | */ |
|
686 | */ |
|
685 |
|
|
687 | tileBatch.Begin(SpriteSortMode.BackToFront, |
|
686 | BlendState.AlphaBlend, |
|
688 | BlendState.AlphaBlend, |
|
687 | null, |
|
689 | null, |
|
688 | null, |
|
690 | null, |
@@ -702,29 +704,29 | |||||
|
702 | if (MathUtils.Between(this.mouseGrid.X, 0, this.simulation.map.MapWidth) |
|
704 | if (MathUtils.Between(this.mouseGrid.X, 0, this.simulation.map.MapWidth) |
|
703 | && MathUtils.Between(this.mouseGrid.Y, 0, this.simulation.map.MapHeight)) |
|
705 | && MathUtils.Between(this.mouseGrid.Y, 0, this.simulation.map.MapHeight)) |
|
704 | { |
|
706 | { |
|
705 |
Tile.OutlineSquare( |
|
707 | Tile.OutlineSquare(tileBatch, this.mouseGrid.X, this.mouseGrid.Y, Color.Yellow, 1); |
|
706 | } |
|
708 | } |
|
707 |
|
709 | ||
|
708 | #if DEBUG |
|
710 | #if DEBUG |
|
709 |
Tile.OutlineSquare( |
|
711 | Tile.OutlineSquare(tileBatch, 1, 1, Color.Red, 2); |
|
710 |
Tile.OutlineSquare( |
|
712 | Tile.OutlineSquare(tileBatch, 3, 1, Color.Blue, 2); |
|
711 |
Tile.OutlineSquare( |
|
713 | Tile.OutlineSquare(tileBatch, 5, 1, Color.Green, 2); |
|
712 |
Tile.OutlineSquare( |
|
714 | Tile.OutlineSquare(tileBatch, 7, 1, Color.Orange, 2); |
|
713 |
Tile.OutlineSquare( |
|
715 | Tile.OutlineSquare(tileBatch, 9, 1, Color.Orange, 3); |
|
714 |
|
716 | ||
|
715 | //donut |
|
717 | //donut |
|
716 |
Tile.DrawOutlinedSquares( |
|
718 | Tile.DrawOutlinedSquares(tileBatch, new Vector2[] {new Vector2(19, 1), new Vector2(19, 2), new Vector2(20, 1), new Vector2(21, 1), |
|
717 | new Vector2(21, 2), new Vector2(19, 3), new Vector2(20, 3), new Vector2(21, 3) |
|
719 | new Vector2(21, 2), new Vector2(19, 3), new Vector2(20, 3), new Vector2(21, 3) |
|
718 | }, Color.Purple); |
|
720 | }, Color.Purple); |
|
719 |
|
721 | ||
|
720 |
Quad.FillSquare2( |
|
722 | Quad.FillSquare2(tileBatch, 7, 4, Color.Orange, 1.0f, 0.79f); |
|
721 |
Quad.FillSquare2( |
|
723 | Quad.FillSquare2(tileBatch, 7, 3, Color.Yellow, 1.0f, 0.79f); |
|
722 |
Quad.FillSquare2( |
|
724 | Quad.FillSquare2(tileBatch, 7, 5, Color.Yellow, .5f, 0.79f); |
|
723 |
Quad.FillSquare2( |
|
725 | Quad.FillSquare2(tileBatch, 7, 6, Color.Yellow, .25f, 0.79f); |
|
724 |
Quad.FillSquare2( |
|
726 | Quad.FillSquare2(tileBatch, 7, 7, Color.Yellow, .125f, 0.79f); |
|
725 |
Quad.FillSquare2( |
|
727 | Quad.FillSquare2(tileBatch, 8, 5, Color.Teal, .5f, 0.79f); |
|
726 |
Quad.FillSquare2( |
|
728 | Quad.FillSquare2(tileBatch, 8, 6, Color.Teal, .25f, 0.79f); |
|
727 |
Quad.FillSquare2( |
|
729 | Quad.FillSquare2(tileBatch, 8, 7, Color.Teal, .125f, 0.79f); |
|
728 | #endif |
|
730 | #endif |
|
729 |
|
731 | ||
|
730 | #endregion draw_cursor |
|
732 | #endregion draw_cursor |
@@ -773,7 +775,7 | |||||
|
773 |
|
775 | ||
|
774 | World.Draw(); |
|
776 | World.Draw(); |
|
775 | // _imGuiRenderer.AfterLayout(); |
|
777 | // _imGuiRenderer.AfterLayout(); |
|
776 |
|
|
778 | tileBatch.End(); |
|
777 |
|
779 | ||
|
778 | #region draw_header |
|
780 | #region draw_header |
|
779 | batch.Begin(SpriteSortMode.BackToFront, |
|
781 | batch.Begin(SpriteSortMode.BackToFront, |
@@ -38,7 +38,7 | |||||
|
38 | ) |
|
38 | ) |
|
39 | { |
|
39 | { |
|
40 | Tile.DrawOutlinedSquares(batch, areaComponent.squares, Color.Teal); |
|
40 | Tile.DrawOutlinedSquares(batch, areaComponent.squares, Color.Teal); |
|
41 |
Quad.FillSquares(batch, areaComponent.squares, Color.Teal, 0.5f, 0. |
|
41 | Quad.FillSquares(batch, areaComponent.squares, Color.Teal, 0.5f, 0.99f); |
|
42 | } |
|
42 | } |
|
43 |
|
43 | ||
|
44 | var selected = GetComponent<SelectedComponent>(entity).selected; |
|
44 | var selected = GetComponent<SelectedComponent>(entity).selected; |
@@ -49,9 +49,9 | |||||
|
49 | ) |
|
49 | ) |
|
50 | { |
|
50 | { |
|
51 | Tile.DrawOutlinedSquares(batch, areaComponent.squares, Color.Teal); |
|
51 | Tile.DrawOutlinedSquares(batch, areaComponent.squares, Color.Teal); |
|
52 |
Quad.FillSquares(batch, areaComponent.squares, Color.Gray, 0.5f, 0.8 |
|
52 | Quad.FillSquares(batch, areaComponent.squares, Color.Gray, 0.5f, 0.98f); |
|
53 | } |
|
53 | } |
|
54 | } |
|
54 | } |
|
55 | } |
|
55 | } |
|
56 | } |
|
56 | } |
|
57 | } No newline at end of file |
|
57 | } |
You need to be logged in to leave comments.
Login now