Example #1
0
        public CLUTControl(TIMHeader header)
        {
            InitializeComponent();
            _header = header;

            UpdateCLUT();
        }
Example #2
0
        /// <summary>
        /// Read a color lookup table from a binary stream.
        /// </summary>
        /// <param name="br">The binary stream.</param>
        /// <param name="header">The header of the TIM.</param>
        public TIMColorLookup(BinaryReader br, TIMHeader header)
        {
            _header = header;

            CLUTLength = br.ReadUInt32();
            XPosition  = br.ReadUInt16();
            YPosition  = br.ReadUInt16();
            Width      = br.ReadUInt16();
            Height     = br.ReadUInt16();

            int singleClutLength      = _header.PixelMode == TIMHeader.PixelModes.CLUT4Bit ? 16 : 256;
            int singleClutLengthBytes = singleClutLength * 2;
            int numCluts = ((int)CLUTLength - CLUT_HEADER_SIZE_BYTES) / singleClutLengthBytes;

            Data = new Color16Bit[numCluts, singleClutLength];
            for (int i = 0; i < numCluts; i++)
            {
                for (int j = 0; j < singleClutLength; j++)
                {
                    Data[i, j] = new Color16Bit(br);
                }
            }
        }
Example #3
0
 public ClutEditorWindow(TIMHeader header)
 {
     InitializeComponent();
     clutControl1.Header = header.DeepClone();
     DialogResult        = DialogResult.Cancel;
 }