-}
-
-const float netgraphcolors[3][4] =
-{
- {1 , 0.5, 0 , 1},
- {1 , 1 , 1 , 1},
- {0 , 1 , 0 , 1},
-};
-
-void SCR_DrawNetGraph_DrawConnection_Client (netconn_t *conn, int graphx, int graphy, int barwidth, int barheight, int bardivide, const char *labelincoming, int separator, const char *labeloutgoing, float textsize)
-{
- int numparameters;
- const int *parameters[3];
- // dim background
- DrawQ_Fill(graphx , graphy, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0);
- DrawQ_Fill(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0);
- // draw the bar graphs
- numparameters = 3;
- parameters[0] = conn->incoming_unreliablesize;
- parameters[1] = conn->incoming_reliablesize;
- parameters[2] = conn->incoming_acksize;
- SCR_DrawNetGraph_DrawGraph(graphx, graphy, barwidth, barheight, bardivide, labelincoming, textsize, conn->incoming_packetcounter, numparameters, parameters, netgraphcolors);
- parameters[0] = conn->outgoing_unreliablesize;
- parameters[1] = conn->outgoing_reliablesize;
- parameters[2] = conn->outgoing_acksize;
- SCR_DrawNetGraph_DrawGraph(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, barwidth, barheight, bardivide, labeloutgoing, textsize, conn->outgoing_packetcounter, numparameters, parameters, netgraphcolors);
- // draw labels
- DrawQ_String(graphx , graphy + barheight, labelincoming, 0, textsize, textsize, 1, 1, 1, 1, 0, NULL, false);
- DrawQ_String(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy + barheight, labeloutgoing, 0, textsize, textsize, 1, 1, 1, 1, 0, NULL, false);
-}
-
-void SCR_DrawNetGraph_DrawConnection_Server (netconn_t *conn, int graphx, int graphy, int barwidth, int barheight, int bardivide, const char *labeloutgoing, int separator, const char *labelincoming, float textsize)
-{
- int numparameters;
- const int *parameters[3];
- // dim background
- DrawQ_Fill(graphx , graphy, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0);
- DrawQ_Fill(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, barwidth * NETGRAPH_PACKETS, barheight + textsize, 0, 0, 0, 0.5, 0);
- // draw the bar graphs
- numparameters = 3;
- parameters[0] = conn->outgoing_unreliablesize;
- parameters[1] = conn->outgoing_reliablesize;
- parameters[2] = conn->outgoing_acksize;
- SCR_DrawNetGraph_DrawGraph(graphx , graphy, barwidth, barheight, bardivide, labeloutgoing, textsize, conn->outgoing_packetcounter, numparameters, parameters, netgraphcolors);
- parameters[0] = conn->incoming_unreliablesize;
- parameters[1] = conn->incoming_reliablesize;
- parameters[2] = conn->incoming_acksize;
- SCR_DrawNetGraph_DrawGraph(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy, barwidth, barheight, bardivide, labelincoming, textsize, conn->incoming_packetcounter, numparameters, parameters, netgraphcolors);
- // draw labels
- DrawQ_String(graphx , graphy + barheight, labeloutgoing, 0, textsize, textsize, 1, 1, 1, 1, 0, NULL, false);
- DrawQ_String(graphx + barwidth * NETGRAPH_PACKETS + separator, graphy + barheight, labelincoming, 0, textsize, textsize, 1, 1, 1, 1, 0, NULL, false);
+ // render the lines for the graph
+ for (j = 0;j < NETGRAPH_PACKETS;j++)
+ {
+ a = g[j];
+ b = g[(j+1)%NETGRAPH_PACKETS];
+ if (a[0] < 0.0f || b[0] > 1.0f || b[0] < a[0])
+ continue;
+ DrawQ_Line(0.0f, graphx + graphwidth * a[0], graphy + graphheight * a[2], graphx + graphwidth * b[0], graphy + graphheight * b[2], 1.0f, 1.0f, 0.0f, 1.0f, 0);
+ DrawQ_Line(0.0f, graphx + graphwidth * a[0], graphy + graphheight * a[1], graphx + graphwidth * b[0], graphy + graphheight * b[1], 1.0f, 0.0f, 0.0f, 1.0f, 0);
+ DrawQ_Line(0.0f, graphx + graphwidth * a[0], graphy + graphheight * a[5], graphx + graphwidth * b[0], graphy + graphheight * b[5], 0.0f, 1.0f, 0.0f, 1.0f, 0);
+ DrawQ_Line(0.0f, graphx + graphwidth * a[0], graphy + graphheight * a[4], graphx + graphwidth * b[0], graphy + graphheight * b[4], 1.0f, 1.0f, 1.0f, 1.0f, 0);
+ DrawQ_Line(0.0f, graphx + graphwidth * a[0], graphy + graphheight * a[3], graphx + graphwidth * b[0], graphy + graphheight * b[3], 1.0f, 0.5f, 0.0f, 1.0f, 0);
+ }
+ x = graphx;
+ y = graphy + graphheight;
+ dpsnprintf(bytesstring, sizeof(bytesstring), "%i", totalbytes);
+ DrawQ_String(x, y, label , 0, textsize, textsize, 1.0f, 1.0f, 1.0f, 1.0f, 0, NULL, false);y += textsize;
+ DrawQ_String(x, y, bytesstring, 0, textsize, textsize, 1.0f, 1.0f, 1.0f, 1.0f, 0, NULL, false);y += textsize;