Initialize the polygon object information for an object
| 633 | #define NUM_PLAYER_ATTACH_POINTS 3 |
| 634 | // Initialize the polygon object information for an object |
| 635 | void ObjSetRenderPolyobj(object *objp, int model_num, int dying_model_num) { |
| 636 | objp->render_type = RT_POLYOBJ; |
| 637 | objp->flags |= OF_POLYGON_OBJECT; |
| 638 | polyobj_info *p_info = &objp->rtype.pobj_info; |
| 639 | p_info->model_num = model_num; |
| 640 | p_info->dying_model_num = dying_model_num; |
| 641 | p_info->anim_frame = 0.0f; |
| 642 | p_info->tmap_override = -1; |
| 643 | p_info->subobj_flags = 0xFFFFFFFF; |
| 644 | p_info->multi_turret_info.num_turrets = 0; |
| 645 | p_info->multi_turret_info.keyframes = NULL; |
| 646 | p_info->multi_turret_info.last_keyframes = NULL; |
| 647 | // Initialize attach slots |
| 648 | if (model_num != -1) { |
| 649 | poly_model *pm = GetPolymodelPointer(model_num); // get also pages in |
| 650 | if (objp->attach_children != NULL) { |
| 651 | mem_free(objp->attach_children); |
| 652 | objp->attach_children = NULL; |
| 653 | } |
| 654 | if ((objp->attach_children == NULL) && pm->n_attach) { |
| 655 | objp->attach_children = (int *)mem_malloc(sizeof(int) * pm->n_attach); |
| 656 | if (objp->type == OBJ_PLAYER) |
| 657 | ASSERT(pm->n_attach >= NUM_PLAYER_ATTACH_POINTS); |
| 658 | for (int i = 0; i < pm->n_attach; i++) |
| 659 | objp->attach_children[i] = OBJECT_HANDLE_NONE; |
| 660 | } |
| 661 | } |
| 662 | } |
| 663 | // Initialize a player object |
| 664 | // Returns 1 if ok, 0 if error |
| 665 | int ObjInitPlayer(object *objp) { |
no test coverage detected