mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-10 07:11:54 +00:00
Merge pull request #534 from illwieckz/noradiosity
Proper working with noradiosity 1 lights
This commit is contained in:
commit
94849adc93
3 changed files with 23 additions and 4 deletions
|
@ -226,6 +226,7 @@ void CreateEntityLights( void ){
|
|||
entity_t *e, *e2;
|
||||
const char *name;
|
||||
const char *target;
|
||||
const char *noradiosity;
|
||||
vec3_t dest;
|
||||
const char *_color;
|
||||
float intensity, scale, deviance, filterRadius;
|
||||
|
@ -251,6 +252,12 @@ void CreateEntityLights( void ){
|
|||
continue;
|
||||
}
|
||||
|
||||
/* neumond: skip dynamic lights */
|
||||
noradiosity = ValueForKey( e, "noradiosity" );
|
||||
if ( noradiosity[ 0 ] == '1' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* lights with target names (and therefore styles) are only parsed from BSP */
|
||||
target = ValueForKey( e, "targetname" );
|
||||
if ( target[ 0 ] != '\0' && i >= numBSPEntities ) {
|
||||
|
|
|
@ -1644,10 +1644,17 @@ static qboolean ParseMapEntity( qboolean onlyLights ){
|
|||
classname = ValueForKey( mapEnt, "classname" );
|
||||
|
||||
/* ydnar: only lights? */
|
||||
if ( onlyLights && Q_strncasecmp( classname, "light", 5 ) ) {
|
||||
if ( onlyLights ) {
|
||||
if ( Q_strncasecmp( classname, "light", 5 ) ) {
|
||||
numEntities--;
|
||||
return qtrue;
|
||||
}
|
||||
value = ValueForKey( mapEnt, "noradiosity" );
|
||||
if ( value[ 0 ] == '1' ) {
|
||||
numEntities--;
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
|
||||
/* ydnar: determine if this is a func_group */
|
||||
if ( !Q_stricmp( "func_group", classname ) ) {
|
||||
|
|
|
@ -281,6 +281,7 @@ void SetModelNumbers( void ){
|
|||
void SetLightStyles( void ){
|
||||
int i, j, style, numStyles;
|
||||
qboolean keepLights;
|
||||
qboolean noRadiosityLight;
|
||||
const char *t;
|
||||
entity_t *e;
|
||||
epair_t *ep, *next;
|
||||
|
@ -303,10 +304,14 @@ void SetLightStyles( void ){
|
|||
if ( Q_strncasecmp( t, "light", 5 ) ) {
|
||||
continue;
|
||||
}
|
||||
t = ValueForKey( e, "noradiosity" );
|
||||
noRadiosityLight = ( t[ 0 ] == '1' ) ? qtrue : qfalse;
|
||||
t = ValueForKey( e, "targetname" );
|
||||
if ( t[ 0 ] == '\0' ) {
|
||||
/* ydnar: strip the light from the BSP file */
|
||||
if ( keepLights == qfalse ) {
|
||||
/* neumond: pass all dynamic lights to BSP regardless of keepLights.
|
||||
pass all lights (radiosity+dynamic) to BSP if keepLights */
|
||||
if ( keepLights == qfalse && noRadiosityLight == qfalse ) {
|
||||
ep = e->epairs;
|
||||
while ( ep != NULL )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue