mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Fixed memory leaks
This commit is contained in:
@@ -444,13 +444,13 @@ namespace GlitchyEngine.Renderer.Text
|
|||||||
int bufferX = desc.Width;
|
int bufferX = desc.Width;
|
||||||
int bufferY = desc.Height;
|
int bufferY = desc.Height;
|
||||||
|
|
||||||
Bitmap<ColorRGB, const 1> bitmap = .((.)bufferX, (.)bufferY);
|
using(Bitmap<ColorRGB, const 1> bitmap = .((.)bufferX, (.)bufferY))
|
||||||
|
{
|
||||||
MSDFGeneratorConfig config = .();
|
MSDFGeneratorConfig config = .();
|
||||||
|
|
||||||
msdfgen.GenerateMSDF(*(Bitmap<float, const 3>*)&bitmap, shape, projection, _range, config);
|
msdfgen.GenerateMSDF(*(Bitmap<float, const 3>*)&bitmap, shape, projection, _range, config);
|
||||||
|
|
||||||
int8[] pixels = new int8[desc.Width * desc.Height * 4];
|
int8[] pixels = new:ScopedAlloc! int8[desc.Width * desc.Height * 4];
|
||||||
|
|
||||||
int8 ToInt8(float f) => (.)Math.Clamp(127f * f, int8.MinValue, int8.MaxValue);
|
int8 ToInt8(float f) => (.)Math.Clamp(127f * f, int8.MinValue, int8.MaxValue);
|
||||||
|
|
||||||
@@ -472,4 +472,5 @@ namespace GlitchyEngine.Renderer.Text
|
|||||||
(.)desc.Width, (.)desc.Height, (.)desc.MapCoord.Z);
|
(.)desc.Width, (.)desc.Height, (.)desc.MapCoord.Z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user