private void UpdateGraphics(int address)
        {
            if (address < 0)
            {
                GraphicsAddress.Text = "0";
                address = 0;
            }

            if (showOverlays &&
                address > 0x2000)
            {
                GraphicsAddress.Text = "2000";
                address = 0x2000;
            }

            if (address > 0x3F000)
            {
                GraphicsAddress.Text = "3F000";
                address = 0x3F000;
            }

            if (showOverlays)
            {
                _graphicsAccessor.SetFullTable(_graphicsService.GetExtraTilesAtAddress(address));
            }
            else
            {
                _graphicsAccessor.SetFullTable(_graphicsService.GetTilesAtAddress(address));
            }

            _graphicsRenderer.Update();
            CopyTilesToEditor();
            UpdateGraphics();
            UpdateEditor();
        }
Example #2
0
        private void BlockSelector_TileBlockSelected(TileBlock tileBlock, int tileValue)
        {
            _ignoreChanges = true;

            if (_currentLevel != null)
            {
                TerrainList.SelectedValue     = _localTileTerrain.Where(t => t.HasTerrain(tileBlock.Property)).FirstOrDefault()?.Value;
                InteractionList.SelectedValue = _localTileTerrain.Where(t => t.HasTerrain(tileBlock.Property)).FirstOrDefault()?.Interactions.Where(i => i.HasInteraction(tileBlock.Property)).FirstOrDefault()?.Value;
            }
            else if (_currentWorld != null)
            {
                MapInteractionList.SelectedValue = _localMapTileInteraction.Where(t => t.HasInteraction(tileBlock.Property)).FirstOrDefault()?.Value;
            }

            _graphicsSetRenderer.Update(paletteIndex: (tileValue & 0xC0) >> 6);
            UpdateTileBlock();
            UpdateGraphics();

            _ignoreChanges = false;
        }