Exemplo n.º 1
0
        private void readPixels(EndianBinaryReader reader, ushort width, ushort height, AmfFile file)
        {
            int totalPixels = width * height;
            uint xLocation = 1;
            uint yLocation = 1;
            for (int i = 0; i < totalPixels; i++)
            {
                byte landTypeId = reader.ReadByte();
                byte climateId = reader.ReadByte();
                file.addPixel(new AmfPixelInfo(xLocation, yLocation, landTypeId, climateId));

                xLocation++;
                if (xLocation > width)
                {
                    xLocation = 1;
                    yLocation++;
                }
            }

            debugLine("pixel count: " + file.pixels.Count());
        }