Beispiel #1
0
        public TXT1(ref EndianBinaryReader reader, ref MAT1 materials, ref FNL1 fonts) : base(ref reader)
        {
            base.setType("Text Box");

            long startPos = reader.Pos() - 0x4C;

            mBufferLength  = reader.ReadUInt16();
            mStringLength  = reader.ReadUInt16();
            mMaterialIdx   = reader.ReadUInt16();
            mFontNum       = reader.ReadUInt16();
            mAnotherOrigin = reader.ReadByte();
            mAlignment     = reader.ReadByte();

            reader.ReadBytes(0x2);
            mTextOffset    = reader.ReadUInt32();
            mTopColor      = reader.ReadRGBAColor8();
            mBottomColor   = reader.ReadRGBAColor8();
            mSizeX         = reader.ReadF32();
            mSizeY         = reader.ReadF32();
            mCharacterSize = reader.ReadF32();
            mLineSize      = reader.ReadF32();

            if (mStringLength != 0)
            {
                byte[] str = reader.ReadBytesFrom(startPos + mTextOffset, mStringLength - 2);
                mString = Encoding.GetEncoding(1201).GetString(str);
            }

            mMaterialName = materials.getMaterialNameFromIndex(mMaterialIdx);
            mFontName     = fonts.getFontNameFromIndex(mFontNum);

            reader.Seek(startPos + mSectionSize);
        }
Beispiel #2
0
        public WND1(ref EndianBinaryReader reader, ref MAT1 materials) : base(ref reader)
        {
            base.setType("Window");

            long startPos = reader.Pos() - 0x4C;

            mContentOverflowLeft   = reader.ReadF32();
            mContentOverflowRight  = reader.ReadF32();
            mContentOverflowTop    = reader.ReadF32();
            mContentOverflowBottom = reader.ReadF32();
            mFrameCount            = reader.ReadByte();
            mFlag = reader.ReadByte();
            reader.ReadUInt16(); // padding
            mWindowContentOffset = reader.ReadUInt32();
            mWindowFrameOffset   = reader.ReadUInt32();

            mTopLeftColor     = reader.ReadRGBAColor8();
            mTopRightColor    = reader.ReadRGBAColor8();
            mBottomLeftColor  = reader.ReadRGBAColor8();
            mBottomRightColor = reader.ReadRGBAColor8();
            mMaterialIndex    = reader.ReadUInt16();
            mNumUVSets        = reader.ReadByte();
            reader.ReadByte(); // padding

            mUVSets = new List <UVCoordSet>();

            for (byte i = 0; i < mNumUVSets; i++)
            {
                mUVSets.Add(reader.ReadUVCoordSet());
            }

            // now we read our window frames
            reader.Seek(startPos + mWindowFrameOffset);

            mFrameOffsets = new List <int>();

            for (byte i = 0; i < mFrameCount; i++)
            {
                mFrameOffsets.Add(reader.ReadInt32());
            }

            mFrames = new List <WND1Frame>();

            foreach (int offset in mFrameOffsets)
            {
                reader.Seek(startPos + offset);
                mFrames.Add(new WND1Frame(ref reader));
            }

            mMaterialName = materials.getMaterialNameFromIndex(mMaterialIndex);

            reader.Seek(startPos + mSectionSize);
        }
Beispiel #3
0
        public PIC1(ref EndianBinaryReader reader, ref MAT1 materials) : base(ref reader)
        {
            base.setType("Picture");

            mTopLeftColor     = reader.ReadRGBAColor8();
            mTopRightColor    = reader.ReadRGBAColor8();
            mBottomLeftColor  = reader.ReadRGBAColor8();
            mBottomRightColor = reader.ReadRGBAColor8();
            mMaterialIndex    = reader.ReadUInt16();
            mNumUVSets        = reader.ReadByte();
            mUnk5F            = reader.ReadByte();

            mUVCoordinates = new List <UVCoordSet>();

            for (byte i = 0; i < mNumUVSets; i++)
            {
                mUVCoordinates.Add(reader.ReadUVCoordSet());
            }

            mMaterialName = materials.getMaterialNameFromIndex(mMaterialIndex);
        }