return -1;
}
-// memset(lfb, 0, stride * yRes);
+// memset(lfb, 0, swidth * yRes);
if (ioctl(fb, FBIOBLANK, FB_BLANK_UNBLANK) < 0) {
printf("screen unblanking failed\n");
}
set332map();
}
for(i = 0; i < yc; i++){
- memcpy(lbb+(i+yoffs)*stride+xo,cp + (i+yp)*pic_xs+xp,xc*cpp);
+ memcpy(lbb+(i+yoffs)*swidth+xo,cp + (i+yp)*pic_xs+xp,xc*cpp);
}
break;
case 2:
for(i = 0; i < yc; i++){
- memcpy(lbb+(i+yoffs)*stride+xo,sp + (i+yp)*pic_xs+xp, xc*cpp);
+ memcpy(lbb+(i+yoffs)*swidth+xo,sp + (i+yp)*pic_xs+xp, xc*cpp);
}
break;
case 4:
{
uint32_t * data = (uint32_t *) fbbuff;
- uint32_t * d = (uint32_t *)lbb + xo + stride * yoffs;
+ uint32_t * d = (uint32_t *)lbb + xo + swidth * yoffs;
uint32_t * d2;
for (count = 0; count < yc; count++ ) {
d2++;
pixpos++;
}
- d += stride;
+ d += swidth;
}
}
break;
y=cfy;
}
- unsigned int stride = fix.line_length;
+ unsigned int swidth = fix.line_length;
switch(cpp){
case 2:
tl = tvar.transp.length;
to = tvar.transp.offset;
short black=make16color(0,0,0, rl, ro, gl, go, bl, bo, tl, to);
- unsigned short *s_fbbuff = (unsigned short *) malloc(y*stride/2 * sizeof(unsigned short));
+ unsigned short *s_fbbuff = (unsigned short *) malloc(y*swidth/2 * sizeof(unsigned short));
if(s_fbbuff==NULL)
{
printf("Error: malloc\n");
return;
}
- for(i = 0; i < y*stride/2; i++)
+ for(i = 0; i < y*swidth/2; i++)
s_fbbuff[i] = black;
- memcpy(lfb, s_fbbuff, y*stride);
+ memcpy(lfb, s_fbbuff, y*swidth);
free(s_fbbuff);
}
break;
unsigned int col = 0xFF000000;
unsigned int * dest = (unsigned int *) lfb;
unsigned int i;
- for(i = 0; i < stride*y/4; i ++)
+ for(i = 0; i < swidth*y/4; i ++)
dest[i] = col;
}
break;
default:
- memset(lfb, 0, stride*y);
+ memset(lfb, 0, swidth*y);
}
}
{
for(x=_sx ; x< _sx+width; x++)
{
- memcpy(busy_buffer_wrk, lbb + y * stride + (x * cpp)/sizeof(uint32_t), cpp);
+ memcpy(busy_buffer_wrk, lbb + y * swidth + (x * cpp)/sizeof(uint32_t), cpp);
busy_buffer_wrk+=cpp;
- memcpy(lbb + y * stride + (x * cpp)/sizeof(uint32_t), fb_buffer, cpp);
+ memcpy(lbb + y * swidth + (x * cpp)/sizeof(uint32_t), fb_buffer, cpp);
}
}
blit();
{
int F,R=rad,ssx=sx+rsx,ssy=sy+rsy,dxx=rex,dyy=rey,rx,ry,wx,wy,count;
- uint32_t *pos = lbb + ssx + stride * ssy;
+ uint32_t *pos = lbb + ssx + swidth * ssy;
uint32_t *pos0, *pos1, *pos2, *pos3, *i;
uint32_t pix = bgra[col];
rx=R-ssx;
ry=R-ssy;
- pos0=pos+(dyy-ry)*stride;
- pos1=pos+ry*stride;
- pos2=pos+rx*stride;
- pos3=pos+(dyy-rx)*stride;
+ pos0=pos+(dyy-ry)*swidth;
+ pos1=pos+ry*swidth;
+ pos2=pos+rx*swidth;
+ pos3=pos+(dyy-rx)*swidth;
while (ssx <= ssy)
{
rx=R-ssx;
*i = pix;
ssx++;
- pos2-=stride;
- pos3+=stride;
+ pos2-=swidth;
+ pos3+=swidth;
if (F<0)
{
F+=(ssx<<1)-1;
{
F+=((ssx-ssy)<<1);
ssy--;
- pos0-=stride;
- pos1+=stride;
+ pos0-=swidth;
+ pos1+=swidth;
}
}
- pos+=R*stride;
+ pos+=R*swidth;
}
for (count=R; count<(dyy-R); count++)
{
for(i=pos; i<pos+dxx;i++)
*i = pix;
- pos+=stride;
+ pos+=swidth;
}
}
End = xb;
step = yb < ya ? -1 : 1;
}
- *(lbb + startx+x + stride*(y+starty)) = pix;
+ *(lbb + startx+x + swidth*(y+starty)) = pix;
while( x < End )
{
y += step;
p += twoDyDx;
}
- *(lbb + startx+x + stride*(y+starty)) = pix;
+ *(lbb + startx+x + swidth*(y+starty)) = pix;
}
}
else
End = yb;
step = xb < xa ? -1 : 1;
}
- *(lbb + startx+x + stride*(y+starty)) = pix;
+ *(lbb + startx+x + swidth*(y+starty)) = pix;
while( y < End )
{
p += twoDxDy;
}
- *(lbb + startx+x + stride*(y+starty)) = pix;
+ *(lbb + startx+x + swidth*(y+starty)) = pix;
}
}
}
if (_sx + sbit->xadvance >= _ex)
return -1; /* limit to maxwidth */
- uint32_t bgcolor = *(lbb + (sy + _sy - _d - 1) * stride + (sx + _sx + sbit->left));
+ uint32_t bgcolor = *(lbb + (sy + _sy - _d - 1) * swidth + (sx + _sx + sbit->left));
uint32_t fgcolor = bgra[color];
uint32_t *colors = lookup_colors(fgcolor, bgcolor);
- uint32_t *p = lbb + (sx + _sx + sbit->left + kerning.x) + stride * (sy + _sy - sbit->top - _d);
+ uint32_t *p = lbb + (sx + _sx + sbit->left + kerning.x) + swidth * (sy + _sy - sbit->top - _d);
uint32_t *r = p + (_ex - _sx); /* end of usable box */
for(row = 0; row < sbit->height; row++)
{
if (q > r) /* we are past _ex */
break;
}
- p += stride;
- r += stride;
+ p += swidth;
+ r += swidth;
}
}
#include "gifdecomp.h"
#include "icons.h"
-#define P_VERSION "4.05"
+#define P_VERSION "4.06"
#define S_VERSION ""
//char LCDL_FILE[]="/tmp/lcd.locked";
int instance=0;
int rclocked=0;
-int stride;
+int swidth;
int get_instance(void)
{
desc.flags = FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT;
//init backbuffer
-
+ int stride = fix_screeninfo.line_length;
+ swidth = stride/sizeof(uint32_t);
+ if (stride == 7680 && var_screeninfo.xres == 1280) {
+ var_screeninfo.yres = 1080;
+ }
if(!(lbb = malloc(var_screeninfo.xres*var_screeninfo.yres*sizeof(uint32_t))))
{
perror("tuxwetter <allocating of Backbuffer>\n");
munmap(lfb, fix_screeninfo.smem_len);
return -1;
}
-
- stride = fix_screeninfo.line_length/sizeof(uint32_t);
-
memset(lbb, TRANSP, var_screeninfo.xres*var_screeninfo.yres*sizeof(uint32_t));
startx = sx;
extern int TABULATOR;
extern uint32_t bgra[];
-extern int stride;
+extern int swidth;
extern uint32_t *lfb, *lbb;
extern char *proxyadress, *proxyuserpwd;