parseMesh_t *patch;
qboolean funcGroup;
int castShadows, recvShadows;
+ vec3_t colormod;
/* eof check */
if( lightmapScale > 0.0f )
Sys_Printf( "Entity %d (%s) has lightmap scale of %.4f\n", mapEnt->mapEntityNum, classname, lightmapScale );
}
+
+ VectorClear(colormod);
+ if( strcmp( "", ValueForKey( mapEnt, "_color" ) ) )
+ {
+ GetVectorForKey( mapEnt, "_color", colormod );
+ }
/* ydnar: get cel shader :) for this entity */
value = ValueForKey( mapEnt, "_celshader" );
brush->lightmapScale = lightmapScale;
brush->celShader = celShader;
brush->shadeAngleDegrees = shadeAngle;
+ brush->colormod = colormod;
}
for( patch = mapEnt->patches; patch != NULL; patch = patch->next )
patch->lightmapSampleSize = lightmapSampleSize;
patch->lightmapScale = lightmapScale;
patch->celShader = celShader;
+ patch->colormod = colormod;
}
/* ydnar: gs mods: set entity bounds */
adds a picomodel into the bsp
*/
-void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap_t *remap, shaderInfo_t *celShader, int eNum, int castShadows, int recvShadows, int spawnFlags, float lightmapScale, int lightmapSampleSize, float shadeAngle )
+void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap_t *remap, shaderInfo_t *celShader, int eNum, int castShadows, int recvShadows, int spawnFlags, float lightmapScale, int lightmapSampleSize, float shadeAngle, vec3_t colormod )
{
int i, j, s, numSurfaces;
m4x4_t identity, nTransform;
if( lightmapScale > 0.0f )
ds->lightmapScale = lightmapScale;
+ /* set color mod */
+ ds->colormod = colormod;
+
/* set shading angle */
if( shadeAngle > 0.0f )
ds->shadeAngleDegrees = shadeAngle;
skin = IntForKey(e2, "skin");
/* insert the model */
- InsertModel( model, skin, frame, transform, remap, celShader, mapEntityNum, castShadows, recvShadows, spawnFlags, lightmapScale, lightmapSampleSize, shadeAngle );
+ InsertModel( model, skin, frame, transform, remap, celShader, mapEntityNum, castShadows, recvShadows, spawnFlags, lightmapScale, lightmapSampleSize, shadeAngle, colormod );
/* free shader remappings */
while( remap != NULL )
/* ydnar: gs mods */
int lightmapSampleSize; /* jal : entity based _lightmapsamplesize */
float lightmapScale;
+ vec3_t colormod;
float shadeAngleDegrees; /* jal : entity based _shadeangle */
vec3_t eMins, eMaxs;
indexMap_t *im;
vec3_t mins, maxs;
int numsides;
-
+
side_t sides[ 6 ]; /* variably sized */
}
brush_t;
/* ydnar: gs mods */
int lightmapSampleSize; /* jal : entity based _lightmapsamplesize */
float lightmapScale;
+ vec3_t colormod;
vec3_t eMins, eMaxs;
indexMap_t *im;
/* ydnar: per-surface (per-entity, actually) lightmap sample size scaling */
float lightmapScale;
+ /* divVerent: per-surface (per-entity, actually) color modding */
+ vec3_t colormod;
+
/* jal: per-surface (per-entity, actually) shadeangle */
float shadeAngleDegrees;
void PicoLoadFileFunc( const char *name, byte **buffer, int *bufSize );
picoModel_t *FindModel( const char *name, int frame );
picoModel_t *LoadModel( const char *name, int frame );
-void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap_t *remap, shaderInfo_t *celShader, int eNum, int castShadows, int recvShadows, int spawnFlags, float lightmapScale, int lightmapSampleSize, float shadeAngle );
+void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap_t *remap, shaderInfo_t *celShader, int eNum, int castShadows, int recvShadows, int spawnFlags, float lightmapScale, int lightmapSampleSize, float shadeAngle, vec3_t colormod );
void AddTriangleModels( entity_t *e );
ds->fogNum = -1;
ds->sampleSize = b->lightmapSampleSize;
ds->lightmapScale = b->lightmapScale;
+ ds->colormod = b->colormod;
ds->numVerts = w->numpoints;
ds->verts = safe_malloc( ds->numVerts * sizeof( *ds->verts ) );
memset( ds->verts, 0, ds->numVerts * sizeof( *ds->verts ) );
ds->mapMesh = p;
ds->sampleSize = p->lightmapSampleSize;
ds->lightmapScale = p->lightmapScale; /* ydnar */
+ ds->colormod = p->colormod;
ds->patchWidth = mesh->width;
ds->patchHeight = mesh->height;
ds->numVerts = ds->patchWidth * ds->patchHeight;
}
/* insert the model */
- InsertModel( (char *) model->model, 0, 0, transform, NULL, ds->celShader, ds->entityNum, ds->castShadows, ds->recvShadows, 0, ds->lightmapScale, 0, 0 );
+ InsertModel( (char *) model->model, 0, 0, transform, NULL, ds->celShader, ds->entityNum, ds->castShadows, ds->recvShadows, 0, ds->lightmapScale, 0, 0, ds->colormod );
/* return to sender */
return 1;
m4x4_scale_for_vec3( transform, scale );
/* add the model to the bsp */
- InsertModel( foliage->model, 0, 0, transform, NULL, NULL, src->entityNum, src->castShadows, src->recvShadows, 0, src->lightmapScale, 0, 0 );
+ InsertModel( foliage->model, 0, 0, transform, NULL, NULL, src->entityNum, src->castShadows, src->recvShadows, 0, src->lightmapScale, 0, 0, src->colormod );
/* walk each new surface */
for( i = oldNumMapDrawSurfs; i < numMapDrawSurfs; i++ )