soft: more use of light3_t

This commit is contained in:
Denis Pauk 2022-03-20 12:26:45 +02:00
parent 5eed0ca5d9
commit 6af5dc1d98
3 changed files with 16 additions and 16 deletions

View file

@ -37,7 +37,7 @@ static vec3_t r_lerp_frontv, r_lerp_backv, r_lerp_move;
static light3_t r_ambientlight;
int r_aliasblendcolor;
static float r_shadelight[3];
static vec3_t r_shadelight;
static daliasframe_t *r_thisframe, *r_lastframe;
@ -447,7 +447,7 @@ R_AliasTransformFinalVerts(const entity_t *currententity, int numpoints, finalve
}
}
else
memcpy(fv->cv.l, r_ambientlight, sizeof(light3_t)); // light;
memcpy(fv->cv.l, r_ambientlight, sizeof(light3_t));
if ( fv->xyz[2] < ALIAS_Z_CLIP_PLANE )
{
@ -543,7 +543,7 @@ R_AliasSetupLighting
static void
R_AliasSetupLighting(entity_t *currententity)
{
const float lightvec[3] = {-1, 0, 0};
const vec3_t lightvec = {-1, 0, 0};
vec3_t light;
int i;

View file

@ -450,16 +450,14 @@ R_BuildLightMap (drawsurf_t* drawsurf)
{
do
{
byte light = sqrt((
lightmap[0] * lightmap[0] +
lightmap[1] * lightmap[1] +
lightmap[2] * lightmap[2]
) / 3);
*curr_light += light * scale;
light_t light = (
lightmap[0] + lightmap[1] + lightmap[2]
) / 3 * scale;
*curr_light += light;
curr_light++;
*curr_light += light * scale;
*curr_light += light;
curr_light++;
*curr_light += light * scale;
*curr_light += light;
curr_light++;
lightmap += 3; /* skip to next lightmap */

View file

@ -59,8 +59,9 @@ static edgetable edgetables[12] = {
};
// FIXME: some of these can become statics
static int a_sstepxfrac, a_tstepxfrac, r_lstepx[3], a_ststepxwhole;
static int r_sstepx, r_tstepx, r_lstepy[3], r_sstepy, r_tstepy;
static int a_sstepxfrac, a_tstepxfrac, a_ststepxwhole;
static int r_sstepx, r_tstepx, r_sstepy, r_tstepy;
static light3_t r_lstepx, r_lstepy;
static zvalue_t r_zistepx, r_zistepy;
static int d_aspancount;
@ -72,8 +73,8 @@ static int d_sfrac, d_tfrac;
static light3_t d_light;
static zvalue_t d_zi;
static int d_ptexextrastep, d_sfracextrastep;
static int d_tfracextrastep, d_lightextrastep[3];
static int d_lightbasestep[3], d_ptexbasestep;
static int d_tfracextrastep, d_ptexbasestep;
static light3_t d_lightbasestep, d_lightextrastep;
static int d_sfracbasestep, d_tfracbasestep;
static zvalue_t d_ziextrastep, d_zibasestep;
@ -774,7 +775,8 @@ R_RasterizeAliasPolySmooth(const entity_t *currententity)
{
int initialleftheight, initialrightheight;
compactvert_t *plefttop, *prighttop, *pleftbottom, *prightbottom;
int working_lstepx[3], originalcount;
light3_t working_lstepx;
int originalcount;
int u, v;
pixel_t *d_ptex;