Exemplo n.º 1
0
        private void loadBitmaps(int daxBlockId, string fileName, List<Bitmap> bitmaps8x8)
        {
            // load 8x8 bitmaps from daxBlockId in fileName into the list bitmaps8x8 to simulate the order the bitmaps would be in memory in the game
            var file = new DaxImageFile(string.Format(fileName));
            foreach (DaxFileBlock block in file.Blocks)
            {

                if (block.Id == daxBlockId)
                {
                    var parameters = new FileBlockParameters
                    {
                        Data = block.Data,
                        Name = block.File,
                        Id = block.Id,
                    };
                    var render = new RenderBlockFactory().CreateUsing(parameters);
                    foreach (var bitmap in render.GetBitmaps())
                    {
                        bitmaps8x8.Add(bitmap);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private int getBitmapCount(int daxBlockId, string fileName)
        {
            // load 8x8 bitmaps from daxBlockId in fileName into the list bitmaps8x8 to simulate the order the bitmaps would be in memory in the game

            if (File.Exists(fileName) == false) return 0;
            var file = new DaxImageFile(string.Format(fileName));
            foreach (DaxFileBlock block in file.Blocks)
            {

                if (block.Id == daxBlockId)
                {
                    var parameters = new FileBlockParameters
                    {
                        Data = block.Data,
                        Name = block.File,
                        Id = block.Id,
                    };

                    var render = new RenderBlockFactory().CreateUsing(parameters);

                    var x = render.GetBitmaps().Count();
                    return x;

                }
            }

            return 0;
        }