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 | 186 | - Trees jump around when pressing show/hide grid @done(2022-01-23) |
|
187 | 187 | - Grids sometimes overlap trees, including area overlays |
|
188 | 188 | - Trees sometimes overlap each other @done(2022-01-23) |
|
189 | - Area overlays overlap trees @done(2022-01-24) | |
|
189 | 190 | - Sometimes framerate jumps to 180-200 fps. (Better than reverse, but kinda weird) |
|
190 | 191 | - Graphics don't adjust for the resolution |
|
191 | 192 | - Scroll area @done(2021-06-23) |
@@ -43,6 +43,7 | |||
|
43 | 43 | private MouseState mousePrev = new MouseState(); |
|
44 | 44 | |
|
45 | 45 | private SpriteBatch batch; |
|
46 | private SpriteBatch tileBatch; | |
|
46 | 47 | #if DEBUG |
|
47 | 48 | private SoundEffect sound; |
|
48 | 49 | #endif |
@@ -188,7 +189,8 | |||
|
188 | 189 | protected override void LoadContent() |
|
189 | 190 | { |
|
190 | 191 | // Create the batch... |
|
191 | batch = new SpriteBatch(GraphicsDevice); | |
|
192 | this.batch = new SpriteBatch(GraphicsDevice); | |
|
193 | this.tileBatch = new SpriteBatch(GraphicsDevice); | |
|
192 | 194 | |
|
193 | 195 | #if DEBUG |
|
194 | 196 | sound = Content.Load<SoundEffect>("FNASound"); |
@@ -288,7 +290,7 | |||
|
288 | 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 | 294 | WorldBuilder.AddGeneralRenderer(new ImGuiWindowRenderer(this, this.simulation, this.imGuiWindowBridgeEngine, this.gdm), 2); |
|
293 | 295 | var contractWindow = WorldBuilder.CreateEntity(); |
|
294 | 296 | WorldBuilder.SetComponent(contractWindow, new VisibilityComponent { visible = false }); |
@@ -527,7 +529,7 | |||
|
527 | 529 | |
|
528 | 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 | 688 | BlendState.AlphaBlend, |
|
687 | 689 | null, |
|
688 | 690 | null, |
@@ -702,29 +704,29 | |||
|
702 | 704 | if (MathUtils.Between(this.mouseGrid.X, 0, this.simulation.map.MapWidth) |
|
703 | 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 | 710 | #if DEBUG |
|
709 |
Tile.OutlineSquare( |
|
|
710 |
Tile.OutlineSquare( |
|
|
711 |
Tile.OutlineSquare( |
|
|
712 |
Tile.OutlineSquare( |
|
|
713 |
Tile.OutlineSquare( |
|
|
711 | Tile.OutlineSquare(tileBatch, 1, 1, Color.Red, 2); | |
|
712 | Tile.OutlineSquare(tileBatch, 3, 1, Color.Blue, 2); | |
|
713 | Tile.OutlineSquare(tileBatch, 5, 1, Color.Green, 2); | |
|
714 | Tile.OutlineSquare(tileBatch, 7, 1, Color.Orange, 2); | |
|
715 | Tile.OutlineSquare(tileBatch, 9, 1, Color.Orange, 3); | |
|
714 | 716 | |
|
715 | 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 | 719 | new Vector2(21, 2), new Vector2(19, 3), new Vector2(20, 3), new Vector2(21, 3) |
|
718 | 720 | }, Color.Purple); |
|
719 | 721 | |
|
720 |
Quad.FillSquare2( |
|
|
721 |
Quad.FillSquare2( |
|
|
722 |
Quad.FillSquare2( |
|
|
723 |
Quad.FillSquare2( |
|
|
724 |
Quad.FillSquare2( |
|
|
725 |
Quad.FillSquare2( |
|
|
726 |
Quad.FillSquare2( |
|
|
727 |
Quad.FillSquare2( |
|
|
722 | Quad.FillSquare2(tileBatch, 7, 4, Color.Orange, 1.0f, 0.79f); | |
|
723 | Quad.FillSquare2(tileBatch, 7, 3, Color.Yellow, 1.0f, 0.79f); | |
|
724 | Quad.FillSquare2(tileBatch, 7, 5, Color.Yellow, .5f, 0.79f); | |
|
725 | Quad.FillSquare2(tileBatch, 7, 6, Color.Yellow, .25f, 0.79f); | |
|
726 | Quad.FillSquare2(tileBatch, 7, 7, Color.Yellow, .125f, 0.79f); | |
|
727 | Quad.FillSquare2(tileBatch, 8, 5, Color.Teal, .5f, 0.79f); | |
|
728 | Quad.FillSquare2(tileBatch, 8, 6, Color.Teal, .25f, 0.79f); | |
|
729 | Quad.FillSquare2(tileBatch, 8, 7, Color.Teal, .125f, 0.79f); | |
|
728 | 730 | #endif |
|
729 | 731 | |
|
730 | 732 | #endregion draw_cursor |
@@ -773,7 +775,7 | |||
|
773 | 775 | |
|
774 | 776 | World.Draw(); |
|
775 | 777 | // _imGuiRenderer.AfterLayout(); |
|
776 |
|
|
|
778 | tileBatch.End(); | |
|
777 | 779 | |
|
778 | 780 | #region draw_header |
|
779 | 781 | batch.Begin(SpriteSortMode.BackToFront, |
@@ -38,7 +38,7 | |||
|
38 | 38 | ) |
|
39 | 39 | { |
|
40 | 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 | 44 | var selected = GetComponent<SelectedComponent>(entity).selected; |
@@ -49,9 +49,9 | |||
|
49 | 49 | ) |
|
50 | 50 | { |
|
51 | 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