Commit Description:
Add timers for Simulation and various engines...
Commit Description:
Add timers for Simulation and various engines Starting to add additional timers for different stages of the process of updating in order to get more insight into what is slowing it down. The update takes 9ms, which is much longer than it used to. Engine-specific timers are coming later.
File last commit:
Show/Diff file:
Action:
SpriteFontPlus/src/FontStashSharp/FontGlyph.cs
41 lines | 834 B | text/x-csharp | CSharpLexer
using Microsoft.Xna.Framework;
using System.Collections.Generic;
namespace FontStashSharp
{
internal class FontGlyph
{
private readonly Dictionary<int, int> _kernings = new Dictionary<int, int>();
public Font Font;
public FontAtlas Atlas;
public int Codepoint;
public int Index;
public int Size;
public Rectangle Bounds;
public int XAdvance;
public int XOffset;
public int YOffset;
public bool IsEmpty
{
get
{
return Bounds.Width == 0 || Bounds.Height == 0;
}
}
public int GetKerning(FontGlyph nextGlyph)
{
int result;
if (_kernings.TryGetValue(nextGlyph.Index, out result))
{
return result;
}
result = StbTrueTypeSharp.StbTrueType.stbtt_GetGlyphKernAdvance(Font._font, Index, nextGlyph.Index);
_kernings[nextGlyph.Index] = result;
return result;
}
}
}