ReactOS Fundraising Campaign 2012
 
€ 3,303 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ft_corner_orientation ( FT_Pos  in_x,
FT_Pos  in_y,
FT_Pos  out_x,
FT_Pos  out_y 
)

Definition at line 840 of file ftcalc.c.

00844   {
00845     FT_Long  result; /* avoid overflow on 16-bit system */
00846 
00847 
00848     /* deal with the trivial cases quickly */
00849     if ( in_y == 0 )
00850     {
00851       if ( in_x >= 0 )
00852         result = out_y;
00853       else
00854         result = -out_y;
00855     }
00856     else if ( in_x == 0 )
00857     {
00858       if ( in_y >= 0 )
00859         result = -out_x;
00860       else
00861         result = out_x;
00862     }
00863     else if ( out_y == 0 )
00864     {
00865       if ( out_x >= 0 )
00866         result = in_y;
00867       else
00868         result = -in_y;
00869     }
00870     else if ( out_x == 0 )
00871     {
00872       if ( out_y >= 0 )
00873         result = -in_x;
00874       else
00875         result =  in_x;
00876     }
00877     else /* general case */
00878     {
00879 #ifdef FT_LONG64
00880 
00881       FT_Int64  delta = (FT_Int64)in_x * out_y - (FT_Int64)in_y * out_x;
00882 
00883 
00884       if ( delta == 0 )
00885         result = 0;
00886       else
00887         result = 1 - 2 * ( delta < 0 );
00888 
00889 #else
00890 
00891       FT_Int64  z1, z2;
00892 
00893 
00894       /* XXX: this function does not allow 64-bit arguments */
00895       ft_multo64( (FT_Int32)in_x, (FT_Int32)out_y, &z1 );
00896       ft_multo64( (FT_Int32)in_y, (FT_Int32)out_x, &z2 );
00897 
00898       if ( z1.hi > z2.hi )
00899         result = +1;
00900       else if ( z1.hi < z2.hi )
00901         result = -1;
00902       else if ( z1.lo > z2.lo )
00903         result = +1;
00904       else if ( z1.lo < z2.lo )
00905         result = -1;
00906       else
00907         result = 0;
00908 
00909 #endif
00910     }
00911 
00912     /* XXX: only the sign of return value, +1/0/-1 must be used */
00913     return (FT_Int)result;
00914   }


Generated on Tue May 15 06:07:19 2012 for ReactOS by doxygen 1.6.3

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.