X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fstarwars.c;h=1efcd154c321d84ffd6e9e4c38790cccab820089;hb=78add6e627ee5f10e1fa6f3852602ea5066eee5a;hp=9ee8cc3f05ed11e00cdb993ae1beeac83c0842d7;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba;p=xscreensaver diff --git a/hacks/glx/starwars.c b/hacks/glx/starwars.c index 9ee8cc3f..1efcd154 100644 --- a/hacks/glx/starwars.c +++ b/hacks/glx/starwars.c @@ -1,4 +1,4 @@ -/* starwars, Copyright (c) 1998-2015 Jamie Zawinski and +/* starwars, Copyright (c) 1998-2018 Jamie Zawinski and * Claudio Matsuoka * * Permission to use, copy, modify, distribute, and sell this software and its @@ -46,9 +46,8 @@ "*textLiteral: " DEF_TEXT "\n" \ "*program: xscreensaver-text --cols 0" /* don't wrap */ -# define refresh_sws 0 # define release_sws 0 -# define sws_handle_event 0 +# define sws_handle_event xlockmore_no_events #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -569,6 +568,12 @@ init_stars (ModeInfo *mi, int width, int height) int max_size = 3; GLfloat inc = 0.5; int steps = max_size / inc; + GLfloat scale = 1; + + if (MI_WIDTH(mi) > 2560) { /* Retina displays */ + scale *= 2; + nstars = (size/scale) * (size/scale) / 320; + } glDeleteLists (sc->star_list, 1); sc->star_list = glGenLists (1); @@ -578,7 +583,7 @@ init_stars (ModeInfo *mi, int width, int height) for (j = 1; j <= steps; j++) { - glPointSize(inc * j); + glPointSize(inc * j * scale); glBegin (GL_POINTS); for (i = 0; i < nstars / steps; i++) { @@ -717,9 +722,6 @@ gl_init (ModeInfo *mi) } -static void free_sws (ModeInfo *mi); - - ENTRYPOINT void init_sws (ModeInfo *mi) { @@ -727,7 +729,7 @@ init_sws (ModeInfo *mi) sws_configuration *sc = 0; - MI_INIT (mi, scs, free_sws); + MI_INIT (mi, scs); sc = &scs[MI_SCREEN(mi)]; @@ -1051,7 +1053,7 @@ draw_sws (ModeInfo *mi) sc->star_theta += star_spin; } -static void +ENTRYPOINT void free_sws (ModeInfo *mi) { sws_configuration *sc = &scs[MI_SCREEN(mi)];