[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] Fwd: gradients,FreeMiNT 1.18



Date: Fri, Jul 29, 2011 at 10:17 PM

On Fri, Jul 29, 2011 at 8:46 PM, Helmut Karlowski
<helmut.karlowski@ish.de> wrote:
> Paul Wratt wrote:
>
>> before we get that far tho, both XA_XTOBJ.RSC and IMG also need to be
>> configurable in .CNF, just as WIDGETS is
>
> Where are they needed?
>
yes, to properly created themes and archives, otherwise they
physically need to be copied & renamed (xa_xtobj.rsc & img)

>> Thanks for the screen shots of the gradients Helmut (it may have
>
> You mean widgets?
>
I misread your post, and I guess gradient screenshots are not helpful
until you have some nonstandard ones.. unless the ones you have are
the same as the ones on my skins page, in which case I give permission
to use those.. (if wanted)

>> app was NOT written in C.. same goes for textures, although specific
>> object rendering is not as clear as with gradients..
>
> Should textures precede gradients - i.e. no gradient if a texture is
> given for an object?
>
If you just extended gradients, then it should use gradients if
non-zero values is given (as it originally did), irrelevant of the
presence of IMG folder (or future setting)

>> That idea also required all gradients to be defined in 1 file, even
>> though 2 separate parts must be included by to separate c files at
>> compile time.. (for those that did not know)
>
> ??
>
the (original) gradients are set in 2 c files. to make thinks simple
for creating and editing, I combined them into one file, and used a
define to include only that part of the (single) gradient file that
was to be used (ie. the correct struct definitions - see attachment)

I see there are 2 files. what is the difference between g_blue.c and
n_blue.c (slist and window-title exchanged?)

>> Hope that answer most of your questions
>
> But this does not answer joksas question: How do the gradients actually
> work, and what impact do the values in the structs have?
>
> I guess he needs to know this when he writes his style-editor ..
>
the gradient struct is very "clean", with the primary difference being
a gradient algorithm (one of 5 I think), look at attachment (from my
1.16.3 build) is easiest, but basically just an array of RGB groups
(in VDI format), depending on algorithm requirements

I am pretty sure there is a post from within the last 2 years that has
some details about the algorithms & a zip with other gradient schemes

> To me the c-files for gradients are a lot easier to edit than the
> keyboard-source-files, so that would not help much apart of the
> additional work/error-source.
>
same, which is why I thought of using a C parser in XaAES, and or an
interpreter in the preview app.. why create a new INI stule format
that will have to then me converted or require a loader, especially
when you realise just how "clean" the gradient structs are in C form.

as for custom gradients for specific apps/windows, people will find a
use for that (especially if it covers IMG as well), but again I think
it comes down to resources too (gradients are pretty lite, but
textures can be huge)

by the way, thanks for confirming the use of Pure-C/AHCC for creating
gradients, I am sure lots more people will be interested in creating
and testing new color schemes

Jo: I guess it is possible to write out a binary from a preview app,
but deciphering the struct output will be time consuming (but not
impossible), I think there were about 148 structs needed (maybe less),
and about 5 different struct layouts (1 per algorithm), so atm it is
just easier to use compiler.. but probably a good idea for a final app

one final thing here regarding loading the structs (I forgot to
mention before), because some algorithms have different sizes (require
more than 2 sets of RGB values, ie used in window widgets), this
complicates loading changes from raw binary. It may be be possible to
pre-define the area with the algorithm that uses the most memory, but
that would also mean changing the default gradient used, and may give
"bad" rendering results too, so some experimentation is required

Adam: he meant gcc is used to get the resulting GRD which is then used
at boot time (also Pure-C/AHCC works), not gcc is used at boot time

anyway, in the meantime, at least people can start playing, and (more)
easily get results

Paul
/*
 * $Id: render_obj.c,v 1.6 2009/12/04 10:44:35 pw Stable $
 *
 * XaAES - XaAES Ain't the AES (c) 1992 - 1998 C.Graham
 *                                 1999 - 2003 H.Robbers
 *                                 2004 - 2006 F.Naumann & O.Skancke
 *                                 2009 - 2010 P.Wratt
 *
 * A multitasking AES replacement for FreeMiNT
 *
 * This file is part of XaAES.
 *
 * XaAES is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * XaAES is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with XaAES; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

// YELLOW - mustard/bronze

#ifdef WIN_DRAW
/* ---------------------------------------------------------------------------------- */
/* -----------  Standard client window colour gradients --------------------------------- */
/* ---------------------------------------------------------------------------------- */
struct xa_gradient otop_vslide_gradient =
{
	NULL,
	-1, 0,
	 0, 16,

	1, 0, {0},
	{{500,500,400},{700,700,600}},
};
struct xa_gradient otop_hslide_gradient =
{
	NULL,
	 0, -1,
	16,  0,

	0, 0, {0},
	{{500,500,400},{700,700,600}},
};
struct xa_gradient otop_vslider_gradient =
{
	NULL,
	-1, 0,
	 0, 16,

	1, 0, {0},
	{{1000,1000,900},{700,700,600}},
};
struct xa_gradient otop_hslider_gradient =
{
	NULL,
	 0, -1,
	16,  0,

	0, 0, {0},
	{{1000,1000,900},{700,700,600}},
};

struct xa_gradient utop_vslide_gradient =
{
	NULL,
	-1, 0,
	 0, 16,

	1, 0, {0},
	{{350,350,300},{550,550,500}},
};
struct xa_gradient utop_hslide_gradient =
{
	NULL,
	 0, -1,
	16,  0,

	0, 0, {0},
	{{350,350,300},{550,550,500}},
};
struct xa_gradient utop_vslider_gradient =
{
	NULL,
	-1, 0,
	 0, 16,

	1, 0, {0},
	{{850,850,800},{550,550,500}},
};
struct xa_gradient utop_hslider_gradient =
{
	NULL,
	 0, -1,
	16,  0,

	0, 0, {0},
	{{850,850,800},{550,550,500}},
};

static struct xa_gradient otop_title_gradient = 
{
#if 0
	NULL,
	-1, -1,
	0, 0,

	2, 0,{0},
	{{500,500,600},{900,900,1000}},
// 	{{200,500,200},{800,1000,800}},
#else
	NULL,
	 0, -1,
	16,  0,

	0, 0, {0},
	{{900,900,700},{700,700,500}},
#endif
};
static struct xa_gradient utop_title_gradient =
{
#if 0
	NULL,
	-1, -1,
	0, 0,
	
	2, 0, {0},
	{{500,500,500},{800,800,800}},
/*	{{500,500,500},{900,900,900}}, */
#else
	NULL,
	0, -1,
	16, 0,

	0,0,{0},
	{{650,650,600},{850,850,800}},
#endif
};

static struct xa_gradient otop_info_gradient = 
{
	NULL,
	0, -1,
	16, 0,

	0,0,{0},
	{{850,850,800},{1000,1000,950}},
// 	3, 1, {3, 0},
// 	{{200,200,200},{600,600,600},{900,900,900}},
};
static struct xa_gradient utop_info_gradient = 
{
	NULL,
	0, -1,
	16, 0,

	0, 0, {0},
	{{650,650,600},{850,850,800}},
};

static struct xa_gradient otop_grey_gradient =
{
	NULL,
	-1, -1,
	0, 0,
	
	2, 0, {0},
	{{700,700,600},{1000,1000,900}},
};

static struct xa_gradient utop_grey_gradient =
{
	NULL,
	-1, -1,
	0, 0,
	
	2, 0, {0},
	{{550,550,500},{850,850,800}},
/*	{{500,500,500},{900,900,900}}, */
};

/* ---------------------------------------------------------------------------------- */
/* ---------------- Alert window colour gradients --------------------------------------- */
/* ---------------------------------------------------------------------------------- */

static struct xa_gradient alert_otop_title_gradient = 
{
	NULL,
	-1, -1,
	0, 0,

	2, 0,{0},
	{{450,250,200},{950,850,800}},
};

static struct xa_gradient alert_utop_title_gradient =
{
	NULL,
	-1, -1,
	0, 0,
	
	2, 0, {0},
	{{550,550,500},{750,750,700}},
/*	{{500,500,500},{900,900,900}}, */
};

static struct xa_gradient alert_utop_grey_gradient =
{
	NULL,
	-1, -1,
	0, 0,
	
	2, 0, {0},
	{{350,350,300},{750,750,700}},
/*	{{500,500,500},{900,900,900}}, */
};

/* ---------------------------------------------------------------------------------- */
/* ---------------- Scroll List window colour gradients --------------------------------- */
/* ---------------------------------------------------------------------------------- */
struct xa_gradient slist_otop_vslide_gradient =
{
	NULL,
	-1, 0,
	0, 16,

	1, 0, {0},
	{{350,350,300},{550,550,500}},
};
struct xa_gradient slist_otop_hslide_gradient =
{
	NULL,
	0, -1, 
	16, 0,

	0, 0, {0},
	{{350,350,300},{550,550,500}},
};
struct xa_gradient slist_otop_vslider_gradient =
{
	NULL,
	-1, 0,
	0, 16,

	1, 0, {0},
	{{850,850,800},{550,550,500}},
};
struct xa_gradient slist_otop_hslider_gradient =
{
	NULL,
	0, -1, 
	16, 0,

	0, 0, {0},
	{{850,850,800},{550,550,500}},
};
struct xa_gradient slist_utop_vslide_gradient =
{
	NULL,
	-1, 0,
	0, 16,

	1, 0, {0},
	{{350,350,300},{550,550,500}},
};
struct xa_gradient slist_utop_hslide_gradient =
{
	NULL,
	0, -1, 
	16, 0,

	0, 0, {0},
	{{350,350,300},{550,550,500}},
};
struct xa_gradient slist_utop_vslider_gradient =
{
	NULL,
	-1, 0,
	0, 16,

	1, 0, {0},
	{{850,850,800},{550,550,500}},
};
struct xa_gradient slist_utop_hslider_gradient =
{
	NULL,
	0, -1, 
	16, 0,

	0, 0, {0},
	{{850,850,800},{550,550,500}},
};

static struct xa_gradient slist_otop_title_gradient = 
{
	NULL,
	-1, -1,
	0, 0,

	2, 0,{0},
	{{400,400,00},{1000,1000,600}},
};
static struct xa_gradient slist_utop_title_gradient =
{
	NULL,
	-1, -1,
	0, 0,
	
	2, 0, {0},
	{{550,550,500},{750,750,700}},
/*	{{500,500,500},{900,900,900}}, */
};

static struct xa_gradient slist_otop_info_gradient = 
{
	NULL,
	0, -1,
	16, 0,

	3, 1, {3, 0},
	{{250,250,200},{650,650,600},{950,950,900}},
};
static struct xa_gradient slist_utop_info_gradient = 
{
	NULL,
	0, -1,
	16, 0,

	0, 0, {0},
	{{250,250,200},{450,450,400}},
};
static struct xa_gradient slist_otop_grey_gradient =
{
	NULL,
	-1, -1,
	0, 0,
	
	2, 0, {0},
	{{550,550,500},{950,950,900}},
};
static struct xa_gradient slist_utop_grey_gradient =
{
	NULL,
	-1, -1,
	0, 0,
	
	2, 0, {0},
	{{350,350,300},{750,750,700}},
/*	{{500,500,500},{900,900,900}}, */
};
#endif


#ifdef RENDER_OBJ
static struct xa_gradient menu_gradient =
{
	NULL,
	 0, -1,
	16,  0,

	0, 0, {0},
// 	{{750,750,750},{900,900,900}},
	{{950,950,900},{650,650,600}},
};
static struct xa_gradient sel_title_gradient =
{
	NULL,
	0, -1,
	16, 0,
	0,0,{0},
	{{650,650,600},{1000,1000,950}},
};
static struct xa_gradient sel_popent_gradient =
{
	NULL,
	0, -1,
	16, 0,
	0,0,{0},
	{{1000,1000,950},{1000,1000,800}},
};

static struct xa_gradient indbutt_gradient =
{
	NULL,
	-1,   0,
	 0,  16,
	
	4, 1, { -35, 0, },
	{{750,750,700},{950,950,900},{750,750,700}},	
};
static struct xa_gradient sel_indbutt_gradient =
{
	NULL,
	-1,   0,
	 0,  16,
	
	4, 1, { -35, 0, },
	{{750,750,700},{550,550,500},{750,750,700}},	
};
static struct xa_gradient actbutt_gradient =
{
	NULL,
	0, -1,
	16, 0,
	
	0, 0, { 0 },
	{{950,950,900},{750,750,700}},	
};

static struct xa_gradient popbkg_gradient =
{
	NULL,
	0, -1,
	16, 0,

	3, 1, {-40, 0},
	{{850,850,800}, {950,950,900}, {750,750,700}},
};
#endif