コード例 #1
0
ファイル: Content.cs プロジェクト: mitchellbarney/FreeSO
        /// <summary>
        /// Creates a new instance of Content.
        /// </summary>
        /// <param name="basePath">Path to client directory.</param>
        /// <param name="device">A GraphicsDevice instance.</param>
        private Content(string basePath, GraphicsDevice device)
        {
            this.BasePath = basePath;
            this.Device   = device;

            Changes = new ChangeManager();

            UIGraphics         = new UIGraphicsProvider(this, Device);
            AvatarMeshes       = new AvatarMeshProvider(this, Device);
            AvatarBindings     = new AvatarBindingProvider(this);
            AvatarTextures     = new AvatarTextureProvider(this, Device);
            AvatarSkeletons    = new AvatarSkeletonProvider(this);
            AvatarAppearances  = new AvatarAppearanceProvider(this);
            AvatarOutfits      = new AvatarOutfitProvider(this);
            AvatarAnimations   = new AvatarAnimationProvider(this);
            AvatarPurchasables = new AvatarPurchasables(this);
            AvatarHandgroups   = new HandgroupProvider(this, Device);
            AvatarThumbnails   = new AvatarThumbnailProvider(this, Device);

            WorldObjects       = new WorldObjectProvider(this);
            WorldFloors        = new WorldFloorProvider(this);
            WorldWalls         = new WorldWallProvider(this);
            WorldObjectGlobals = new WorldGlobalProvider(this);
            WorldCatalog       = new WorldObjectCatalog();

            Audio        = new Audio(this);
            GlobalTuning = new Tuning(Path.Combine(basePath, "tuning.dat"));

            Init();
        }
コード例 #2
0
 public GameObjectReference(WorldObjectProvider provider)
 {
     this.Provider = provider;
 }
コード例 #3
0
ファイル: Content.cs プロジェクト: HarryFreeMyLand/newso
        /// <summary>
        /// Creates a new instance of Content.
        /// </summary>
        /// <param name="basePath">Path to client directory.</param>
        /// <param name="device">A GraphicsDevice instance.</param>
        private GameContent(string basePath, ContentMode mode, GraphicsDevice device, bool init)
        {
            LoadProgress = ContentLoadingProgress.Started;
            BasePath     = basePath;
            _device      = device;
            Mode         = mode;

            ImageLoader.PremultiplyPNG = 1;// (FSOEnvironment.DirectX)?0:1;

            if (device != null)
            {
                RCMeshes   = new RCMeshProvider(device);
                UIGraphics = new UIGraphicsProvider(this);
                if (TS1)
                {
                    TS1Global      = new TS1Provider(this);
                    AvatarTextures = new TS1AvatarTextureProvider(TS1Global);
                    AvatarMeshes   = new TS1BMFProvider(TS1Global);
                }
                else
                {
                    AvatarTextures = new AvatarTextureProvider(this);
                    AvatarMeshes   = new AvatarMeshProvider(this, _device);
                }
                AvatarHandgroups = new HandgroupProvider(this);
                AbstractTextureRef.FetchDevice        = device;
                AbstractTextureRef.ImageFetchFunction = AbstractTextureRef.ImageFetchWithDevice;
            }
            Changes  = new ChangeManager();
            CustomUI = new CustomUIProvider(this);

            if (TS1)
            {
                var provider = new TS1ObjectProvider(this, TS1Global);
                WorldObjects      = provider;
                WorldCatalog      = provider;
                BCFGlobal         = new TS1BCFProvider(this, TS1Global);
                AvatarAnimations  = new TS1BCFAnimationProvider(BCFGlobal);
                AvatarSkeletons   = new TS1BCFSkeletonProvider(BCFGlobal);
                AvatarAppearances = new TS1BCFAppearanceProvider(BCFGlobal);
                Audio             = new TS1Audio(this);
            }
            else
            {
                AvatarBindings    = new AvatarBindingProvider(this);
                AvatarAppearances = new AvatarAppearanceProvider(this);
                AvatarOutfits     = new AvatarOutfitProvider(this);

                AvatarPurchasables = new AvatarPurchasables(this);
                AvatarCollections  = new AvatarCollectionsProvider(this);
                AvatarThumbnails   = new AvatarThumbnailProvider(this);

                AvatarAnimations = new AvatarAnimationProvider(this);
                AvatarSkeletons  = new AvatarSkeletonProvider(this);
                WorldObjects     = new WorldObjectProvider(this);
                WorldCatalog     = new WorldObjectCatalog();
                Audio            = new Audio(this);
                CityMaps         = new CityMapsProvider(this);
                RackOutfits      = new RackOutfitsProvider(this);
                Ini          = new IniProvider(this);
                GlobalTuning = new Tuning(Path.Combine(basePath, "tuning.dat"));
            }
            WorldFloors        = new WorldFloorProvider(this);
            WorldWalls         = new WorldWallProvider(this);
            WorldObjectGlobals = new WorldGlobalProvider(this);
            WorldRoofs         = new WorldRoofProvider(this);

            InitBasic();
            if (init)
            {
                Init();
            }
        }
コード例 #4
0
ファイル: Content.cs プロジェクト: fourks/FreeSO
        /// <summary>
        /// Creates a new instance of Content.
        /// </summary>
        /// <param name="basePath">Path to client directory.</param>
        /// <param name="device">A GraphicsDevice instance.</param>
        private Content(string basePath, ContentMode mode, GraphicsDevice device)
        {
            this.BasePath = basePath;
            this.Device   = device;
            this.Mode     = mode;

            if (device != null)
            {
                UIGraphics = new UIGraphicsProvider(this);
                if (TS1)
                {
                    TS1Global      = new TS1Provider(this);
                    AvatarTextures = new TS1AvatarTextureProvider(TS1Global);
                    AvatarMeshes   = new TS1BMFProvider(TS1Global);
                }
                else
                {
                    AvatarTextures = new AvatarTextureProvider(this);
                    AvatarMeshes   = new AvatarMeshProvider(this, Device);
                }
                AvatarHandgroups = new HandgroupProvider(this);
                AbstractTextureRef.FetchDevice        = device;
                AbstractTextureRef.ImageFetchFunction = AbstractTextureRef.ImageFetchWithDevice;
            }
            Changes           = new ChangeManager();
            AvatarBindings    = new AvatarBindingProvider(this);
            AvatarAppearances = new AvatarAppearanceProvider(this);
            AvatarOutfits     = new AvatarOutfitProvider(this);

            AvatarPurchasables = new AvatarPurchasables(this);
            AvatarCollections  = new AvatarCollectionsProvider(this);
            AvatarThumbnails   = new AvatarThumbnailProvider(this);

            if (TS1)
            {
                var provider = new TS1ObjectProvider(this, TS1Global);
                WorldObjects      = provider;
                WorldCatalog      = provider;
                BCFGlobal         = new TS1BCFProvider(this, TS1Global);
                AvatarAnimations  = new TS1BCFAnimationProvider(BCFGlobal);
                AvatarSkeletons   = new TS1BCFSkeletonProvider(BCFGlobal);
                AvatarAppearances = new TS1BCFAppearanceProvider(BCFGlobal);
                Audio             = new TS1Audio(this);
            }
            else
            {
                AvatarAnimations = new AvatarAnimationProvider(this);
                AvatarSkeletons  = new AvatarSkeletonProvider(this);
                WorldObjects     = new WorldObjectProvider(this);
                WorldCatalog     = new WorldObjectCatalog();
                Audio            = new Audio(this);
            }
            WorldFloors        = new WorldFloorProvider(this);
            WorldWalls         = new WorldWallProvider(this);
            WorldObjectGlobals = new WorldGlobalProvider(this);
            WorldRoofs         = new WorldRoofProvider(this);

            GlobalTuning = new Tuning(Path.Combine(basePath, "tuning.dat"));
            Ini          = new IniProvider(this);
            CityMaps     = new CityMapsProvider(this);

            RackOutfits = new RackOutfitsProvider(this);

            Init();
        }