+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these libraries and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
/* $XConsortium: pyro.c /main/3 1995/11/02 16:07:59 rswiston $ */
/*
*/
#include "dtscreen.h"
#include <math.h>
+#include <stdlib.h>
+
#define TWOPI 6.2831853
/* Define this >1 to get small rectangles instead of points */
static int just_started = True;/* Greet the user right away */
void
-initpyro(pwin)
- perwindow *pwin;
+initpyro(perwindow *pwin)
{
pyrostruct *pp;
rocket *rp;
/*ARGSUSED*/
void
-drawpyro(pwin)
- perwindow *pwin;
+drawpyro(perwindow *pwin)
{
pyrostruct *pp;
rocket *rp;
}
static void
-ignite(pwin, pp)
- perwindow *pwin;
- pyrostruct *pp;
+ignite(perwindow *pwin, pyrostruct *pp)
{
rocket *rp;
int multi, shelltype, nstars, fuse, npix, pix, color1, color2;
x = random() % pp->width;
xvel = FLOATRAND(-pp->maxvelx, pp->maxvelx);
/* All this to stop too many rockets going offscreen: */
- if (x < pp->lmargin && xvel < 0.0 || x > pp->rmargin && xvel > 0.0)
+ if ((x < pp->lmargin && xvel < 0.0) || (x > pp->rmargin && xvel > 0.0))
xvel = -xvel;
yvel = FLOATRAND(pp->minvely, pp->maxvely);
fuse = INTRAND(MINFUSE, MAXFUSE);
}
static void
-animate(pwin, pp, rp)
- perwindow *pwin;
- pyrostruct *pp;
- rocket *rp;
+animate(perwindow *pwin, pyrostruct *pp, rocket *rp)
{
int starn;
float r, theta;
}
static void
-shootup(pwin, pp, rp)
- perwindow *pwin;
- pyrostruct *pp;
- rocket *rp;
+shootup(perwindow *pwin, pyrostruct *pp, rocket *rp)
{
XFillRectangle(dsp, pwin->w, pp->bgGC, (int) (rp->x), (int) (rp->y),
ROCKETW, ROCKETH + 3);
}
static void
-burst(pwin, pp, rp)
- perwindow *pwin;
- pyrostruct *pp;
- rocket *rp;
+burst(perwindow *pwin, pyrostruct *pp, rocket *rp)
{
register int starn;
register int nstars, stype;