X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fglmatrix.c;h=6a9b1fe18529c1c1c42bd23571a6e5774198faad;hp=7683c39ffe614331adce6e5f4922259a18fc418a;hb=78add6e627ee5f10e1fa6f3852602ea5066eee5a;hpb=39809ded547bdbb08207d3e514950425215b4410 diff --git a/hacks/glx/glmatrix.c b/hacks/glx/glmatrix.c index 7683c39f..6a9b1fe1 100644 --- a/hacks/glx/glmatrix.c +++ b/hacks/glx/glmatrix.c @@ -1,4 +1,4 @@ -/* glmatrix, Copyright (c) 2003, 2004 Jamie Zawinski +/* glmatrix, Copyright (c) 2003-2018 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,14 +29,9 @@ #define BELLRAND(n) ((frand((n)) + frand((n)) + frand((n))) / 3) #include "xlockmore.h" -#include "xpm-ximage.h" +#include "ximage-loader.h" -#ifdef __GNUC__ - __extension__ /* don't warn about "string length is greater than the length - ISO C89 compilers are required to support" when including - the following XPM file... */ -#endif -#include "../images/matrix3.xpm" +#include "images/gen/matrix3_png.h" #ifdef USE_GL /* whole file */ @@ -703,11 +698,11 @@ load_textures (ModeInfo *mi, Bool flip_p) int cw, ch; int orig_w, orig_h; - /* The Matrix XPM is 512x598 -- but GL texture sizes must be powers of 2. + /* The Matrix image is 512x598 -- but GL texture sizes must be powers of 2. So we waste some padding rows to round up. */ - xi = xpm_to_ximage (mi->dpy, mi->xgwa.visual, mi->xgwa.colormap, - matrix3_xpm); + xi = image_data_to_ximage (mi->dpy, mi->xgwa.visual, + matrix3_png, sizeof(matrix3_png)); orig_w = xi->width; orig_h = xi->height; mp->real_char_rows = CHAR_ROWS; @@ -794,7 +789,7 @@ load_textures (ModeInfo *mi, Bool flip_p) glBindTexture (GL_TEXTURE_2D, mp->texture); check_gl_error ("texture init"); glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, xi->width, xi->height, 0, GL_RGBA, - GL_UNSIGNED_INT_8_8_8_8_REV, xi->data); + GL_UNSIGNED_BYTE, xi->data); { char buf[255]; sprintf (buf, "creating %dx%d texture:", xi->width, xi->height);