//canvas set // Type is optional. If you pass -1, type is determined, else type is used, and id is not xlated through ObjId. draw_robot_picture(int id, vms_angvec *orient_angles, int type) { if (id >= Num_total_object_types) return; if ( type == -1 ) { type = ObjType[id]; // Find the object type, given an object id. id = ObjId[id]; // Translate to sub-id. } switch (type) { case OL_HOSTAGE: PIGGY_PAGE_IN(Vclip[Hostage_vclip_num[id]].frames[0]); gr_bitmap(0,0,&GameBitmaps[Vclip[Hostage_vclip_num[id]].frames[0].index]); break; case OL_POWERUP: if ( Powerup_info[id].vclip_num > -1 ) { PIGGY_PAGE_IN(Vclip[Powerup_info[id].vclip_num].frames[0]); gr_bitmap(0,0,&GameBitmaps[Vclip[Powerup_info[id].vclip_num].frames[0].index]); } break; case OL_PLAYER: draw_model_picture(Player_ship->model_num,orient_angles); // Draw a poly model below break; case OL_ROBOT: draw_model_picture(Robot_info[id].model_num,orient_angles); // Draw a poly model below break; case OL_CONTROL_CENTER: case OL_CLUTTER: draw_model_picture(id,orient_angles); break; default: //Int3(); // Invalid type!!! return; } }
// ----------------------------------------------------------------------------- void show_spinning_robot_frame(int robot_num) { grs_canvas *curcanv_save; if (robot_num != -1) { Robot_angles.h += 150; curcanv_save = grd_curcanv; grd_curcanv = Robot_canv; Assert(Robot_info[robot_num].model_num != -1); draw_model_picture(Robot_info[robot_num].model_num, &Robot_angles); grd_curcanv = curcanv_save; } }