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

Method DrawPicture

editor/ObjectDialog.cpp:607–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607void CObjectDialog::DrawPicture(CWnd *wnd) {
608 RECT box_rect;
609 int width, height, model_num;
610 grHardwareSurface hw_surf;
611
612 if (!Editor_active)
613 return;
614
615 // initialize graphic objects
616 wnd->GetClientRect(&box_rect);
617
618 width = box_rect.right - box_rect.left;
619 height = box_rect.bottom - box_rect.top;
620
621 Desktop_surf->attach_to_window((unsigned)wnd->m_hWnd);
622
623 hw_surf.create(width, height, BPP_16);
624
625 switch (D3EditState.current_obj_type) {
626 case OBJ_CLUTTER:
627 case OBJ_BUILDING:
628 case OBJ_POWERUP:
629 case OBJ_ROBOT:
630 model_num = GetObjectImage(GetCurrentIndex());
631 break;
632 case OBJ_PLAYER:
633 model_num = GetShipImage(GetCurrentIndex());
634 break;
635 default:
636 Int3();
637 }
638
639 DrawItemModel(&hw_surf, model_num);
640}
641
642// Keypad functions!
643

Callers

nothing calls this directly

Calls 6

GetObjectImageFunction · 0.85
GetCurrentIndexFunction · 0.85
GetShipImageFunction · 0.85
DrawItemModelFunction · 0.85
attach_to_windowMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected