# HG changeset patch # User nenolod # Date 1164265166 28800 # Node ID b185ed2f8fa24f9d138a6c9256dbadbfae34c900 # Parent cf6bd092969d015ee64c02d07ed02c81f1e36fb3 [svn] - improve beat detection diff -r cf6bd092969d -r b185ed2f8fa2 ChangeLog --- a/ChangeLog Wed Nov 22 22:46:16 2006 -0800 +++ b/ChangeLog Wed Nov 22 22:59:26 2006 -0800 @@ -1,3 +1,11 @@ +2006-11-23 06:46:16 +0000 William Pitcock + revision [656] + - i've done a lot of this + + trunk/src/paranormal/TODO | 6 ------ + 1 file changed, 6 deletions(-) + + 2006-11-23 06:41:39 +0000 William Pitcock revision [654] - another 3d preset diff -r cf6bd092969d -r b185ed2f8fa2 src/paranormal/containers.c --- a/src/paranormal/containers.c Wed Nov 22 22:46:16 2006 -0800 +++ b/src/paranormal/containers.c Wed Nov 22 22:59:26 2006 -0800 @@ -175,12 +175,11 @@ { struct container_cycle_data *cdata = (struct container_cycle_data*)data; int now; - int new_beat = pn_is_new_beat(); /* * Change branch if all of the requirements are met for the branch to change. */ - if ((opts[1].val.bval == TRUE && new_beat != 0) || opts[1].val.bval == FALSE) + if ((opts[1].val.bval == TRUE && pn_new_beat != FAlSE) || opts[1].val.bval == FALSE) { now = SDL_GetTicks(); @@ -232,7 +231,7 @@ { GSList *child; - if (pn_is_new_beat() == TRUE) + if (pn_new_beat == TRUE) { for (child = *data; child; child = child->next) exec_actuator ((struct pn_actuator *) child->data); diff -r cf6bd092969d -r b185ed2f8fa2 src/paranormal/misc.c --- a/src/paranormal/misc.c Wed Nov 22 22:46:16 2006 -0800 +++ b/src/paranormal/misc.c Wed Nov 22 22:59:26 2006 -0800 @@ -88,7 +88,7 @@ } /* check if we need to change direction yet, and if so, do so. */ - if (pn_is_new_beat() == TRUE) + if (pn_new_beat == TRUE) opaque_data->dir = (FloaterDirection) rand() % 15; /* sum of all dir values */ /* now adjust the direction so we stay in boundary */ diff -r cf6bd092969d -r b185ed2f8fa2 src/paranormal/paranormal.c --- a/src/paranormal/paranormal.c Wed Nov 22 22:46:16 2006 -0800 +++ b/src/paranormal/paranormal.c Wed Nov 22 22:59:26 2006 -0800 @@ -30,6 +30,8 @@ float sin_val[360]; float cos_val[360]; +gboolean pn_new_beat; + /* **************** drawing doodads **************** */ static void @@ -197,6 +199,8 @@ } } + pn_new_beat = pn_is_new_beat(); + if (pn_rc->actuator) { exec_actuator (pn_rc->actuator); diff -r cf6bd092969d -r b185ed2f8fa2 src/paranormal/paranormal.h --- a/src/paranormal/paranormal.h Wed Nov 22 22:46:16 2006 -0800 +++ b/src/paranormal/paranormal.h Wed Nov 22 22:59:26 2006 -0800 @@ -46,6 +46,8 @@ extern struct pn_sound_data *pn_sound_data; extern struct pn_image_data *pn_image_data; +extern gboolean pn_new_beat; + /* global trig pre-computes */ extern float sin_val[360]; extern float cos_val[360];