| 605 | } |
| 606 | |
| 607 | void 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 |
nothing calls this directly
no test coverage detected