home *** CD-ROM | disk | FTP | other *** search
-
- #include "swar.h"
-
- InitStars()
- {
- extern STARREC gStarRecs[MAX_STARS];
- short i;
-
- for (i = 0; i < MAX_STARS; i++) {
- gStarRecs[i].where.v = RngRnd(0, 479);
- gStarRecs[i].where.h = RngRnd(0, 639);
- gStarRecs[i].color.red = -1;
- gStarRecs[i].color.green = -1;
- gStarRecs[i].color.blue = -1;
- } /* for */
-
- } /* InitStars() */
-
- DrawStars()
- {
- short i;
- GrafPtr savePort;
- extern CGrafPort *gOSPtr;
-
- GetPort(&savePort);
- SetPort((GrafPtr)gOSPtr);
- for (i = 0; i < MAX_STARS; i++) {
- SetCPixel(gStarRecs[i].where.h, gStarRecs[i].where.v, &(gStarRecs[i].color));
- } /* for */
- SetPort(savePort);
-
- } /* DrawStars() */