]> git.webhop.me Git - logoview.git/commitdiff
improved patched for hd51
authorMarkham <markham001@gmx.de>
Sat, 2 Jun 2018 14:05:10 +0000 (16:05 +0200)
committerMarkham <markham001@gmx.de>
Sat, 2 Jun 2018 14:05:10 +0000 (16:05 +0200)
logoview.cpp

index 82eb1ec9690e07557f6c26f1d7c88c77ad7e6202..82d00e896963d45a48db2fb1e749e06351d54d09 100644 (file)
 #include "logoview.h"
 #include "jpeg.h"
 
-#define LV_VERSION "1.01c"
+#define LV_VERSION "1.01d"
 #define VERSIONSTR "\n\
       -------------------------------------------------------------\n\
       -- logoview v" LV_VERSION " * (C)2011-2012, M. Liebmann (micha-bbg) --\n\
-      -- patched for Keywelt by Markham                          --\n\
+      -- patched for Keywelt HD51 by Markham 2018                --\n\
       -------------------------------------------------------------\n\n"
 #define FLAG_FILE "/tmp/.logoview"
 #define NEUTRINO_CONF "/var/tuxbox/config/neutrino.conf"
@@ -160,10 +160,17 @@ bool CLogoView::ReadConfig()
                screen_EndY   = 1058;
        }
        else {
+#if HAVE_ARM_HARDWARE
+               screen_StartX = 0;
+               screen_StartY = 0;
+               screen_EndX   = 1280;
+               screen_EndY   = 720;
+#else
                screen_StartX = 15;
                screen_StartY = 15;
                screen_EndX   = 1265;
                screen_EndY   = 705;
+#endif
        }
 
        if(!noconf && (fv = fopen(NEUTRINO_CONF,"r")) != NULL) {
@@ -376,13 +383,22 @@ TIMER_STOP("[logoview] load pic       ");
 
        int skalFaktor = 8;
        int skalKorr   = 2;
-       unsigned int tmp_xres = (var_screeninfo.xres - (screen_StartX + (var_screeninfo.xres - screen_EndX)));
-       unsigned int tmp_yres = (var_screeninfo.yres - (screen_StartY + (var_screeninfo.yres - screen_EndY)));
-       unsigned int xres = (((var_screeninfo.xres - (screen_StartX + (var_screeninfo.xres - screen_EndX))) / skalFaktor) + skalKorr) * skalFaktor;
-       unsigned int yres = (((var_screeninfo.yres - (screen_StartY + (var_screeninfo.yres - screen_EndY))) / skalFaktor) + skalKorr) * skalFaktor;
-//printf("##### tmp_xres: %d, tmp_yres: %d, xres: %d, yres: %d\n", tmp_xres, tmp_yres, xres, yres);
+
+       if ( var_screeninfo.xres <= 2*skalFaktor + (var_screeninfo.xres - (screen_StartX + (var_screeninfo.xres - screen_EndX))))
+               skalKorr = 1;
+       if ( var_screeninfo.yres <= 2*skalFaktor + (var_screeninfo.yres - (screen_StartY + (var_screeninfo.yres - screen_EndY))))
+               skalKorr = 1;
+#if HAVE_ARM_HARDWARE
+               skalKorr = 0;
+#endif
+       unsigned int tmp_xres = (var_screeninfo.xres-1 - (screen_StartX + (var_screeninfo.xres-1 - screen_EndX)));
+       unsigned int tmp_yres = (var_screeninfo.yres-1 - (screen_StartY + (var_screeninfo.yres-1 - screen_EndY)));
+       unsigned int xres = (((var_screeninfo.xres-1 - (screen_StartX + (var_screeninfo.xres-1 - screen_EndX))) / skalFaktor) + skalKorr) * skalFaktor;
+       unsigned int yres = (((var_screeninfo.yres-1 - (screen_StartY + (var_screeninfo.yres-1 - screen_EndY))) / skalFaktor) + skalKorr) * skalFaktor;
+//printf("##### tmp_xres: %d, tmp_yres: %d, xres: %d, yres: %d skal %d\n", tmp_xres, tmp_yres, xres, yres, skalKorr);
        tmp_xres = (xres - tmp_xres) / 2;
        tmp_yres = (yres - tmp_yres) / 2;
+
 //printf("##### tmp_xres: %d, tmp_yres: %d, xres: %d, yres: %d\n", tmp_xres, tmp_yres, xres, yres);
 
 TIMER_START();