-------------------------------------------------------------------- Process an object for the current frame
| 2630 | //-------------------------------------------------------------------- |
| 2631 | // Process an object for the current frame |
| 2632 | void ObjDoFrame(object *obj) { |
| 2633 | int previous_room = obj->roomnum; |
| 2634 | float save_frametime = Frametime; |
| 2635 | |
| 2636 | ASSERT(obj->type != OBJ_NONE); |
| 2637 | |
| 2638 | // Clear attached vis for this frame |
| 2639 | obj->lowest_attached_vis = -1; |
| 2640 | |
| 2641 | // If this is a permissable netgame, accelerate this object if need by |
| 2642 | if ((Game_mode & GM_MULTI) && Netgame.local_role == LR_CLIENT && (obj->flags & OF_PING_ACCELERATE)) { |
| 2643 | Frametime += (NetPlayers[Player_num].ping_time / 2.0); |
| 2644 | obj->flags &= ~OF_PING_ACCELERATE; |
| 2645 | } |
| 2646 | // Update previous position before moving |
| 2647 | obj->last_pos = obj->pos; |
| 2648 | |
| 2649 | // Inevitable countdown towards death |
| 2650 | if (obj->flags & OF_USES_LIFELEFT) |
| 2651 | obj->lifeleft -= Frametime; |
| 2652 | |
| 2653 | // #ifdef _DEBUG |
| 2654 | // if(Physics_player_verbose) |
| 2655 | // { |
| 2656 | // debug_check_terrain_objects(); |
| 2657 | // } |
| 2658 | // #endif _DEBUG |
| 2659 | |
| 2660 | // Process the control for this object |
| 2661 | switch (obj->control_type) { |
| 2662 | |
| 2663 | case CT_POWERUP: |
| 2664 | case CT_NONE: |
| 2665 | break; |
| 2666 | case CT_FLYING: { |
| 2667 | RTP_STARTINCTIME(ct_flying_time); |
| 2668 | DoFlyingControl(obj); |
| 2669 | RTP_ENDINCTIME(ct_flying_time); |
| 2670 | } break; |
| 2671 | case CT_AI: |
| 2672 | if (DoAI) { |
| 2673 | RTP_STARTINCTIME(ct_aidoframe_time); |
| 2674 | AIDoFrame(obj); |
| 2675 | RTP_ENDINCTIME(ct_aidoframe_time); |
| 2676 | } |
| 2677 | break; |
| 2678 | case CT_WEAPON: { |
| 2679 | RTP_STARTINCTIME(ct_weaponframe_time); |
| 2680 | WeaponDoFrame(obj); |
| 2681 | RTP_ENDINCTIME(ct_weaponframe_time); |
| 2682 | } break; |
| 2683 | case CT_EXPLOSION: { |
| 2684 | RTP_STARTINCTIME(ct_explosionframe_time); |
| 2685 | DoExplosionFrame(obj); |
| 2686 | RTP_ENDINCTIME(ct_explosionframe_time); |
| 2687 | } break; |
| 2688 | case CT_DEBRIS: { |
| 2689 | RTP_STARTINCTIME(ct_debrisframe_time); |
no test coverage detected