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.38.tar.gz
[xscreensaver]
/
hacks
/
glx
/
vigilance.c
diff --git
a/hacks/glx/vigilance.c
b/hacks/glx/vigilance.c
index e276bd75bd3dc9ffbff065fe3d4c9d2eeb978eda..c4f590f889b0c0efcb878fa0d2d2d4a6973b93ae 100644
(file)
--- a/
hacks/glx/vigilance.c
+++ b/
hacks/glx/vigilance.c
@@
-22,7
+22,7
@@
"*lensColor: #000000" "\n" \
"*groundColor: #004400" "\n" \
"*lensColor: #000000" "\n" \
"*groundColor: #004400" "\n" \
-# define
refresh
_camera 0
+# define
free
_camera 0
# define release_camera 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
# define release_camera 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@
-136,7
+136,15
@@
ENTRYPOINT void
reshape_camera (ModeInfo *mi, int width, int height)
{
GLfloat h = (GLfloat) height / (GLfloat) width;
reshape_camera (ModeInfo *mi, int width, int height)
{
GLfloat h = (GLfloat) height / (GLfloat) width;
- glViewport (0, 0, width, height);
+ int y = 0;
+
+ if (width > height * 5) { /* tiny window: show middle */
+ height = width * 9/16;
+ y = -height/2;
+ h = height / (GLfloat) width;
+ }
+
+ glViewport (0, y, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective (30.0, 1/h, 1.0, 200);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective (30.0, 1/h, 1.0, 200);
@@
-216,7
+224,7
@@
init_camera (ModeInfo *mi)
camera_configuration *bp;
int wire = MI_IS_WIREFRAME(mi);
int i;
camera_configuration *bp;
int wire = MI_IS_WIREFRAME(mi);
int i;
- MI_INIT (mi, bps
, 0
);
+ MI_INIT (mi, bps);
bp = &bps[MI_SCREEN(mi)];
bp = &bps[MI_SCREEN(mi)];
@@
-879,8
+887,10
@@
tick_camera (ModeInfo *mi, camera *c)
which = i-2;
else if (i >= 1 && which == 1)
which = i-1;
which = i-2;
else if (i >= 1 && which == 1)
which = i-1;
- else if (i < bp->ncameras-
1
&& which == 2)
+ else if (i < bp->ncameras-
2
&& which == 2)
which = i+2;
which = i+2;
+ else if (i == bp->ncameras-1)
+ which = i-1;
else /* (i < bp->ncameras-2 && which == 3) */
which = i+1;
else /* (i < bp->ncameras-2 && which == 3) */
which = i+1;