int dst = glhanoi->dst;
GLfloat theta;
GLfloat sintheta, costheta;
- double absx, dh;
+ double dh;
double dx, dz; /* total x and z distances from src to dst */
Pole *poleSrc, *poleDst;
/* horizontal distance to travel? */
/* was: absx = sqrt(disk->xmax - disk->xmin); */
dh = distance(poleSrc->position, poleDst->position);
- absx = sqrt(dh);
+ /* absx = sqrt(dh); */
ymax = glhanoi->poleHeight + dh;
if(glhanoi->state == FINISHED) {
ymax += dh * (double)(glhanoi->numberOfDisks - disk->id);
GLint lastSlice = nSlice - 1;
GLfloat radius;
GLfloat innerRadius;
- GLfloat maxRadius;
if(bottomThickness > bottomRadius) {
bottomThickness = bottomRadius;
if(topThickness < 0.0) {
topThickness = 0.0;
}
- if(topRadius >= bottomRadius) {
+/* if(topRadius >= bottomRadius) {
maxRadius = topRadius;
} else {
maxRadius = bottomRadius;
- }
+ } */
/* bottom */
y = 0.0;
update_glhanoi(glhanoi);
updateView(glhanoi);
+# 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
+
if(!glhanoi->wire && glhanoi->texture) {
glEnable(GL_TEXTURE_2D);
}
{
glhcfg *glhanoi = &glhanoi_cfg[MI_SCREEN(mi)];
+ /* #### this is all wrong on iOS -- should be using gltrackball. */
+
if(event->xany.type == ButtonPress && event->xbutton.button == Button1) {
glhanoi->button_down_p = True;
glhanoi->drag_x = event->xbutton.x;
return True;
}
+#if 0 /* #### doesn't work */
+ else if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
+ {
+ changeState(glhanoi, START);
+ return True;
+ }
+#endif
return False;
}