Beispiel #1
0
        public static CollideMaterial Read(Reader reader, Pointer offset)
        {
            MapLoader       l  = MapLoader.Loader;
            CollideMaterial cm = new CollideMaterial(offset);

            //l.print(offset);

            if (Settings.s.game == Settings.Game.R2Revolution)
            {
                cm.type       = reader.ReadUInt16();
                cm.identifier = reader.ReadUInt16();
            }
            else
            {
                cm.type       = reader.ReadUInt16();
                cm.identifier = reader.ReadUInt16();
                if (Settings.s.engineVersion == Settings.EngineVersion.R3)
                {
                    cm.direction = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                    cm.coef      = reader.ReadSingle();
                }
                cm.typeForAI = reader.ReadUInt32();
            }

            // For specific games
            cm.identifier_R2 = (CollisionFlags_R2)cm.identifier;
            return(cm);
        }
Beispiel #2
0
        public static CollideMaterial FromOffsetOrRead(Pointer offset, Reader reader)
        {
            CollideMaterial cm = FromOffset(offset);

            if (cm == null)
            {
                Pointer off_current = Pointer.Goto(ref reader, offset);
                cm = CollideMaterial.Read(reader, offset);
                Pointer.Goto(ref reader, off_current);
                MapLoader.Loader.collideMaterials.Add(cm);
            }
            return(cm);
        }