+ "*showFPS: False \n" \
+ "*wireframe: False \n" \
+ "*suppressRotationAnimation: True\n" \
+
+# define free_superquadrics 0
+# define release_superquadrics 0
+# define superquadrics_handle_event 0
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
# include "xlock.h" /* from the xlockmore distribution */
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
# include "xlock.h" /* from the xlockmore distribution */
- {"-spinspeed", ".superquadrics.spinspeed", XrmoptionSepArg, (caddr_t) NULL}
+ {"-spinspeed", ".superquadrics.spinspeed", XrmoptionSepArg, 0}
- {(caddr_t *) & spinspeed, "spinspeed", "Spinspeed", DEF_SPINSPEED, t_Float}
+ {&spinspeed, "spinspeed", "Spinspeed", DEF_SPINSPEED, t_Float}
};
static OptionStruct desc[] =
{
{"-spinspeed num", "speed of rotation, in degrees per frame"}
};
};
static OptionStruct desc[] =
{
{"-spinspeed num", "speed of rotation, in degrees per frame"}
};
{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
#ifdef USE_MODULES
ModStruct superquadrics_description =
{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
#ifdef USE_MODULES
ModStruct superquadrics_description =
-{"superquadrics", "init_superquadrics", "draw_superquadrics", "release_superquadrics",
+{"superquadrics", "init_superquadrics", "draw_superquadrics", NULL,
"refresh_superquadrics", "init_superquadrics", NULL, &superquadrics_opts,
1000, 25, 40, 1, 4, 1.0, "",
"Shows 3D mathematical shapes", 0, NULL};
#endif
"refresh_superquadrics", "init_superquadrics", NULL, &superquadrics_opts,
1000, 25, 40, 1, 4, 1.0, "",
"Shows 3D mathematical shapes", 0, NULL};
#endif
int dostuff;
int t, pat;
GLfloat r, g, b, r2, g2, b2;
int dostuff;
int t, pat;
GLfloat r, g, b, r2, g2, b2;
- sp->later.r[t] = pats[pat][t] ? r : r2;
- sp->later.g[t] = pats[pat][t] ? g : g2;
- sp->later.b[t] = pats[pat][t] ? b : b2;
+ sp->later.r[t] = sp->pats[pat][t] ? r : r2;
+ sp->later.g[t] = sp->pats[pat][t] ? g : g2;
+ sp->later.b[t] = sp->pats[pat][t] ? b : b2;
DoneScale(superquadricsstruct * sp)
{
double xx, yy, zz, xp = 0, yp = 0, zp = 0, xn, yn, zn, xnp = 0,
ynp = 0, znp = 0;
int ih, iv;
DoneScale(superquadricsstruct * sp)
{
double xx, yy, zz, xp = 0, yp = 0, zp = 0, xn, yn, zn, xnp = 0,
ynp = 0, znp = 0;
int ih, iv;
}
/* PURIFY 4.0.1 reports an unitialized memory read on the next line when using
* MesaGL 2.2 and -mono. This has been fixed in MesaGL 2.3 and later. */
}
/* PURIFY 4.0.1 reports an unitialized memory read on the next line when using
* MesaGL 2.2 and -mono. This has been fixed in MesaGL 2.3 and later. */
if (!sp->flatshade)
glNormal3f(sp->Prevxn[iv - 1], sp->Prevyn[iv - 1], sp->Prevzn[iv - 1]);
glVertex3f(sp->Prevxx[iv - 1], sp->Prevyy[iv - 1], sp->Prevzz[iv - 1]);
if (!sp->flatshade)
glNormal3f(sp->Prevxn[iv - 1], sp->Prevyn[iv - 1], sp->Prevzn[iv - 1]);
glVertex3f(sp->Prevxx[iv - 1], sp->Prevyy[iv - 1], sp->Prevzz[iv - 1]);
}
glPushMatrix();
glTranslatef(0.0, 0.0, -((GLfloat) (sp->dist) / 16.0) - (sp->Mode * 3.0 - 1.0)); /* viewing transform */
}
glPushMatrix();
glTranslatef(0.0, 0.0, -((GLfloat) (sp->dist) / 16.0) - (sp->Mode * 3.0 - 1.0)); /* viewing transform */
+ glScalef(0.7, 0.7, 0.7); /* jwz: scale it down a bit */
+
+# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */
+ {
+ GLfloat h = MI_HEIGHT(mi) / (GLfloat) MI_WIDTH(mi);
+ int o = (int) current_device_rotation();
+ if (o != 0 && o != 180 && o != -180)
+ glScalef (1/h, 1/h, 1/h);
+ }
+# endif
+
+ polys = DoneScale(sp);
- gluPerspective(30.0, (GLfloat) w / (GLfloat) h, 0.1, 200.0);
+ gluPerspective(15.0, (GLfloat) w / (GLfloat) h, 0.1, 200.0);
- for (t = 0; t < 4; ++t)
+ for (t = 0; t < 4; ++t) {
+ sp->curmat[t][0] = 0.0;
+ sp->curmat[t][1] = 0.0;
+ sp->curmat[t][2] = 0.0;
- if (superquadrics == NULL) {
- if ((superquadrics = (superquadricsstruct *) calloc(MI_NUM_SCREENS(mi),
- sizeof (superquadricsstruct))) == NULL)
- return;
- }
+ MI_INIT (mi, superquadrics);
if ((sp->glx_context = init_GL(mi)) != NULL) {
InitSuperquadrics(MI_IS_WIREFRAME(mi), 0,
MI_COUNT(mi), MI_CYCLES(mi), spinspeed, sp);
ReshapeSuperquadrics(MI_WIDTH(mi), MI_HEIGHT(mi));
if ((sp->glx_context = init_GL(mi)) != NULL) {
InitSuperquadrics(MI_IS_WIREFRAME(mi), 0,
MI_COUNT(mi), MI_CYCLES(mi), spinspeed, sp);
ReshapeSuperquadrics(MI_WIDTH(mi), MI_HEIGHT(mi));