home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / EXPSTD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  1.6 KB  |  71 lines

  1. /*
  2.     expstd.c
  3.  
  4.     % Explode function for windows
  5.  
  6.     OWL 1.1
  7.     Copyright (c) 1988, 1989 by Oakland Group, Inc.
  8.     ALL RIGHTS RESERVED.
  9.  
  10.     Revision History:
  11.     -----------------
  12.      8/17/88 jmd    created
  13.      9/12/88 jmd    Added in and out data to objects
  14.     12/01/88 jmd    Tinkered with delay, steps, etc.
  15.  
  16.      8/13/89 jmd    removed GETEXPLODE message
  17. */
  18.  
  19.  
  20. #include "oakhead.h"
  21. #include "disppriv.h"
  22.  
  23. #include "explode.h"
  24.  
  25. #define EXPLODE_BOX     "\332\304\277\263\331\304\300\263"
  26. #define ERASE_BOX     "        "
  27.  
  28. int exp_std(objdata, msg, indata, outdata)
  29.     VOID *objdata;            /* calling object's instance data pointer (ignored) */
  30.     int msg;                /* message */
  31.     VOID *indata;            /* message input data */
  32.     VOID *outdata;            /* message output data */
  33. /*
  34.     "Standard" explode function.
  35. */
  36. {
  37.     ptd_struct *ptd;
  38.     int               explode, hgt, wid;
  39.     ocbox              cbox;
  40.     byte               attr;
  41.  
  42.     /* objdata is ignored. */ oak_notused(objdata);
  43.     /* outdata is not used. */ oak_notused(outdata);
  44.  
  45.     switch (msg) {
  46.     case WINM_EXPLODE:
  47.         /* paint an explode window (called with increasing values of explode) */
  48.         ptd = (ptd_struct *)indata;
  49.  
  50.         for (explode = 3; explode < 6; explode++) {
  51.             hgt = win_GetHeight(ptd->win);
  52.             wid = win_GetWidth(ptd->win);
  53.             attr = win_GetAttr(ptd->win);
  54.  
  55.             cbox.toprow   = hgt/explode;
  56.             cbox.leftcol  = wid/explode;
  57.             cbox.botrow   = hgt - cbox.toprow;
  58.             cbox.rightcol = wid - cbox.leftcol;
  59.  
  60.             ptd_DrawCharBox(ptd, EXPLODE_BOX, &cbox, attr);
  61.             hard_Pause(1);
  62.             ptd_DrawCharBox(ptd, ERASE_BOX, &cbox, attr);
  63.         }
  64.         break;
  65.     }
  66.  
  67.     return(TRUE);
  68. }
  69. /* -------------------------------------------------------------------------- */
  70.  
  71.