//============================================================================= // © 2004 Matt 'SquirrelZero' Farber //============================================================================= // This is a master class for controlling all shadows. This is needed to spawn // and determine the visibility of all shadows. It also keeps track of all the // nearby lights. //============================================================================= // JCBDigger // I have made all the functions simulated // I have included a line to destroy the shadows if the Pawn no longer exists class Effect_ShadowController extends Actor config(User); // the type of shadow projector we're going to use var class ShadowClass; // an array of shadows, the maximum allowed per player can be specified below var array Shadows; // a special variable type, lastlight is used for fading struct LightGroup { var Actor CurrentLight; var Actor LastLight; }; // an array of lightgroups, filled when spawned var array Lights; // the maximum distance a light can be from a player to cast a shadow var float MaxLightDistance; // the sun var SunLight SunLightActor; // turns on/off all shadows var bool bShadowActive; // maximum allowed shadows per player, configurable var globalconfig int MaxShadows; // how crisp (detailed) the shadows should be. The higher, the better // they look, but the worse they perform. // Low = 128x128 // Medium = 256 // High = 512 // Maximum = 1024 <- can any modern video technology even run it at maximum? var globalconfig enum CrispnessEnum { Low, Medium, High, Maximum }ShadowCrispness; simulated function Initialize() { local SunLight LightActor; local array SunLights; local int i; // set the sunlight, pick the brightest one if we have multiple foreach AllActors(class'SunLight',LightActor) { if (LightActor == None) continue; SunLights[i] = LightActor; i++; } for (i=0;i OrigLight; // clear array of lights, leave LastLight alone to fade for (i=0;i 1 && LightActor.LightRadius >= (VSize(LightActor.Location-Instigator.Location)*0.041)) // (0.041 is not perfect) { if (Lights[0].CurrentLight != None && LightPriority(Lights[0].CurrentLight.LightBrightness,Lights[0].CurrentLight.LightRadius,VSize(Lights[0].CurrentLight.Location-Instigator.Location)) > LightPriority(LightActor.LightBrightness,LightActor.LightRadius,VSize(LightActor.Location-Instigator.Location))) continue; // this puts them in order of priority for (i=1;i