summaryrefslogtreecommitdiffstats
path: root/gst/goom
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-03-15 19:32:27 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-03-15 19:32:27 +0000
commit6cc1c73d2baa95c46edc04f57cbe9ed690dc2f21 (patch)
tree82b5546809a42a56a7bc18bacf8ed6e209ad006e /gst/goom
parentd07ec45fa47fbd0e36224e11bcd8ba2faee1a78c (diff)
don't mix tabs and spaces
Original commit message from CVS: don't mix tabs and spaces
Diffstat (limited to 'gst/goom')
-rw-r--r--gst/goom/filters.c246
-rw-r--r--gst/goom/goom_core.c306
-rw-r--r--gst/goom/gstgoom.c33
-rw-r--r--gst/goom/lines.c48
4 files changed, 317 insertions, 316 deletions
diff --git a/gst/goom/filters.c b/gst/goom/filters.c
index 14bd7ec6..9fadf2f6 100644
--- a/gst/goom/filters.c
+++ b/gst/goom/filters.c
@@ -55,8 +55,8 @@ unsigned int ppcsize4;
#endif /* PowerPC */
unsigned int *coeffs = 0, *freecoeffs = 0;
-guint32 *expix1 = 0; /* pointeur exporte vers p1 */
-guint32 *expix2 = 0; /* pointeur exporte vers p2 */
+guint32 *expix1 = 0; /* pointeur exporte vers p1 */
+guint32 *expix2 = 0; /* pointeur exporte vers p2 */
guint32 zoom_width;
#endif /* ASM */
@@ -141,33 +141,33 @@ calculatePXandPY (int x, int y, int *px, int *py)
switch (theMode) {
case WAVE_MODE:
- dist =
- ShiftRight (vx, 9) * ShiftRight (vx, 9) + ShiftRight (vy,
- 9) * ShiftRight (vy, 9);
- fvitesse *=
- 1024 +
- ShiftRight (sintable[(unsigned short) (0xffff * dist *
- EFFECT_DISTORS)], 6);
- fvitesse /= 1024;
- break;
+ dist =
+ ShiftRight (vx, 9) * ShiftRight (vx, 9) + ShiftRight (vy,
+ 9) * ShiftRight (vy, 9);
+ fvitesse *=
+ 1024 +
+ ShiftRight (sintable[(unsigned short) (0xffff * dist *
+ EFFECT_DISTORS)], 6);
+ fvitesse /= 1024;
+ break;
case CRYSTAL_BALL_MODE:
- dist =
- ShiftRight (vx, 9) * ShiftRight (vx, 9) + ShiftRight (vy,
- 9) * ShiftRight (vy, 9);
- fvitesse += (dist * EFFECT_DISTORS >> 10);
- break;
+ dist =
+ ShiftRight (vx, 9) * ShiftRight (vx, 9) + ShiftRight (vy,
+ 9) * ShiftRight (vy, 9);
+ fvitesse += (dist * EFFECT_DISTORS >> 10);
+ break;
case AMULETTE_MODE:
- dist =
- ShiftRight (vx, 9) * ShiftRight (vx, 9) + ShiftRight (vy,
- 9) * ShiftRight (vy, 9);
- fvitesse -= (dist * EFFECT_DISTORS >> 4);
- break;
+ dist =
+ ShiftRight (vx, 9) * ShiftRight (vx, 9) + ShiftRight (vy,
+ 9) * ShiftRight (vy, 9);
+ fvitesse -= (dist * EFFECT_DISTORS >> 4);
+ break;
case SCRUNCH_MODE:
- dist =
- ShiftRight (vx, 9) * ShiftRight (vx, 9) + ShiftRight (vy,
- 9) * ShiftRight (vy, 9);
- fvitesse -= (dist * EFFECT_DISTORS >> 9);
- break;
+ dist =
+ ShiftRight (vx, 9) * ShiftRight (vx, 9) + ShiftRight (vy,
+ 9) * ShiftRight (vy, 9);
+ fvitesse -= (dist * EFFECT_DISTORS >> 9);
+ break;
}
if (vx < 0)
*px = (middleX << 4) - (-(vx * fvitesse) >> 16);
@@ -285,7 +285,7 @@ zoomFilterFastRGB (Uint * pix1,
{
static guint32 prevX = 0, prevY = 0;
- static char reverse = 0; /*vitesse inversé..(zoom out) */
+ static char reverse = 0; /*vitesse inversé..(zoom out) */
/* static int perte = 100; // 100 = normal */
static unsigned char pertedec = 8;
@@ -361,7 +361,7 @@ zoomFilterFastRGB (Uint * pix1,
firstTime = 0;
#ifdef USE_ASM
freecoeffs = (unsigned int *)
- malloc (resx * resy * 2 * sizeof (unsigned int) + 128);
+ malloc (resx * resy * 2 * sizeof (unsigned int) + 128);
coeffs = (guint32 *) ((1 + ((unsigned int) (freecoeffs)) / 128) * 128);
#else
@@ -372,49 +372,49 @@ zoomFilterFastRGB (Uint * pix1,
c4 = (unsigned int *) malloc (resx * resy * sizeof (unsigned int));
#endif
for (us = 0; us < 0xffff; us++) {
- sintable[us] = (int) (1024.0f * sin (us * 2 * 3.31415f / 0xffff));
+ sintable[us] = (int) (1024.0f * sin (us * 2 * 3.31415f / 0xffff));
}
{
- int loopv;
- firedec = (int *) malloc (prevY * sizeof (int));
- for (loopv = prevY; loopv != 0;) {
- static int decc = 0;
- static int spdc = 0;
- static int accel = 0;
-
- loopv--;
- firedec[loopv] = decc;
- decc += spdc / 10;
- spdc += RAND () % 3;
- spdc -= RAND () % 3;
-
- if (decc > 4)
- spdc -= 1;
- if (decc < -4)
- spdc += 1;
-
- if (spdc > 30)
- spdc = spdc - RAND () % 3 + accel / 10;
- if (spdc < -30)
- spdc = spdc + RAND () % 3 + accel / 10;
-
- if (decc > 8 && spdc > 1)
- spdc -= RAND () % 3 - 2;
-
- if (decc < -8 && spdc < -1)
- spdc += RAND () % 3 + 2;
-
- if (decc > 8 || decc < -8)
- decc = decc * 8 / 9;
-
- accel += RAND () % 2;
- accel -= RAND () % 2;
- if (accel > 20)
- accel -= 2;
- if (accel < -20)
- accel += 2;
- }
+ int loopv;
+ firedec = (int *) malloc (prevY * sizeof (int));
+ for (loopv = prevY; loopv != 0;) {
+ static int decc = 0;
+ static int spdc = 0;
+ static int accel = 0;
+
+ loopv--;
+ firedec[loopv] = decc;
+ decc += spdc / 10;
+ spdc += RAND () % 3;
+ spdc -= RAND () % 3;
+
+ if (decc > 4)
+ spdc -= 1;
+ if (decc < -4)
+ spdc += 1;
+
+ if (spdc > 30)
+ spdc = spdc - RAND () % 3 + accel / 10;
+ if (spdc < -30)
+ spdc = spdc + RAND () % 3 + accel / 10;
+
+ if (decc > 8 && spdc > 1)
+ spdc -= RAND () % 3 - 2;
+
+ if (decc < -8 && spdc < -1)
+ spdc += RAND () % 3 + 2;
+
+ if (decc > 8 || decc < -8)
+ decc = decc * 8 / 9;
+
+ accel += RAND () % 2;
+ accel -= RAND () % 2;
+ if (accel > 20)
+ accel -= 2;
+ if (accel < -20)
+ accel += 2;
+ }
}
}
@@ -422,67 +422,67 @@ zoomFilterFastRGB (Uint * pix1,
/* generation du buffer */
for (y = 0; y < prevY; y++)
for (x = 0; x < prevX; x++) {
- int px, py;
- unsigned char coefv, coefh;
-
- /* calculer px et py en fonction de */
- /* x,y,middleX,middleY et theMode */
- calculatePXandPY (x, y, &px, &py);
- if ((px == x << 4) && (py == y << 4))
- py += 8;
-
- if ((py < 0) || (px < 0) ||
- (py >= (prevY - 1) * sqrtperte) ||
- (px >= (prevX - 1) * sqrtperte)) {
+ int px, py;
+ unsigned char coefv, coefh;
+
+ /* calculer px et py en fonction de */
+ /* x,y,middleX,middleY et theMode */
+ calculatePXandPY (x, y, &px, &py);
+ if ((px == x << 4) && (py == y << 4))
+ py += 8;
+
+ if ((py < 0) || (px < 0) ||
+ (py >= (prevY - 1) * sqrtperte) ||
+ (px >= (prevX - 1) * sqrtperte)) {
#ifdef USE_ASM
- coeffs[(y * prevX + x) * 2] = 0;
- coeffs[(y * prevX + x) * 2 + 1] = 0;
+ coeffs[(y * prevX + x) * 2] = 0;
+ coeffs[(y * prevX + x) * 2 + 1] = 0;
#else
- pos10[y * prevX + x] = 0;
- c1[y * prevX + x] = 0;
- c2[y * prevX + x] = 0;
- c3[y * prevX + x] = 0;
- c4[y * prevX + x] = 0;
+ pos10[y * prevX + x] = 0;
+ c1[y * prevX + x] = 0;
+ c2[y * prevX + x] = 0;
+ c3[y * prevX + x] = 0;
+ c4[y * prevX + x] = 0;
#endif
- } else {
- int npx10;
- int npy10;
- int pos;
+ } else {
+ int npx10;
+ int npy10;
+ int pos;
- npx10 = (px / sqrtperte);
- npy10 = (py / sqrtperte);
+ npx10 = (px / sqrtperte);
+ npy10 = (py / sqrtperte);
/* if (npx10 >= prevX) fprintf(stderr,"error npx:%d",npx10);
if (npy10 >= prevY) fprintf(stderr,"error npy:%d",npy10);
*/
- coefh = px % sqrtperte;
- coefv = py % sqrtperte;
+ coefh = px % sqrtperte;
+ coefv = py % sqrtperte;
#ifdef USE_ASM
- pos = (y * prevX + x) * 2;
- coeffs[pos] = (npx10 + prevX * npy10) * 4;
+ pos = (y * prevX + x) * 2;
+ coeffs[pos] = (npx10 + prevX * npy10) * 4;
- if (!(coefh || coefv))
- coeffs[pos + 1] = (sqrtperte * sqrtperte - 1);
- else
- coeffs[pos + 1] = ((sqrtperte - coefh) * (sqrtperte - coefv));
+ if (!(coefh || coefv))
+ coeffs[pos + 1] = (sqrtperte * sqrtperte - 1);
+ else
+ coeffs[pos + 1] = ((sqrtperte - coefh) * (sqrtperte - coefv));
- coeffs[pos + 1] |= (coefh * (sqrtperte - coefv)) << 8;
- coeffs[pos + 1] |= ((sqrtperte - coefh) * coefv) << 16;
- coeffs[pos + 1] |= (coefh * coefv) << 24;
+ coeffs[pos + 1] |= (coefh * (sqrtperte - coefv)) << 8;
+ coeffs[pos + 1] |= ((sqrtperte - coefh) * coefv) << 16;
+ coeffs[pos + 1] |= (coefh * coefv) << 24;
#else
- pos = y * prevX + x;
- pos10[pos] = npx10 + prevX * npy10;
+ pos = y * prevX + x;
+ pos10[pos] = npx10 + prevX * npy10;
- if (!(coefh || coefv))
- c1[pos] = sqrtperte * sqrtperte - 1;
- else
- c1[pos] = (sqrtperte - coefh) * (sqrtperte - coefv);
+ if (!(coefh || coefv))
+ c1[pos] = sqrtperte * sqrtperte - 1;
+ else
+ c1[pos] = (sqrtperte - coefh) * (sqrtperte - coefv);
- c2[pos] = coefh * (sqrtperte - coefv);
- c3[pos] = (sqrtperte - coefh) * coefv;
- c4[pos] = coefh * coefv;
+ c2[pos] = coefh * (sqrtperte - coefv);
+ c3[pos] = (sqrtperte - coefh) * coefv;
+ c4[pos] = coefh * coefv;
#endif
- }
+ }
}
}
#ifdef USE_ASM
@@ -511,21 +511,21 @@ zoomFilterFastRGB (Uint * pix1,
getPixelRGB_ (pix1, pos10[position] + prevX + 1, &col4);
couleur.r = col1.r * c1[position]
- + col2.r * c2[position]
- + col3.r * c3[position]
- + col4.r * c4[position];
+ + col2.r * c2[position]
+ + col3.r * c3[position]
+ + col4.r * c4[position];
couleur.r >>= pertedec;
couleur.v = col1.v * c1[position]
- + col2.v * c2[position]
- + col3.v * c3[position]
- + col4.v * c4[position];
+ + col2.v * c2[position]
+ + col3.v * c3[position]
+ + col4.v * c4[position];
couleur.v >>= pertedec;
couleur.b = col1.b * c1[position]
- + col2.b * c2[position]
- + col3.b * c3[position]
- + col4.b * c4[position];
+ + col2.b * c2[position]
+ + col3.b * c3[position]
+ + col4.b * c4[position];
couleur.b >>= pertedec;
setPixelRGB_ (pix2, position, couleur);
diff --git a/gst/goom/goom_core.c b/gst/goom/goom_core.c
index 5c4a75a3..644ff0a6 100644
--- a/gst/goom/goom_core.c
+++ b/gst/goom/goom_core.c
@@ -67,21 +67,21 @@ goom_set_resolution (guint32 resx, guint32 resy)
guint32 *
goom_update (gint16 data[2][512])
{
- static int lockvar = 0; /* pour empecher de nouveaux changements */
- static int goomvar = 0; /* boucle des gooms */
- static int totalgoom = 0; /* nombre de gooms par seconds */
- static int agoom = 0; /* un goom a eu lieu.. */
- static int loopvar = 0; /* mouvement des points */
- static int speedvar = 0; /* vitesse des particules */
- static int lineMode = 0; /* l'effet lineaire a dessiner */
+ static int lockvar = 0; /* pour empecher de nouveaux changements */
+ static int goomvar = 0; /* boucle des gooms */
+ static int totalgoom = 0; /* nombre de gooms par seconds */
+ static int agoom = 0; /* un goom a eu lieu.. */
+ static int loopvar = 0; /* mouvement des points */
+ static int speedvar = 0; /* vitesse des particules */
+ static int lineMode = 0; /* l'effet lineaire a dessiner */
guint32 *return_val;
guint32 pointWidth;
guint32 pointHeight;
- int incvar; /* volume du son */
- int accelvar; /* acceleration des particules */
+ int incvar; /* volume du son */
+ int accelvar; /* acceleration des particules */
int i;
- float largfactor; /* elargissement de l'intervalle d'évolution des points */
- static char goomlimit = 2; /* sensibilité du goom */
+ float largfactor; /* elargissement de l'intervalle d'évolution des points */
+ static char goomlimit = 2; /* sensibilité du goom */
static ZoomFilterData zfd = {
128, 8, 16,
1, 1, 0, WAVE_MODE,
@@ -128,26 +128,26 @@ goom_update (gint16 data[2][512])
loopvar += speedvar + 1;
pointFilter (p1,
- YELLOW,
- ((pointWidth - 6.0f) * largfactor + 5.0f),
- ((pointHeight - 6.0f) * largfactor + 5.0f),
- i * 152.0f, 128.0f, loopvar + i * 2032);
+ YELLOW,
+ ((pointWidth - 6.0f) * largfactor + 5.0f),
+ ((pointHeight - 6.0f) * largfactor + 5.0f),
+ i * 152.0f, 128.0f, loopvar + i * 2032);
pointFilter (p1, ORANGE,
- ((pointWidth / 2) * largfactor) / i + 10.0f * i,
- ((pointHeight / 2) * largfactor) / i + 10.0f * i,
- 96.0f, i * 80.0f, loopvar / i);
+ ((pointWidth / 2) * largfactor) / i + 10.0f * i,
+ ((pointHeight / 2) * largfactor) / i + 10.0f * i,
+ 96.0f, i * 80.0f, loopvar / i);
pointFilter (p1, VIOLET,
- ((pointHeight / 3 + 5.0f) * largfactor) / i + 10.0f * i,
- ((pointHeight / 3 + 5.0f) * largfactor) / i + 10.0f * i,
- i + 122.0f, 134.0f, loopvar / i);
+ ((pointHeight / 3 + 5.0f) * largfactor) / i + 10.0f * i,
+ ((pointHeight / 3 + 5.0f) * largfactor) / i + 10.0f * i,
+ i + 122.0f, 134.0f, loopvar / i);
pointFilter (p1, BLACK,
- ((pointHeight / 3) * largfactor + 20.0f),
- ((pointHeight / 3) * largfactor + 20.0f),
- 58.0f, i * 66.0f, loopvar / i);
+ ((pointHeight / 3) * largfactor + 20.0f),
+ ((pointHeight / 3) * largfactor + 20.0f),
+ 58.0f, i * 66.0f, loopvar / i);
pointFilter (p1, WHITE,
- (pointHeight * largfactor + 10.0f * i) / i,
- (pointHeight * largfactor + 10.0f * i) / i,
- 66.0f, 74.0f, loopvar + i * 500);
+ (pointHeight * largfactor + 10.0f * i) / i,
+ (pointHeight * largfactor + 10.0f * i) / i,
+ 66.0f, 74.0f, loopvar + i * 500);
}
/* par défaut pas de changement de zoom */
@@ -167,33 +167,33 @@ goom_update (gint16 data[2][512])
if ((accelvar > goomlimit) || (accelvar < -goomlimit)) {
/* UN GOOM !!! YAHOO ! */
totalgoom++;
- agoom = 20; /* mais pdt 20 cycles, il n'y en aura plus. */
- lineMode = (lineMode + 1) % 20; /* Tous les 10 gooms on change de mode lineaire */
+ agoom = 20; /* mais pdt 20 cycles, il n'y en aura plus. */
+ lineMode = (lineMode + 1) % 20; /* Tous les 10 gooms on change de mode lineaire */
/* changement eventuel de mode */
switch (iRAND (10)) {
case 0:
case 1:
case 2:
- zfd.mode = WAVE_MODE;
- zfd.vitesse = STOP_SPEED - 1;
- zfd.reverse = 0;
- break;
+ zfd.mode = WAVE_MODE;
+ zfd.vitesse = STOP_SPEED - 1;
+ zfd.reverse = 0;
+ break;
case 3:
case 4:
- zfd.mode = CRYSTAL_BALL_MODE;
- break;
+ zfd.mode = CRYSTAL_BALL_MODE;
+ break;
case 5:
- zfd.mode = AMULETTE_MODE;
- break;
+ zfd.mode = AMULETTE_MODE;
+ break;
case 6:
- zfd.mode = WATER_MODE;
- break;
+ zfd.mode = WATER_MODE;
+ break;
case 7:
- zfd.mode = SCRUNCH_MODE;
- break;
+ zfd.mode = SCRUNCH_MODE;
+ break;
default:
- zfd.mode = NORMAL_MODE;
+ zfd.mode = NORMAL_MODE;
}
}
@@ -205,113 +205,113 @@ goom_update (gint16 data[2][512])
goomvar++;
/*if (goomvar % 1 == 0) */
{
- guint32 vtmp;
- guint32 newvit;
-
- newvit = STOP_SPEED - speedvar / 2;
- /* retablir le zoom avant.. */
- if ((zfd.reverse) && (!(cycle % 12)) && (rand () % 3 == 0)) {
- zfd.reverse = 0;
- zfd.vitesse = STOP_SPEED - 2;
- lockvar = 50;
- }
- if (iRAND (10) == 0) {
- zfd.reverse = 1;
- lockvar = 100;
- }
-
- /* changement de milieu.. */
- switch (iRAND (20)) {
- case 0:
- zfd.middleY = resoly - 1;
- zfd.middleX = resolx / 2;
- break;
- case 1:
- zfd.middleX = resolx - 1;
- break;
- case 2:
- zfd.middleX = 1;
- break;
- default:
- zfd.middleY = resoly / 2;
- zfd.middleX = resolx / 2;
- }
-
- if (zfd.mode == WATER_MODE) {
- zfd.middleX = resolx / 2;
- zfd.middleY = resoly / 2;
- }
-
- switch (vtmp = (iRAND (27))) {
- case 0:
- zfd.vPlaneEffect = iRAND (3);
- zfd.vPlaneEffect -= iRAND (3);
- zfd.hPlaneEffect = iRAND (3);
- zfd.hPlaneEffect -= iRAND (3);
- break;
- case 3:
- zfd.vPlaneEffect = 0;
- zfd.hPlaneEffect = iRAND (8);
- zfd.hPlaneEffect -= iRAND (8);
- break;
- case 4:
- case 5:
- case 6:
- case 7:
- zfd.vPlaneEffect = iRAND (5);
- zfd.vPlaneEffect -= iRAND (5);
- zfd.hPlaneEffect = -zfd.vPlaneEffect;
- break;
- case 8:
- zfd.hPlaneEffect = 5 + iRAND (8);
- zfd.vPlaneEffect = -zfd.hPlaneEffect;
- break;
- case 9:
- zfd.vPlaneEffect = 5 + iRAND (8);
- zfd.hPlaneEffect = -zfd.hPlaneEffect;
- break;
- case 13:
- zfd.hPlaneEffect = 0;
- zfd.vPlaneEffect = iRAND (10);
- zfd.vPlaneEffect -= iRAND (10);
- break;
- default:
- if (vtmp < 10) {
- zfd.vPlaneEffect = 0;
- zfd.hPlaneEffect = 0;
- }
- }
-
- if (iRAND (3) != 0)
- zfd.noisify = 0;
- else {
- zfd.noisify = iRAND (3) + 2;
- lockvar *= 3;
- }
-
- if (zfd.mode == AMULETTE_MODE) {
- zfd.vPlaneEffect = 0;
- zfd.hPlaneEffect = 0;
- zfd.noisify = 0;
- }
-
- if ((zfd.middleX == 1) || (zfd.middleX == resolx - 1)) {
- zfd.vPlaneEffect = 0;
- zfd.hPlaneEffect = iRAND (2) ? 0 : zfd.hPlaneEffect;
- }
-
- if (newvit < zfd.vitesse) { /* on accelere */
- pzfd = &zfd;
- if (((newvit < STOP_SPEED - 7) &&
- (zfd.vitesse < STOP_SPEED - 6) &&
- (cycle % 3 == 0)) || (iRAND (40) == 0)) {
- zfd.vitesse = STOP_SPEED - 1;
- zfd.reverse = !zfd.reverse;
- } else {
- zfd.vitesse = (newvit + zfd.vitesse * 4) / 5;
- }
- lockvar += 50;
- }
+ guint32 vtmp;
+ guint32 newvit;
+
+ newvit = STOP_SPEED - speedvar / 2;
+ /* retablir le zoom avant.. */
+ if ((zfd.reverse) && (!(cycle % 12)) && (rand () % 3 == 0)) {
+ zfd.reverse = 0;
+ zfd.vitesse = STOP_SPEED - 2;
+ lockvar = 50;
+ }
+ if (iRAND (10) == 0) {
+ zfd.reverse = 1;
+ lockvar = 100;
+ }
+
+ /* changement de milieu.. */
+ switch (iRAND (20)) {
+ case 0:
+ zfd.middleY = resoly - 1;
+ zfd.middleX = resolx / 2;
+ break;
+ case 1:
+ zfd.middleX = resolx - 1;
+ break;
+ case 2:
+ zfd.middleX = 1;
+ break;
+ default:
+ zfd.middleY = resoly / 2;
+ zfd.middleX = resolx / 2;
+ }
+
+ if (zfd.mode == WATER_MODE) {
+ zfd.middleX = resolx / 2;
+ zfd.middleY = resoly / 2;
+ }
+
+ switch (vtmp = (iRAND (27))) {
+ case 0:
+ zfd.vPlaneEffect = iRAND (3);
+ zfd.vPlaneEffect -= iRAND (3);
+ zfd.hPlaneEffect = iRAND (3);
+ zfd.hPlaneEffect -= iRAND (3);
+ break;
+ case 3:
+ zfd.vPlaneEffect = 0;
+ zfd.hPlaneEffect = iRAND (8);
+ zfd.hPlaneEffect -= iRAND (8);
+ break;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ zfd.vPlaneEffect = iRAND (5);
+ zfd.vPlaneEffect -= iRAND (5);
+ zfd.hPlaneEffect = -zfd.vPlaneEffect;
+ break;
+ case 8:
+ zfd.hPlaneEffect = 5 + iRAND (8);
+ zfd.vPlaneEffect = -zfd.hPlaneEffect;
+ break;
+ case 9:
+ zfd.vPlaneEffect = 5 + iRAND (8);
+ zfd.hPlaneEffect = -zfd.hPlaneEffect;
+ break;
+ case 13:
+ zfd.hPlaneEffect = 0;
+ zfd.vPlaneEffect = iRAND (10);
+ zfd.vPlaneEffect -= iRAND (10);
+ break;
+ default:
+ if (vtmp < 10) {
+ zfd.vPlaneEffect = 0;
+ zfd.hPlaneEffect = 0;
+ }
+ }
+
+ if (iRAND (3) != 0)
+ zfd.noisify = 0;
+ else {
+ zfd.noisify = iRAND (3) + 2;
+ lockvar *= 3;
+ }
+
+ if (zfd.mode == AMULETTE_MODE) {
+ zfd.vPlaneEffect = 0;
+ zfd.hPlaneEffect = 0;
+ zfd.noisify = 0;
+ }
+
+ if ((zfd.middleX == 1) || (zfd.middleX == resolx - 1)) {
+ zfd.vPlaneEffect = 0;
+ zfd.hPlaneEffect = iRAND (2) ? 0 : zfd.hPlaneEffect;
+ }
+
+ if (newvit < zfd.vitesse) { /* on accelere */
+ pzfd = &zfd;
+ if (((newvit < STOP_SPEED - 7) &&
+ (zfd.vitesse < STOP_SPEED - 6) &&
+ (cycle % 3 == 0)) || (iRAND (40) == 0)) {
+ zfd.vitesse = STOP_SPEED - 1;
+ zfd.reverse = !zfd.reverse;
+ } else {
+ zfd.vitesse = (newvit + zfd.vitesse * 4) / 5;
+ }
+ lockvar += 50;
+ }
}
}
/* mode mega-lent */
@@ -370,9 +370,9 @@ goom_update (gint16 data[2][512])
/* si on est dans un goom : afficher les lignes... */
if (agoom > 15)
goom_lines
- (data, ((zfd.middleX == resolx / 2) && (zfd.middleY == resoly / 2)
- && (zfd.mode != WATER_MODE))
- ? (lineMode / 10) : 0, p2, agoom - 15);
+ (data, ((zfd.middleX == resolx / 2) && (zfd.middleY == resoly / 2)
+ && (zfd.mode != WATER_MODE))
+ ? (lineMode / 10) : 0, p2, agoom - 15);
return_val = p2;
tmp = p1;
@@ -390,7 +390,7 @@ goom_update (gint16 data[2][512])
goomlimit++;
} else {
if ((totalgoom == 0) && (goomlimit > 1))
- goomlimit--;
+ goomlimit--;
}
totalgoom = 0;
}
diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c
index b5ad63a5..a4716c99 100644
--- a/gst/goom/gstgoom.c
+++ b/gst/goom/gstgoom.c
@@ -88,15 +88,15 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB_HOST_ENDIAN)
);
-static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", /* the name of the pads */
- GST_PAD_SINK, /* type of the pad */
- GST_PAD_ALWAYS, /* ALWAYS/SOMETIMES */
+static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", /* the name of the pads */
+ GST_PAD_SINK, /* type of the pad */
+ GST_PAD_ALWAYS, /* ALWAYS/SOMETIMES */
GST_STATIC_CAPS ("audio/x-raw-int, "
- "endianness = (int) BYTE_ORDER, "
- "signed = (boolean) TRUE, "
- "width = (int) 16, "
- "depth = (int) 16, "
- "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 2 ]")
+ "endianness = (int) BYTE_ORDER, "
+ "signed = (boolean) TRUE, "
+ "width = (int) 16, "
+ "depth = (int) 16, "
+ "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 2 ]")
);
@@ -134,6 +134,7 @@ gst_goom_get_type (void)
0,
(GInstanceInitFunc) gst_goom_init,
};
+
type = g_type_register_static (GST_TYPE_ELEMENT, "GstGOOM", &info, 0);
}
return type;
@@ -190,7 +191,7 @@ gst_goom_init (GstGOOM * goom)
goom->width = 320;
goom->height = 200;
- goom->fps = 25.; /* desired frame rate */
+ goom->fps = 25.; /* desired frame rate */
goom->channels = 0;
/* set to something */
goom_init (50, 50);
@@ -258,7 +259,7 @@ gst_goom_src_fixate (GstPad * pad, const GstCaps * caps)
return newcaps;
}
if (gst_caps_structure_fixate_field_nearest_double (structure, "framerate",
- 30.0)) {
+ 30.0)) {
return newcaps;
}
@@ -287,22 +288,22 @@ gst_goom_chain (GstPad * pad, GstData * _data)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_DISCONTINUOUS:
{
- gint64 value = 0;
+ gint64 value = 0;
- gst_event_discont_get_value (event, GST_FORMAT_TIME, &value);
+ gst_event_discont_get_value (event, GST_FORMAT_TIME, &value);
- goom->next_time = value;
+ goom->next_time = value;
}
default:
- gst_pad_event_default (pad, event);
- break;
+ gst_pad_event_default (pad, event);
+ break;
}
return;
}
if (goom->channels == 0) {
GST_ELEMENT_ERROR (goom, CORE, NEGOTIATION, (NULL),
- ("format wasn't negotiated before chain function"));
+ ("format wasn't negotiated before chain function"));
goto done;
}
diff --git a/gst/goom/lines.c b/gst/goom/lines.c
index 611f9a52..e497b5eb 100644
--- a/gst/goom/lines.c
+++ b/gst/goom/lines.c
@@ -35,14 +35,14 @@ goom_lines (gint16 data[2][512], unsigned int ID, unsigned int *p,
unsigned char *color = 1 + (unsigned char *) &color1;
switch (ID) {
- case 0: /* Horizontal stereo lines */
+ case 0: /* Horizontal stereo lines */
{
color1 = 0x0000AA00;
color2 = 0x00AA0000;
break;
}
- case 1: /* Stereo circles */
+ case 1: /* Stereo circles */
{
color1 = 0x00AA33DD;
color2 = 0x00AA33DD;
@@ -62,24 +62,24 @@ goom_lines (gint16 data[2][512], unsigned int ID, unsigned int *p,
*color = lighten (*color, power);
switch (ID) {
- case 0: /* Horizontal stereo lines */
+ case 0: /* Horizontal stereo lines */
{
unsigned int i;
for (i = 0; i < 512; i++) {
- guint32 plot;
+ guint32 plot;
- plot = i * resolx / 512 + (resoly / 4 + data[0][i] / 1600) * resolx;
- p[plot] = color1;
- p[plot + 1] = color1;
- plot = i * resolx / 512 + (resoly * 3 / 4 - data[1][i] / 1600) * resolx;
- p[plot] = color2;
- p[plot + 1] = color2;
+ plot = i * resolx / 512 + (resoly / 4 + data[0][i] / 1600) * resolx;
+ p[plot] = color1;
+ p[plot + 1] = color1;
+ plot = i * resolx / 512 + (resoly * 3 / 4 - data[1][i] / 1600) * resolx;
+ p[plot] = color2;
+ p[plot + 1] = color2;
}
break;
}
- case 1: /* Stereo circles */
+ case 1: /* Stereo circles */
{
float z;
unsigned int monX = resolx / 2;
@@ -87,19 +87,19 @@ goom_lines (gint16 data[2][512], unsigned int ID, unsigned int *p,
float monY2 = resoly / 2;
for (z = 0; z < 6.2832f; z += 1.0f / monY) {
- /* float offset1 = 128+data[1][(unsigned int)(z*81.33f)])/200000; */
- p[monX + (unsigned int) ((monY + ((float) resoly) * (128 +
- data[1][(unsigned int) (z * 81.33f)]) / 200000) *
- cos (z) + resolx * (unsigned int) (monY2 + (monY +
- ((float) resoly) * (128 +
- data[1][(unsigned int) (z * 81.33f)]) / 400000) *
- sin (z)))] = color1;
- p[monX + (unsigned int) ((monY - ((float) resoly) * (128 +
- data[0][(unsigned int) (z * 81.33f)]) / 200000) *
- cos (z) + resolx * (unsigned int) (monY2 + (monY -
- ((float) resoly) * (128 +
- data[0][(unsigned int) (z * 81.33f)]) / 400000) *
- sin (z)))] = color2;
+ /* float offset1 = 128+data[1][(unsigned int)(z*81.33f)])/200000; */
+ p[monX + (unsigned int) ((monY + ((float) resoly) * (128 +
+ data[1][(unsigned int) (z * 81.33f)]) / 200000) *
+ cos (z) + resolx * (unsigned int) (monY2 + (monY +
+ ((float) resoly) * (128 +
+ data[1][(unsigned int) (z * 81.33f)]) / 400000) *
+ sin (z)))] = color1;
+ p[monX + (unsigned int) ((monY - ((float) resoly) * (128 +
+ data[0][(unsigned int) (z * 81.33f)]) / 200000) *
+ cos (z) + resolx * (unsigned int) (monY2 + (monY -
+ ((float) resoly) * (128 +
+ data[0][(unsigned int) (z * 81.33f)]) / 400000) *
+ sin (z)))] = color2;
}
break;
}