| 423 | } |
| 424 | |
| 425 | void tGraphNode::Render(void) { |
| 426 | if (num_items_stored < 2) |
| 427 | return; |
| 428 | rend_SetFlatColor(color); |
| 429 | |
| 430 | int last_x, last_y = 0, y; |
| 431 | int index = first_pos; |
| 432 | int count = num_items_stored; |
| 433 | count--; |
| 434 | |
| 435 | switch (init_data.data_input) { |
| 436 | case DATA_TYPE_FLOAT: |
| 437 | GetGraphY(&last_y, f_data[index], init_data.f_max_value, init_data.f_min_value); |
| 438 | break; |
| 439 | case DATA_TYPE_INT: |
| 440 | GetGraphY(&last_y, i_data[index], init_data.i_max_value, init_data.i_min_value); |
| 441 | break; |
| 442 | }; |
| 443 | index++; |
| 444 | last_x = TOP_L; |
| 445 | |
| 446 | while (count > 0) { |
| 447 | if (index != 0 && (index % NUM_FRAMES_TO_DISPLAY) == 0) { |
| 448 | index = 0; |
| 449 | } |
| 450 | |
| 451 | switch (init_data.data_input) { |
| 452 | case DATA_TYPE_FLOAT: |
| 453 | GetGraphY(&y, f_data[index], init_data.f_max_value, init_data.f_min_value); |
| 454 | break; |
| 455 | case DATA_TYPE_INT: |
| 456 | GetGraphY(&y, i_data[index], init_data.i_max_value, init_data.i_min_value); |
| 457 | break; |
| 458 | }; |
| 459 | |
| 460 | rend_DrawLine(last_x, last_y, last_x + 1, y); |
| 461 | count--; |
| 462 | last_x += 2; |
| 463 | last_y = y; |
| 464 | index++; |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | /* |
| 469 | *********************************************************************** |
no test coverage detected