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

Method Update

Descent3/debuggraph.cpp:342–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342void tGraphNode::Update(int value) {
343 ASSERT(init_data.data_input == DATA_TYPE_INT);
344
345 bool multi_game = (bool)((Game_mode & GM_MULTI) != 0);
346 if (multi_game) {
347 if (!(init_data.flags & DGF_MULTIPLAYER))
348 return;
349 } else {
350 if (!(init_data.flags & DGF_SINGLEPLAYER))
351 return;
352 }
353
354 if (cur_write_pos != 0 && (cur_write_pos % NUM_FRAMES_TO_DISPLAY) == 0) {
355 cur_write_pos = 0;
356 }
357
358 if (num_items_stored == NUM_FRAMES_TO_DISPLAY) {
359 first_pos++;
360 if (first_pos != 0 && (first_pos % NUM_FRAMES_TO_DISPLAY) == 0) {
361 first_pos = 0;
362 }
363 } else {
364 num_items_stored++;
365 }
366
367 if (value < init_data.i_min_value)
368 value = init_data.i_min_value;
369 if (value > init_data.i_max_value)
370 value = init_data.i_max_value;
371
372 i_data[cur_write_pos] = value;
373 cur_write_pos++;
374}
375
376void tGraphNode::Update(float value) {
377 ASSERT(init_data.data_input == DATA_TYPE_FLOAT);

Callers 1

DebugGraph_UpdateFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected