projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.31.tar.gz
[xscreensaver]
/
hacks
/
glx
/
stonerview-move.c
diff --git
a/hacks/glx/stonerview-move.c
b/hacks/glx/stonerview-move.c
index b8a2041b17b4fb1fffd3359d2dd382b77fba8508..8639f10c0da0429efb47451c37af6d58484060b4 100644
(file)
--- a/
hacks/glx/stonerview-move.c
+++ b/
hacks/glx/stonerview-move.c
@@
-19,20
+19,12
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-#ifndef HAVE_COCOA
-# include <GL/gl.h>
-#endif
-
-#ifdef HAVE_JWZGLES
-# include "jwzgles.h"
-#endif /* HAVE_JWZGLES */
-
#include "yarandom.h"
#include "stonerview.h"
void
#include "yarandom.h"
#include "stonerview.h"
void
-init_move(stonerview_state *st)
+
stonerview_
init_move(stonerview_state *st)
{
/*st->theta = new_osc_linear(
new_osc_wrap(0, 36000, 25),
{
/*st->theta = new_osc_linear(
new_osc_wrap(0, 36000, 25),
@@
-95,29
+87,26
@@
init_move(stonerview_state *st)
new_osc_buffer(st, new_osc_wrap(st, 0, 3600, 17)),
new_osc_buffer(st, new_osc_wrap(st, 0, 3600, 7)));
new_osc_buffer(st, new_osc_wrap(st, 0, 3600, 17)),
new_osc_buffer(st, new_osc_wrap(st, 0, 3600, 7)));
- move_increment(st);
-}
-
-void final_move(stonerview_state *st)
-{
+ stonerview_move_increment(st);
}
/* Set up the list of polygon data for rendering. */
}
/* Set up the list of polygon data for rendering. */
-void move_increment(stonerview_state *st)
+void
+stonerview_move_increment(stonerview_state *st)
{
int ix, val;
{
int ix, val;
-/*
GLfloat
fval; */
-/*
GLfloat recipels = (1.0 / (GLfloat
)st->num_els); */
-
GLfloat
pt[2];
-
GLfloat
ptrad, pttheta;
+/*
double
fval; */
+/*
double recipels = (1.0 / (double
)st->num_els); */
+
double
pt[2];
+
double
ptrad, pttheta;
for (ix=0; ix<st->num_els; ix++) {
for (ix=0; ix<st->num_els; ix++) {
- elem_t *el = &st->elist[ix];
+
stonerview_
elem_t *el = &st->elist[ix];
/* Grab r and theta... */
val = osc_get(st, st->theta, ix);
pttheta = val * (0.01 * M_PI / 180.0);
/* Grab r and theta... */
val = osc_get(st, st->theta, ix);
pttheta = val * (0.01 * M_PI / 180.0);
- ptrad = (
GLfloat
)osc_get(st, st->rad, ix) * 0.001;
+ ptrad = (
double
)osc_get(st, st->rad, ix) * 0.001;
/* And convert them to x,y coordinates. */
pt[0] = ptrad * cos(pttheta);
pt[1] = ptrad * sin(pttheta);
/* And convert them to x,y coordinates. */
pt[0] = ptrad * cos(pttheta);
pt[1] = ptrad * sin(pttheta);
@@
-125,7
+114,7
@@
void move_increment(stonerview_state *st)
/* Set x,y,z. */
el->pos[0] = pt[0];
el->pos[1] = pt[1];
/* Set x,y,z. */
el->pos[0] = pt[0];
el->pos[1] = pt[1];
- el->pos[2] = (
GLfloat
)osc_get(st, st->alti, ix) * 0.001;
+ el->pos[2] = (
double
)osc_get(st, st->alti, ix) * 0.001;
/* Set which way the square is rotated. This is fixed for now, although
it would be trivial to make the squares spin as they revolve. */
/* Set which way the square is rotated. This is fixed for now, although
it would be trivial to make the squares spin as they revolve. */
@@
-136,19
+125,19
@@
void move_increment(stonerview_state *st)
converting an HSV value to RGB, where S and V are always 1. */
val = osc_get(st, st->color, ix);
if (val < 1200) {
converting an HSV value to RGB, where S and V are always 1. */
val = osc_get(st, st->color, ix);
if (val < 1200) {
- el->col[0] = ((
GLfloat
)val / 1200.0);
+ el->col[0] = ((
double
)val / 1200.0);
el->col[1] = 0;
el->col[1] = 0;
- el->col[2] = (
GLfloat
)(1200 - val) / 1200.0;
+ el->col[2] = (
double
)(1200 - val) / 1200.0;
}
else if (val < 2400) {
}
else if (val < 2400) {
- el->col[0] = (
GLfloat
)(2400 - val) / 1200.0;
- el->col[1] = ((
GLfloat
)(val - 1200) / 1200.0);
+ el->col[0] = (
double
)(2400 - val) / 1200.0;
+ el->col[1] = ((
double
)(val - 1200) / 1200.0);
el->col[2] = 0;
}
else {
el->col[0] = 0;
el->col[2] = 0;
}
else {
el->col[0] = 0;
- el->col[1] = (
GLfloat
)(3600 - val) / 1200.0;
- el->col[2] = ((
GLfloat
)(val - 2400) / 1200.0);
+ el->col[1] = (
double
)(3600 - val) / 1200.0;
+ el->col[2] = ((
double
)(val - 2400) / 1200.0);
}
el->col[3] = 1.0;
}
}
el->col[3] = 1.0;
}