コード例 #1
0
ファイル: SideDef.cs プロジェクト: MSylvia/DoomEngine
 public SideDef(Fixed textureOffset, Fixed rowOffset, int topTexture, int bottomTexture, int middleTexture, Sector sector)
 {
     this.textureOffset = textureOffset;
     this.rowOffset     = rowOffset;
     this.topTexture    = topTexture;
     this.bottomTexture = bottomTexture;
     this.middleTexture = middleTexture;
     this.sector        = sector;
 }
コード例 #2
0
ファイル: Subsector.cs プロジェクト: MSylvia/DoomEngine
 public Subsector(Sector sector, int segCount, int firstSeg)
 {
     this.sector   = sector;
     this.segCount = segCount;
     this.firstSeg = firstSeg;
 }
コード例 #3
0
        public Map(TextureLookup textures, FlatLookup flats, TextureAnimation animation, World world)
        {
            try
            {
                this.textures  = textures;
                this.flats     = flats;
                this.animation = animation;
                this.world     = world;

                var options = world.Options;

                string name;

                if (DoomApplication.Instance.IWad == "doom2" ||
                    DoomApplication.Instance.IWad == "freedoom2" ||
                    DoomApplication.Instance.IWad == "plutonia" ||
                    DoomApplication.Instance.IWad == "tnt")
                {
                    name = "MAP" + options.Map.ToString("00");
                }
                else
                {
                    name = "E" + options.Episode + "M" + options.Map;
                }

                Console.Write("Load map '" + name + "': ");

                var map = $"MAPS/{name}/";

                if (!DoomApplication.Instance.FileSystem.Files().Any(file => file.StartsWith(map)))
                {
                    throw new Exception("Map '" + name + "' was not found!");
                }

                this.vertices   = Vertex.FromWad($"{map}VERTEXES");
                this.sectors    = Sector.FromWad($"{map}SECTORS", flats);
                this.sides      = SideDef.FromWad($"{map}SIDEDEFS", textures, this.sectors);
                this.lines      = LineDef.FromWad($"{map}LINEDEFS", this.vertices, this.sides);
                this.segs       = Seg.FromWad($"{map}SEGS", this.vertices, this.lines);
                this.subsectors = Subsector.FromWad($"{map}SSECTORS", this.segs);
                this.nodes      = Node.FromWad($"{map}NODES", this.subsectors);
                this.things     = MapThing.FromWad($"{map}THINGS");
                this.blockMap   = BlockMap.FromWad($"{map}BLOCKMAP", this.lines);
                this.reject     = Reject.FromWad($"{map}REJECT", this.sectors);

                this.GroupLines();

                this.skyTexture = this.GetSkyTextureByMapName(name);

                if (DoomApplication.Instance.IWad == "doom2" ||
                    DoomApplication.Instance.IWad == "freedoom2" ||
                    DoomApplication.Instance.IWad == "plutonia" ||
                    DoomApplication.Instance.IWad == "tnt")
                {
                    if (DoomApplication.Instance.IWad == "plutonia")
                    {
                        this.title = DoomInfo.MapTitles.Plutonia[options.Map - 1];
                    }
                    else if (DoomApplication.Instance.IWad == "tnt")
                    {
                        this.title = DoomInfo.MapTitles.Tnt[options.Map - 1];
                    }
                    else
                    {
                        this.title = DoomInfo.MapTitles.Doom2[options.Map - 1];
                    }
                }
                else
                {
                    this.title = DoomInfo.MapTitles.Doom[options.Episode - 1][options.Map - 1];
                }

                Console.WriteLine("OK");
            }
            catch (Exception e)
            {
                Console.WriteLine("Failed");
                ExceptionDispatchInfo.Throw(e);
            }
        }