home *** CD-ROM | disk | FTP | other *** search
- /* wzoom.c - window with zoom-in effect like PROCOMM */
- /* This function saves the used area to a user defined */
- /* buffer which may be restored with scrn_restore. */
- /* */
- /* AUTHOR Tim Spencer - Compuserve [73657,1400] */
- /* DATE March 13, 1987 */
- /* ALTERED R. Hensel */
- /* DATE Noovember 27 1987 */
- /* Reason allow choice of single or double line box */
-
- #include "video.h"
-
- void scrn_wzoom(left,right,top,bottom,buff,type,sc)
- int left,right,top,bottom; /* boundries */
- int type; /* single or double line */
- char *buff; /* user defined pointer to screen storage */
- SCRN *sc;
- {
- unsigned l = left, r = right ,t = top, b = bottom;/* create work copies */
- /* of parameters */
- int temp_cga = sc->cga_card;
-
- scrn_save(left,right,top,bottom,buff,sc); /* save the area to buff */
- sc->cga_card = 1; /* slow it down a little for mono & ega cards */
-
-
- /* shrink the box until top meets bottom or left meets right */
-
- while (l < r-1 && t < b-1) {
- ++l;
- --r;
- ++t;
- --b;
- }
-
- /* expand the parameters once to make sure none are the same */
-
- scrn_border(l,r,t,b,type,sc);
- l -= 1;
- r += 1;
- t -= 1;
- b += 1;
-
- /* now keep drawing the box, blanking it's area, expanding, etc. */
- /* until any border reaches it's boundry */
-
- while (l > left && r < right && t > top && b < bottom) {
- scrn_border(l,r,t,b,type,sc);
- vid_up(0,l+1,r-1,t+1,b-1,sc->attrib); /* blank the area using the */
- /* attribute defined in sc */
- l -= 1;
- r += 1;
- t -= 1;
- b += 1;
- }
-
- /* Draw the final box and clear it's area */
-
- scrn_border(left,right,top,bottom,type,sc);
- vid_up(0,left+1,right-1,top+1,bottom-1,sc->attrib);
-
- sc->cga_card = temp_cga; /* restore original cga truth */
- }
-