R_DrawSurfaceBlock8_mip c functions speed
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
R_DrawSurfaceBlock8_mip c functions speed
Can you tell if the following is faster or slower by visual inspection? I can't. Original is in r_surf.c, and there's a comment- "use delta like asm"?
- Code: Select all
void R_DrawSurfaceBlock8_mip0 (void)
{
int v, i, b, lightdelta, light; //qbism - lightdelta
unsigned char pix, *psource, *prowdest;
psource = pbasesource;
prowdest = prowdestbase;
for (v=0 ; v<r_numvblocks ; v++)
{
// FIXME: make these locals?
// FIXME: use delta rather than both right and left, like ASM? //qbism- something like that
lightleft = r_lightptr[0];
lightright = r_lightptr[1];
lightdelta = (lightleft - lightright)>> 4; //qbism
r_lightptr += r_lightwidth;
lightleftstep = (r_lightptr[0] - lightleft) >> 4;
lightrightstep = (r_lightptr[1] - lightright) >> 4;
for (i=0 ; i<16 ; i++)
{
light = lightright;
for (b=15; b>=0; b--)
{
pix = psource[b];
prowdest[b] = ((unsigned char *)vid.colormap)
[(light & 0xFF00) + pix];
light += lightdelta; //qbism
}
psource += sourcetstep;
lightright += lightrightstep;
lightleft += lightleftstep;
lightdelta += (lightleftstep-lightrightstep) >>4; //qbism
prowdest += surfrowbytes;
}
if (psource >= r_sourcemax)
psource -= r_stepback;
}
}
-
qbism - Posts: 1236
- Joined: Thu Nov 04, 2004 5:51 am
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest