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

Function EBNode_DrawRoom

editor/ebnode.cpp:1195–1289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1193#include "epath.h"
1194
1195void EBNode_DrawRoom(int room, grViewport *vp, vector *viewer_eye, matrix *viewer_orient, float zoom,
1196 bool f_current_room = false) {
1197 int i, current_path_index = 0, t;
1198 g3Point rot_points[300];
1199 int sort_index[300];
1200
1201 bn_list *bn_info = BNode_GetBNListPtr(room);
1202
1203 for (i = 0; i < bn_info->num_nodes; i++) {
1204 // int curnode=D3EditState.current_node;
1205 //
1206 g3_RotatePoint(&rot_points[0], &bn_info->nodes[i].pos);
1207 sort_index[0] = 0;
1208
1209 for (t = 0; t < bn_info->nodes[i].num_edges; t++) {
1210
1211 bn_list *ebn_info = BNode_GetBNListPtr(bn_info->nodes[i].edges[t].end_room);
1212
1213 g3_RotatePoint(&rot_points[t + 1], &ebn_info->nodes[bn_info->nodes[i].edges[t].end_index].pos);
1214 sort_index[t + 1] = t + 1;
1215 }
1216
1217 // ddgr_color path_color = (current_path_index==D3EditState.current_path) ? GR_RGB(255,255,255) :
1218 //GR_RGB(36,99,238);
1219 ddgr_color path_color;
1220
1221 if (f_current_room)
1222 path_color = GR_RGB(255, 0, 0);
1223 else
1224 path_color = GR_RGB(100, 0, 0);
1225
1226 int x;
1227 g3Point p1 = rot_points[0];
1228
1229 for (x = 0; x < bn_info->nodes[i].num_edges; x++) {
1230 g3Point p2 = rot_points[x + 1];
1231 g3_DrawLine(path_color, &p1, &p2);
1232 }
1233
1234 for (t = 0; t < bn_info->nodes[i].num_edges + 1; t++) {
1235 for (int k = 0; k < bn_info->nodes[i].num_edges + 1; k++) {
1236 if (rot_points[k].p3_vec.z < rot_points[t].p3_vec.z) {
1237 g3Point temp;
1238 int tindex;
1239
1240 memcpy(&temp, &rot_points[t], sizeof(g3Point));
1241 memcpy(&rot_points[t], &rot_points[k], sizeof(g3Point));
1242 memcpy(&rot_points[k], &temp, sizeof(g3Point));
1243
1244 tindex = sort_index[t];
1245 sort_index[t] = sort_index[k];
1246 sort_index[k] = tindex;
1247 }
1248 }
1249 }
1250 }
1251
1252 int color;

Callers 1

EBNode_DrawFunction · 0.85

Calls 8

BNode_GetBNListPtrFunction · 0.85
g3_RotatePointFunction · 0.85
g3_DrawLineFunction · 0.85
g3_DrawSphereFunction · 0.85
DrawNumberFunction · 0.70
GR_RGBFunction · 0.50
rend_SetPixelFunction · 0.50
rend_GetPixelFunction · 0.50

Tested by

no test coverage detected