/*
* 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.
*/
/*-
* rotor.c - A swirly rotor for xlock, the X Window System lockscreen.
*
* Copyright (c) 1991 by Patrick J. Naughton.
*
* See xlock.c for copying information.
*
* Revision History:
* 11-Nov-90: put into xlock (by Steve Zellers, zellers@sun.com)
* 16-Oct-90: Received from Tom Lawrence (tcl@cs.brown.edu: 'flight' simulator)
*/
/*
* A 'batchcount' of 3 or 4 works best!
*/
#include <stdio.h>
#include <math.h>
#include "xlock.h"
typedef unsigned char Boolean;
#define IDENT(X) X
#ifdef __STDC__
#define CAT(X,Y) X##Y
#else
#endif
struct elem {
float angle;
float radius;
float start_radius;
float end_radius;
float radius_drift_max;
float radius_drift_now;
float ratio;
float start_ratio;
float end_ratio;
float ratio_drift_max;
float ratio_drift_now;
};
typedef struct flightstruct {
int pix;
int lastx,
int num,
prev;
float angle;
int centerx,
} flightstruct;
void
{
int x;
/*
* sometimes, you go into small view, only to see a really whizzy pattern
* that you would like to look more closely at. Normally, clicking in the
* icon reinitializes everything - but I don't, cuz I'm that kind of guy.
* HENCE, the wassmall stuff you see here.
*/
else {
error("allocation failed, unable to motor our rotor\n");
}
}
}
}
void
{
int thisx,
int i,
rp;
int x1,
y1,
x2,
y2;
}
pelem->end_radius =
}
}
}
else {
SCALEIFSMALL();
} else
SCALEIFSMALL();
}
}
} else {
}
}
}
}