Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 120492 Details for
Bug 180081
games-action/abuse_sdl-0.7.0-r2: PATCH for 1) shots that go left insist on 45 degree angles and 2) mouse won't go to other parts of screen in edit mode
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
abuse.atan2fix.patch
abuse.atan2fix.patch (text/plain), 3.20 KB, created by
Triffid Hunter
on 2007-05-28 02:47:04 UTC
(
hide
)
Description:
abuse.atan2fix.patch
Filename:
MIME Type:
Creator:
Triffid Hunter
Created:
2007-05-28 02:47:04 UTC
Size:
3.20 KB
patch
obsolete
>diff -ur abuse_sdl-0.7.0-old/src/cop.cpp abuse_sdl-0.7.0/src/cop.cpp >--- abuse_sdl-0.7.0-old/src/cop.cpp 2002-12-15 15:00:32.000000000 +1000 >+++ abuse_sdl-0.7.0/src/cop.cpp 2007-05-28 12:09:16.000000000 +1000 >@@ -146,7 +146,7 @@ > int best_diff=200,best_num; > int iy=f[1],ix=f[6*2]; > >- int best_angle=lisp_atan2(q->y-iy-v->pointer_y,v->pointer_x-q->x-ix); >+ int best_angle=lisp_atan2(q->y-iy-v->pointer_y,v->pointer_x-ix-q->x); > for (i=0;i<24;i++,f+=2) // check all the angles to see which would best fit animation wise > { > int this_angle=lisp_atan2(f[1]-iy,f[0]-ix); >@@ -161,10 +161,10 @@ > > > // if the pointer is too close to the player go with the angle shown, not the angle through the pointer >- if (abs(q->y-fb[1]-v->pointer_y)<45 & abs(v->pointer_x-q->x+fb[0])<40) >+ if (abs(q->y-fb[1]-v->pointer_y)<45 & abs(v->pointer_x-q->x-fb[0])<40) > o->lvars[point_angle]=lisp_atan2(fb[1]-iy,fb[0]-ix); > else >- o->lvars[point_angle]=lisp_atan2(q->y-fb[1]-v->pointer_y,v->pointer_x-(q->x+fb[0])); >+ o->lvars[point_angle]=lisp_atan2(q->y-fb[1]-v->pointer_y,v->pointer_x-q->x-fb[0]); > > > if (q->direction<0) >@@ -900,10 +900,11 @@ > > long xvel=(lisp_cos(ang))*(mag); > current_object->set_xvel(xvel>>16); >- current_object->set_fxvel((xvel&0xffff)>>8); >+ current_object->set_fxvel((xvel&0xff00)>>8); >+ > long yvel=-(lisp_sin(ang))*(mag); > current_object->set_yvel(yvel>>16); >- current_object->set_fyvel((yvel&0xffff)>>8); >+ current_object->set_fyvel((yvel&0xff00)>>8); > > > int whit=0; >diff -ur abuse_sdl-0.7.0-old/src/lisp.cpp abuse_sdl-0.7.0/src/lisp.cpp >--- abuse_sdl-0.7.0-old/src/lisp.cpp 2002-12-15 15:00:32.000000000 +1000 >+++ abuse_sdl-0.7.0/src/lisp.cpp 2007-05-28 12:05:13.000000000 +1000 >@@ -703,33 +703,33 @@ > { > if (dy>0) > { >- if (abs(dx)>abs(dy)) >+ if (labs(dx)>labs(dy)) > { >- long a=dx*29/dy; >- if (a>=TBS) return 0; >+ long a=(dx*29)/dy; >+ if (a>=TBS) return 45-45; > else return 45-atan_table[a]; > } > else > { >- long a=dy*29/dx; >- if (a>=TBS) return 90; >+ long a=(dy*29)/dx; >+ if (a>=TBS) return 45+45; > else return 45+atan_table[a]; > } > } else > { >- if (abs(dx)>abs(dy)) >+ if (labs(dx)>labs(dy)) > { >- long a=dx*29/abs(dy); >+ long a=(dx*29)/labs(dy); > if (a>=TBS) >- return 0; >+ return 0; // 315+45=0 > else > return 315+atan_table[a]; > } > else > { >- long a=abs(dy)*29/dx; >+ long a=(labs(dy)*29)/dx; > if (a>=TBS) >- return 260; >+ return 315-45; > else > return 315-atan_table[a]; > } >@@ -738,9 +738,9 @@ > { > if (dy>0) > { >- if (abs(dx)>abs(dy)) >+ if (labs(dx)>labs(dy)) > { >- long a=-dx*29/dy; >+ long a=(labs(dx)*29)/dy; > if (a>=TBS) > return 135+45; > else >@@ -748,7 +748,7 @@ > } > else > { >- long a=dy*29/-dx; >+ long a=(dy*29)/labs(dx); > if (a>=TBS) > return 135-45; > else >@@ -756,16 +756,16 @@ > } > } else > { >- if (abs(dx)>abs(dy)) >+ if (labs(dx)>labs(dy)) > { >- long a=-dx*29/abs(dy); >+ long a=(labs(dx)*29)/labs(dy); > if (a>=TBS) > return 225-45; > else return 225-atan_table[a]; > } > else > { >- long a=abs(dy)*29/abs(dx); >+ long a=(labs(dy)*29)/labs(dx); > if (a>=TBS) > return 225+45; > else return 225+atan_table[a];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 180081
:
120490
| 120492