home *** CD-ROM | disk | FTP | other *** search
- /*
- expbmu.c
-
- % Beam Me Up Explode function for windows
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 8/18/88 jmd created
- 9/12/88 jmd Added in and out data to objects
- 12/01/88 jmd Tidied up
-
- 8/13/89 jmd removed GETEXPLODE message
- */
-
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "explode.h"
-
- #define COUNT 400
-
- #define EXP_CHARS "*!. "
-
- int exp_BeamMeUp(objdata, msg, indata, outdata)
- VOID *objdata; /* calling object's instance data pointer (ignored) */
- int msg; /* message */
- VOID *indata; /* message input data */
- VOID *outdata; /* message output data */
- /*
- "Beam Me Up" explode function.
- */
- {
- ptd_struct *ptd;
- int hgt, wid, i;
- byte attr;
- char expchar[2];
-
- /* objdata is ignored. */ oak_notused(objdata);
- /* outdata is not used. */ oak_notused(outdata);
-
- switch (msg) {
- case WINM_EXPLODE:
- /* paint random dots within the window for a while */
- ptd = (ptd_struct *)indata;
-
- hgt = win_GetHeight(ptd->win);
- wid = win_GetWidth(ptd->win);
- attr = win_GetAttr(ptd->win);
- expchar[1] = '\0'; /* terminate, cause I'm a good boy */
-
- for (i = 0; i < COUNT; i++) {
- expchar[0] = *(EXP_CHARS + rand() % sizeof(EXP_CHARS));
- ptd_DrawString(ptd, rand() % hgt, rand() % wid, expchar, attr, 1);
- }
- break;
- }
-
- return(TRUE);
- }
-
-