diff options
Diffstat (limited to 'jwxyz')
-rw-r--r-- | jwxyz/Makefile.in | 6 | ||||
-rw-r--r-- | jwxyz/jwxyz-android.c | 6 | ||||
-rw-r--r-- | jwxyz/jwxyz-cocoa.m | 2 | ||||
-rw-r--r-- | jwxyz/jwxyz-common.c | 15 | ||||
-rw-r--r-- | jwxyz/jwxyz.m | 13 | ||||
-rw-r--r-- | jwxyz/jwzgles.c | 37 | ||||
-rw-r--r-- | jwxyz/jwzglesI.h | 3 |
7 files changed, 45 insertions, 37 deletions
diff --git a/jwxyz/Makefile.in b/jwxyz/Makefile.in index 1f6d6ae..53f7189 100644 --- a/jwxyz/Makefile.in +++ b/jwxyz/Makefile.in @@ -1,4 +1,4 @@ -# utils/Makefile.in --- xscreensaver, Copyright © 1997-2021 Jamie Zawinski. +# utils/Makefile.in --- xscreensaver, Copyright © 1997-2023 Jamie Zawinski. # the `../configure' script generates `jwxyz/Makefile' from this file. # JWXYZ Is Not Xlib. @@ -44,6 +44,8 @@ EXTRAS = README Makefile.in TARFILES = $(EXTRAS) $(SRCS) $(HDRS) $(LOGOS) +# Using $(MAKE) directly means the shell executes things even with "make -n" +MAKE2 = $(MAKE) default: all all: $(OBJS) @@ -52,7 +54,7 @@ install: install-program install-man uninstall: uninstall-program uninstall-man install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install + $(MAKE2) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install install-program: install-man: diff --git a/jwxyz/jwxyz-android.c b/jwxyz/jwxyz-android.c index c84028b..ad7ec55 100644 --- a/jwxyz/jwxyz-android.c +++ b/jwxyz/jwxyz-android.c @@ -49,10 +49,11 @@ #include "jwzglesI.h" #include "jwxyz-android.h" #include "textclient.h" -#include "grabscreen.h" +#include "grabclient.h" #include "pow2.h" +#undef countof #define countof(x) (sizeof(x)/sizeof(*(x))) extern struct xscreensaver_function_table *xscreensaver_function_table; @@ -1759,6 +1760,9 @@ jwxyz_render_text (Display *dpy, void *native_font, } +// Returns the verbose Unicode name of this character, like "agrave" or +// "daggerdouble". Used by Unicrud, and by Fontglide with debugMetrics. +// char * jwxyz_unicode_character_name (Display *dpy, Font fid, unsigned long uc) { diff --git a/jwxyz/jwxyz-cocoa.m b/jwxyz/jwxyz-cocoa.m index f5bc551..9d13da1 100644 --- a/jwxyz/jwxyz-cocoa.m +++ b/jwxyz/jwxyz-cocoa.m @@ -858,7 +858,7 @@ jwxyz_copy_area (Display *dpy, Drawable src, Drawable dst, GC gc, void -jwxyz_assert_gl () +jwxyz_assert_gl (void) { // This is like check_gl_error, except this happens for debug builds only. #ifndef __OPTIMIZE__ diff --git a/jwxyz/jwxyz-common.c b/jwxyz/jwxyz-common.c index 0b170f6..b54e06c 100644 --- a/jwxyz/jwxyz-common.c +++ b/jwxyz/jwxyz-common.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1991-2020 Jamie Zawinski <jwz@jwz.org> +/* xscreensaver, Copyright © 1991-2022 Jamie Zawinski <jwz@jwz.org> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -164,9 +164,15 @@ jwxyz_validate_pixel (Display *dpy, unsigned long pixel, unsigned int depth, if (depth == 1) Assert ((pixel == 0 || pixel == 1), "bogus mono pixel: 0x%08X", pixel); + +# if !defined __OPTIMIZE__ + // This test fails somewhat regularly with certain X11 hacks. This might + // indicate the use of uninitialized data, or an assumption that BlackPixel + // is 0, but either way, crashing here is not super helpful. else if (!alpha_allowed_p) Assert (((pixel & BlackPixel(dpy,0)) == BlackPixel(dpy,0)), "bogus color pixel: 0x%08X", pixel); +# endif } @@ -1853,11 +1859,4 @@ screen_number (Screen *screen) return 0; } -// declared in utils/grabclient.h -Bool -use_subwindow_mode_p (Screen *screen, Window window) -{ - return False; -} - #endif /* HAVE_JWXYZ */ diff --git a/jwxyz/jwxyz.m b/jwxyz/jwxyz.m index d25d580..63f5569 100644 --- a/jwxyz/jwxyz.m +++ b/jwxyz/jwxyz.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1991-2020 Jamie Zawinski <jwz@jwz.org> +/* xscreensaver, Copyright © 1991-2022 Jamie Zawinski <jwz@jwz.org> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -891,8 +891,8 @@ fill_rects (Display *dpy, Drawable d, GC gc, int x = rectangles[i].x; int y = rectangles[i].y; - unsigned long width = rectangles[i].width; - unsigned long height = rectangles[i].height; + long width = rectangles[i].width; /* Might go negative */ + long height = rectangles[i].height; if (fast_fill_p) { long // negative_int > unsigned_int == 1 @@ -1515,8 +1515,9 @@ jwxyz_png_to_ximage (Display *dpy, Visual *visual, [img release]; return 0; } - int width = [img size].width; - int height = [img size].height; + // images/earth.png is 2048x1024 but img.size is 491x245? + int width = [bm pixelsWide]; + int height = [bm pixelsHigh]; size_t ibpp = [bm bitsPerPixel]; size_t ibpl = [bm bytesPerRow]; const unsigned char *data = [bm bitmapData]; @@ -1649,7 +1650,7 @@ copy_pixmap (Display *dpy, Pixmap p) // Returns the verbose Unicode name of this character, like "agrave" or -// "daggerdouble". Used by fontglide debugMetrics. +// "daggerdouble". Used by Unicrud, and by Fontglide with debugMetrics. // char * jwxyz_unicode_character_name (Display *dpy, Font fid, unsigned long uc) diff --git a/jwxyz/jwzgles.c b/jwxyz/jwzgles.c index 26f1188..e11a6f4 100644 --- a/jwxyz/jwzgles.c +++ b/jwxyz/jwzgles.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright © 2012-2021 Jamie Zawinski <jwz@jwz.org> +/* xscreensaver, Copyright © 2012-2023 Jamie Zawinski <jwz@jwz.org> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -1253,10 +1253,10 @@ void jwzgles_glColor4i (GLint r, GLint g, GLint b, GLint a) { /* -0x8000000 - 0x7FFFFFFF => 0.0 - 1.0 */ - jwzgles_glColor4f (0.5 + (GLfloat) r / 0xFFFFFFFF, - 0.5 + (GLfloat) g / 0xFFFFFFFF, - 0.5 + (GLfloat) b / 0xFFFFFFFF, - 0.5 + (GLfloat) a / 0xFFFFFFFF); + jwzgles_glColor4f (0.5 + (double) r / 0xFFFFFFFF, /* Not GLfloat */ + 0.5 + (double) g / 0xFFFFFFFF, + 0.5 + (double) b / 0xFFFFFFFF, + 0.5 + (double) a / 0xFFFFFFFF); } void @@ -1285,10 +1285,10 @@ void jwzgles_glColor4ui (GLuint r, GLuint g, GLuint b, GLuint a) { /* 0 - 0xFFFFFFFF => 0.0 - 1.0 */ - jwzgles_glColor4f ((GLfloat) r / 0xFFFFFFFF, - (GLfloat) g / 0xFFFFFFFF, - (GLfloat) b / 0xFFFFFFFF, - (GLfloat) a / 0xFFFFFFFF); + jwzgles_glColor4f ((double) r / 0xFFFFFFFF, /* Not GLfloat */ + (double) g / 0xFFFFFFFF, + (double) b / 0xFFFFFFFF, + (double) a / 0xFFFFFFFF); } void @@ -1316,10 +1316,10 @@ void jwzgles_glColor4s (GLshort r, GLshort g, GLshort b, GLshort a) { /* -0x8000 - 0x7FFF => 0.0 - 1.0 */ - jwzgles_glColor4f (0.5 + (GLfloat) r / 0xFFFF, - 0.5 + (GLfloat) g / 0xFFFF, - 0.5 + (GLfloat) b / 0xFFFF, - 0.5 + (GLfloat) a / 0xFFFF); + jwzgles_glColor4f (0.5 + (double) r / 0xFFFF, /* Not GLfloat */ + 0.5 + (double) g / 0xFFFF, + 0.5 + (double) b / 0xFFFF, + 0.5 + (double) a / 0xFFFF); } void @@ -1378,10 +1378,10 @@ void jwzgles_glColor4b (GLbyte r, GLbyte g, GLbyte b, GLbyte a) { /* -128 - 127 => 0.0 - 1.0 */ - jwzgles_glColor4f (0.5 + (GLfloat) r / 255, - 0.5 + (GLfloat) g / 255, - 0.5 + (GLfloat) b / 255, - 0.5 + (GLfloat) a / 255); + jwzgles_glColor4f (0.5 + (double) r / 255, /* Not GLfloat */ + 0.5 + (double) g / 255, + 0.5 + (double) b / 255, + 0.5 + (double) a / 255); } void @@ -4349,7 +4349,8 @@ void jwzgles_##NAME (ARGS_##SIG) \ WRAP (glActiveTexture, I) WRAP (glAlphaFunc, IF) WRAP (glBlendFunc, II) -/*WRAP (glBlendColor, FFFF);*/ +WRAP (glBlendColor, FFFF) +WRAP (glBlendEquation, I) WRAP (glClear, I) WRAP (glClearColor, FFFF) WRAP (glClearStencil, I) diff --git a/jwxyz/jwzglesI.h b/jwxyz/jwzglesI.h index 975b3ee..8a63e0a 100644 --- a/jwxyz/jwzglesI.h +++ b/jwxyz/jwzglesI.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright © 2012-2021 Jamie Zawinski <jwz@jwz.org> +/* xscreensaver, Copyright © 2012-2023 Jamie Zawinski <jwz@jwz.org> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -175,6 +175,7 @@ extern void jwzgles_glActiveTexture (GLuint); extern void jwzgles_glBindTexture (GLuint, GLuint); extern void jwzgles_glBlendFunc (GLuint, GLuint); extern void jwzgles_glBlendColor (GLfloat, GLfloat, GLfloat, GLfloat); +extern void jwzgles_glBlendEquation (GLenum); extern void jwzgles_glClear (GLuint); extern void jwzgles_glClearColor (GLclampf, GLclampf, GLclampf, GLclampf); extern void jwzgles_glClearStencil (GLuint); |