예제 #1
0
        public BitmapCastProperties(ref ShockwaveReader input)
        {
            int v27 = input.ReadUInt16();

            TotalWidth = v27 & 0x7FFF; //TODO: what does that last bit even do.. some sneaky flag?
            //DIRAPI checks if TotalWidth & 0x8000 == 0

            Rectangle      = input.ReadRect();
            AlphaThreshold = input.ReadByte();
            OLE            = input.ReadBytes(7).ToArray();

            RegistrationPoint = input.ReadPoint();

            Flags = (BitmapFlags)input.ReadByte();

            if (!input.IsDataAvailable)
            {
                return;
            }
            BitDepth = input.ReadByte();

            if (!input.IsDataAvailable)
            {
                return;
            }
            Palette = input.ReadInt32();

            //TODO: PaletteRef or something
            if (!IsSystemPalette)
            {
                Palette &= 0x7FFF;
            }
        }
예제 #2
0
        public Frame(ref ShockwaveReader input)
        {
            Debug.WriteLine("## Frame start");

            long endOffset = input.Position + input.ReadInt16();

            if ((endOffset - input.Position) < 0)
            {
                Debugger.Break(); //We at padding of the framez I guess
            }
            while ((endOffset - input.Position) > 0)
            {
                short  channelLength     = input.ReadInt16();
                ushort channelOffset     = input.ReadUInt16();
                ReadOnlySpan <byte> data = input.ReadBytes(channelLength);

                Debug.WriteLine($"Channel: {channelOffset / 48} To: {channelOffset} | Len: {channelLength} | Left: {(endOffset - input.Position)}");
            }
        }
예제 #3
0
        public ConfigChunk(ref ShockwaveReader input, ChunkHeader header)
            : base(header)
        {
            input.IsBigEndian = true;

            input.ReadInt16();
            Version = (DirectorVersion)input.ReadUInt16();

            StageRectangle = input.ReadRect();

            MinMember = input.ReadInt16();      //Obsolete
            MaxMember = input.ReadInt16();      //Obsolete

            Tempo = input.ReadByte();           // == 0 => 20
            Remnants.Enqueue(input.ReadByte()); //LightSwitch

            byte g = input.ReadByte();          //??
            byte b = input.ReadByte();          //??

            Remnants.Enqueue(input.ReadInt16());
            Remnants.Enqueue(input.ReadInt16()); //768 - Seen this one alot in DIRAPI
            Remnants.Enqueue(input.ReadInt16());

            byte r = input.ReadByte(); //??????????

            StageBackgroundColor = Color.FromArgb(r, g, b);

            Remnants.Enqueue(input.ReadByte());
            Remnants.Enqueue(input.ReadInt16());
            Remnants.Enqueue(input.ReadByte()); //-2 when version < 0x551
            Remnants.Enqueue(input.ReadByte());
            Remnants.Enqueue(input.ReadInt32());

            MovieVersion = (DirectorVersion)input.ReadInt16();
            Remnants.Enqueue(input.ReadInt16());//16?
            Remnants.Enqueue(input.ReadInt32());
            Remnants.Enqueue(input.ReadInt32());
            Remnants.Enqueue(input.ReadInt32());
            Remnants.Enqueue(input.ReadByte());
            Remnants.Enqueue(input.ReadByte());
            Remnants.Enqueue(input.ReadInt16());
            Remnants.Enqueue(input.ReadInt16());

            RandomNumber = input.ReadInt16();

            Remnants.Enqueue(input.ReadInt32());
            Remnants.Enqueue(input.ReadInt32());
            OldDefaultPalette = input.ReadInt16();
            Remnants.Enqueue(input.ReadInt16());
            Remnants.Enqueue(input.ReadInt32());

            DefaultPalette = input.ReadInt32(); //TODO:
            //two int16?? ^^

            Remnants.Enqueue(input.ReadInt16()); //two bytes? - IDA

            Remnants.Enqueue(input.ReadInt16());

            if (!input.IsDataAvailable)
            {
                return;
            }

            DownloadFramesBeforePlaying = input.ReadInt32(); //90
            //Zeros
            Remnants.Enqueue(input.ReadInt16());
            Remnants.Enqueue(input.ReadInt16());
            Remnants.Enqueue(input.ReadInt16());
            Remnants.Enqueue(input.ReadInt16());
            Remnants.Enqueue(input.ReadInt16());
            Remnants.Enqueue(input.ReadInt16());
        }