Exemple #1
0
        public LabData(Stream input)
        {
            BinaryReader reader = new BinaryReader(input);

            reader.ReadByte();
            Scale1       = reader.ReadByte();
            CameraHeight = reader.ReadByte();
            CameraAngle  = reader.ReadByte();
            reader.ReadInt16();
            Background = reader.ReadByte();
            reader.ReadBytes(3);
            FogDistance = reader.ReadByte();
            reader.ReadBytes(13);
            MaxLightStrength = reader.ReadByte();
            reader.ReadByte();
            Scale2 = reader.ReadByte();
            reader.ReadBytes(3);
            ViewDistance = reader.ReadByte();
            reader.ReadBytes(7);

            short numobjects = reader.ReadInt16();

            Objects = new ObjectData[numobjects];
            for (int i = 0; i < numobjects; i++)
            {
                Objects[i] = new ObjectData(reader);
            }

            short numfloors = reader.ReadInt16();

            Floors = new FloorData[numfloors];
            for (int i = 0; i < numfloors; i++)
            {
                Floors[i] = new FloorData(reader);
            }

            short numoinfos = reader.ReadInt16();

            ObjectInfos = new ObjectInfo[numoinfos];
            for (int i = 0; i < numoinfos; i++)
            {
                ObjectInfos[i] = new ObjectInfo(reader);
            }

            short numwalls = reader.ReadInt16();

            Walls = new WallData[numwalls];
            for (int i = 0; i < numwalls; i++)
            {
                Walls[i] = new WallData(reader);
            }
        }
Exemple #2
0
        public LabData(Stream input)
        {
            BinaryReader reader = new BinaryReader(input);
            reader.ReadByte();
            Scale1 = reader.ReadByte();
            CameraHeight = reader.ReadByte();
            CameraAngle = reader.ReadByte();
            reader.ReadInt16();
            Background = reader.ReadByte();
            reader.ReadBytes(3);
            FogDistance = reader.ReadByte();
            reader.ReadBytes(13);
            MaxLightStrength = reader.ReadByte();
            reader.ReadByte();
            Scale2 = reader.ReadByte();
            reader.ReadBytes(3);
            ViewDistance = reader.ReadByte();
            reader.ReadBytes(7);

            short numobjects = reader.ReadInt16();
            Objects = new ObjectData[numobjects];
            for(int i = 0; i < numobjects; i++)
            {
                Objects[i] = new ObjectData(reader);
            }

            short numfloors = reader.ReadInt16();
            Floors = new FloorData[numfloors];
            for(int i = 0; i < numfloors; i++)
            {
                Floors[i] = new FloorData(reader);
            }

            short numoinfos = reader.ReadInt16();
            ObjectInfos = new ObjectInfo[numoinfos];
            for(int i = 0; i < numoinfos; i++)
            {
                ObjectInfos[i] = new ObjectInfo(reader);
            }

            short numwalls = reader.ReadInt16();
            Walls = new WallData[numwalls];
            for(int i = 0; i < numwalls; i++)
            {
                Walls[i] = new WallData(reader);
            }
        }
Exemple #3
0
        public static RawImage GetWall(int labdata, int wall)
        {
            LabData  ld       = LabData.GetLabData(labdata);
            WallData walldata = ld.GetWall(wall);

            int texture = walldata.Texture;
            var bg      = GameData.Walls3D.Open(texture);

            bg.Width  = walldata.TextureWidth;
            bg.Height = walldata.TextureHeight;
            var plane = new GraphicPlane(bg.Width, bg.Height);

            plane.Background = bg;

            /*foreach(var ovrl in walldata.Overlays)
             * {
             *      var img = GameData.Overlays3D.Open(ovrl.Texture);
             *      img.Width = ovrl.TextureWidth;
             *      img.Height = ovrl.TextureHeight;
             *      plane.Objects.Add(new GraphicObject(img, new Point(ovrl.X, ovrl.Y)));
             * }*/
            plane.Bake();
            return((RawImage)plane.Background);
        }