コード例 #1
0
 void DrawBlockLineSeparated(float[] data, int lastFrameIndex, int windowEnd, MyDrawArea scale, Color color)
 {
     if (lastFrameIndex > windowEnd)
     {
         DrawBlockLine(data, windowEnd, lastFrameIndex, scale, color);
     }
     else
     {
         DrawBlockLine(data, 0, lastFrameIndex, scale, color);
         DrawBlockLine(data, windowEnd, MyProfiler.MAX_FRAMES - 1, scale, color);
     }
 }
コード例 #2
0
        void DrawBlockLine(float[] data, int start, int end, MyDrawArea area, Color color)
        {
            Vector3 v0 = Vector3.Zero;
            Vector3 v1 = Vector3.Zero;

            for (int i = start + 1; i <= end; i++)
            {
                v0.X = -1.0f + area.x_start + area.x_scale * (i - 1) / 512.0f;
                v0.Y = area.y_start + data[i - 1] * area.y_scale / area.y_range;
                v0.Z = 0;

                v1.X = -1.0f + area.x_start + area.x_scale * i / 512.0f;
                v1.Y = area.y_start + data[i] * area.y_scale / area.y_range;
                v1.Z = 0;

                if (v0.Y - area.y_start > 1e-3f || v1.Y - area.y_start > 1e-3f)
                    DrawOnScreenLine(v0, v1, color);
            }
        }