Example #1
0
        public ChunkUpdater( Game game, MapRenderer renderer )
        {
            this.game = game;
            this.renderer = renderer;
            info = game.BlockInfo;

            builder = new ChunkMeshBuilder( game );
            api = game.Graphics;

            game.Events.TerrainAtlasChanged += TerrainAtlasChanged;
            game.WorldEvents.OnNewMap += OnNewMap;
            game.WorldEvents.OnNewMapLoaded += OnNewMapLoaded;
            game.WorldEvents.EnvVariableChanged += EnvVariableChanged;
            game.Events.BlockDefinitionChanged += BlockDefinitionChanged;
            game.Events.ViewDistanceChanged += ViewDistanceChanged;
            game.Events.ProjectionChanged += ProjectionChanged;
        }
        public ChunkUpdater( Game game, MapRenderer renderer )
        {
            this.game = game;
            this.renderer = renderer;
            info = game.BlockInfo;

            renderer._1DUsed = game.TerrainAtlas1D.CalcMaxUsedRow( game.TerrainAtlas, info );
            renderer.totalUsed = new int[game.TerrainAtlas1D.TexIds.Length];
            RecalcBooleans( true );

            builder = new ChunkMeshBuilder( game );
            api = game.Graphics;
            elementsPerBitmap = game.TerrainAtlas1D.elementsPerBitmap;

            game.Events.TerrainAtlasChanged += TerrainAtlasChanged;
            game.WorldEvents.OnNewMap += OnNewMap;
            game.WorldEvents.OnNewMapLoaded += OnNewMapLoaded;
            game.WorldEvents.EnvVariableChanged += EnvVariableChanged;
            game.Events.BlockDefinitionChanged += BlockDefinitionChanged;
            game.Events.ViewDistanceChanged += ViewDistanceChanged;
            game.Events.ProjectionChanged += ProjectionChanged;
        }