Ejemplo n.º 1
0
 // Token: 0x06004A23 RID: 18979 RVA: 0x0011D91C File Offset: 0x0011BB1C
 public bool LegacyCheck()
 {
     if (this.mGlyphs != null && this.mGlyphs.Length > 0)
     {
         int i   = 0;
         int num = this.mGlyphs.Length;
         while (i < num)
         {
             global::BMGlyph bmglyph = this.mGlyphs[i];
             if (bmglyph != null)
             {
                 bmglyph.index = i;
                 this.mSaved.Add(bmglyph);
                 while (++i < num)
                 {
                     if (bmglyph != null)
                     {
                         bmglyph.index = i;
                         this.mSaved.Add(bmglyph);
                     }
                 }
                 this.mGlyphs = null;
                 return(true);
             }
             i++;
         }
         this.mGlyphs = null;
         return(false);
     }
     return(false);
 }
Ejemplo n.º 2
0
 // Token: 0x06004A27 RID: 18983 RVA: 0x0011DA10 File Offset: 0x0011BC10
 public global::BMFont.GetOrCreateGlyphResult GetOrCreateGlyph(int index, out global::BMGlyph glyph)
 {
     if (!this.mDictMade)
     {
         this.mDictMade = true;
         this.mDictAny  = true;
         int count = this.mSaved.Count;
         if (count == 0 && this.LegacyCheck())
         {
             count = this.mSaved.Count;
         }
         if (count > 0)
         {
             this.mDict = global::BMFont.CreateGlyphDictionary(count + 1);
             for (int i = count - 1; i >= 0; i--)
             {
                 global::BMGlyph bmglyph = this.mSaved[i];
                 this.mDict.Add(bmglyph.index, bmglyph);
                 if (bmglyph.index == index)
                 {
                     glyph = bmglyph;
                     while (--i >= 0)
                     {
                         bmglyph = this.mSaved[i];
                         this.mDict.Add(bmglyph.index, bmglyph);
                     }
                     return(global::BMFont.GetOrCreateGlyphResult.Found);
                 }
             }
         }
         else
         {
             this.mDict = global::BMFont.CreateGlyphDictionary();
         }
     }
     else if (this.mDictAny)
     {
         if (this.mDict.TryGetValue(index, out glyph))
         {
             return(global::BMFont.GetOrCreateGlyphResult.Found);
         }
     }
     else
     {
         this.mDict    = global::BMFont.CreateGlyphDictionary();
         this.mDictAny = true;
     }
     glyph = new global::BMGlyph
     {
         index = index
     };
     this.mDict.Add(index, glyph);
     return(global::BMFont.GetOrCreateGlyphResult.Created);
 }
Ejemplo n.º 3
0
 // Token: 0x06004A2D RID: 18989 RVA: 0x0011DEEC File Offset: 0x0011C0EC
 public void Trim(int xMin, int yMin, int xMax, int yMax)
 {
     if (this.isValid)
     {
         int i     = 0;
         int count = this.mSaved.Count;
         while (i < count)
         {
             global::BMGlyph bmglyph = this.mSaved[i];
             if (bmglyph != null)
             {
                 bmglyph.Trim(xMin, yMin, xMax, yMax);
             }
             i++;
         }
     }
 }
Ejemplo n.º 4
0
 // Token: 0x06004A28 RID: 18984 RVA: 0x0011DB54 File Offset: 0x0011BD54
 public bool GetGlyph(int index, out global::BMGlyph glyph)
 {
     if (!this.mDictMade)
     {
         this.mDictMade = true;
         int count = this.mSaved.Count;
         if (count == 0 && this.LegacyCheck())
         {
             count = this.mSaved.Count;
         }
         this.mDictAny = (count > 0);
         if (this.mDictAny)
         {
             this.mDict = global::BMFont.CreateGlyphDictionary(count);
             for (int i = count - 1; i >= 0; i--)
             {
                 global::BMGlyph bmglyph = this.mSaved[i];
                 this.mDict.Add(bmglyph.index, bmglyph);
                 if (bmglyph.index == index)
                 {
                     glyph = bmglyph;
                     while (--i >= 0)
                     {
                         bmglyph = this.mSaved[i];
                         this.mDict.Add(bmglyph.index, bmglyph);
                     }
                     return(true);
                 }
             }
         }
     }
     else if (this.mDictAny)
     {
         return(this.mDict.TryGetValue(index, out glyph));
     }
     glyph = null;
     return(false);
 }