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/jigglypuff.c | |
parent | Maybe not remove, but ... (diff) | |
download | xscreensaver-38886de0c3e9ea5729ef23e4c653fa2822f52e8f.tar.gz xscreensaver-38886de0c3e9ea5729ef23e4c653fa2822f52e8f.tar.xz xscreensaver-38886de0c3e9ea5729ef23e4c653fa2822f52e8f.zip |
Diffstat (limited to 'hacks/glx/jigglypuff.c')
-rw-r--r-- | hacks/glx/jigglypuff.c | 18 |
1 files changed, 5 insertions, 13 deletions
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); |