|
Lines 146-152
Link Here
|
| 146 |
int best_diff=200,best_num; |
146 |
int best_diff=200,best_num; |
| 147 |
int iy=f[1],ix=f[6*2]; |
147 |
int iy=f[1],ix=f[6*2]; |
| 148 |
|
148 |
|
| 149 |
int best_angle=lisp_atan2(q->y-iy-v->pointer_y,v->pointer_x-q->x-ix); |
149 |
int best_angle=lisp_atan2(q->y-iy-v->pointer_y,v->pointer_x-ix-q->x); |
| 150 |
for (i=0;i<24;i++,f+=2) // check all the angles to see which would best fit animation wise |
150 |
for (i=0;i<24;i++,f+=2) // check all the angles to see which would best fit animation wise |
| 151 |
{ |
151 |
{ |
| 152 |
int this_angle=lisp_atan2(f[1]-iy,f[0]-ix); |
152 |
int this_angle=lisp_atan2(f[1]-iy,f[0]-ix); |
|
Lines 161-170
Link Here
|
| 161 |
|
161 |
|
| 162 |
|
162 |
|
| 163 |
// if the pointer is too close to the player go with the angle shown, not the angle through the pointer |
163 |
// if the pointer is too close to the player go with the angle shown, not the angle through the pointer |
| 164 |
if (abs(q->y-fb[1]-v->pointer_y)<45 & abs(v->pointer_x-q->x+fb[0])<40) |
164 |
if (abs(q->y-fb[1]-v->pointer_y)<45 & abs(v->pointer_x-q->x-fb[0])<40) |
| 165 |
o->lvars[point_angle]=lisp_atan2(fb[1]-iy,fb[0]-ix); |
165 |
o->lvars[point_angle]=lisp_atan2(fb[1]-iy,fb[0]-ix); |
| 166 |
else |
166 |
else |
| 167 |
o->lvars[point_angle]=lisp_atan2(q->y-fb[1]-v->pointer_y,v->pointer_x-(q->x+fb[0])); |
167 |
o->lvars[point_angle]=lisp_atan2(q->y-fb[1]-v->pointer_y,v->pointer_x-q->x-fb[0]); |
| 168 |
|
168 |
|
| 169 |
|
169 |
|
| 170 |
if (q->direction<0) |
170 |
if (q->direction<0) |
|
Lines 900-909
Link Here
|
| 900 |
|
900 |
|
| 901 |
long xvel=(lisp_cos(ang))*(mag); |
901 |
long xvel=(lisp_cos(ang))*(mag); |
| 902 |
current_object->set_xvel(xvel>>16); |
902 |
current_object->set_xvel(xvel>>16); |
| 903 |
current_object->set_fxvel((xvel&0xffff)>>8); |
903 |
current_object->set_fxvel((xvel&0xff00)>>8); |
|
|
904 |
|
| 904 |
long yvel=-(lisp_sin(ang))*(mag); |
905 |
long yvel=-(lisp_sin(ang))*(mag); |
| 905 |
current_object->set_yvel(yvel>>16); |
906 |
current_object->set_yvel(yvel>>16); |
| 906 |
current_object->set_fyvel((yvel&0xffff)>>8); |
907 |
current_object->set_fyvel((yvel&0xff00)>>8); |
| 907 |
|
908 |
|
| 908 |
|
909 |
|
| 909 |
int whit=0; |
910 |
int whit=0; |