2011-01-23 21:07:20 +02:00
|
|
|
Index: zgv-5.9/src/zgv.c
|
|
|
|
===================================================================
|
|
|
|
--- zgv-5.9.orig/src/zgv.c 2011-01-23 19:09:28.000000000 +0100
|
2011-02-03 23:24:11 +02:00
|
|
|
+++ zgv-5.9/src/zgv.c 2011-02-03 22:20:30.000000000 +0100
|
2011-01-29 15:58:54 +02:00
|
|
|
@@ -148,7 +148,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
/* from 18-bit RGB (as used by VGA palette) to 3:3:2 palette index */
|
|
|
|
-#define MAKE332COL(r,g,b) (((r)>>3)*32+((g)>>3)*4+((b)>>4))
|
|
|
|
+#define MAKE332COL(r,g,b) vga_setrgbcolor(((r)<<2)+2, ((g)<<2)+2, ((b)<<2)+2);
|
|
|
|
+//(((r)>>3)*32+((g)>>3)*4+((b)>>4))
|
|
|
|
|
|
|
|
/* colour indicies used for filenames-only selector */
|
|
|
|
#define LIGHT 2
|
|
|
|
@@ -254,6 +255,7 @@
|
2011-01-23 21:07:20 +02:00
|
|
|
|
|
|
|
int fs_vgamode=G640x480x256; /* current video mode for selector */
|
|
|
|
int fs_scrnwide,fs_scrnhigh; /* width/height of selector mode */
|
|
|
|
+int fs_bypp;
|
|
|
|
|
|
|
|
/* stuff for checking old directories (to avoid symlink loops in
|
|
|
|
* recursive update).
|
2011-01-29 15:58:54 +02:00
|
|
|
@@ -2225,6 +2227,32 @@
|
2011-01-23 21:07:20 +02:00
|
|
|
return(buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
+static void drawscansegment_332(unsigned char *colors, int x, int y, int length)
|
|
|
|
+{
|
|
|
|
+ unsigned char *conv = colors;
|
|
|
|
+ int bypp = fs_bypp;
|
|
|
|
+
|
2011-01-29 15:58:54 +02:00
|
|
|
+ if (bypp > 1)
|
2011-01-23 21:07:20 +02:00
|
|
|
+ {
|
|
|
|
+ int i, j, k;
|
|
|
|
+ conv = malloc(length*bypp);
|
|
|
|
+ for (i = 0, j=0; i < length; i++)
|
|
|
|
+ {
|
|
|
|
+ int c332=colors[i];
|
|
|
|
+ int r = c332>>5, g = (c332>>2)&0x7, b = (c332&0x3);
|
|
|
|
+ int crgb = vga_setrgbcolor((r<<5)+16,(g<<5)+16,(b<<6)+32);
|
|
|
|
+ for (k = 0; k < bypp; k++) {
|
|
|
|
+ conv[j++] = crgb>>(k*8) & 0xff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
2011-01-29 15:58:54 +02:00
|
|
|
+ vga_drawscansegment(conv, x, y, length*(bypp < 1 ? 1 : bypp));
|
2011-01-23 21:07:20 +02:00
|
|
|
+ if (conv != colors)
|
|
|
|
+ {
|
|
|
|
+ free(conv);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
void showgifdir(int startfrom,int unshow,int drawdirmsg,int do_one_only)
|
|
|
|
{
|
2011-01-29 15:58:54 +02:00
|
|
|
@@ -2317,14 +2345,12 @@
|
|
|
|
/* load and draw thumbnail file (or undraw it) */
|
|
|
|
if(unshow)
|
|
|
|
{
|
|
|
|
- image=malloc(96);
|
|
|
|
if(image!=NULL)
|
2011-01-23 21:07:20 +02:00
|
|
|
{
|
2011-01-29 15:58:54 +02:00
|
|
|
- memset(image,idx_medium,96);
|
|
|
|
- for(y=-2;y<62;y++)
|
2011-01-23 21:07:20 +02:00
|
|
|
- vga_drawscansegment(image,
|
2011-01-29 15:58:54 +02:00
|
|
|
- xpos+(BARWIDTH-80)/2-2,ypos+y+GDFYBIT+9,96);
|
|
|
|
- free(image);
|
|
|
|
+ gl_fillbox(xpos+(BARWIDTH-80)/2-2,ypos-2+GDFYBIT+9,96,62+2,
|
|
|
|
+ idx_medium);
|
|
|
|
+ gl_fillbox(xpos+(BARWIDTH-80)/2-2,ypos-2+GDFYBIT+9,96,62+2,
|
|
|
|
+ idx_medium);
|
2011-01-23 21:07:20 +02:00
|
|
|
}
|
2011-01-29 15:58:54 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
@@ -2370,7 +2396,7 @@
|
2011-01-23 21:07:20 +02:00
|
|
|
if(image!=NULL)
|
|
|
|
{
|
|
|
|
for(y=0;y<h;y++)
|
|
|
|
- vga_drawscansegment(image+y*(fs_vgamode==G640x480x16?w8:w),xwant,
|
|
|
|
+ drawscansegment_332(image+y*(fs_vgamode==G640x480x16?w8:w),xwant,
|
|
|
|
ypos+y+GDFYBIT+39-h/2,fs_vgamode==G640x480x16?w8:w);
|
|
|
|
free(image);
|
|
|
|
}
|
2011-01-29 15:58:54 +02:00
|
|
|
@@ -2666,7 +2692,10 @@
|
|
|
|
/* fs_vgamode is known to be valid at this point. */
|
|
|
|
|
|
|
|
if(fs_vgamode!=vga_getcurrentmode())
|
|
|
|
+{
|
|
|
|
vga_setmode(fs_vgamode);
|
|
|
|
+ gl_setcontextvga(vga_getcurrentmode());
|
|
|
|
+}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* the palette-setting makes sure we don't have a possibly-crazy palette
|
|
|
|
@@ -2678,6 +2707,7 @@
|
2011-01-23 21:07:20 +02:00
|
|
|
|
|
|
|
fs_scrnwide=vga_getxdim();
|
|
|
|
fs_scrnhigh=vga_getydim();
|
|
|
|
+fs_bypp=vga_getmodeinfo(vga_getcurrentmode())->bytesperpixel;
|
|
|
|
|
|
|
|
msgbox_draw_ok=1;
|
|
|
|
gdfsiz=3-cfg.smallfstext;
|
2011-02-03 23:24:11 +02:00
|
|
|
@@ -2734,10 +2764,11 @@
|
|
|
|
{
|
|
|
|
/* no-thumbnails selector */
|
|
|
|
barheight=GDFYBIT+6;
|
|
|
|
- idx_medium=MIDGREY; idx_dark=DARK; idx_light=LIGHT; idx_black=BLACK;
|
|
|
|
- idx_marked=MARKEDCOL;
|
|
|
|
- idx_blacknz=BLACK;
|
|
|
|
- if(fs_vgamode==G640x480x16) idx_medium=0;
|
|
|
|
+ idx_medium=MAKE332COL(cfg.medium.r,cfg.medium.g,cfg.medium.b);
|
|
|
|
+ idx_dark =MAKE332COL(cfg.dark.r ,cfg.dark.g ,cfg.dark.b );
|
|
|
|
+ idx_light =MAKE332COL(cfg.light.r ,cfg.light.g ,cfg.light.b );
|
|
|
|
+ idx_black =MAKE332COL(cfg.black.r ,cfg.black.g ,cfg.black.b );
|
|
|
|
+ idx_marked=MAKE332COL(cfg.marked.r,cfg.marked.g,cfg.marked.b);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!(cfg.xvpic_index && cfg.perfectindex))
|
|
|
|
@@ -2772,14 +2803,7 @@
|
2011-01-29 15:58:54 +02:00
|
|
|
|
|
|
|
if(idx_medium)
|
|
|
|
{
|
|
|
|
- /* clear screen with `medium' (i.e. background) colour. */
|
|
|
|
- if((tmp=malloc(fs_scrnwide))!=NULL)
|
|
|
|
- {
|
|
|
|
- memset(tmp,idx_medium,fs_scrnwide);
|
|
|
|
- for(n=0;n<fs_scrnhigh;n++)
|
2011-01-23 21:07:20 +02:00
|
|
|
- vga_drawscanline(n,tmp);
|
2011-01-29 15:58:54 +02:00
|
|
|
- free(tmp);
|
|
|
|
- }
|
|
|
|
+ gl_clearscreen(idx_medium);
|
2011-01-23 21:07:20 +02:00
|
|
|
}
|
2011-01-29 15:58:54 +02:00
|
|
|
#ifndef BACKEND_SVGALIB
|
|
|
|
else
|
2011-02-03 23:24:11 +02:00
|
|
|
@@ -2932,12 +2956,8 @@
|
2011-01-23 21:07:20 +02:00
|
|
|
|
2011-01-29 15:58:54 +02:00
|
|
|
void clear_xvpic(int xpos,int ypos)
|
|
|
|
{
|
|
|
|
-unsigned char tmp[96];
|
|
|
|
-int y;
|
|
|
|
-
|
|
|
|
-memset(tmp,idx_medium,96);
|
|
|
|
-for(y=-3;y<63;y++)
|
2011-01-23 21:07:20 +02:00
|
|
|
- vga_drawscansegment(tmp,xpos+(BARWIDTH-80)/2-3,ypos+y+GDFYBIT+9,96);
|
2011-01-29 15:58:54 +02:00
|
|
|
+gl_fillbox(xpos+(BARWIDTH-80)/2-3,ypos-3+GDFYBIT+9,
|
|
|
|
+ 96, 63+3, idx_medium);
|
2011-01-23 21:07:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-01-29 15:58:54 +02:00
|
|
|
Index: zgv-5.9/src/rbmenu.c
|
|
|
|
===================================================================
|
|
|
|
--- zgv-5.9.orig/src/rbmenu.c 2011-01-29 13:15:39.000000000 +0100
|
|
|
|
+++ zgv-5.9/src/rbmenu.c 2011-01-29 13:16:14.000000000 +0100
|
|
|
|
@@ -235,6 +235,8 @@
|
|
|
|
unsigned char distnum;
|
|
|
|
int xr,xg,xb,dist,distquan,f;
|
|
|
|
|
|
|
|
+return vga_setrgbcolor((r<<2)+2, (g<<2)+2, (b<<2)+2);
|
|
|
|
+
|
|
|
|
rgb=((b<<12)|(g<<6)|r);
|
|
|
|
distnum=0;
|
|
|
|
distquan=20000; /* standard arbitrary bignum */
|