MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / Render

Method Render

Descent3/debuggraph.cpp:425–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425void 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***********************************************************************

Callers 1

DebugGraph_RenderFunction · 0.45

Calls 3

GetGraphYFunction · 0.85
rend_SetFlatColorFunction · 0.50
rend_DrawLineFunction · 0.50

Tested by

no test coverage detected