From 724296dc6522cc7a4c3585b04e842ddf447b5ab1 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sat, 21 Jun 2008 23:24:24 +0000 Subject: [PATCH] Removed unnecessary memory allocations. Removed out-of-date comment. --- Source/Utilities/Fonts/TextPrinter.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Utilities/Fonts/TextPrinter.cs b/Source/Utilities/Fonts/TextPrinter.cs index 3e713800..9c504484 100644 --- a/Source/Utilities/Fonts/TextPrinter.cs +++ b/Source/Utilities/Fonts/TextPrinter.cs @@ -183,10 +183,10 @@ namespace OpenTK.Graphics throw new NotImplementedException(); while (8 * text.Length > vertices.Length) - vertices = new Vector2[vertices.Length << 1]; + vertices = new Vector2[Math.Functions.NextPowerOfTwo(8 * text.Length)]; while (6 * text.Length > indices.Length) - indices = new ushort[indices.Length << 1]; + indices = new ushort[Math.Functions.NextPowerOfTwo(6 * text.Length)]; num_indices = 6 * text.Length; @@ -201,9 +201,7 @@ namespace OpenTK.Graphics font.LoadGlyphs(text); // Every character comprises of 4 vertices, forming two triangles. We generate an index array which - // indexes vertices in a triangle-strip fashion. To create a single strip for the whole string, we - // need to add a degenerate triangle (0 height) to connect the last vertex of the previous line with - // the first vertex of the next line. + // indexes vertices in a triangle-list fashion. // This algorithm works for left-to-right scripts. if (alignment == StringAlignment.Near && !rightToLeft || alignment == StringAlignment.Far && rightToLeft)