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
/
antspotlight.c
diff --git
a/hacks/glx/antspotlight.c
b/hacks/glx/antspotlight.c
index a049976de0d4683cd1798fac13aa14d338570395..55bb80cd51158d03db785e586be717a6fef5bcf5 100644
(file)
--- a/
hacks/glx/antspotlight.c
+++ b/
hacks/glx/antspotlight.c
@@
-19,7
+19,8
@@
"*showFPS: False \n" \
"*useSHM: True \n"
"*showFPS: False \n" \
"*useSHM: True \n"
-# define refresh_antspotlight 0
+# define free_antspotlight 0
+# define release_antspotlight 0
#include "xlockmore.h"
#else
#include "xlock.h"
#include "xlockmore.h"
#else
#include "xlock.h"
@@
-49,7
+50,7
@@
ENTRYPOINT ModeSpecOpt antspotlight_opts = {
#ifdef USE_MODULES
ModStruct antspotlight_description = {
"antspotlight", "init_antspotlight", "draw_antspotlight",
#ifdef USE_MODULES
ModStruct antspotlight_description = {
"antspotlight", "init_antspotlight", "draw_antspotlight",
- "release_antspotlight", "draw_antspotlight", "change_antspotlight",
+ (char *) NULL, "draw_antspotlight", "change_antspotlight",
(char *) NULL, &antspotlight_opts, 1000, 1, 1, 1, 4, 1.0, "",
"draws an ant scoping the screen", 0, NULL
};
(char *) NULL, &antspotlight_opts, 1000, 1, 1, 1, 4, 1.0, "",
"draws an ant scoping the screen", 0, NULL
};
@@
-551,8
+552,16
@@
static void draw_antspotlight_strip(ModeInfo *mi)
ENTRYPOINT void reshape_antspotlight(ModeInfo * mi, int width, int height)
{
double h = (GLfloat) height / (GLfloat) width;
ENTRYPOINT void reshape_antspotlight(ModeInfo * mi, int width, int height)
{
double h = (GLfloat) height / (GLfloat) width;
+ int y = 0;
int size = 2;
int size = 2;
- glViewport(0, 0, width, height);
+
+ 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();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@@
-617,18
+626,6
@@
static void pinit(void)
glEnable(GL_DEPTH_TEST);
}
glEnable(GL_DEPTH_TEST);
}
-/* cleanup routine */
-ENTRYPOINT void release_antspotlight(ModeInfo * mi)
-{
-
- if(antspotlight) {
- free((void *) antspotlight);
- antspotlight = (antspotlightstruct *) NULL;
- }
-
- FreeAllGL(mi);
-}
-
#define MAX_MAGNIFICATION 10
#define max(a, b) a < b ? b : a
#define min(a, b) a < b ? a : b
#define MAX_MAGNIFICATION 10
#define max(a, b) a < b ? b : a
#define min(a, b) a < b ? a : b
@@
-708,11
+705,7
@@
ENTRYPOINT void init_antspotlight(ModeInfo *mi)
antspotlightstruct *mp;
antspotlightstruct *mp;
- if(!antspotlight) {
- if((antspotlight = (antspotlightstruct *)
- calloc(MI_NUM_SCREENS(mi), sizeof (antspotlightstruct))) == NULL)
- return;
- }
+ MI_INIT(mi, antspotlight);
mp = &antspotlight[MI_SCREEN(mi)];
mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
mp->trackball = gltrackball_init (False);
mp = &antspotlight[MI_SCREEN(mi)];
mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
mp->trackball = gltrackball_init (False);