Exemplo n.º 1
0
 void RmImg(RmImgCmd cmd)
 {
                 #if FDB
     if (cmd.id >= 0)
     {
         Should.True("nodeIdxDict.ContainsKey(cmd.id)", PtrIntDict.Contains(nodeDict, cmd.id));
     }
                 #endif
     if (cmd.id < 0)
     {
         nodeTouchHandlerDict.Clear();
         PtrIntDict.Clear(nodeDict);
         PtrLst.Clear(spritePtrLst);
         Pool.Clear(spritePool);
     }
     else
     {
         if (nodeTouchHandlerDict.ContainsKey(cmd.id))
         {
             nodeTouchHandlerDict.Remove(cmd.id);
         }
         void *node = PtrIntDict.Remove(nodeDict, cmd.id);
         PtrLst.Remove(spritePtrLst, node);
         Pool.Free(spritePool, node);
     }
 }
Exemplo n.º 2
0
 public static void ReleaseAtlases(params int[] ids)
 {
     for (int i = 0, len = ids.Length; i < len; i += 1)
     {
         int id        = ids[i];
         var atlasMeta = (TpAtlasMeta *)atlasMetaLst->arr[i];
         if (atlasMeta->name == id)
         {
             ReleaseTexture(id);
             for (int j = 0, jlen = atlasMeta->spriteCount; j < jlen; j += 1)
             {
                 var spriteMeta = atlasMeta->sprites + j;
                 PtrIntDict.Remove(spriteMetaDict, spriteMeta->name);
             }
             TpAtlasMeta.Decon(atlasMeta); Mem.Free(atlasMeta);
             PtrLst.RemoveAt(atlasMetaLst, i);
             i -= 1;
         }
     }
 }