/*
* Copyright (c) 1988-91 by Patrick J. Naughton.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation.
*
* This file is provided AS IS with no warranties of any kind. The author
* shall have no liability with respect to the infringement of copyrights,
* trade secrets or any patents by this file or any part thereof. In no
* event will the author be liable for any lost revenue or profits or
* other special, indirect and consequential damages.
*/
/*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/*-
* pyro.c - Fireworks for xlock, the X Window System lockscreen.
*
* Copyright (c) 1991 by Patrick J. Naughton.
*
* See xlock.c for copying information.
*
* Revision History:
* 16-Mar-91: Written. (received from David Brooks, brooks@osf.org).
*/
/* The physics of the rockets is a little bogus, but it looks OK. Each is
* given an initial velocity impetus. They decelerate slightly (gravity
* overcomes the rocket's impulse) and explode as the rocket's main fuse
* gives out (we could add a ballistic stage, maybe). The individual
* stars fan out from the rocket, and they decelerate less quickly.
* That's called bouyancy, but really it's again a visual preference.
*/
#include "xlock.h"
#include <math.h>
/* Define this >1 to get small rectangles instead of points */
#ifndef STARSIZE
#endif
#define SILENT 0
#define CLOUD 0
/* Clearly other types and other fascinating visual effects could be added...*/
/* P_xxx parameters represent the reciprocal of the probability... */
static void ignite();
static void animate();
static void shootup();
static void burst();
typedef struct {
int state;
int shelltype;
int fuse;
float x, y;
int nstars;
#if STARSIZE > 1
#else
#endif
* center */
* center */
} rocket;
typedef struct {
int p_ignite;
unsigned long bgpixel;
unsigned long fgpixel;
unsigned long rockpixel;
int nflying;
int fusilcount;
float maxsvel;
} pyrostruct;
static int orig_p_ignite;
void
{
if (orig_p_ignite <= 0)
orig_p_ignite = 1;
}
#if STARSIZE > 1
}
#endif
}
* orange */
else
}
/* Geometry-dependent physical data: */
}
/*ARGSUSED*/
void
{
int rockn;
if (random() % P_FUSILLADE == 0) {
}
if (pp->fusilcount > 0) {
if (--pp->fusilcount == 0)
}
}
rockn--;
}
}
}
static void
pyrostruct *pp;
{
/* All this to stop too many rockets going offscreen: */
} else {
}
multi = 1;
if (random() % P_DOUBLECLOUD == 0)
else {
}
while (multi--) {
return;
rp++;
}
}
static void
pyrostruct *pp;
{
int starn;
float r, theta;
/* Handle setup for explosion */
}
/* This isn't accurate solid geometry, but it looks OK. */
}
}
}
}
}
static void
pyrostruct *pp;
{
return;
}
}
static void
pyrostruct *pp;
{
register int starn;
#if STARSIZE > 1
if (stype == DOUBLECLOUD)
#else
if (stype == DOUBLECLOUD)
#endif
return;
}
/* Stagger the stars' decay */
return;
}
if (stype == DOUBLECLOUD) {
}
}
#if STARSIZE > 1
if (stype == DOUBLECLOUD) {
}
#else
if (stype == DOUBLECLOUD) {
}
#endif
}