Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 180081 | Differences between
and this patch

Collapse All | Expand All

(-)abuse_sdl-0.7.0-old/src/cop.cpp (-5 / +6 lines)
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;
(-)abuse_sdl-0.7.0-old/src/lisp.cpp (-16 / +16 lines)
Lines 703-735 Link Here
703
    {      
703
    {      
704
      if (dy>0)
704
      if (dy>0)
705
      {
705
      {
706
	if (abs(dx)>abs(dy))
706
	if (labs(dx)>labs(dy))
707
	{
707
	{
708
	  long a=dx*29/dy;
708
	  long a=(dx*29)/dy;
709
	  if (a>=TBS) return 0;
709
	  if (a>=TBS) return 45-45;
710
	  else return 45-atan_table[a];
710
	  else return 45-atan_table[a];
711
	}
711
	}
712
	else 
712
	else 
713
	{
713
	{
714
	  long a=dy*29/dx;
714
	  long a=(dy*29)/dx;
715
	  if (a>=TBS) return 90;
715
	  if (a>=TBS) return 45+45;
716
	  else return 45+atan_table[a];
716
	  else return 45+atan_table[a];
717
	}
717
	}
718
      } else
718
      } else
719
      {
719
      {
720
	if (abs(dx)>abs(dy))
720
	if (labs(dx)>labs(dy))
721
	{
721
	{
722
	  long a=dx*29/abs(dy);
722
	  long a=(dx*29)/labs(dy);
723
	  if (a>=TBS)
723
	  if (a>=TBS)
724
	    return 0;
724
	    return 0; // 315+45=0
725
	  else
725
	  else
726
	    return 315+atan_table[a];
726
	    return 315+atan_table[a];
727
	}
727
	}
728
	else
728
	else
729
	{
729
	{
730
	  long a=abs(dy)*29/dx;
730
	  long a=(labs(dy)*29)/dx;
731
	  if (a>=TBS)
731
	  if (a>=TBS)
732
	    return 260;
732
	    return 315-45;
733
	  else
733
	  else
734
	    return 315-atan_table[a];
734
	    return 315-atan_table[a];
735
	}
735
	}
Lines 738-746 Link Here
738
    {
738
    {
739
      if (dy>0)
739
      if (dy>0)
740
      {
740
      {
741
	if (abs(dx)>abs(dy))
741
	if (labs(dx)>labs(dy))
742
	{
742
	{
743
	  long a=-dx*29/dy;
743
	  long a=(labs(dx)*29)/dy;
744
	  if (a>=TBS)
744
	  if (a>=TBS)
745
	    return 135+45;
745
	    return 135+45;
746
	  else
746
	  else
Lines 748-754 Link Here
748
	}
748
	}
749
	else 
749
	else 
750
	{
750
	{
751
	  long a=dy*29/-dx;
751
	  long a=(dy*29)/labs(dx);
752
	  if (a>=TBS)
752
	  if (a>=TBS)
753
	    return 135-45;
753
	    return 135-45;
754
	  else
754
	  else
Lines 756-771 Link Here
756
	}
756
	}
757
      } else
757
      } else
758
      {
758
      {
759
	if (abs(dx)>abs(dy))
759
	if (labs(dx)>labs(dy))
760
	{
760
	{
761
	  long a=-dx*29/abs(dy);
761
	  long a=(labs(dx)*29)/labs(dy);
762
	  if (a>=TBS)
762
	  if (a>=TBS)
763
	    return 225-45;
763
	    return 225-45;
764
	  else return 225-atan_table[a];
764
	  else return 225-atan_table[a];
765
	}
765
	}
766
	else 
766
	else 
767
	{
767
	{
768
	  long a=abs(dy)*29/abs(dx);
768
	  long a=(labs(dy)*29)/labs(dx);
769
	  if (a>=TBS)
769
	  if (a>=TBS)
770
	    return 225+45;	  
770
	    return 225+45;	  
771
	  else return 225+atan_table[a];
771
	  else return 225+atan_table[a];

Return to bug 180081