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

Function SelectRoomsInBox

editor/drawworld.cpp:559–590  ·  view source on GitHub ↗

Adds all the rooms that have a vertex inside of a given screen box to the selected list Parameters: vp - the viewport we're checking. Must be the same viewport as the last wireframe view rendered left,top,right,bot - the screen coordinates of the box Returns: the number of rooms found

Source from the content-addressed store, hash-verified

557// left,top,right,bot - the screen coordinates of the box
558// Returns: the number of rooms found
559int SelectRoomsInBox(grViewport *vp, int left, int top, int right, int bot) {
560
561 // TEMP: The caller doesn't know the viewport, so we set it here
562 vp = last_vp;
563
564 if (vp != last_vp) {
565 Int3();
566 return -1;
567 }
568
569 Draw_viewport = vp;
570
571 vp->clear();
572
573 StartEditorFrame(vp, &last_viewer_position, &last_view_orient, last_zoom);
574
575 Search_mode = 2;
576 Search_left = left;
577 Search_top = top;
578 Search_right = right;
579 Search_bot = bot;
580 Search_viewer = last_viewer_position;
581 Found_roomnum = 0; // we use this as a counter
582
583 DrawAllRooms(&last_viewer_target, last_rad);
584
585 EndEditorFrame();
586
587 Search_mode = 0;
588
589 return Found_roomnum;
590}
591
592// Resets the edge list
593void ResetEdgeList(int size) {

Callers 1

EndWireframeSelFunction · 0.85

Calls 4

StartEditorFrameFunction · 0.85
DrawAllRoomsFunction · 0.85
EndEditorFrameFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected