Description:
Fix some rendering bugs. This includes an embarassing bug where all trees were rendered at the exact same depth.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r526:0fc89866c755 -

1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -1,4 +1,4
1 // <autogenerated />
1 // <autogenerated />
2 using System;
2 using System;
3 using System.Reflection;
3 using System.Reflection;
4 // [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
4 // [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -183,9 +183,9
183 If nothing else, might be useful for future projects.
183 If nothing else, might be useful for future projects.
184 Bugs:
184 Bugs:
185 Graphics:
185 Graphics:
186 - Trees jump around when pressing show/hide grid
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
188 - Trees sometimes overlap each other @done(2022-01-23)
189 - Sometimes framerate jumps to 180-200 fps. (Better than reverse, but kinda weird)
189 - Sometimes framerate jumps to 180-200 fps. (Better than reverse, but kinda weird)
190 - Graphics don't adjust for the resolution
190 - Graphics don't adjust for the resolution
191 - Scroll area @done(2021-06-23)
191 - Scroll area @done(2021-06-23)
@@ -525,7 +525,7
525 {
525 {
526 float maxdepth = ((this.squaresAcross + 1) + ((this.squaresDown + 1) * Tile.TileWidth)) * 10;
526 float maxdepth = ((this.squaresAcross + 1) + ((this.squaresDown + 1) * Tile.TileWidth)) * 10;
527
527
528 float depthOffset = 0.7f - ((0 + (0 * Tile.TileWidth)) / maxdepth);
528 float depthOffset = 0.7f - ((x + (y * Tile.TileWidth)) / maxdepth);
529
529
530 Tile.drawTileAt(this.batch, x, y, tileIndex, height, depthOffset);
530 Tile.drawTileAt(this.batch, x, y, tileIndex, height, depthOffset);
531 }
531 }
@@ -596,7 +596,7
596 #endregion draw_tiles
596 #endregion draw_tiles
597
597
598 #region draw_gridlines
598 #region draw_gridlines
599 batch.Begin(SpriteSortMode.BackToFront,
599 batch.Begin(SpriteSortMode.Deferred,
600 BlendState.AlphaBlend,
600 BlendState.AlphaBlend,
601 null,
601 null,
602 null,
602 null,
@@ -638,6 +638,7
638
638
639 }
639 }
640 }
640 }
641 batch.End();
641 stopWatch2.Stop();
642 stopWatch2.Stop();
642 this.gridDrawTime = stopWatch2.Elapsed;
643 this.gridDrawTime = stopWatch2.Elapsed;
643 #endregion draw_gridlines
644 #endregion draw_gridlines
@@ -681,6 +682,13
681
682
682 }
683 }
683 */
684 */
685 batch.Begin(SpriteSortMode.BackToFront,
686 BlendState.AlphaBlend,
687 null,
688 null,
689 null,
690 null,
691 camera.get_transformation(GraphicsDevice));
684
692
685 #if DEBUG
693 #if DEBUG
686 drawTileAt(4, 4, 140, 3);
694 drawTileAt(4, 4, 140, 3);
You need to be logged in to leave comments. Login now