Ejemplo n.º 1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load Voxel Model from Content Application
            m_voxelBrush = ImportContentVoxelBrush("monu1.vox");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Import Brush from Content Application
        /// </summary>
        /// <param name="_strName"></param>
        private CubeBrush ImportContentVoxelBrush(string _strName)
        {
            var stream = System.IO.File.OpenRead(Path.Combine(Content.RootDirectory, _strName));

            //Load From Content Application
            MagicaVoxelLoader loader = new MagicaVoxelLoader();
            BinaryReader      br     = new BinaryReader(stream);

            CubeBrush brush = null;

            if (loader.ReadFile(br) == true)
            {
                brush = new CubeBrush(this, loader.Array, loader.Palette);
                brush.GenerateMesh();
                brush.ApplyEditorEffect();
            }

            br.Dispose();

            return(brush);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Import Brush from Content Application
        /// </summary>
        /// <param name="_strName"></param>
        private CubeBrush ImportContentVoxelBrush(string _strName)
        {
            //Lecture assets sous android
            var stream = Game.Activity.Assets.Open(Path.Combine(Content.RootDirectory, _strName), Android.Content.Res.Access.Buffer);

            //Load From Content Application
            MagicaVoxelLoader loader = new MagicaVoxelLoader();
            BinaryReader      br     = new BinaryReader(stream);

            CubeBrush brush = null;

            if (loader.ReadFile(br) == true)
            {
                brush = new CubeBrush(this, loader.Array, loader.Palette);
                brush.GenerateMesh();
                brush.ApplyEditorEffect();
            }

            br.Dispose();

            return(brush);
        }