private bool LoadFile(byte[] Bytes)
        {
            originalFile = Bytes;

            Header       = new LuxPainEvtHeader();
            Header.Magic = BitConverter.ToUInt32(Bytes, 0x00);
            if (Header.Magic != 0x31304353)
            {
                return(false);
            }
            Header.Unknown1            = BitConverter.ToUInt32(Bytes, 0x04);
            Header.Unknown2            = BitConverter.ToUInt32(Bytes, 0x08);
            Header.Unknown3            = BitConverter.ToUInt32(Bytes, 0x0C);
            Header.TextOffsetsLocation = BitConverter.ToUInt32(Bytes, 0x10);
            Header.TextLocation        = BitConverter.ToUInt32(Bytes, 0x14);

            UInt32 PredictedTextAmount = (Header.TextLocation - Header.TextOffsetsLocation) / 2;

            TextEntries = new List <LuxPainEvtText>((int)PredictedTextAmount);

            for (UInt32 loc = Header.TextOffsetsLocation; loc < Header.TextLocation; loc += 2)
            {
                LuxPainEvtText txt = new LuxPainEvtText();
                txt.OffsetLocation = loc;
                txt.Offset         = BitConverter.ToUInt16(Bytes, (int)loc);

                txt.Text = LuxPainUtil.GetTextLuxPain((int)(Header.TextLocation + (txt.Offset * 2)), Bytes);

                TextEntries.Add(txt);
            }

            //foreach (LuxPainEvtText t in TextEntries)
            //{
            //    Console.WriteLine(t.Text);
            //}

            return(true);
        }
Esempio n. 2
0
        private bool LoadFile( byte[] Bytes )
        {
            originalFile = Bytes;

            Header = new LuxPainEvtHeader();
            Header.Magic = BitConverter.ToUInt32( Bytes, 0x00 );
            if ( Header.Magic != 0x31304353 ) return false;
            Header.Unknown1 = BitConverter.ToUInt32( Bytes, 0x04 );
            Header.Unknown2 = BitConverter.ToUInt32( Bytes, 0x08 );
            Header.Unknown3 = BitConverter.ToUInt32( Bytes, 0x0C );
            Header.TextOffsetsLocation = BitConverter.ToUInt32( Bytes, 0x10 );
            Header.TextLocation = BitConverter.ToUInt32( Bytes, 0x14 );

            UInt32 PredictedTextAmount = ( Header.TextLocation - Header.TextOffsetsLocation ) / 2;
            TextEntries = new List<LuxPainEvtText>( (int)PredictedTextAmount );

            for ( UInt32 loc = Header.TextOffsetsLocation; loc < Header.TextLocation; loc += 2 ) {
                LuxPainEvtText txt = new LuxPainEvtText();
                txt.OffsetLocation = loc;
                txt.Offset = BitConverter.ToUInt16( Bytes, (int)loc );

                txt.Text = LuxPainUtil.GetTextLuxPain( (int)( Header.TextLocation + ( txt.Offset * 2 ) ), Bytes );

                TextEntries.Add( txt );
            }

            //foreach (LuxPainEvtText t in TextEntries)
            //{
            //    Console.WriteLine(t.Text);
            //}

            return true;
        }