Treat robot joints as const
This commit is contained in:
parent
ae2d94309a
commit
05861ca745
|
@ -525,7 +525,7 @@ int player_is_visible_from_object(object *objp, vms_vector *pos, fix field_of_vi
|
|||
int do_silly_animation(object *objp)
|
||||
{
|
||||
int objnum = objp-Objects;
|
||||
jointpos *jp_list;
|
||||
const jointpos *jp_list;
|
||||
int robot_type, gun_num, robot_state, num_joint_positions;
|
||||
polyobj_info *pobj_info = &objp->rtype.pobj_info;
|
||||
ai_static *aip = &objp->ctype.ai_info;
|
||||
|
@ -560,7 +560,7 @@ int do_silly_animation(object *objp)
|
|||
for (joint=0; joint<num_joint_positions; joint++) {
|
||||
fix delta_angle, delta_2;
|
||||
int jointnum = jp_list[joint].jointnum;
|
||||
vms_angvec *jp = &jp_list[joint].angles;
|
||||
const vms_angvec *jp = &jp_list[joint].angles;
|
||||
vms_angvec *pobjp = &pobj_info->anim_angles[jointnum];
|
||||
|
||||
if (jointnum >= Polygon_models[objp->rtype.pobj_info.model_num].n_models) {
|
||||
|
|
|
@ -131,7 +131,7 @@ void calc_gun_point(vms_vector *gun_point,object *obj,int gun_num)
|
|||
|
||||
//fills in ptr to list of joints, and returns the number of joints in list
|
||||
//takes the robot type (object id), gun number, and desired state
|
||||
int robot_get_anim_state(jointpos **jp_list_ptr,int robot_type,int gun_num,int state)
|
||||
int robot_get_anim_state(const jointpos **jp_list_ptr,int robot_type,int gun_num,int state)
|
||||
{
|
||||
|
||||
Assert(gun_num <= Robot_info[robot_type].n_guns);
|
||||
|
|
|
@ -173,7 +173,7 @@ void calc_gun_point(vms_vector *gun_point,struct object *obj,int gun_num);
|
|||
// On exit:
|
||||
// Returns number of joints in list.
|
||||
// jp_list_ptr is stuffed with a pointer to a static array of joint positions. This pointer is valid forever.
|
||||
extern int robot_get_anim_state(jointpos **jp_list_ptr,int robot_type,int gun_num,int state);
|
||||
extern int robot_get_anim_state(const jointpos **jp_list_ptr,int robot_type,int gun_num,int state);
|
||||
|
||||
/*
|
||||
* reads n robot_info structs from a PHYSFS_file
|
||||
|
|
Loading…
Reference in a new issue