OurSonic.SonicManager.drawDebugTextChunks C# (CSharp) Method

drawDebugTextChunks() private method

private drawDebugTextChunks ( CanvasRenderingContext2D canvas, int fxP, int fyP, Point offs, Point localPoint ) : void
canvas System.Html.Media.Graphics.CanvasRenderingContext2D
fxP int
fyP int
offs Point
localPoint Point
return void
        private void drawDebugTextChunks(CanvasRenderingContext2D canvas, int fxP, int fyP, Point[] offs, Point localPoint)
        {
            foreach (Point off in offs)
            {
                int _xP = fxP + off.X;
                int _yP = fyP + off.Y;
                int _xPreal = fxP + off.X;
                int _yPreal = fyP + off.Y;
                //if (_xP < 0 || _xP >= SonicLevel.LevelWidth) continue;
                _xP = Help.Mod(_xP, SonicLevel.LevelWidth);
                _yP = Help.Mod(_yP, SonicLevel.LevelHeight);
                TileChunk chunk = SonicLevel.GetChunkAt(_xP, _yP);
                if (chunk == null) continue;

                localPoint.X = (_xPreal * 128) - WindowLocation.X;
                localPoint.Y = (_yPreal * 128) - WindowLocation.Y;

                if (!chunk.IsEmpty() && !chunk.OnlyForeground())
                    chunk.DrawAnimationDebug(canvas, localPoint, ChunkLayer.Low, TileChunkDebugDrawOptions);

                if (!chunk.IsEmpty() && !chunk.OnlyBackground())
                    chunk.DrawAnimationDebug(canvas, localPoint, ChunkLayer.High, TileChunkDebugDrawOptions);
            }
        }