コード例 #1
0
        internal WorldRenderer(ModData modData, World world)
        {
            World     = world;
            TileSize  = World.Map.Grid.TileSize;
            TileScale = World.Map.Grid.Type == MapGridType.RectangularIsometric ? 1448 : 1024;
            Viewport  = new Viewport(this, world.Map);

            createPaletteReference = CreatePaletteReference;

            var mapGrid = modData.Manifest.Get <MapGrid>();

            enableDepthBuffer = mapGrid.EnableDepthBuffer;

            foreach (var pal in world.TraitDict.ActorsWithTrait <ILoadsPalettes>())
            {
                pal.Trait.LoadPalettes(this);
            }

            foreach (var p in world.Players)
            {
                UpdatePalettesForPlayer(p.InternalName, p.Color, false);
            }

            palette.Initialize();

            Theater         = new Theater(world.Map.Rules.TileSet);
            terrainRenderer = new TerrainRenderer(world, this);

            debugVis = Exts.Lazy(() => world.WorldActor.TraitOrDefault <DebugVisualizations>());
        }
コード例 #2
0
        internal WorldRenderer(ModData modData, World world)
        {
            World    = world;
            TileSize = World.Map.Grid.TileSize;
            Viewport = new Viewport(this, world.Map);

            createPaletteReference = CreatePaletteReference;

            var mapGrid = modData.Manifest.Get <MapGrid>();

            enableDepthBuffer = mapGrid.EnableDepthBuffer;

            foreach (var pal in world.TraitDict.ActorsWithTrait <ILoadsPalettes>())
            {
                pal.Trait.LoadPalettes(this);
            }

            foreach (var p in world.Players)
            {
                UpdatePalettesForPlayer(p.InternalName, p.Color, false);
            }

            palette.Initialize();

            Theater         = new Theater(world.Map.Rules.TileSet);
            terrainRenderer = new TerrainRenderer(world, this);

            devTrait = Exts.Lazy(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait <DeveloperMode>() : null);
        }
コード例 #3
0
        internal WorldRenderer(World world)
        {
            this.world   = world;
            this.palette = Game.modData.Palette;
            foreach (var pal in world.traitDict.ActorsWithTraitMultiple <IPalette>(world))
            {
                pal.Trait.InitPalette(this);
            }

            terrainRenderer = new TerrainRenderer(world, this);
            shroudRenderer  = new ShroudRenderer(world);
        }
コード例 #4
0
        internal WorldRenderer(World world)
        {
            this.world = world;
            palette    = new HardwarePalette();

            palettes = new Cache <string, PaletteReference>(CreatePaletteReference);
            foreach (var pal in world.traitDict.ActorsWithTraitMultiple <IPalette>(world))
            {
                pal.Trait.InitPalette(this);
            }

            palette.Initialize();

            terrainRenderer = new TerrainRenderer(world, this);
            shroudRenderer  = new ShroudRenderer(world);
        }
コード例 #5
0
ファイル: WorldRenderer.cs プロジェクト: JackKucan/OpenRA
		internal WorldRenderer(World world)
		{
			this.world = world;
			Viewport = new Viewport(this, world.Map);
			palette = new HardwarePalette();

			palettes = new Dictionary<string, PaletteReference>();
			foreach (var pal in world.traitDict.ActorsWithTrait<ILoadsPalettes>())
				pal.Trait.LoadPalettes(this);

			palette.Initialize();

			Theater = new Theater(world.TileSet);
			terrainRenderer = new TerrainRenderer(world, this);

			devTrait = Exts.Lazy(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait<DeveloperMode>() : null);
		}
コード例 #6
0
ファイル: WorldRenderer.cs プロジェクト: Generalcamo/OpenRA
        internal WorldRenderer(World world)
        {
            this.world = world;
            Viewport = new Viewport(this, world.Map);
            palette = new HardwarePalette();

            palettes = new Cache<string, PaletteReference>(CreatePaletteReference);
            foreach (var pal in world.traitDict.ActorsWithTraitMultiple<IPalette>(world))
                pal.Trait.InitPalette(this);

            palette.Initialize();

            Theater = new Theater(world.TileSet);
            terrainRenderer = new TerrainRenderer(world, this);

            devTrait = Lazy.New(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait<DeveloperMode>() : null);
        }
コード例 #7
0
ファイル: WorldRenderer.cs プロジェクト: wytsep/OpenRA
        internal WorldRenderer(World world)
        {
            this.world = world;
            Viewport   = new Viewport(this, world.Map);
            palette    = new HardwarePalette();

            palettes = new Dictionary <string, PaletteReference>();
            foreach (var pal in world.traitDict.ActorsWithTrait <ILoadsPalettes>())
            {
                pal.Trait.LoadPalettes(this);
            }

            palette.Initialize();

            Theater         = new Theater(world.TileSet);
            terrainRenderer = new TerrainRenderer(world, this);

            devTrait = Exts.Lazy(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait <DeveloperMode>() : null);
        }
コード例 #8
0
ファイル: WorldRenderer.cs プロジェクト: xbayrockx/OpenRA
        internal WorldRenderer(World world)
        {
            this.world = world;
            Viewport   = new Viewport(this, world.Map);
            palette    = new HardwarePalette();

            palettes = new Cache <string, PaletteReference>(CreatePaletteReference);
            foreach (var pal in world.traitDict.ActorsWithTraitMultiple <IPalette>(world))
            {
                pal.Trait.InitPalette(this);
            }

            palette.Initialize();

            Theater         = new Theater(world.TileSet);
            terrainRenderer = new TerrainRenderer(world, this);

            devTrait = Lazy.New(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait <DeveloperMode>() : null);
        }
コード例 #9
0
ファイル: WorldRenderer.cs プロジェクト: ushardul/OpenRA
        internal WorldRenderer(World world)
        {
            World = world;
            Viewport = new Viewport(this, world.Map);

            createPaletteReference = CreatePaletteReference;

            foreach (var pal in world.TraitDict.ActorsWithTrait<ILoadsPalettes>())
                pal.Trait.LoadPalettes(this);

            foreach (var p in world.Players)
                UpdatePalettesForPlayer(p.InternalName, p.Color, false);

            palette.Initialize();

            Theater = new Theater(world.TileSet);
            terrainRenderer = new TerrainRenderer(world, this);

            devTrait = Exts.Lazy(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait<DeveloperMode>() : null);
        }
コード例 #10
0
ファイル: WorldRenderer.cs プロジェクト: Blackbird88/OpenRA
        internal WorldRenderer(World world)
        {
            World    = world;
            Viewport = new Viewport(this, world.Map);

            createPaletteReference = CreatePaletteReference;

            foreach (var pal in world.TraitDict.ActorsWithTrait <ILoadsPalettes>())
            {
                pal.Trait.LoadPalettes(this);
            }

            foreach (var p in world.Players)
            {
                UpdatePalettesForPlayer(p.InternalName, p.Color, false);
            }

            palette.Initialize();

            Theater         = new Theater(world.TileSet);
            terrainRenderer = new TerrainRenderer(world, this);

            devTrait = Exts.Lazy(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait <DeveloperMode>() : null);
        }
コード例 #11
0
ファイル: WorldRenderer.cs プロジェクト: pchote/OpenRA
        internal WorldRenderer(ModData modData, World world)
        {
            World = world;
            TileSize = World.Map.Grid.TileSize;
            Viewport = new Viewport(this, world.Map);

            createPaletteReference = CreatePaletteReference;

            var mapGrid = modData.Manifest.Get<MapGrid>();
            enableDepthBuffer = mapGrid.EnableDepthBuffer;

            foreach (var pal in world.TraitDict.ActorsWithTrait<ILoadsPalettes>())
                pal.Trait.LoadPalettes(this);

            foreach (var p in world.Players)
                UpdatePalettesForPlayer(p.InternalName, p.Color, false);

            palette.Initialize();

            Theater = new Theater(world.Map.Rules.TileSet);
            terrainRenderer = new TerrainRenderer(world, this);

            devTrait = Exts.Lazy(() => world.LocalPlayer != null ? world.LocalPlayer.PlayerActor.Trait<DeveloperMode>() : null);
        }