From 38886de0c3e9ea5729ef23e4c653fa2822f52e8f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 6 Apr 2021 14:43:39 +0200 Subject: xscreensaver 6.00 --- hacks/glx/jigglypuff.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'hacks/glx/jigglypuff.c') diff --git a/hacks/glx/jigglypuff.c b/hacks/glx/jigglypuff.c index d67a14d..22b8408 100644 --- a/hacks/glx/jigglypuff.c +++ b/hacks/glx/jigglypuff.c @@ -47,10 +47,6 @@ # include "xlock.h" #endif -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #include "ximage-loader.h" #include "gltrackball.h" #include "images/gen/jigglymap_png.h" @@ -167,9 +163,6 @@ static argtype vars[] = { {&damping, "damping", "Damping", DEF_DAMPING, t_Int} }; -#undef countof -#define countof(x) ((int)(sizeof(x)/sizeof(*(x)))) - ENTRYPOINT ModeSpecOpt jigglypuff_opts = {countof(opts), opts, countof(vars), vars, NULL}; #define COLOR_STYLE_NORMAL 0 @@ -254,6 +247,7 @@ struct vertex { vertex *next, *next0; }; + static inline void vector_init(vector v, coord x, coord y, coord z) { v[0] = x; @@ -989,14 +983,12 @@ ENTRYPOINT void draw_jigglypuff(ModeInfo *mi) glTranslatef(0,0,-10); -# 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); + GLfloat s = (MI_WIDTH(mi) < MI_HEIGHT(mi) + ? (MI_WIDTH(mi) / (GLfloat) MI_HEIGHT(mi)) + : 1); + glScalef (s, s, s); } -# endif glRotatef(js->angle, sin(js->axis), cos(js->axis), -sin(js->axis)); glTranslatef(0, 0, 5); -- cgit v1.2.3-55-g7522