home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 10.ddi / TVSRC.ZIP / TPOINT.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.6 KB  |  47 lines

  1. /*------------------------------------------------------------*/
  2. /* filename -       tpoint.cpp                                */
  3. /*                                                            */
  4. /* function(s)                                                */
  5. /*                  TPoint member functions                   */
  6. /*------------------------------------------------------------*/
  7.  
  8. /*------------------------------------------------------------*/
  9. /*                                                            */
  10. /*    Turbo Vision -  Version 1.0                             */
  11. /*                                                            */
  12. /*                                                            */
  13. /*    Copyright (c) 1991 by Borland International             */
  14. /*    All Rights Reserved.                                    */
  15. /*                                                            */
  16. /*------------------------------------------------------------*/
  17.  
  18. #define Uses_TPoint
  19. #include <tv.h>
  20.  
  21. TPoint operator - ( const TPoint& one, const TPoint& two )
  22. {
  23.     TPoint result;
  24.     result.x = one.x - two.x;
  25.     result.y = one.y - two.y;
  26.     return result;
  27. }
  28.  
  29. TPoint operator + ( const TPoint& one, const TPoint& two )
  30. {
  31.     TPoint result;
  32.     result.x = one.x + two.x;
  33.     result.y = one.y + two.y;
  34.     return result;
  35. }
  36.  
  37. int operator == ( const TPoint& one, const TPoint& two )
  38. {
  39.     return one.x == two.x && one.y == two.y;
  40. }
  41.  
  42. int operator!= ( const TPoint& one, const TPoint& two )
  43. {
  44.     return one.x != two.x || one.y != two.y;
  45. }
  46.  
  47.