コード例 #1
0
        public static SimPe.Cache.ObjectCacheItem ObjectCacheItemFromPackage(SimPe.Interfaces.Files.IPackageFile pkg)
        {
            SimPe.Cache.ObjectCacheItem oci = new SimPe.Cache.ObjectCacheItem();

            oci.Class = SimPe.Cache.ObjectClass.Object;


            SimPe.Interfaces.Files.IPackedFileDescriptor[] pfds = pkg.FindFiles(Data.MetaData.OBJD_FILE);
            bool first = true;

            foreach (SimPe.Interfaces.Files.IPackedFileDescriptor pfd in pfds)
            {
                SimPe.Interfaces.Scenegraph.IScenegraphFileIndexItem[] items = FileTable.FileIndex.FindFile(pfd, pkg);
                foreach (SimPe.Interfaces.Scenegraph.IScenegraphFileIndexItem item in items)
                {
                    if (first || item.FileDescriptor.Instance == 0x41A7 || item.FileDescriptor.Instance == 0x41AF)
                    {
                        oci.Tag     = item;
                        oci.Useable = false;

                        ObjectConsumer.DoConsume(oci, null, Helper.WindowsRegistry.LanguageCode);

                        first = false;
                    }
                }
            }

            return(oci);
        }
コード例 #2
0
        public void LoadData()
        {
            Wait.SubStart();
            FileTable.FileIndex.Load();

            ObjectReader   erz  = new ObjectReader();
            ObjectConsumer ver1 = new ObjectConsumer(erz);

            //ObjectConsumer ver2 = new ObjectConsumer(erz);

            ver1.LoadedItem += new LoadItemHandler(ver1_LoadedItem);
            //ver2.LoadedItem += new LoadItemHandler(ver1_LoadedItem);
            erz.Finished += new EventHandler(erz_Finished);
            Thread te  = new Thread(new ThreadStart(erz.start));
            Thread tv1 = new Thread(new ThreadStart(ver1.start));

            //Thread tv2 = new Thread(new ThreadStart(ver2.start));
            te.Name  = "Object Loader: Producer";
            tv1.Name = "Object Loader: Consumer";
            te.Start();
            tv1.Start();
        }