Example #1
0
        /// <summary>
        /// If this MipMap is a LifoReference, then this Method will try to load the Lifo Data
        /// </summary>
        public void GetReferencedLifo()
        {
            if (datatype == MipMapType.LifoReference)
            {
                SimPe.Interfaces.Scenegraph.IScenegraphFileIndex nfi = FileTable.FileIndex.AddNewChild();
                nfi.AddIndexFromPackage(this.parent.Parent.Package);
                bool succ = GetReferencedLifo_NoLoad();
                FileTable.FileIndex.RemoveChild(nfi);
                nfi.Clear();

                if (!succ && !FileTable.FileIndex.Loaded)
                {
                    FileTable.FileIndex.Load();
                    GetReferencedLifo_NoLoad();
                }
            }
        }
Example #2
0
        /// <summary>
        /// Returns the RCOL which lists this Resource in it's ReferencedFiles Attribute
        /// </summary>
        /// <param name="type">the Type of the ressource youar looking for</param>
        /// <returns>null or the RCOl Ressource</returns>
        public Rcol FindReferencingParent(uint type)
        {
            SimPe.Interfaces.Scenegraph.IScenegraphFileIndex nfi = FileTable.FileIndex.AddNewChild();
            nfi.AddIndexFromPackage(this.Parent.Package);
            Rcol rcol = FindReferencingParent_NoLoad(type);

            FileTable.FileIndex.RemoveChild(nfi);
            nfi.Clear();

            if (rcol == null && !FileTable.FileIndex.Loaded)
            {
                FileTable.FileIndex.Load();
                rcol = FindReferencingParent_NoLoad(type);
            }

            if (rcol == null)
            {
                throw new Warning("No Parent was found in the Search Path!", "Either there is no Scenegraph Resource that is referencing the File, or the package containing that Resource is not in the FileTable (see Extra->Preferences...)");
            }
            return(rcol);
        }