diff options
Diffstat (limited to 'hacks/glx/photopile.c')
-rw-r--r-- | hacks/glx/photopile.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/hacks/glx/photopile.c b/hacks/glx/photopile.c index 01d18d6..78e34b5 100644 --- a/hacks/glx/photopile.c +++ b/hacks/glx/photopile.c @@ -11,13 +11,8 @@ * implied warranty. */ -#if defined(HAVE_COCOA) || defined(HAVE_ANDROID) -# define DEF_FONT "OCR A Std 48, Lucida Console 48, Monaco 48" -#elif 0 /* real X11, XQueryFont() */ -# define DEF_FONT "-*-helvetica-bold-r-normal-*-*-480-*-*-*-*-*-*" -#else /* real X11, load_font_retry() */ -# define DEF_FONT "-*-ocr a std-medium-r-*-*-*-480-*-*-m-*-*-*" -#endif +#define DEF_FONT \ + "OCR A Std 18, Lucida Console 18, Monaco 18, Courier 18, monospace 18" #define DEFAULTS "*count: 7 \n" \ "*delay: 10000 \n" \ @@ -34,9 +29,6 @@ # define release_photopile 0 # define photopile_handle_event xlockmore_no_events -#undef countof -#define countof(x) (sizeof((x))/sizeof((*x))) - #ifndef HAVE_JWXYZ # include <X11/Intrinsic.h> /* for XrmDatabase in -debug mode */ #endif @@ -49,7 +41,7 @@ #ifdef USE_GL -# define DEF_SCALE "0.4" +# define DEF_IMG_SCALE "0.4" # define DEF_MAX_TILT "50" # define DEF_SPEED "1.0" # define DEF_DURATION "5" @@ -122,7 +114,8 @@ static Bool debug_p; /* Be loud and do weird things. */ static XrmOptionDescRec opts[] = { - {"-scale", ".scale", XrmoptionSepArg, 0 }, + /* Xft uses 'scale' */ + {"-scale", ".imgScale", XrmoptionSepArg, 0 }, {"-maxTilt", ".maxTilt", XrmoptionSepArg, 0 }, {"-speed", ".speed", XrmoptionSepArg, 0 }, {"-duration", ".duration", XrmoptionSepArg, 0 }, @@ -141,7 +134,7 @@ static XrmOptionDescRec opts[] = { }; static argtype vars[] = { - { &scale, "scale", "Scale", DEF_SCALE, t_Float}, + { &scale, "imgScale", "Scale", DEF_IMG_SCALE, t_Float}, { &max_tilt, "maxTilt", "MaxTilt", DEF_MAX_TILT, t_Float}, { &speed, "speed", "Speed", DEF_SPEED, t_Float}, { &duration, "duration", "Duration", DEF_DURATION, t_Int}, @@ -447,6 +440,15 @@ reshape_photopile (ModeInfo *mi, int width, int height) if (o != 0 && o != 180 && o != -180) glScalef (1/h, h, 1); } +# else + { + /* Don't understand why this clause doesn't work on mobile, but it + doesn't. */ + GLfloat s = (MI_WIDTH(mi) < MI_HEIGHT(mi) + ? (MI_WIDTH(mi) / (GLfloat) MI_HEIGHT(mi)) + : 1); + glScalef (s, s, s); + } # endif glClear(GL_COLOR_BUFFER_BIT); @@ -702,7 +704,9 @@ draw_image (ModeInfo *mi, int i, GLfloat t, GLfloat s, GLfloat z) glEnable (GL_TEXTURE_2D); glEnable (GL_BLEND); glDisable (GL_DEPTH_TEST); +# ifndef HAVE_ANDROID /* Doesn't work -- photo displays as static */ print_texture_string (ss->texfont, title); +# endif glEnable (GL_DEPTH_TEST); } else |