|
|
@ -200,7 +200,6 @@ void R_DrawSurface (void) |
|
|
|
surfrowbytes = r_drawsurf.rowbytes; |
|
|
|
surfrowbytes = r_drawsurf.rowbytes; |
|
|
|
|
|
|
|
|
|
|
|
mt = r_drawsurf.image; |
|
|
|
mt = r_drawsurf.image; |
|
|
|
r_drawsurf.surfmip = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r_source = mt->pixels[r_drawsurf.surfmip]; |
|
|
|
r_source = mt->pixels[r_drawsurf.surfmip]; |
|
|
|
|
|
|
|
|
|
|
@ -220,7 +219,7 @@ void R_DrawSurface (void) |
|
|
|
|
|
|
|
|
|
|
|
//==============================
|
|
|
|
//==============================
|
|
|
|
|
|
|
|
|
|
|
|
pblockdrawer = surfmiptable[0]; |
|
|
|
pblockdrawer = surfmiptable[r_drawsurf.surfmip]; |
|
|
|
// TODO: only needs to be set when there is a display settings change
|
|
|
|
// TODO: only needs to be set when there is a display settings change
|
|
|
|
horzblockstep = blocksize; |
|
|
|
horzblockstep = blocksize; |
|
|
|
|
|
|
|
|
|
|
@ -324,7 +323,7 @@ R_DrawSurfaceBlock8_mip1 |
|
|
|
void R_DrawSurfaceBlock8_mip1 (void) |
|
|
|
void R_DrawSurfaceBlock8_mip1 (void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int v, i, b, lightstep, lighttemp, light; |
|
|
|
int v, i, b, lightstep, lighttemp, light; |
|
|
|
unsigned char pix, *psource, *prowdest; |
|
|
|
pixel_t pix, *psource, *prowdest; |
|
|
|
|
|
|
|
|
|
|
|
psource = pbasesource; |
|
|
|
psource = pbasesource; |
|
|
|
prowdest = prowdestbase; |
|
|
|
prowdest = prowdestbase; |
|
|
@ -333,11 +332,11 @@ void R_DrawSurfaceBlock8_mip1 (void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// FIXME: make these locals?
|
|
|
|
// FIXME: make these locals?
|
|
|
|
// FIXME: use delta rather than both right and left, like ASM?
|
|
|
|
// FIXME: use delta rather than both right and left, like ASM?
|
|
|
|
lightleft = r_lightptr[0]; |
|
|
|
//lightleft = r_lightptr[0];
|
|
|
|
lightright = r_lightptr[1]; |
|
|
|
//lightright = r_lightptr[1];
|
|
|
|
r_lightptr += r_lightwidth; |
|
|
|
//r_lightptr += r_lightwidth;
|
|
|
|
lightleftstep = (r_lightptr[0] - lightleft) >> 3; |
|
|
|
//lightleftstep = (r_lightptr[0] - lightleft) >> 3;
|
|
|
|
lightrightstep = (r_lightptr[1] - lightright) >> 3; |
|
|
|
//lightrightstep = (r_lightptr[1] - lightright) >> 3;
|
|
|
|
|
|
|
|
|
|
|
|
for (i=0 ; i<8 ; i++) |
|
|
|
for (i=0 ; i<8 ; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -349,14 +348,15 @@ void R_DrawSurfaceBlock8_mip1 (void) |
|
|
|
for (b=7; b>=0; b--) |
|
|
|
for (b=7; b>=0; b--) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pix = psource[b]; |
|
|
|
pix = psource[b]; |
|
|
|
prowdest[b] = ((unsigned char *)vid.colormap) |
|
|
|
prowdest[b] = pix; |
|
|
|
[(light & 0xFF00) + pix]; |
|
|
|
//((unsigned char *)vid.colormap)
|
|
|
|
|
|
|
|
//[(light & 0xFF00) + pix];
|
|
|
|
light += lightstep; |
|
|
|
light += lightstep; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
psource += sourcetstep; |
|
|
|
psource += sourcetstep; |
|
|
|
lightright += lightrightstep; |
|
|
|
//lightright += lightrightstep;
|
|
|
|
lightleft += lightleftstep; |
|
|
|
//lightleft += lightleftstep;
|
|
|
|
prowdest += surfrowbytes; |
|
|
|
prowdest += surfrowbytes; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -374,7 +374,7 @@ R_DrawSurfaceBlock8_mip2 |
|
|
|
void R_DrawSurfaceBlock8_mip2 (void) |
|
|
|
void R_DrawSurfaceBlock8_mip2 (void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int v, i, b, lightstep, lighttemp, light; |
|
|
|
int v, i, b, lightstep, lighttemp, light; |
|
|
|
unsigned char pix, *psource, *prowdest; |
|
|
|
pixel_t pix, *psource, *prowdest; |
|
|
|
|
|
|
|
|
|
|
|
psource = pbasesource; |
|
|
|
psource = pbasesource; |
|
|
|
prowdest = prowdestbase; |
|
|
|
prowdest = prowdestbase; |
|
|
@ -383,11 +383,11 @@ void R_DrawSurfaceBlock8_mip2 (void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// FIXME: make these locals?
|
|
|
|
// FIXME: make these locals?
|
|
|
|
// FIXME: use delta rather than both right and left, like ASM?
|
|
|
|
// FIXME: use delta rather than both right and left, like ASM?
|
|
|
|
lightleft = r_lightptr[0]; |
|
|
|
//lightleft = r_lightptr[0];
|
|
|
|
lightright = r_lightptr[1]; |
|
|
|
//lightright = r_lightptr[1];
|
|
|
|
r_lightptr += r_lightwidth; |
|
|
|
//r_lightptr += r_lightwidth;
|
|
|
|
lightleftstep = (r_lightptr[0] - lightleft) >> 2; |
|
|
|
//lightleftstep = (r_lightptr[0] - lightleft) >> 2;
|
|
|
|
lightrightstep = (r_lightptr[1] - lightright) >> 2; |
|
|
|
//lightrightstep = (r_lightptr[1] - lightright) >> 2;
|
|
|
|
|
|
|
|
|
|
|
|
for (i=0 ; i<4 ; i++) |
|
|
|
for (i=0 ; i<4 ; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -399,14 +399,15 @@ void R_DrawSurfaceBlock8_mip2 (void) |
|
|
|
for (b=3; b>=0; b--) |
|
|
|
for (b=3; b>=0; b--) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pix = psource[b]; |
|
|
|
pix = psource[b]; |
|
|
|
prowdest[b] = ((unsigned char *)vid.colormap) |
|
|
|
prowdest[b] = pix; |
|
|
|
[(light & 0xFF00) + pix]; |
|
|
|
//((unsigned char *)vid.colormap)
|
|
|
|
|
|
|
|
//[(light & 0xFF00) + pix];
|
|
|
|
light += lightstep; |
|
|
|
light += lightstep; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
psource += sourcetstep; |
|
|
|
psource += sourcetstep; |
|
|
|
lightright += lightrightstep; |
|
|
|
//lightright += lightrightstep;
|
|
|
|
lightleft += lightleftstep; |
|
|
|
//lightleft += lightleftstep;
|
|
|
|
prowdest += surfrowbytes; |
|
|
|
prowdest += surfrowbytes; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -424,7 +425,7 @@ R_DrawSurfaceBlock8_mip3 |
|
|
|
void R_DrawSurfaceBlock8_mip3 (void) |
|
|
|
void R_DrawSurfaceBlock8_mip3 (void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int v, i, b, lightstep, lighttemp, light; |
|
|
|
int v, i, b, lightstep, lighttemp, light; |
|
|
|
unsigned char pix, *psource, *prowdest; |
|
|
|
pixel_t pix, *psource, *prowdest; |
|
|
|
|
|
|
|
|
|
|
|
psource = pbasesource; |
|
|
|
psource = pbasesource; |
|
|
|
prowdest = prowdestbase; |
|
|
|
prowdest = prowdestbase; |
|
|
@ -433,11 +434,11 @@ void R_DrawSurfaceBlock8_mip3 (void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// FIXME: make these locals?
|
|
|
|
// FIXME: make these locals?
|
|
|
|
// FIXME: use delta rather than both right and left, like ASM?
|
|
|
|
// FIXME: use delta rather than both right and left, like ASM?
|
|
|
|
lightleft = r_lightptr[0]; |
|
|
|
//lightleft = r_lightptr[0];
|
|
|
|
lightright = r_lightptr[1]; |
|
|
|
//lightright = r_lightptr[1];
|
|
|
|
r_lightptr += r_lightwidth; |
|
|
|
//r_lightptr += r_lightwidth;
|
|
|
|
lightleftstep = (r_lightptr[0] - lightleft) >> 1; |
|
|
|
//lightleftstep = (r_lightptr[0] - lightleft) >> 1;
|
|
|
|
lightrightstep = (r_lightptr[1] - lightright) >> 1; |
|
|
|
//lightrightstep = (r_lightptr[1] - lightright) >> 1;
|
|
|
|
|
|
|
|
|
|
|
|
for (i=0 ; i<2 ; i++) |
|
|
|
for (i=0 ; i<2 ; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -449,14 +450,15 @@ void R_DrawSurfaceBlock8_mip3 (void) |
|
|
|
for (b=1; b>=0; b--) |
|
|
|
for (b=1; b>=0; b--) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pix = psource[b]; |
|
|
|
pix = psource[b]; |
|
|
|
prowdest[b] = ((unsigned char *)vid.colormap) |
|
|
|
prowdest[b] = pix; |
|
|
|
[(light & 0xFF00) + pix]; |
|
|
|
//((unsigned char *)vid.colormap)
|
|
|
|
|
|
|
|
//[(light & 0xFF00) + pix];
|
|
|
|
light += lightstep; |
|
|
|
light += lightstep; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
psource += sourcetstep; |
|
|
|
psource += sourcetstep; |
|
|
|
lightright += lightrightstep; |
|
|
|
//lightright += lightrightstep;
|
|
|
|
lightleft += lightleftstep; |
|
|
|
//lightleft += lightleftstep;
|
|
|
|
prowdest += surfrowbytes; |
|
|
|
prowdest += surfrowbytes; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|