Exemple #1
0
		public SpriteManager Clone()
		{
			SpriteManager clone = new SpriteManager(m_spritefile);
			clone.OverridePalette = OverridePalette;
			clone.UseOverride = UseOverride;

			return clone;
		}
Exemple #2
0
        protected override void Initialize()
        {
            m_subsystems = new SubSystems(this);
            m_subsystems.GetSubSystem<IO.FileSystem>().Initialize();
            m_subsystems.GetSubSystem<InitializationSettings>().Initialize();
            m_subsystems.GetSubSystem<Input.InputSystem>().Initialize();
            m_subsystems.GetSubSystem<Video.VideoSystem>().Initialize();

            //m_font = m_subsystems.GetSubSystem<Drawing.SpriteSystem>().LoadFont(@"font/num1.fnt");
            //m_sprites = m_subsystems.GetSubSystem<Drawing.SpriteSystem>().CreateManager(@"chars/BuraiYamamoto/Burai.sff");
            //m_animations = m_subsystems.GetSubSystem<Animations.AnimationSystem>().CreateManager(@"chars/BuraiYamamoto/Burai.air");

            m_sprites = m_subsystems.GetSubSystem<Drawing.SpriteSystem>().CreateManager(@"chars/kfm/kfm.sff");
            m_animations = m_subsystems.GetSubSystem<Animations.AnimationSystem>().CreateManager(@"chars/kfm/kfm.air");

            m_animations.SetLocalAnimation(0, 0);
            m_sprites.LoadSprites(m_animations.CurrentAnimation);

            m_subsystems.GetSubSystem<Input.InputSystem>().CurrentInput[0].Add(SystemButton.DebugDraw, this.Click);

            base.Initialize();
        }
Exemple #3
0
        public PlayerProfile(ProfileLoader loader, String playerpath, String stagepath)
        {
            if (playerpath == null) throw new ArgumentNullException("playerpath");
            if (loader == null) throw new ArgumentNullException("loader");

            m_loader = loader;

            //May be null
            m_playerstagepath = stagepath;

            IO.TextFile textfile = m_loader.SubSystems.GetSubSystem<IO.FileSystem>().OpenTextFile(playerpath);

            TextSection infosection = textfile.GetSection("info");
            if (infosection == null) throw new InvalidOperationException("No 'info' section in .def file");

            TextSection filesection = textfile.GetSection("files");
            if (filesection == null) throw new InvalidOperationException("No 'files' section in .def file");

            m_defpath = playerpath;
            m_basepath = Path.GetDirectoryName(textfile.Filepath);
            m_playername = infosection.GetAttribute<String>("name", String.Empty);
            m_displayname = infosection.GetAttribute<String>("displayname", m_playername);
            m_author = infosection.GetAttribute<String>("author", String.Empty);
            m_version = infosection.GetAttribute<String>("versiondate", String.Empty);
            m_mugenversion = infosection.GetAttribute<String>("mugenversion", String.Empty);
            m_paletteorder = BuildPaletteOrder(infosection.GetAttribute<String>("pal.defaults", null));
            m_commandfile = FilterPath(filesection.GetAttribute<String>("cmd", String.Empty));
            m_constantsfile = FilterPath(filesection.GetAttribute<String>("cns", String.Empty));
            m_commonstatefile = GetCommonStateFile(filesection.GetAttribute<String>("stcommon"));
            m_statesfiles = BuildStateFiles(filesection);
            m_spritesfile = FilterPath(filesection.GetAttribute<String>("sprite", String.Empty));
            m_animationfile = FilterPath(filesection.GetAttribute<String>("anim", String.Empty));
            m_soundfile = FilterPath(filesection.GetAttribute<String>("sound", String.Empty));
            m_palettefiles = BuildPaletteFiles(filesection);

            m_spritemanager = m_loader.SubSystems.GetSubSystem<Drawing.SpriteSystem>().CreateManager(SpritePath);

            SpriteManager.GetSprite(SpriteId.LargePortrait);
            SpriteManager.GetSprite(SpriteId.SmallPortrait);
        }