X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fflurry.c;h=3571bece03dad6ec4fe4f22127e5787a966fddeb;hp=0014cd818e7589535dc5f1abb3fa0a59083cd3bd;hb=96a411663168b0ba5432b407a83be55f3df0c802;hpb=4cecfc89e5e889c7232693897c06168fb378bd5c diff --git a/hacks/glx/flurry.c b/hacks/glx/flurry.c index 0014cd81..3571bece 100644 --- a/hacks/glx/flurry.c +++ b/hacks/glx/flurry.c @@ -37,9 +37,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* flurry */ -#if !defined( lint ) && !defined( SABER ) +#if 0 static const char sccsid[] = "@(#)flurry.c 4.07 97/11/24 xlockmore"; - #endif /*- @@ -56,8 +55,6 @@ static const char sccsid[] = "@(#)flurry.c 4.07 97/11/24 xlockmore"; # define HACK_INIT init_flurry # define HACK_DRAW draw_flurry # define HACK_RESHAPE reshape_flurry -# define HACK_HANDLE_EVENT flurry_handle_event -# define EVENT_MASK PointerMotionMask # define flurry_opts xlockmore_opts # define DEFAULTS "*showFPS: False \n" \ "*preset: " DEF_PRESET " \n" @@ -66,9 +63,6 @@ static const char sccsid[] = "@(#)flurry.c 4.07 97/11/24 xlockmore"; #ifdef USE_GL -#include "rotator.h" -#include "gltrackball.h" - static char *preset_str; static XrmOptionDescRec opts[] = { @@ -103,7 +97,6 @@ ModStruct flurry_description = { #endif #include -#include #include "flurry.h" @@ -113,8 +106,12 @@ static double gTimeCounter = 0.0; double currentTime(void) { struct timeval tv; - - gettimeofday(&tv, NULL); +# ifdef GETTIMEOFDAY_TWO_ARGS + struct timezone tzp; + gettimeofday(&tv, &tzp); +# else + gettimeofday(&tv); +# endif return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0; } @@ -129,12 +126,14 @@ double TimeInSecondsSinceStart (void) { return currentTime() - gTimeCounter; } +#if 0 #ifdef __ppc__ static int IsAltiVecAvailable(void) { return 0; } #endif +#endif void delete_flurry_info(flurry_info_t *flurry) { @@ -158,7 +157,9 @@ flurry_info_t *new_flurry_info(global_info_t *global, int streams, ColorModes co flurry->flurryRandomSeed = RandFlt(0.0, 300.0); - flurry->fOldTime = TimeInSecondsSinceStart() + flurry->flurryRandomSeed; + flurry->fOldTime = 0; + flurry->fTime = TimeInSecondsSinceStart() + flurry->flurryRandomSeed; + flurry->fDeltaTime = flurry->fTime - flurry->fOldTime; flurry->numStreams = streams; flurry->streamExpansion = thickness; @@ -216,6 +217,7 @@ void GLSetupRC(global_info_t *global) glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); +#if 0 #ifdef __ppc__ global->optMode = OPT_MODE_SCALAR_FRSQRTE; @@ -226,6 +228,7 @@ void GLSetupRC(global_info_t *global) #else global->optMode = OPT_MODE_SCALAR_BASE; #endif +#endif /* 0 */ } void GLRenderScene(global_info_t *global, flurry_info_t *flurry, double b) @@ -263,6 +266,7 @@ void GLRenderScene(global_info_t *global, flurry_info_t *flurry, double b) case OPT_MODE_SCALAR_BASE: UpdateSmoke_ScalarBase(global, flurry, flurry->s); break; +#if 0 #ifdef __ppc__ case OPT_MODE_SCALAR_FRSQRTE: UpdateSmoke_ScalarFrsqrte(global, flurry, flurry->s); @@ -276,6 +280,8 @@ void GLRenderScene(global_info_t *global, flurry_info_t *flurry, double b) UpdateSmoke_VectorUnrolled(global, flurry, flurry->s); break; #endif +#endif /* 0 */ + default: break; } @@ -287,17 +293,21 @@ void GLRenderScene(global_info_t *global, flurry_info_t *flurry, double b) switch(global->optMode) { case OPT_MODE_SCALAR_BASE: +#if 0 #ifdef __ppc__ case OPT_MODE_SCALAR_FRSQRTE: #endif +#endif /* 0 */ DrawSmoke_Scalar(global, flurry, flurry->s, b); break; +#if 0 #ifdef __VEC__ case OPT_MODE_VECTOR_SIMPLE: case OPT_MODE_VECTOR_UNROLLED: DrawSmoke_Vector(global, flurry, flurry->s, b); break; #endif +#endif /* 0 */ default: break; } @@ -332,32 +342,6 @@ void reshape_flurry(ModeInfo *mi, int width, int height) GLResize(global, (float)width, (float)height); } -Bool -flurry_handle_event (ModeInfo *mi, XEvent *event) -{ - global_info_t *global = flurry_info + MI_SCREEN(mi); - - if (event->xany.type == ButtonPress && event->xbutton.button & Button1) { - global->button_down_p = True; - gltrackball_start (global->trackball, - event->xbutton.x, event->xbutton.y, - MI_WIDTH (mi), MI_HEIGHT (mi)); - return True; - } - else if (event->xany.type == ButtonRelease && event->xbutton.button & Button1) { - global->button_down_p = False; - return True; - } - else if (event->xany.type == MotionNotify && global->button_down_p) { - gltrackball_track (global->trackball, - event->xmotion.x, event->xmotion.y, - MI_WIDTH (mi), MI_HEIGHT (mi)); - return True; - } - - return False; -} - void init_flurry(ModeInfo * mi) { @@ -386,9 +370,6 @@ init_flurry(ModeInfo * mi) global->window = MI_WINDOW(mi); - global->rot = make_rotator(1, 1, 1, 1, 0, True); - global->trackball = gltrackball_init(); - global->flurry = NULL; if (!preset_str || !*preset_str) preset_str = DEF_PRESET;