Exemple #1
0
 /// <summary>
 /// Sets up lighting using SADX Stage Lights data.
 /// </summary>
 private static void SetStageLights(Device d3ddevice)
 {
     for (int i = 0; i < 4; i++)
     {
         d3ddevice.EnableLight(i, false);
     }
     for (int i = 0; i < stageLights.Count; i++)
     {
         SADXStageLightData lightData = stageLights[i];
         currentLight.Type      = LightType.Directional;
         currentLight.Direction = lightData.Direction.ToVector3();
         currentLight.Specular  = new RawColor4(lightData.Specular, lightData.Specular, lightData.Specular, 1.0f);
         // SADXPC reuses the first light's ambient color for other lights
         currentLight.Ambient = new RawColor4(
             stageLights[0].AmbientRGB.X,
             stageLights[0].AmbientRGB.Y,
             stageLights[0].AmbientRGB.Z,
             1.0f);
         currentLight.Diffuse = new RawColor4(
             lightData.RGB.X * lightData.Diffuse,
             lightData.RGB.Y * lightData.Diffuse,
             lightData.RGB.Z * lightData.Diffuse,
             1.0f);
         d3ddevice.SetRenderState(RenderState.SpecularEnable, false);
         d3ddevice.SetLight(i, ref currentLight);
         d3ddevice.EnableLight(i, lightData.UseDirection);
     }
 }
Exemple #2
0
        private void RemoveStageLight(int level, int act, int index)
        {
            SADXStageLightData light = FindStageLight(level, act, index);

            if (light != null)
            {
                StageLights.Remove(light);
            }
        }
Exemple #3
0
 private void SetCurrentLights()
 {
     CurrentStageLight = FindStageLight(comboBoxLevel.SelectedIndex, (int)numericUpDownAct.Value, (int)numericUpDownStageLightIndex.Value);
     CurrentCharLight  = FindCharacterLight(comboBoxLevel.SelectedIndex, (int)numericUpDownAct.Value, comboBoxLightType.SelectedIndex);
     RefreshUIValues();
 }