#include "DynamicLighting_shader.h"
#include "DynamicLighting_layout.h"
#define DYNAMICLIGHTING__LAYOUT DynamicLightingLayout
DYNAMICLIGHTING__DESCSTR,
bool DynamicLightingLayout::FBCreate()
{
mShader = (DynamicLighting*)(FBShader*)Shader;
UICreate ();
UIConfigure ();
UIReset ();
return true;
}
void DynamicLightingLayout::FBDestroy()
{
}
void DynamicLightingLayout::UICreate()
{
int lB = 10;
int lS = 4;
int lW = 110;
int lH = 18;
AddRegion("TransLabel", "TransLabel",
AddRegion("Transparency","Transparency",
AddRegion("TransFactorLabel", "TransFactorLabel",
AddRegion("TransparencyFactor", "TransparencyFactor",
AddRegion("AffectLabel", "AffectLabel",
AddRegion("AffectingLights","AffectingLights",
SetControl( "TransLabel", mTransLabel );
SetControl( "Transparency", mTransparency );
SetControl( "TransFactorLabel", mTransFactorLabel );
SetControl( "TransparencyFactor", mTransparencyFactor );
SetControl( "AffectLabel", mAffectLabel);
SetControl( "AffectingLights", mAffectingLights);
}
void DynamicLightingLayout::UIConfigure()
{
mTransLabel.Caption = "Transparency Type";
for(
int i = 0;
i < 7; ++
i )
{
mTransparency.Items.Add( lEnum.EnumList(
i),
i );
}
mTransparency.OnChange.Add(
this, (
FBCallback)&DynamicLightingLayout::EventTransparencyChange );
mTransFactorLabel.Caption = "Transparency Factor";
mTransparencyFactor.Property = &mShader->TransparencyFactor;
mAffectLabel.Caption = "Affecting Lights";
mAffectingLights.Property = &mShader->AffectingLights;
}
void DynamicLightingLayout::UIReset()
{
mTransparency.ItemIndex = (
int)mShader->GetTransparencyType();
}
{
mShader->SetTransparencyType( (
FBAlphaSource)(
int)mTransparency.ItemIndex );
}