diff options
author | Simon Rettberg | 2021-04-06 14:43:39 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-04-07 13:38:37 +0200 |
commit | 38886de0c3e9ea5729ef23e4c653fa2822f52e8f (patch) | |
tree | 9b799c8c968a92cc77746a95e0e8bdd90b6b13c3 /hacks/glx/blinkbox.c | |
parent | Maybe not remove, but ... (diff) | |
download | xscreensaver-38886de0c3e9ea5729ef23e4c653fa2822f52e8f.tar.gz xscreensaver-38886de0c3e9ea5729ef23e4c653fa2822f52e8f.tar.xz xscreensaver-38886de0c3e9ea5729ef23e4c653fa2822f52e8f.zip |
Diffstat (limited to 'hacks/glx/blinkbox.c')
-rw-r--r-- | hacks/glx/blinkbox.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/hacks/glx/blinkbox.c b/hacks/glx/blinkbox.c index 45071a9..61531e7 100644 --- a/hacks/glx/blinkbox.c +++ b/hacks/glx/blinkbox.c @@ -18,8 +18,6 @@ # define release_ball 0 # define ball_handle_event xlockmore_no_events -#undef countof -#define countof(x) (sizeof((x))/sizeof((*x))) #include "xlockmore.h" #include "sphere.h" @@ -249,14 +247,6 @@ reshape_ball (ModeInfo *mi, int width, int height) gluLookAt( 0.0, 0.0, 40.0, 0.0, 0.0, 0.0, 0.0, 2.0, 10.0); - -# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */ - { - int o = (int) current_device_rotation(); - if (o != 0 && o != 180 && o != -180) - glScalef (1/h, 1/h, 1/h); - } -# endif } static void @@ -462,7 +452,14 @@ draw_ball (ModeInfo *mi) glPushMatrix(); - glScalef(0.5,0.5,0.5); + + { + GLfloat s = (MI_WIDTH(mi) < MI_HEIGHT(mi) + ? MI_WIDTH(mi) / (GLfloat) MI_HEIGHT(mi) + : 1); + s *= 0.5; + glScalef (s, s, s); + } glColor3f(1,1,1); glPushMatrix(); |