home *** CD-ROM | disk | FTP | other *** search
- /*
- expbmu.c
-
- % Beam Me Up Explode function for windows
-
- OWL 1.2
- 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
- 3/28/90 jmd ansi-fied
- */
-
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "explode.h"
-
- #define COUNT 400
-
- #define EXP_CHARS "*!. "
-
- int exp_BeamMeUp(VOID *objdata, int msg, VOID *indata, VOID *outdata)
- /*
- "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);
- }
-
-