Пример #1
0
static T_void __interrupt __far ITickerInterruptSimple(T_void)
{
    T_word16 i ;
    static T_byte8 flag = 0 ;

    /* Do the old interrupt. */
    IOldTickerInterrupt() ;

    if (flag == 1)  {
        flag = 0 ;
        /* Change colors. */
        for (i=0; i<32; i++)  {
            palette[i][0] = rand()&63 ;
            palette[i][1] = rand()&63 ;
            palette[i][2] = rand()&63 ;
        }
        GrSetPalette(225, 32) ;
    } else {
        flag++ ;
    }


    /* Note that we are done. */
    outp(0x20, 0x20) ;
}
Пример #2
0
void GrRemapBitmap (grsBitmap * bmP, ubyte *palette, int transparentColor, int superTranspColor)
{
	int freq [256];

memset (freq, 0, 256 * sizeof (int));
if (!palette)
	palette = bmP->bm_palette;
if (!palette)
	return;
GrCountColors (bmP->bm_texBuf, bmP->bm_props.w * bmP->bm_props.h, freq);
GrSetPalette (bmP, palette, transparentColor, superTranspColor, freq);
}
Пример #3
0
void GrRemapBitmapGood (grsBitmap * bmP, ubyte *palette, int transparentColor, int superTranspColor)
{
	int freq [256];

memset (freq, 0, 256 * sizeof (int));
if (!palette)
	palette = bmP->bm_palette;
if (!palette)
	return;
if (bmP->bm_props.w == bmP->bm_props.rowsize)
	GrCountColors (bmP->bm_texBuf, bmP->bm_props.w * bmP->bm_props.h, freq);
else {
	int y;
	ubyte *p = bmP->bm_texBuf;
	for (y = bmP->bm_props.h; y; y--, p += bmP->bm_props.rowsize)
		GrCountColors (p, bmP->bm_props.w, freq);
	}
GrSetPalette (bmP, palette, transparentColor, superTranspColor, freq);
}