perf: removed obsolete method calls and switched to for in draw calls

This commit is contained in:
2025-05-29 22:49:51 +03:00
parent 59059fa09d
commit 3c38cb4159
7 changed files with 18 additions and 18 deletions

View File

@@ -179,13 +179,13 @@ public class GamePong : Game
universe.Draw();
spriteBatch.Begin(SpriteSortMode.Deferred, transformMatrix: cameraBehaviour.MatrixTransform);
foreach (var displayable in displayableCollector)
displayable.Draw(spriteBatch);
for (int i = displayableCollector.Behaviours.Count - 1; i >= 0; i--)
displayableCollector.Behaviours[i].Draw(spriteBatch);
spriteBatch.End();
shapeBatch.Begin(cameraBehaviour.MatrixTransform);
foreach (var displayableShape in displayableShapeCollector)
displayableShape.Draw(shapeBatch);
for (int i = displayableShapeCollector.Behaviours.Count - 1; i >= 0; i--)
displayableShapeCollector.Behaviours[i].Draw(shapeBatch);
shapeBatch.End();
base.Draw(gameTime);