Example #1
0
        /// <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();
            }
        }
Example #2
0
        /// <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();
        }