"*size: 6000 \n" \
"*wireframe: False \n"
# define release_atlantis 0
-# define atlantis_handle_event 0
+# define atlantis_handle_event xlockmore_no_events
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
# include "xlock.h" /* from the xlockmore distribution */
#ifdef USE_MODULES
ModStruct atlantis_description =
{"atlantis", "init_atlantis", "draw_atlantis", NULL,
- "refresh_atlantis", "change_atlantis", NULL, &atlantis_opts,
+ "refresh_atlantis", "change_atlantis", "free_atlantis", &atlantis_opts,
1000, NUM_SHARKS, SHARKSPEED, SHARKSIZE, 64, 1.0, "",
"Shows moving sharks/whales/dolphin", 0, NULL};
ENTRYPOINT void
reshape_atlantis(ModeInfo * mi, int width, int height)
{
- atlantisstruct *ap = &atlantis[MI_SCREEN(mi)];
+ double h = (GLfloat) height / (GLfloat) width;
+ atlantisstruct *ap = &atlantis[MI_SCREEN(mi)];
+ int y = 0;
+
+ if (width > height * 5) { /* tiny window: show middle */
+ height = width * 9/16;
+ y = -height/2;
+ h = height / (GLfloat) width;
+ }
- glViewport(0, 0, ap->WinW = (GLint) width, ap->WinH = (GLint) height);
+ glViewport(0, y, ap->WinW = (GLint) width, ap->WinH = (GLint) height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(400.0, (GLdouble) width / (GLdouble) height, 1.0, 2000000.0);
- glMatrixMode(GL_MODELVIEW);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluPerspective(400.0, 1/h, 1.0, 2000000.0);
+ glMatrixMode(GL_MODELVIEW);
}
glVertex3f ( 1, 1, 1); glVertex3f (-1, 1, 1);
glEnd();
glEnable (GL_LIGHTING);
+
+ /* Need to reset this because jwzgles conflates color and material */
+ glColor3f (0.0, 0.1, 0.2);
}
glPopMatrix();
}
*-----------------------------------------------------------------------------
*/
-static void free_atlantis(ModeInfo * mi);
-
/*
*-----------------------------------------------------------------------------
* Initialize atlantis. Called each time the window changes.
Display *display = MI_DISPLAY(mi);
Window window = MI_WINDOW(mi);
- MI_INIT(mi, atlantis, free_atlantis);
+ MI_INIT(mi, atlantis);
ap = &atlantis[screen];
ap->num_sharks = MI_COUNT(mi);
if (ap->sharks == NULL) {
*-----------------------------------------------------------------------------
*/
-static void
+ENTRYPOINT void
free_atlantis(ModeInfo * mi)
{
#if 0
#endif
}
+#ifndef STANDALONE
ENTRYPOINT void
refresh_atlantis(ModeInfo * mi)
{
}
-#ifndef STANDALONE
ENTRYPOINT void
change_atlantis(ModeInfo * mi)
{