#include <stdio.h>
#include <string.h>
-#ifdef HAVE_COCOA
+#ifdef HAVE_ANDROID
+#include <GLES/gl.h>
+#endif
+
+#ifdef HAVE_JWXYZ
# include "jwxyz.h"
# ifndef HAVE_JWZGLES
# include <OpenGL/glu.h>
#include <sys/time.h>
-#ifdef HAVE_COCOA
+#ifdef HAVE_JWXYZ
# include "jwxyz.h"
#else
# include <X11/Xutil.h>
/* Given a bitmask, returns the position and width of the field.
*/
static void
-decode_mask (unsigned int mask, unsigned int *pos_ret, unsigned int *size_ret)
+decode_mask (unsigned long mask, unsigned long *pos_ret,
+ unsigned long *size_ret)
{
int i;
for (i = 0; i < 32; i++)
Visual *visual = DefaultVisualOfScreen (screen);
int x, y;
- unsigned int crpos=0, cgpos=0, cbpos=0, capos=0; /* bitfield positions */
- unsigned int srpos=0, sgpos=0, sbpos=0;
- unsigned int srmsk=0, sgmsk=0, sbmsk=0;
- unsigned int srsiz=0, sgsiz=0, sbsiz=0;
+ unsigned long crpos=0, cgpos=0, cbpos=0, capos=0; /* bitfield positions */
+ unsigned long srpos=0, sgpos=0, sbpos=0;
+ unsigned long srmsk=0, sgmsk=0, sbmsk=0;
+ unsigned long srsiz=0, sgsiz=0, sbsiz=0;
XColor *colors = 0;
unsigned char spread_map[3][256];
*/
XImage *from = image;
XImage *to = XCreateImage (dpy, visual, 32, /* depth */
- ZPixmap, 0, 0, from->width, from->height + 2,
+ ZPixmap, 0, 0, from->width, from->height,
32, /* bitmap pad */
0);
- to->data = (char *) calloc (to->height, to->bytes_per_line);
+ to->data = (char *) calloc (to->height + 2, to->bytes_per_line);
/* Set the bit order in the XImage structure to whatever the
local host's native bit order is.
if (geometry->width <= 0 || geometry->height <= 0)
{
/* This can happen if an old version of xscreensaver-getimage
- is installed. */
+ is installed. Or if we have no image (checkerboard). */
geometry->x = 0;
geometry->y = 0;
geometry->width = dd.pix_width;