#include "DynamicLightingShadow_shader.h"
#include "DynamicLightingShadow_layout.h"
#define DYNAMICLIGHTINGSHADOW__LAYOUT DynamicLightingShadowLayout
DYNAMICLIGHTINGSHADOW__DESCSTR,
bool DynamicLightingShadowLayout::FBCreate()
{
mShader = (DynamicLightingShadow*)(FBShader*)Shader;
UICreate ();
UIConfigure ();
UIReset ();
return true;
}
void DynamicLightingShadowLayout::FBDestroy()
{
}
void DynamicLightingShadowLayout::UICreate()
{
int lB = 10;
int lS = 4;
int lW = 100;
int lH = 18;
AddRegion("TransLabel", "TransLabel",
AddRegion("Transparency","Transparency",
AddRegion("TransFactorLabel", "TransFactorLabel",
AddRegion("TransparencyFactor", "TransparencyFactor",
AddRegion("AffectLabel", "AffectLabel",
AddRegion("AffectingLights","AffectingLights",
AddRegion("ShadowMapSizeLabel", "ShadowMapSizeLabel",
AddRegion("ShadowMapSize", "ShadowMapSize",
AddRegion("ShadowPCFKernelSizeLabel", "ShadowPCFKernelSizeLabel",
AddRegion("ShadowPCFKernelSize", "ShadowPCFKernelSize",
AddRegion("ShadowCastersLabel", "ShadowCastersLabel",
AddRegion("ShadowCasters", "ShadowCasters",
AddRegion("ShadowStrengthLabel", "ShadowStrengthLabel",
AddRegion("ShadowStrength", "ShadowStrength",
AddRegion("OffsetScaleLabel", "OffsetScaleLabel",
AddRegion("OffsetScale", "OffsetScale",
AddRegion("OffsetBiasLabel", "OffsetBiasLabel",
AddRegion("OffsetBias", "OffsetBias",
SetControl( "TransLabel", mTransLabel );
SetControl( "Transparency", mTransparency );
SetControl( "TransFactorLabel", mTransFactorLabel );
SetControl( "TransparencyFactor", mTransparencyFactor );
SetControl( "AffectLabel", mAffectLabel);
SetControl( "AffectingLights", mAffectingLights);
SetControl( "ShadowMapSizeLabel", mShadowMapSizeLabel );
SetControl( "ShadowMapSize", mShadowMapSize );
SetControl( "ShadowPCFKernelSizeLabel", mShadowPCFKernelSizeLabel );
SetControl( "ShadowPCFKernelSize", mShadowPCFKernelSize );
SetControl( "ShadowCastersLabel", mShadowCastersLabel );
SetControl( "ShadowCasters", mShadowCasters );
SetControl( "ShadowStrengthLabel", mShadowStrengthLabel );
SetControl( "ShadowStrength", mShadowStrength );
SetControl( "OffsetScaleLabel", mOffsetScaleLabel );
SetControl( "OffsetScale", mOffsetScale );
SetControl( "OffsetBiasLabel", mOffsetBiasLabel );
SetControl( "OffsetBias", mOffsetBias );
}
void DynamicLightingShadowLayout::UIConfigure()
{
mTransLabel.Caption = "Transparency Type";
for(
int i = 0;
i < 7; ++
i )
{
mTransparency.Items.Add( lEnum.EnumList(
i),
i );
}
mTransparency.OnChange.Add(
this, (
FBCallback)&DynamicLightingShadowLayout::EventTransparencyChange );
mTransFactorLabel.Caption = "Transparency Factor";
mTransparencyFactor.Property = &mShader->TransparencyFactor;
mAffectLabel.Caption = "Affecting Lights";
mAffectingLights.Property = &mShader->AffectingLights;
mShadowMapSizeLabel.Caption = "Shadow Map Size";
mShadowMapSize.Property = &mShader->ShadowMapSize;
mShadowPCFKernelSizeLabel.Caption = "Shadow Blur";
mShadowPCFKernelSize.Property = &mShader->ShadowPCFKernelSize;
mShadowCastersLabel.Caption = "Shadow Casters";
mShadowCasters.Property = &mShader->ShadowCasters;
mShadowStrengthLabel.Caption = "Shadow Strength";
mShadowStrength.Property = &mShader->ShadowStrength;
mOffsetScaleLabel.Caption = "Offset Scale";
mOffsetScale.Property = &mShader->OffsetScale;
mOffsetBiasLabel.Caption = "Offset Bias";
mOffsetBias.Property = &mShader->OffsetBias;
}
void DynamicLightingShadowLayout::UIReset()
{
mTransparency.ItemIndex = (
int)mShader->GetTransparencyType();
}
void DynamicLightingShadowLayout::EventTransparencyChange(
HISender ,
HKEvent )
{
mShader->SetTransparencyType( (
FBAlphaSource)(
int)mTransparency.ItemIndex );
}