# define DEFAULTS "*delay: 20000\n" \
"*showFPS: False\n" \
"*wireframe: False\n" \
- "*color: cycle\n" \
- "*shininess: 100\n" \
- "*complexity: 2\n" \
- "*speed: 500\n" \
- "*distance: 100\n" \
- "*hold: 800\n" \
- "*spherism: 200\n" \
- "*damping: 500\n"
-
# include "xlockmore.h"
#else
static jigglystruct *jss = NULL;
static XrmOptionDescRec opts[] = {
- {"-random", ".Jigglypuff.random", XrmoptionNoArg, (caddr_t)"true"},
- {"+random", ".Jigglypuff.random", XrmoptionNoArg, (caddr_t)"false"},
- {"-tetra", ".Jigglypuff.tetra", XrmoptionNoArg, (caddr_t)"true"},
- {"+tetra", ".Jigglypuff.tetra", XrmoptionNoArg, (caddr_t)"false"},
- {"-spooky", ".Jigglypuff.spooky", XrmoptionSepArg, (caddr_t)"0"},
- {"-color", ".Jigglypuff.color", XrmoptionSepArg, (caddr_t)DEF_COLOR},
- {"-shininess", ".Jigglypuff.shininess", XrmoptionSepArg, (caddr_t)DEF_SHININESS},
- {"-complexity", ".Jigglypuff.complexity", XrmoptionSepArg, (caddr_t)DEF_COMPLEXITY},
- {"-speed", ".Jigglypuff.speed", XrmoptionSepArg, (caddr_t)DEF_SPEED},
- {"-spherism", ".Jigglypuff.spherism", XrmoptionSepArg, (caddr_t)DEF_SPHERISM},
- {"-hold", ".Jigglypuff.hold", XrmoptionSepArg, (caddr_t)DEF_HOLD},
- {"-distance", "Jigglypuff.distance", XrmoptionSepArg, (caddr_t)DEF_DISTANCE},
- {"-damping", "Jigglypuff.damping", XrmoptionSepArg, (caddr_t)DEF_DAMPING}
+ {"-random", ".Jigglypuff.random", XrmoptionNoArg, "true"},
+ {"+random", ".Jigglypuff.random", XrmoptionNoArg, "false"},
+ {"-tetra", ".Jigglypuff.tetra", XrmoptionNoArg, "true"},
+ {"+tetra", ".Jigglypuff.tetra", XrmoptionNoArg, "false"},
+ {"-spooky", ".Jigglypuff.spooky", XrmoptionSepArg, "0"},
+ {"-color", ".Jigglypuff.color", XrmoptionSepArg, DEF_COLOR},
+ {"-shininess", ".Jigglypuff.shininess", XrmoptionSepArg, DEF_SHININESS},
+ {"-complexity", ".Jigglypuff.complexity", XrmoptionSepArg, DEF_COMPLEXITY},
+ {"-speed", ".Jigglypuff.speed", XrmoptionSepArg, DEF_SPEED},
+ {"-spherism", ".Jigglypuff.spherism", XrmoptionSepArg, DEF_SPHERISM},
+ {"-hold", ".Jigglypuff.hold", XrmoptionSepArg, DEF_HOLD},
+ {"-distance", "Jigglypuff.distance", XrmoptionSepArg, DEF_DISTANCE},
+ {"-damping", "Jigglypuff.damping", XrmoptionSepArg, DEF_DAMPING}
};
static argtype vars[] = {
- {(caddr_t*)&random_parms, "random", "Random", "False", t_Bool},
- {(caddr_t*)&do_tetrahedron, "tetra", "Tetra", "False", t_Bool},
- {(caddr_t*)&spooky, "spooky", "Spooky", "0", t_Int},
- {(caddr_t*)&color, "color", "Color", DEF_COLOR, t_String},
- {(caddr_t*)&shininess, "shininess", "Shininess", DEF_SHININESS, t_Int},
- {(caddr_t*)&complexity, "complexity", "Complexity", DEF_COMPLEXITY, t_Int},
- {(caddr_t*)&speed, "speed", "Speed", DEF_SPEED, t_Int},
- {(caddr_t*)&spherism, "spherism", "Spherism", DEF_SPHERISM, t_Int},
- {(caddr_t*)&hold, "hold", "Hold", DEF_HOLD, t_Int},
- {(caddr_t*)&distance, "distance", "Distance", DEF_DISTANCE, t_Int},
- {(caddr_t*)&damping, "damping", "Damping", DEF_DAMPING, t_Int}
+ {&random_parms, "random", "Random", "False", t_Bool},
+ {&do_tetrahedron, "tetra", "Tetra", "False", t_Bool},
+ {&spooky, "spooky", "Spooky", "0", t_Int},
+ {&color, "color", "Color", DEF_COLOR, t_String},
+ {&shininess, "shininess", "Shininess", DEF_SHININESS, t_Int},
+ {&complexity, "complexity", "Complexity", DEF_COMPLEXITY, t_Int},
+ {&speed, "speed", "Speed", DEF_SPEED, t_Int},
+ {&spherism, "spherism", "Spherism", DEF_SPHERISM, t_Int},
+ {&hold, "hold", "Hold", DEF_HOLD, t_Int},
+ {&distance, "distance", "Distance", DEF_DISTANCE, t_Int},
+ {&damping, "damping", "Damping", DEF_DAMPING, t_Int}
};
#undef countof
{0.0, 0.0, 0.9, 1.0},
};
+# if 0 /* I am not even going to *try* and make this bullshit compile
+ without warning under gcc -std=c89 -pedantic. -jwz. */
#ifdef DEBUG
+# ifdef __GNUC__ /* GCC style */
#define _DEBUG(msg, args...) do { \
fprintf(stderr, "%s : %d : " msg ,__FILE__,__LINE__ ,##args); \
} while(0)
+# else /* C99 standard style */
+#define _DEBUG(msg, ...) do { \
+ fprintf(stderr, "%s : %d : " msg ,__FILE__,__LINE__,__VA_ARGS__); \
+} while(0)
+# endif
#else
+# ifdef __GNUC__ /* GCC style */
#define _DEBUG(msg, args...)
+# else /* C99 standard style */
+#define _DEBUG(msg, ...)
+# endif
#endif
+#endif /* 0 */
/* This is all the half-edge b-rep code (as well as basic geometry) */
typedef struct face face;
return h->e->left;
}
else {
- _DEBUG("Inconsistent edge detected. Presumably, this is a bug. Exiting.\n");
+/* _DEBUG("Inconsistent edge detected. Presumably, this is a bug. Exiting.\n", NULL); */
exit(-1);
}
}
hedge *h = (hedge*)malloc(sizeof(hedge));
if(!h) {
- _DEBUG("Out of memory in hedge_new()\n");
+/* _DEBUG("Out of memory in hedge_new()\n",NULL); */
return NULL;
}
h->f = hafter->f;
{
edge *e = (edge*)malloc(sizeof(edge));
if(!e) {
- _DEBUG("Out of memory in edge_new()\n");
+/* _DEBUG("Out of memory in edge_new()\n",NULL);*/
exit(-1);
}
e->next = s->edges;
{
face *f = (face*)malloc(sizeof(face));
if(!f) {
- _DEBUG("Out of memory in face_new()");
+/* _DEBUG("Out of memory in face_new()",NULL);*/
exit(-1);
}
f->s = s;
face *fn;
if(h1->f != f || h2->f != f) {
- _DEBUG("Whoah, cap'n, yer usin' a bad halfedge!\n");
+/* _DEBUG("Whoah, cap'n, yer usin' a bad halfedge!\n",NULL);*/
exit(-1);
}
if(h1 == h2) {
- _DEBUG("Trying to split a face at a single vertex\n");
+/* _DEBUG("Trying to split a face at a single vertex\n",NULL);*/
exit(-1);
}
/* close the loops */
{
const GLfloat lpos0[4] = {-12, 8, 12, 0};
const GLfloat lpos1[4] = {7, -5, 0, 0};
- const GLfloat lcol0[4] = {0.7, 0.7, 0.65, 1};
- const GLfloat lcol1[4] = {0.3, 0.2, 0.1, 1};
- const GLfloat scolor[4]= {0.9, 0.9, 0.9, 0.5};
+ const GLfloat lcol0[4] = {0.7f, 0.7f, 0.65f, 1};
+ const GLfloat lcol1[4] = {0.3f, 0.2f, 0.1f, 1};
+ const GLfloat scolor[4]= {0.9f, 0.9f, 0.9f, 0.5f};
glDrawBuffer(GL_BACK);
glClearColor(0, 0, 0, 0);
int parse_color(jigglystruct *js)
{
- int r, g, b;
+ unsigned int r, g, b;
if(!strcmp(color, "clownbarf")) {
js->color_style = COLOR_STYLE_CLOWNBARF;
return 1;
jigglystruct *js = &jss[MI_SCREEN(mi)];
if(event->xany.type == ButtonPress &&
- event->xbutton.button & Button1) {
+ event->xbutton.button == Button1) {
js->button_down = 1;
gltrackball_start(js->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) {
+ event->xbutton.button == Button1) {
js->button_down = 0;
return True;
}
+ else if (event->xany.type == ButtonPress &&
+ (event->xbutton.button == Button4 ||
+ event->xbutton.button == Button5))
+ {
+ gltrackball_mousewheel (js->trackball, event->xbutton.button, 10,
+ !!event->xbutton.state);
+ return True;
+ }
else if(event->xany.type == MotionNotify && js->button_down) {
gltrackball_track(js->trackball, event->xmotion.x, event->xmotion.y,
MI_WIDTH(mi), MI_HEIGHT(mi));
MI_CLEARWINDOW(mi);
}
js->trackball = gltrackball_init();
- _DEBUG("distance : %f\nhold : %f\nspherify : %f\ndamping : %f\ndfact : %f\n",
+/* _DEBUG("distance : %f\nhold : %f\nspherify : %f\ndamping : %f\ndfact : %f\n",
js->stable_distance, js->hold_strength, js->spherify_strength,
js->damping_velocity, js->damping_factor);
_DEBUG("wire : %d\nspooky : %d\nstyle : %d\nshininess : %d\n",
- js->do_wireframe, js->spooky, js->color_style, js->shininess);
+ js->do_wireframe, js->spooky, js->color_style, js->shininess);*/
}
/* This is the end of the file */