home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / CLRSCR.PRG < prev    next >
Encoding:
Text File  |  1991-04-23  |  3.2 KB  |  99 lines

  1. /*
  2.     Program: CLRSCR.PRG
  3.     System: GRUMPFISH LIBRARY
  4.     Author: Greg Lief
  5.     Copyright (c) 1988-90, Greg Lief
  6.     Clipper 5.x Version
  7.     Compile instructions: clipper clrscr /n/w/a
  8.  
  9.                Methods #8 and #9 written and provided courtesy of:
  10.                    Laurent Maggiore
  11.                    150 Bd. Poincaré
  12.                    06160 Juan-Les_Pins
  13.                    FRANCE
  14.  
  15.     WILL HANDLE 25/43/50 ROW DISPLAYS (except for methods 7 and 8,
  16.     camera lens and diagonal, which are still 25 x 80 only)
  17. */
  18.  
  19. //───── begin preprocessor directives
  20.  
  21. #include "grump.ch"
  22. #command CLEARIT(<t>, <l>, <b>, <r>) => scroll(<t>, <l>, <b>, <r>, 0) ;;
  23.                                         for yy := 1 TO ndelay; next
  24. #define MIDPOINT int((maxcol + 1) / 2)
  25.  
  26. //───── end preprocessor directives
  27.  
  28. function clrscr(ntype, ndelay)
  29. local xx, yy, maxrow := maxrow(), maxcol := maxcol(), buffer, mrow, ;
  30.       ndelays := {100, 100, 40, 40, 40, 40, 150, 40, 15}
  31. default ntype to 1
  32. default ndelay to ndelays[ntype]
  33. do case
  34.    case ntype == WINDOWDOWN
  35.       for xx = 0 to maxrow
  36.          CLEARIT(xx, 0, xx, maxcol)
  37.       next
  38.    case ntype == WINDOWUP
  39.       for xx = maxrow to 0 step -1
  40.          CLEARIT(xx, 0, xx, maxcol)
  41.       next
  42.    case ntype == DOORRIGHT
  43.       for xx = 0 to maxcol
  44.          CLEARIT(0, xx, maxrow, xx)
  45.       next
  46.    case ntype == DOORLEFT
  47.       for xx = maxcol to 0 step -1
  48.          CLEARIT(0, xx, maxrow, xx)
  49.       next
  50.    case ntype == CURTAINOPEN
  51.       for xx = MIDPOINT to maxcol
  52.          scroll(00, maxcol-xx, maxrow, maxcol-xx, 0)
  53.          CLEARIT(0, xx, maxrow, xx)
  54.       next
  55.    case ntype == CURTAINSHUT
  56.       for xx = maxcol to MIDPOINT step -1
  57.          scroll(00, maxcol-xx, maxrow, maxcol-xx, 0)
  58.          CLEARIT(0, xx, maxrow, xx)
  59.       next
  60.    case ntype == CAMERALENS     // still set up for 25 x 80 mode
  61.       mrow := 0
  62.       for xx = 0 to 33 step 3
  63.           scroll(mrow, xx, mrow, maxcol - xx, 0)
  64.           scroll(maxrow - mrow, xx, maxrow - mrow, maxcol - xx, 0)
  65.           scroll(mrow, xx, maxrow - mrow, xx + 3, 0)
  66.           CLEARIT(mrow, 76 - xx, maxrow - mrow, maxcol - xx)
  67.           mrow++
  68.       next
  69.       scroll(mrow, 37, mrow, 42, 0)
  70.    case ntype == DIAGONAL        // still set up for 25 x 80 mode
  71.       for xx = 0 to maxcol
  72.          scroll(int(xx/3.2), xx, maxrow, xx, 0)
  73.          scroll(0, maxcol - xx, maxrow - int(xx/3.2), maxcol - xx, 0)
  74.          for yy = 1 to ndelay
  75.          next
  76.       next
  77.    otherwise                    // HALVES
  78.       for xx = 0 to maxrow
  79.          buffer := savescreen(xx, 0, maxrow - 1, MIDPOINT - 1)
  80.          scroll(xx, 0, xx, MIDPOINT - 1, 0)
  81.          if xx < maxrow
  82.            restscreen(xx+1, 0, maxrow, MIDPOINT - 1, buffer)
  83.          endif
  84.          buffer := savescreen(1, MIDPOINT, maxrow-xx, maxcol)
  85.          scroll(maxrow-xx, MIDPOINT, maxrow-xx, maxcol, 0)
  86.          if xx < maxrow
  87.            restscreen(0, MIDPOINT, maxrow - 1 - xx, maxcol, buffer)
  88.          endif
  89.          for yy = 1 to ndelay
  90.          next
  91.       next
  92. endcase
  93. return NIL
  94.  
  95. * end function ClrScr()
  96. *--------------------------------------------------------------------*
  97.  
  98. * eof clrscr.prg
  99.