(41c5679ec) Resize fonts according to resolution (TODO: test on resolutions larger than 1080p)
This commit is contained in:
@@ -7,7 +7,7 @@ using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
public class ScalableFont
|
||||
public class ScalableFont : IDisposable
|
||||
{
|
||||
private static List<ScalableFont> FontList = new List<ScalableFont>();
|
||||
private static Library Lib = null;
|
||||
@@ -30,7 +30,7 @@ namespace Barotrauma
|
||||
set
|
||||
{
|
||||
size = value;
|
||||
if (graphicsDevice!=null) RenderAtlas(graphicsDevice, charRanges, texDims, baseChar);
|
||||
if (graphicsDevice != null) RenderAtlas(graphicsDevice, charRanges, texDims, baseChar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,5 +302,15 @@ namespace Barotrauma
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
FontList.Remove(this);
|
||||
foreach (Texture2D texture in textures)
|
||||
{
|
||||
texture.Dispose();
|
||||
}
|
||||
textures.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user