mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-21 03:11:57 +00:00
soft: directly copy r_ambientlight
This commit is contained in:
parent
6c80d9b987
commit
480f278045
2 changed files with 20 additions and 13 deletions
|
@ -399,7 +399,6 @@ R_AliasTransformFinalVerts(const entity_t *currententity, int numpoints, finalve
|
|||
|
||||
for ( i = 0; i < numpoints; i++, fv++, oldv++, newv++ )
|
||||
{
|
||||
int j;
|
||||
float lightcos;
|
||||
const float *plightnormal;
|
||||
vec3_t lerped_vert;
|
||||
|
@ -427,24 +426,28 @@ R_AliasTransformFinalVerts(const entity_t *currententity, int numpoints, finalve
|
|||
// lighting
|
||||
lightcos = DotProduct (plightnormal, r_plightvec);
|
||||
|
||||
for(j=0; j<3; j++)
|
||||
if (lightcos < 0)
|
||||
{
|
||||
int temp;
|
||||
int j;
|
||||
|
||||
temp = r_ambientlight[j];
|
||||
|
||||
if (lightcos < 0)
|
||||
for(j=0; j<3; j++)
|
||||
{
|
||||
temp += (int)(r_shadelight[j] * lightcos);
|
||||
int temp;
|
||||
|
||||
temp = r_ambientlight[j];
|
||||
|
||||
temp += (r_shadelight[j] * lightcos);
|
||||
|
||||
// clamp; because we limited the minimum ambient and shading light, we
|
||||
// don't have to clamp low light, just bright
|
||||
if (temp < 0)
|
||||
temp = 0;
|
||||
}
|
||||
|
||||
fv->l[j] = temp;
|
||||
fv->l[j] = temp;
|
||||
}
|
||||
}
|
||||
else
|
||||
memcpy(fv->l, r_ambientlight, sizeof(int) * 3); // light;
|
||||
|
||||
if ( fv->xyz[2] < ALIAS_Z_CLIP_PLANE )
|
||||
{
|
||||
|
@ -540,7 +543,7 @@ R_AliasSetupLighting
|
|||
static void
|
||||
R_AliasSetupLighting(entity_t *currententity)
|
||||
{
|
||||
float lightvec[3] = {-1, 0, 0};
|
||||
const float lightvec[3] = {-1, 0, 0};
|
||||
vec3_t light;
|
||||
int i;
|
||||
|
||||
|
|
|
@ -215,11 +215,12 @@ R_LoadPic (char *name, byte *pic, int width, int realwidth, int height, int real
|
|||
size_t data_size, imagetype_t type)
|
||||
{
|
||||
image_t *image;
|
||||
size_t i, size, full_size;
|
||||
size_t size, full_size;
|
||||
|
||||
size = width * height;
|
||||
|
||||
if (!pic || data_size <= 0 || width <= 0 || height <= 0 || size <= 0)
|
||||
/* data_size/size are unsigned */
|
||||
if (!pic || data_size == 0 || width <= 0 || height <= 0 || size == 0)
|
||||
return NULL;
|
||||
|
||||
image = R_FindFreeImage();
|
||||
|
@ -246,6 +247,8 @@ R_LoadPic (char *name, byte *pic, int width, int realwidth, int height, int real
|
|||
image->transparent = false;
|
||||
if (type != it_wall)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i=0 ; i<size ; i++)
|
||||
{
|
||||
if (pic[i] == 255)
|
||||
|
@ -305,7 +308,8 @@ R_LoadWal (char *name, imagetype_t type)
|
|||
height = LittleLong (mt->height);
|
||||
ofs = LittleLong(mt->offsets[0]);
|
||||
|
||||
if ((ofs <= 0) || (width <= 0) || (height <= 0) ||
|
||||
/* width/height are unsigned */
|
||||
if ((ofs <= 0) || (width == 0) || (height == 0) ||
|
||||
((file_size - ofs) / width < height))
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: can't load %s, small body\n", __func__, name);
|
||||
|
|
Loading…
Reference in a new issue