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

Method UpdatePowerupView

editor/WorldObjectsPowerupDialog.cpp:611–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609}
610
611void CWorldObjectsPowerupDialog::UpdatePowerupView(void) {
612#if 0
613 int n=D3EditState.current_powerup;
614 CWnd *powwnd;
615 RECT rect;
616 int x, y, bm_handle,w,h;
617 static int frame=0;
618 static int last_powerup=-1;
619 static int last_image_handle=-1;
620
621 if (Num_powerups<1)
622 return;
623
624 frame++;
625
626 powwnd = GetDlgItem(IDC_POWERUPVIEW);
627 powwnd->GetWindowRect(&rect);
628 ScreenToClient(&rect);
629
630 Desktop_surf->attach_to_window((unsigned)m_hWnd);
631
632 w=rect.right-rect.left;
633 h=rect.bottom-rect.top;
634
635 if (last_powerup!=n || last_image_handle!=Powerups[n].image_handle)
636 {
637 Desktop_surf->clear(rect.left,rect.top,w,h);
638 last_powerup=n;
639 last_image_handle=Powerups[n].image_handle;
640 }
641
642 bm_handle=GetPowerupImage (n,frame);
643
644 if (Powerups[n].flags & PF_IMAGE_BITMAP)
645 {
646 m_PowerupSurf.create(bm_w(bm_handle,0), bm_h(bm_handle,0), bm_bpp(bm_handle));
647 m_PowerupSurf.load(bm_handle);
648
649 x = rect.left + ((rect.right-rect.left)/2) - m_PowerupSurf.width()/2;
650 y = rect.top + ((rect.bottom-rect.top)/2) - m_PowerupSurf.height()/2;
651
652 Desktop_surf->blt(x, y, &m_PowerupSurf);
653 m_PowerupSurf.free();
654 }
655 else
656 {
657 vector zero_vector;
658 vector view_vector={0,0,-2};
659 matrix id_matrix,rot_matrix;
660
661 vm_MakeZero (&zero_vector);
662 vm_MakeIdentity (&id_matrix);
663 vm_AnglesToMatrix (&rot_matrix,0,frame*400,0);
664
665 m_PowerupSurf.create(128, 128, BPP_16);
666 grViewport *vport=new grViewport (&m_PowerupSurf);
667 g3_StartFrame (vport,&view_vector,&id_matrix,D3_DEFAULT_ZOOM);
668 DrawPolygonModel (&zero_vector,&rot_matrix,bm_handle,NULL,0,1.0);

Callers

nothing calls this directly

Calls 15

bm_wFunction · 0.85
bm_hFunction · 0.85
bm_bppFunction · 0.85
vm_MakeZeroFunction · 0.85
g3_StartFrameFunction · 0.85
DrawPolygonModelFunction · 0.85
g3_EndFrameFunction · 0.85
attach_to_windowMethod · 0.80
vm_MakeIdentityFunction · 0.50
vm_AnglesToMatrixFunction · 0.50
clearMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected