Esempio n. 1
0
 private static void UpdateLinkDicts(PackageReference pr, IList <Entry> contents)
 {
     for (int i = 0; i < contents.Count; i++)
     {
         TextureEntry te = contents[i] as TextureEntry;
         if (te != null)
         {
             if (TexturesByName.ContainsKey(te.Name))
             {
                 Console.WriteLine("Duplicate Texture entry: " + te.Name + " in " + pr.DisplayName + " and " + TexturesByName[te.Name].ContainingPackage.DisplayName);
             }
             else
             {
                 TexturesByName.Add(te.Name, new EntryReference(i, pr));
             }
             continue;
         }
         AtlasEntry ae = contents[i] as AtlasEntry;
         if (ae != null)
         {
             if (ae.IsReference)
             {
                 AddTo(AtlasesByTextureName, ae.ReferencedTextureName, new EntryReference(i, pr));
             }
             continue;
         }
     }
 }
Esempio n. 2
0
 public static TextureEntry GetTextureByName(string textureName)
 {
     lock (Lock) {
         if (TexturesByName.ContainsKey(textureName))
         {
             return(TexturesByName[textureName].Dereference() as TextureEntry);
         }
         return(null);
     }
 }
Esempio n. 3
0
 public static string GetTexturePackageName(string textureName)
 {
     if (textureName == null)
     {
         return(null);
     }
     lock (Lock) {
         if (TexturesByName.ContainsKey(textureName))
         {
             return(TexturesByName[textureName].ContainingPackage.DisplayName);
         }
     }
     return(null);
 }