From 002925ea99665294ae559050718244f23e066c81 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 9 May 2017 12:56:16 +0200 Subject: [PATCH] - add compatibility to old neutrino.conf keywords --- globals.c | 18 ++++++++++++++---- globals.h | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/globals.c b/globals.c index 5f23208..438fec4 100644 --- a/globals.c +++ b/globals.c @@ -182,10 +182,20 @@ void read_neutrino_osd_conf(int *ex, int *sx, int *ey, int *sy) free(buffer); rewind(fd); ++pres; - sprintf(sstr[0], "screen_EndX_%s_%d=%%d", spres[pres], resolution); - sprintf(sstr[1], "screen_StartX_%s_%d=%%d", spres[pres], resolution); - sprintf(sstr[2], "screen_EndY_%s_%d=%%d", spres[pres], resolution); - sprintf(sstr[3], "screen_StartY_%s_%d=%%d", spres[pres], resolution); + if (resolution == -1) + { + sprintf(sstr[0], "screen_EndX_%s=%%d", spres[pres]); + sprintf(sstr[1], "screen_StartX_%s=%%d", spres[pres]); + sprintf(sstr[2], "screen_EndY_%s=%%d", spres[pres]); + sprintf(sstr[3], "screen_StartY_%s=%%d", spres[pres]); + } + else + { + sprintf(sstr[0], "screen_EndX_%s_%d=%%d", spres[pres], resolution); + sprintf(sstr[1], "screen_StartX_%s_%d=%%d", spres[pres], resolution); + sprintf(sstr[2], "screen_EndY_%s_%d=%%d", spres[pres], resolution); + sprintf(sstr[3], "screen_StartY_%s_%d=%%d", spres[pres], resolution); + } buffer=NULL; len = 0; diff --git a/globals.h b/globals.h index 212995d..e3bc8bf 100644 --- a/globals.h +++ b/globals.h @@ -23,7 +23,7 @@ #define __GLOBALS_H__ -#define P_VERSION "0.78" +#define P_VERSION "0.79" #define ADS_FILE "/tmp/blockads.ads" #define ZAP_FILE "/tmp/blockads.zap" -- 2.39.5