Ejemplo n.º 1
0
        public static TextureInfo Read(EndianBinaryReader reader, Pointer offset)
        {
            TextureInfo tex = new TextureInfo(offset);

            reader.ReadUInt32(); // 888 or 8888
            reader.ReadUInt16(); // 20
            reader.ReadUInt16();
            reader.ReadUInt32();
            reader.ReadUInt32();
            reader.ReadUInt32();
            tex.flags = reader.ReadUInt32();
            reader.ReadBytes(0x2E);
            if (MapLoader.Loader.mode != MapLoader.Mode.Rayman2PC)
            {
                reader.ReadUInt32();
            }
            tex.name = reader.ReadNullDelimitedString();
            return(tex);
        }
Ejemplo n.º 2
0
        public static State Read(EndianBinaryReader reader, Pointer offset, Family family)
        {
            MapLoader l = MapLoader.Loader;
            State     s = new State(offset, family);

            if (l.mode == MapLoader.Mode.Rayman3GC)
            {
                s.name = new string(reader.ReadChars(0x50)).TrimEnd('\0');
            }
            if (l.mode != MapLoader.Mode.RaymanArenaGC)
            {
                s.off_state_next = Pointer.Read(reader);
            }
            if (l.mode == MapLoader.Mode.Rayman3GC)
            {
                s.off_state_prev = Pointer.Read(reader);
                Pointer.Read(reader); // unknown offset, end of state array?
            }
            s.off_anim_ref = Pointer.Read(reader);
            s.off_state_transitions_first = Pointer.Read(reader);
            if (l.mode != MapLoader.Mode.RaymanArenaGC)
            {
                s.off_state_transitions_last = Pointer.Read(reader);                                         // same?
            }
            s.num_state_transitions = reader.ReadUInt32();
            reader.ReadUInt32();
            reader.ReadUInt32();
            if (l.mode != MapLoader.Mode.RaymanArenaGC)
            {
                reader.ReadUInt32();
            }
            s.off_state_auto = Pointer.Read(reader);
            Pointer.Read(reader); // fam end?
            if (l.mode != MapLoader.Mode.Rayman2PC)
            {
                s.off_cine_mapname = Pointer.Read(reader);
                s.off_cine_name    = Pointer.Read(reader);
            }
            reader.ReadByte();
            s.speed = reader.ReadByte();
            reader.ReadByte();
            reader.ReadByte();
            if (l.mode == MapLoader.Mode.Rayman2PC)
            {
                reader.ReadUInt32();
            }

            if (s.off_cine_mapname != null)
            {
                Pointer.Goto(ref reader, s.off_cine_mapname);
                s.cine_mapname = reader.ReadNullDelimitedString();
            }
            if (s.off_cine_name != null)
            {
                Pointer.Goto(ref reader, s.off_cine_name);
                s.cine_name = reader.ReadNullDelimitedString();
            }
            if (s.off_anim_ref != null)
            {
                Pointer.Goto(ref reader, s.off_anim_ref);
                s.anim_ref = AnimationReference.Read(reader, s.off_anim_ref);
            }

            return(s);
        }