home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m242 / 1.ddi / SOURCE.ZIP / CROSSHAI.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-16  |  1.4 KB  |  51 lines

  1. #include "eg_grafx.h"
  2.   
  3. /* function to turn off-on graphics cursor */
  4.   
  5. crosshair()
  6. {
  7.     extern int _gc_x,_gc_y,_gcolor,_gcheight,_gcwidth;
  8.     extern int _clip;          /* clipping, 0=off, 1 = on */
  9.     extern int _clipuc;        /* clipping upper left & lower right boundaries */
  10.     extern int _cliplc;
  11.     extern int _clipur;        /* clipping upper left & lower right boundaries */
  12.     extern int _cliplr;
  13.     int store_x,store_y;
  14.   
  15.     struct egstatus s;
  16.   
  17.     eg_status(&s);
  18.   
  19.     if (s.world_on){
  20.         store_x  = _gc_x; store_y = _gc_y;
  21.         worldpts(_gc_x,_gc_y,&_gc_x,&_gc_y);
  22.         if (_gc_x < _clipuc) _gc_x = _clipuc;
  23.         if (_gc_x > _cliplc) _gc_x = _cliplc;
  24.         if (_gc_y < _clipur) _gc_y = _clipur;
  25.         if (_gc_y > _cliplr) _gc_y = _cliplr;
  26.         worldon(0);
  27.     }
  28.     else{
  29.         if (_clip){
  30.             if (_gc_x < _clipuc) _gc_x = _clipuc;
  31.             if (_gc_x > _cliplc) _gc_x = _cliplc;
  32.             if (_gc_y < _clipur) _gc_y = _clipur;
  33.             if (_gc_y > _cliplr) _gc_y = _cliplr;
  34.         }
  35.     }
  36.   
  37.     if (!s.xor_on)
  38.         typedot(1);
  39.     eg_line(_gc_x-(_gcwidth/2),_gc_y,_gc_x+(_gcwidth/2),_gc_y,_gcolor);
  40.     eg_line(_gc_x,_gc_y-(_gcheight/2),_gc_x,_gc_y+(_gcheight/2),_gcolor);
  41.     eg_dot(_gc_x,_gc_y,_gcolor);
  42.     if (!s.xor_on)
  43.         typedot(0);
  44.   
  45.     if (s.world_on){
  46.         _gc_x = store_x; _gc_y = store_y;
  47.         worldon(1);
  48.     }
  49.     return(0);
  50. }
  51.