Oskar Lindgren wrote:
[quote]
if (top < 128)    // the artists made some backwards ranges.  sigh.
[/quote]

So, whats the story behide this line? Dont make me guess.

/ Oskar Lindgren


The paletted imaged for Quake skins whas designed with special colors mean, but the artist fail to protect these so a rearrangement of code whas needed.

//Q1 code:

/*
=====================
CL_NewTranslation
=====================
*/
void CL_NewTranslation (int slot)
{
        int             i, j;
        int             top, bottom;
        byte    *dest, *source;

        if (slot > cl.maxclients)
                Sys_Error ("CL_NewTranslation: slot > cl.maxclients");
        dest = cl.scores[slot].translations;
        source = vid.colormap;
        memcpy (dest, vid.colormap, sizeof(cl.scores[slot].translations));
        top = cl.scores[slot].colors & 0xf0;
        bottom = (cl.scores[slot].colors &15)<<4;

        R_TranslatePlayerSkin (slot);

        for (i=0 ; i<VID_GRADES ; i++, dest += 256, source+=256)
        {
                if (top < 128)       // the artists made some backwards ranges. 
 sigh.
                        memcpy (dest + TOP_RANGE, source + top, 16);
                else
                        for (j=0 ; j<16 ; j++)
                                dest[TOP_RANGE+j] = source[top+15-j];

                if (bottom < 128)
                        memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
                else
                        for (j=0 ; j<16 ; j++)
                                dest[BOTTOM_RANGE+j] = source[bottom+15-j];
        }
}

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to