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

  1. #include "eg_grafx.h"
  2.   
  3. /* function to turn off-on graphics cursor */
  4.   
  5. cursor_x()
  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.     struct egstatus s;
  15.   
  16.     eg_status(&s);
  17.     if (s.world_on){
  18.         store_x  = _gc_x; store_y = _gc_y;
  19.         worldpts(_gc_x,_gc_y,&_gc_x,&_gc_y);
  20.         if (_gc_x < _clipuc) _gc_x = _clipuc;
  21.         if (_gc_x > _cliplc) _gc_x = _cliplc;
  22.         if (_gc_y < _clipur) _gc_y = _clipur;
  23.         if (_gc_y > _cliplr) _gc_y = _cliplr;
  24.         worldon(0);
  25.     }
  26.     else{
  27.         if (_clip){
  28.             if (_gc_x < _clipuc) _gc_x = _clipuc;
  29.             if (_gc_x > _cliplc) _gc_x = _cliplc;
  30.             if (_gc_y < _clipur) _gc_y = _clipur;
  31.             if (_gc_y > _cliplr) _gc_y = _cliplr;
  32.         }
  33.     }
  34.   
  35.     if (!s.xor_on)
  36.         typedot(1);
  37.     eg_line(_gc_x-(_gcwidth/2),_gc_y-(_gcheight/2),_gc_x+(_gcwidth/2),_gc_y+(_gcheight/2),_gcolor);
  38.     eg_line(_gc_x+(_gcwidth/2),_gc_y-(_gcheight/2),_gc_x-(_gcwidth/2),_gc_y+(_gcheight/2),_gcolor);
  39.     eg_dot(_gc_x,_gc_y,_gcolor);
  40.     if (!s.xor_on)
  41.         typedot(0);
  42.     if (s.world_on){
  43.         _gc_x = store_x; _gc_y = store_y;
  44.         worldon(1);
  45.     }
  46.     return(0);
  47. }
  48.