コード例 #1
0
        public LingoHandler(ScriptChunk script, ShockwaveReader input)
            : this(script)
        {
            NameIndex             = input.ReadBigEndian <short>();
            HandlerVectorPosition = input.ReadBigEndian <short>();

            Body        = new LingoHandlerBody(this, input);
            _codeOffset = input.ReadBigEndian <int>();

            Arguments.Capacity = input.ReadBigEndian <short>();
            _argumentsOffset   = input.ReadBigEndian <int>();

            Locals.Capacity = input.ReadBigEndian <short>();
            _localsOffset   = input.ReadBigEndian <int>();

            short unk1Length = input.ReadBigEndian <short>();
            int   unk1Offset = input.ReadBigEndian <int>();

            int unk2Length = input.ReadBigEndian <int>();
            int unk2Offset = input.ReadBigEndian <short>();

            BytesPerLine.Capacity = input.ReadBigEndian <short>();
            _lineOffset           = input.ReadBigEndian <int>();

            Body.StackHeight = input.ReadBigEndian <int>();
        }
コード例 #2
0
        public LingoHandler(LingoScriptChunk script, ref ShockwaveReader input)
            : this(script)
        {
            NameIndex             = input.ReadInt16();
            HandlerVectorPosition = input.ReadInt16();

            Body = new LingoHandlerBody(this, ref input);
            int codeOffset = input.ReadInt32();

            Arguments.Capacity = input.ReadInt16();
            int argumentsOffset = input.ReadInt32();

            Locals.Capacity = input.ReadInt16();
            int localsOffset = input.ReadInt32();

            input.ReadInt16(); //offset(?)
            input.ReadInt32(); //length(?)

            input.ReadInt32(); //offset?
            input.ReadInt16(); //length?

            BytesPerLine.Capacity = input.ReadInt16();
            int lineOffset = input.ReadInt32();

            Body.StackHeight = input.ReadInt32();

            int handlerEndOffset = input.Position;

            input.Position = codeOffset;
            input.ReadBytes(Body.Code);

            input.Position = argumentsOffset;
            for (int i = 0; i < Arguments.Capacity; i++)
            {
                Arguments.Add(input.ReadInt16());
            }

            input.Position = localsOffset;
            for (int i = 0; i < Locals.Capacity; i++)
            {
                Locals.Add(input.ReadInt16());
            }

            input.Position = lineOffset;
            for (int i = 0; i < BytesPerLine.Capacity; i++)
            {
                BytesPerLine.Add(input.ReadByte());
            }

            input.Position = handlerEndOffset;
        }