diff --git a/includes/graphics.h b/includes/graphics.h index a5de71a25..4d4d438fb 100644 --- a/includes/graphics.h +++ b/includes/graphics.h @@ -46,6 +46,7 @@ extern unsigned char fire_b[YRES/CELL][XRES/CELL]; extern unsigned int fire_alpha[CELL*3][CELL*3]; extern pixel *fire_bg; +extern pixel *pers_bg; pixel *rescale_img(pixel *src, int sw, int sh, int *qw, int *qh, int f); diff --git a/src/graphics.c b/src/graphics.c index 78f1867fb..a3cbf8774 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -31,6 +31,7 @@ unsigned char fire_b[YRES/CELL][XRES/CELL]; unsigned int fire_alpha[CELL*3][CELL*3]; pixel *fire_bg; +pixel *pers_bg; pixel *rescale_img(pixel *src, int sw, int sh, int *qw, int *qh, int f) { diff --git a/src/interface.c b/src/interface.c index d3057d8e0..703ac068b 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1892,6 +1892,7 @@ void set_cmode(int cm) else if (cmode==CM_PERS) { memset(fire_bg, 0, XRES*YRES*PIXELSIZE); + memset(pers_bg, 0, (XRES+BARSIZE)*YRES*PIXELSIZE); strcpy(itc_msg, "Persistent Display"); } else if (cmode==CM_PRESS) @@ -1925,6 +1926,7 @@ void set_cmode(int cm) { strcpy(itc_msg, "Velocity Display"); } + save_presets(0); } char *download_ui(pixel *vid_buf, char *uri, int *len) diff --git a/src/main.c b/src/main.c index 16f309253..2f3a6414f 100644 --- a/src/main.c +++ b/src/main.c @@ -1188,7 +1188,6 @@ int main(int argc, char *argv[]) int pastFPS = 0; int past = 0; pixel *vid_buf=calloc((XRES+BARSIZE)*(YRES+MENUSIZE), PIXELSIZE); - pixel *pers_bg=calloc((XRES+BARSIZE)*YRES, PIXELSIZE); void *http_ver_check; void *http_session_check = NULL; char *ver_data=NULL, *check_data=NULL, *tmp; @@ -1248,6 +1247,7 @@ int main(int argc, char *argv[]) parts[NPART-1].life = -1; pfree = 0; fire_bg=calloc(XRES*YRES, PIXELSIZE); + pers_bg=calloc((XRES+BARSIZE)*YRES, PIXELSIZE); memset(signs, 0, sizeof(signs)); //fbi_img = render_packed_rgb(fbi, FBI_W, FBI_H, FBI_CMP); @@ -2291,6 +2291,7 @@ int main(int argc, char *argv[]) ISSPAWN2 = 0; memset(fire_bg, 0, XRES*YRES*PIXELSIZE); + memset(pers_bg, 0, (XRES+BARSIZE)*YRES*PIXELSIZE); memset(fire_r, 0, sizeof(fire_r)); memset(fire_g, 0, sizeof(fire_g)); memset(fire_b, 0, sizeof(fire_b)); @@ -2319,6 +2320,7 @@ int main(int argc, char *argv[]) { search_ui(vid_buf); memset(fire_bg, 0, XRES*YRES*PIXELSIZE); + memset(pers_bg, 0, (XRES+BARSIZE)*YRES*PIXELSIZE); memset(fire_r, 0, sizeof(fire_r)); memset(fire_g, 0, sizeof(fire_g)); memset(fire_b, 0, sizeof(fire_b)); @@ -2340,7 +2342,6 @@ int main(int argc, char *argv[]) set_cmode((cmode+(CM_COUNT-1)) % CM_COUNT); } } - save_presets(0); } if (x>=(XRES+BARSIZE-(510-494)) && x<=(XRES+BARSIZE-(510-509)) && !bq) sys_pause = !sys_pause;