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

Function DebugGraph_Render

Descent3/debuggraph.cpp:274–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272#define TOP_T 50
273
274void DebugGraph_Render(void) {
275 if (graph_bmp == -1) {
276 // create the bitmap
277 graph_bmp = bm_AllocBitmap(64, 64, 0);
278 if (graph_bmp > BAD_BITMAP_HANDLE) {
279 uint16_t *data = bm_data(graph_bmp, 0);
280 for (int i = 0; i < 64 * 64; i++) {
281 data[i] = GR_RGB16(0, 0, 0) | OPAQUE_FLAG;
282 }
283 }
284 }
285 if (graph_bmp <= BAD_BITMAP_HANDLE)
286 return;
287
288 if (graph_mask == 0)
289 return;
290
291 rend_SetAlphaType(AT_CONSTANT_TEXTURE);
292 rend_SetAlphaValue(240);
293 rend_SetLighting(LS_NONE);
294 rend_SetColorModel(CM_MONO);
295 rend_SetOverlayType(OT_NONE);
296 rend_SetWrapType(WT_CLAMP);
297 rend_SetFiltering(0);
298
299 rend_DrawScaledBitmap(TOP_L, TOP_T, TOP_L + 256, TOP_T + 64, graph_bmp, 0, 0, 1, 1);
300
301 int bit = 0x01;
302 tGraphNode *node;
303 bool multi_game = (bool)((Game_mode & GM_MULTI) != 0);
304 bool ok_to_render;
305
306 for (int i = 0; i < graph_num_nodes; i++) {
307 node = DebugGraph_FindNode(i);
308 ok_to_render = true;
309
310 if (node && (graph_mask & bit)) {
311 if (multi_game) {
312 if (!(node->init_data.flags & DGF_MULTIPLAYER))
313 ok_to_render = false;
314 } else {
315 if (!(node->init_data.flags & DGF_SINGLEPLAYER))
316 ok_to_render = false;
317 }
318
319 if (ok_to_render)
320 node->Render();
321 }
322 bit = bit << 1;
323 }
324
325 rend_SetFiltering(1);
326}
327
328////////////////////////////////////////////
329void tGraphNode::Initialize(tAddDebugGraph *data) {

Callers 1

GameRenderFrameFunction · 0.85

Calls 13

bm_AllocBitmapFunction · 0.85
bm_dataFunction · 0.85
GR_RGB16Function · 0.85
DebugGraph_FindNodeFunction · 0.85
rend_SetAlphaTypeFunction · 0.50
rend_SetAlphaValueFunction · 0.50
rend_SetLightingFunction · 0.50
rend_SetColorModelFunction · 0.50
rend_SetOverlayTypeFunction · 0.50
rend_SetWrapTypeFunction · 0.50
rend_SetFilteringFunction · 0.50
rend_DrawScaledBitmapFunction · 0.50

Tested by

no test coverage detected