Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
DirtyRectnagleExtensions.cs
1using System.Drawing;
2
3namespace Gondwana.Rendering;
4
5internal static class DirtyRectangleExtensions
6{
7 internal static void AddDeduped(this List<Rectangle> rects, Rectangle rect)
8 {
9 // If an existing rect fully contains this one, skip it
10 for (int i = 0; i < rects.Count; i++)
11 {
12 if (rects[i].Contains(rect))
13 return;
14 }
15
16 // Merge with any overlapping rects
17 for (int i = rects.Count - 1; i >= 0; i--)
18 {
19 if (rect.IntersectsWith(rects[i]))
20 {
21 rect = Rectangle.Union(rect, rects[i]);
22 rects.RemoveAt(i);
23 }
24 }
25
26 rects.Add(rect);
27 }
28}
@ Rectangle
Particles are spawned uniformly within a rectangular area. This is the default distribution.