mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2025-02-16 17:01:08 +00:00
removed dead code and commented on lightgrid variables
This commit is contained in:
parent
15d8ccf982
commit
f4833d9c61
2 changed files with 9 additions and 22 deletions
|
@ -112,10 +112,8 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
|
|||
float factor;
|
||||
byte *data;
|
||||
vec3_t normal;
|
||||
#if idppc
|
||||
float d0, d1, d2, d3, d4, d5;
|
||||
#endif
|
||||
factor = 1.0;
|
||||
|
||||
factor = 1.0f;
|
||||
data = gridData;
|
||||
for ( j = 0 ; j < 3 ; j++ ) {
|
||||
if ( i & (1<<j) ) {
|
||||
|
@ -130,18 +128,7 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
|
|||
continue; // ignore samples in walls
|
||||
}
|
||||
totalFactor += factor;
|
||||
#if idppc
|
||||
d0 = data[0]; d1 = data[1]; d2 = data[2];
|
||||
d3 = data[3]; d4 = data[4]; d5 = data[5];
|
||||
|
||||
ent->ambientLight[0] += factor * d0;
|
||||
ent->ambientLight[1] += factor * d1;
|
||||
ent->ambientLight[2] += factor * d2;
|
||||
|
||||
ent->directedLight[0] += factor * d3;
|
||||
ent->directedLight[1] += factor * d4;
|
||||
ent->directedLight[2] += factor * d5;
|
||||
#else
|
||||
ent->ambientLight[0] += factor * data[0];
|
||||
ent->ambientLight[1] += factor * data[1];
|
||||
ent->ambientLight[2] += factor * data[2];
|
||||
|
@ -149,7 +136,6 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
|
|||
ent->directedLight[0] += factor * data[3];
|
||||
ent->directedLight[1] += factor * data[4];
|
||||
ent->directedLight[2] += factor * data[5];
|
||||
#endif
|
||||
|
||||
const float lat = (float)data[7] * (2.0f * M_PI / 256.0f);
|
||||
const float lon = (float)data[6] * (2.0f * M_PI / 256.0f);
|
||||
|
@ -164,7 +150,7 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) {
|
|||
VectorMA( direction, factor, normal, direction );
|
||||
}
|
||||
|
||||
if ( totalFactor > 0 && totalFactor < 0.99 ) {
|
||||
if ( totalFactor > 0.0f && totalFactor < 0.99f ) {
|
||||
totalFactor = 1.0f / totalFactor;
|
||||
VectorScale( ent->ambientLight, totalFactor, ent->ambientLight );
|
||||
VectorScale( ent->directedLight, totalFactor, ent->directedLight );
|
||||
|
|
|
@ -776,11 +776,12 @@ typedef struct {
|
|||
int numfogs;
|
||||
fog_t *fogs;
|
||||
|
||||
vec3_t lightGridOrigin;
|
||||
vec3_t lightGridSize;
|
||||
vec3_t lightGridInverseSize;
|
||||
int lightGridBounds[3];
|
||||
byte *lightGridData;
|
||||
vec3_t lightGridOrigin; // center of the voxel at (0, 0, 0)
|
||||
vec3_t lightGridSize; // world units per voxel
|
||||
vec3_t lightGridInverseSize; // reciprocal world units per voxel
|
||||
int lightGridBounds[3]; // voxel counts
|
||||
byte *lightGridData; // 8 bytes per voxel: ambient RGB, light RGB + longitude + latitude
|
||||
// indexing: x + y*w + z*w*h
|
||||
|
||||
int numClusters;
|
||||
int clusterBytes;
|
||||
|
|
Loading…
Reference in a new issue