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

Function DrawRoomObjects

editor/drawworld.cpp:705–743  ·  view source on GitHub ↗

Draw the objects in a room as spheres

Source from the content-addressed store, hash-verified

703
704// Draw the objects in a room as spheres
705void DrawRoomObjects(room *rp) {
706 int objnum;
707
708 if (!D3EditState.objects_in_wireframe)
709 return;
710
711 for (objnum = rp->objects; objnum != -1; objnum = Objects[objnum].next) {
712 object *obj = &Objects[objnum];
713 g3Point sphere_point;
714 ddgr_color color;
715
716 switch (obj->type) {
717 case OBJ_POWERUP:
718 color = POWERUP_COLOR;
719 break;
720 case OBJ_ROBOT:
721 color = ROBOT_COLOR;
722 break;
723 case OBJ_PLAYER:
724 color = PLAYER_COLOR;
725 break;
726 case OBJ_VIEWER:
727 color = VIEWER_COLOR;
728 break;
729 case OBJ_CAMERA:
730 color = CAMERA_COLOR;
731 break;
732 default:
733 color = MISCOBJ_COLOR;
734 break;
735 }
736
737 if (obj->type == OBJ_DOOR) // don't draw doors
738 continue;
739
740 g3_RotatePoint(&sphere_point, &obj->pos);
741 g3_DrawSphere(color, &sphere_point, obj->size);
742 }
743}
744
745void DrawAllRooms(vector *view_target, float rad) {
746 int r;

Callers 2

DrawAllRoomsFunction · 0.85
DrawWorldFunction · 0.85

Calls 2

g3_RotatePointFunction · 0.85
g3_DrawSphereFunction · 0.85

Tested by

no test coverage detected