| 39 | #include "debug_renderer.h" |
| 40 | |
| 41 | void CLevelGraph::draw_nodes() |
| 42 | { |
| 43 | auto O = smart_cast<CGameObject*>(Level().CurrentEntity()); |
| 44 | if (!O) |
| 45 | return; |
| 46 | |
| 47 | Fvector POSITION = O->Position(); |
| 48 | POSITION.y += 0.5f; |
| 49 | |
| 50 | // display |
| 51 | Fvector P = POSITION; |
| 52 | |
| 53 | // CPosition Local; |
| 54 | // vertex_position (Local,P); |
| 55 | |
| 56 | u32 ID = O->ai_location().level_vertex_id(); |
| 57 | |
| 58 | CGameFont* F = HUD().Font().pFontDI; |
| 59 | F->SetHeightI(.02f); |
| 60 | F->OutI(0.f, 0.5f, "%f,%f,%f", VPUSH(P)); |
| 61 | // float x,z; |
| 62 | // unpack_xz (Local,x,z); |
| 63 | // F->Out (0.f,0.55f,"%3d,%4d,%3d -> %d", iFloor(x),iFloor(Local.y()),iFloor(z),u32(ID)); |
| 64 | |
| 65 | svector<u32, 128> linked; |
| 66 | { |
| 67 | const_iterator i, e; |
| 68 | begin(ID, i, e); |
| 69 | for (; i != e; ++i) |
| 70 | linked.push_back(value(ID, i)); |
| 71 | } |
| 72 | |
| 73 | // render |
| 74 | float sc = header().cell_size() / 16; |
| 75 | float st = 0.98f * header().cell_size() / 2; |
| 76 | float tt = 0.01f; |
| 77 | |
| 78 | Fvector DUP; |
| 79 | DUP.set(0, 1, 0); |
| 80 | |
| 81 | DRender->OnFrameEnd(); |
| 82 | DRender->SetShader(sh_debug); |
| 83 | |
| 84 | F->SetColor(color_rgba(255, 255, 255, 255)); |
| 85 | |
| 86 | ////////////////////////////////////////////////////////////////////////// |
| 87 | Fvector min_position, max_position; |
| 88 | max_position = min_position = Device.vCameraPosition; |
| 89 | min_position.sub(30.f); |
| 90 | max_position.add(30.f); |
| 91 | |
| 92 | CLevelGraph::const_vertex_iterator I, E; |
| 93 | if (valid_vertex_position(min_position)) |
| 94 | I = std::lower_bound(begin(), end(), vertex_position(min_position).xz(), &vertex::predicate2); |
| 95 | else |
| 96 | I = begin(); |
| 97 | |
| 98 | if (valid_vertex_position(max_position)) |
nothing calls this directly
no test coverage detected