X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fbouncingcow.c;h=122befa65a41024559dd2d24a1f878c2271ca52c;hb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c;hp=968002c4f4d7c18c789a20af23ddb8ae529e8597;hpb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;p=xscreensaver diff --git a/hacks/glx/bouncingcow.c b/hacks/glx/bouncingcow.c index 968002c4..122befa6 100644 --- a/hacks/glx/bouncingcow.c +++ b/hacks/glx/bouncingcow.c @@ -211,6 +211,7 @@ load_texture (ModeInfo *mi, const char *filename) } image = xpm_file_to_ximage (dpy, visual, cmap, filename); + if (!image) return False; clear_gl_error(); glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, @@ -471,7 +472,16 @@ draw_cow (ModeInfo *mi) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix (); - glRotatef(current_device_rotation(), 0, 0, 1); + +# 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); + glRotatef(o, 0, 0, 1); + } +# endif glScalef (0.5, 0.5, 0.5);