Exemplo n.º 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>());
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
		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);
		}
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
0
        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);
        }
Exemplo n.º 11
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);
        }