Exemple #1
0
        private void CreateArrows()
        {
            GArrows = new List <GraphArrow>();
            // TODO: dont render all blocks

            // TODO: add thicc-nes
            // TODO: add 'points' so arrow end/start dont share start/destination
            // add arrow dict with block offsets if needed
            foreach (var GB in GBlocks)
            {
                // TODO: use both Block Index or Address Number for lines (merged block use block!)
                var thicc = GB.GetBlockWidth();
                if (GB.Block.JumpsTo == -1 && GB.Block.JumpsNext != -1)
                {
                    GArrows.Add(new GraphArrow(ref GBlocks)
                    {
                        Brush = blue2Brush,
                        Start = GB.Block.StartAddress,
                        End   = GB.Block.JumpsNext
                    });
                }
                else if (GB.Block.JumpsNext != -1)
                {
                    //GB.BoundryBox.Left += thicc;
                    //GB.BoundryBox.Right += thicc;
                    GArrows.Add(new GraphArrow(ref GBlocks)
                    {
                        //Brush = redBrush,
                        Brush = greenBrush, // colors are reverse due to jump skip logic
                        Start = GB.Block.StartAddress,
                        End   = GB.Block.JumpsNext
                    });
                }
                if (GB.Block.JumpsTo != -1)
                {
                    //GArrows.Add(block.JumpsToBlock, new RawVector2(((box.Left + box.Right) / 2), box.Bottom)); // green, jump OK
                    GArrows.Add(new GraphArrow(ref GBlocks)
                    {
                        //Brush = greenBrush,
                        Brush = redBrush, // colors are reverse due to jump skip logic
                        Start = GB.Block.StartAddress,
                        End   = GB.Block.JumpsTo
                    });
                }
            }
        }
Exemple #2
0
        private void CreateArrows()
        {
            GArrows = new List <GraphArrow>();
            // TODO: dont render all blocks

            // TODO: add thicc-nes
            // add arrow dict with block offsets if needed
            foreach (var GB in GBlocks)
            {
                var thicc = GB.GetBlockWidth();
                if (GB.Block.JumpsToBlock == -1 && GB.Block.NextBlock != -1)
                {
                    GArrows.Add(new GraphArrow(ref GBlocks)
                    {
                        Brush = blue2Brush,
                        Start = GB.Block.Address,
                        End   = GB.Block.NextBlock
                    });
                }
                else if (GB.Block.NextBlock != -1)
                {
                    //GB.BoundryBox.Left += thicc;
                    //GB.BoundryBox.Right += thicc;
                    GArrows.Add(new GraphArrow(ref GBlocks)
                    {
                        Brush = redBrush,
                        Start = GB.Block.Address,
                        End   = GB.Block.NextBlock
                    });
                }
                if (GB.Block.JumpsToBlock != -1)
                {
                    //GArrows.Add(block.JumpsToBlock, new RawVector2(((box.Left + box.Right) / 2), box.Bottom)); // green, jump OK
                    GArrows.Add(new GraphArrow(ref GBlocks)
                    {
                        Brush = greenBrush,
                        Start = GB.Block.Address,
                        End   = GB.Block.JumpsToBlock
                    });
                }
            }
        }