| version 1.1 | | version 1.2 |
|---|
| | |
| * C version of fixed point library | | * C version of fixed point library |
| * | | * |
| * $Log$ | | * $Log$ |
| * Revision 1.1 1999/06/14 22:13:35 donut | | * Revision 1.2 1999/08/05 22:53:41 sekmu |
| * Initial revision | | * |
| | | * D3D patch(es) from ADB |
| | | * |
| | | * Revision 1.1.1.1 1999/06/14 22:13:35 donut |
| | | * Import of d1x 1.37 source. |
| * | | * |
| * Revision 1.7 1995/09/22 14:08:16 allender | | * Revision 1.7 1995/09/22 14:08:16 allender |
| * fixed fix_atan2 to work correctly with doubles | | * fixed fix_atan2 to work correctly with doubles |
| | |
| fixang fix_atan2(fix cos,fix sin) | | fixang fix_atan2(fix cos,fix sin) |
| { | | { |
| double d, dsin, dcos; | | double d, dsin, dcos; |
| fix t; | | fixang t; |
| | | |
| //Assert(!(cos==0 && sin==0)); | | //Assert(!(cos==0 && sin==0)); |
| | | |
| | |
| } | | } |
| #endif | | #endif |
| | | |
| ulong quad_sqrt(long low,long high) | | ulong quad_sqrt(ulong low,long high) |
| { | | { |
| int i, cnt; | | int i, cnt; |
| ulong r,old_r,t; | | ulong r,old_r,t; |
| | |
| if (high<0) | | if (high<0) |
| return 0; | | return 0; |
| | | |
| if (high==0 && low>=0) | | if (high==0 && (long)low>=0) |
| return long_sqrt(low); | | return long_sqrt((long)low); |
| | | |
| if (high & 0xff000000) { | | if (high & 0xff000000) { |
| cnt=12+16; i = high >> 24; | | cnt=12+16; i = high >> 24; |