/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// Description : SpotMod.cpp
//
// Modification classes
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// inherit from CPA_Modif
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Creation date: 11 feb 1997                        Author: J Thénoz
///////////////////////////////////////////////////////////////////////////////////////////////////
// Modification date:			                      Author:
//
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
*/

#include "stdafx.h"
#include "acp_base.h"
#include "resource.h"
#include "itf.h"
#include "LightMod.hpp"
#include "LightObj.hpp"
#include "LightDia.hpp"
#include "Inter.hpp"

//------ Modif of RGB
ModifLightRGB::ModifLightRGB (Light* poLight, GEO_tdstColor& stColor, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_RGB,"",pBlock)
{
	m_poLight = poLight;
	m_stColor = stColor;
	GLI_xGetLightColor ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stOldColor );
	m_bRedo = FALSE;
	if (poLight) SetName(CString("Change color of ")+poLight->GetName());
}

void ModifLightRGB::fn_vSetLightRGB ( GEO_tdstColor& stColor )
{
	m_stColor = stColor;
	m_poLight->fn_vNotifySave ();
	GLI_xSetLightColor ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stColor );
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->fn_vSetModify (TRUE);
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}

BOOL ModifLightRGB::Do (void)
{
	GLI_xSetLightColor ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stColor );
	m_poLight->fn_vNotifySave ();
	if (m_bRedo) Light::fn_pGetDialog()->fn_vEdit (m_poLight);
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	m_poLight->fn_vSetModify (TRUE);
	m_bRedo = TRUE;
	return TRUE;
}

BOOL ModifLightRGB::Undo (void)
{
	GLI_xSetLightColor ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stOldColor );
	m_poLight->fn_vNotifySave ();
	Light::fn_pGetDialog()->fn_vEdit (m_poLight);
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->fn_vSetModify (TRUE);
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

//------ Modif Intensity
ModifLightIntensity::ModifLightIntensity (Light* poLight, float& fIntensity, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_INTENSITY,"",pBlock)
{
	m_poLight = poLight;
	m_fIntensity = fIntensity;
	m_fOldIntensity = m_poLight->fn_fGetIntensity();
	m_bRedo = FALSE;
	GLI_xGetLightColor ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stColor );
	float fCurrentIntensity = m_poLight->fn_fGetIntensity();
	if (fCurrentIntensity>1e-6)
	{
		m_stColor.xR /= fCurrentIntensity;
		m_stColor.xG /= fCurrentIntensity;
		m_stColor.xB /= fCurrentIntensity;
	}
	else
	{
		m_stColor.xR = 0.f;
		m_stColor.xG = 0.f;
		m_stColor.xB = 0.f;
	}
	if (poLight) SetName(CString("Change intensity of ")+poLight->GetName());
}

void ModifLightIntensity::fn_vSetLightIntensity (float& fIntensity)
{
	m_fIntensity = fIntensity;
	m_poLight->fn_vNotifySave ();
	fn_vChangeIntensity (m_fIntensity);
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->fn_vSetModify (TRUE);
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}

BOOL ModifLightIntensity::Do (void)
{
	fn_vChangeIntensity (m_fIntensity);
	m_poLight->fn_vNotifySave ();
	if (m_bRedo) Light::fn_pGetDialog()->fn_vEdit (m_poLight);
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	m_poLight->fn_vSetModify (TRUE);
	m_bRedo = TRUE;
	return TRUE;
}

BOOL ModifLightIntensity::Undo (void)
{
	fn_vChangeIntensity (m_fOldIntensity);
	m_poLight->fn_vNotifySave ();
	Light::fn_pGetDialog()->fn_vEdit (m_poLight);
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	m_poLight->fn_vSetModify (TRUE);
	return TRUE;
}

void ModifLightIntensity::fn_vChangeIntensity (float& fIntensity)
{
	if (m_poLight->fn_lGetType() == GLI_C_lFogLight)
		fIntensity = fIntensity / 10.0f;

	// color
	GEO_tdstColor stColor;
	stColor.xR = m_stColor.xR * fIntensity;
	stColor.xG = m_stColor.xG * fIntensity;
	stColor.xB = m_stColor.xB * fIntensity;
	stColor.xA = m_stColor.xA;

	if (m_poLight->fn_lGetType() == GLI_C_lFogLight)
	{
		float fMax = 1.0f;
		if (stColor.xR > fMax)
			fMax = stColor.xR;
		if (stColor.xG > fMax)
			fMax = stColor.xG;
		if (stColor.xB > fMax)
			fMax = stColor.xB;

		stColor.xR = stColor.xR / fMax;
		stColor.xG = stColor.xG / fMax;
		stColor.xB = stColor.xB / fMax;
	}

	GLI_xSetLightColor ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &stColor );

	// intensity
	m_poLight->fn_vSetIntensity (fIntensity);
}

//------ Modif of Near Far
ModifLightNearFar::ModifLightNearFar (Light* poLight, MTH_tdxReal& xNearValue, MTH_tdxReal& xFarValue, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_NEARFAR,"",pBlock)
{
	m_poLight = poLight;
	m_stNearValue = xNearValue;
	m_stFarValue = xFarValue;
	m_bRedo = FALSE;
	if (poLight) SetName(CString("Change near/far of ")+poLight->GetName());
}

void ModifLightNearFar::fn_vSetLightNearFar ( MTH_tdxReal& xNearValue, MTH_tdxReal& xFarValue )
{
	m_stNearValue = xNearValue;
	m_stFarValue = xFarValue;
	GLI_vSetLightNearFar ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stNearValue, m_stFarValue );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->fn_vSetModify (TRUE);
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}

BOOL ModifLightNearFar::Do (void)
{
	GLI_vGetLightNearFar ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stOldNearValue, &m_stOldFarValue );
	GLI_vSetLightNearFar ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stNearValue, m_stFarValue );
	if (m_bRedo) Light::fn_pGetDialog()->fn_vEdit (m_poLight);
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->fn_vSetModify (TRUE);
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	m_bRedo = TRUE;
	return TRUE;
}

BOOL ModifLightNearFar::Undo (void)
{
	GLI_vSetLightNearFar ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stOldNearValue, m_stOldFarValue );
	Light::fn_pGetDialog()->fn_vEdit (m_poLight);
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

//------ Modif of Alpha
ModifLightAlpha::ModifLightAlpha (Light* poLight, MTH_tdxReal& xLittleAlpha, MTH_tdxReal& xBigAlpha, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_ALPHA,"",pBlock)
{
	m_poLight = poLight;
	m_stLittleAlpha = xLittleAlpha;
	m_stBigAlpha = xBigAlpha;
	m_bRedo = FALSE;
	GLI_vGetLightAlphas ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stOldLittleAlpha, &m_stOldBigAlpha );
	if (poLight) SetName(CString("Modify alpha of ")+poLight->GetName());
}

void ModifLightAlpha::fn_vSetLightAlpha ( MTH_tdxReal& xLittleAlpha, MTH_tdxReal& xBigAlpha )
{
	m_stLittleAlpha = xLittleAlpha;
	m_stBigAlpha = xBigAlpha;
	GLI_vSetLightAlphas ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stLittleAlpha, m_stBigAlpha );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->fn_vSetModify (TRUE);
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}

BOOL ModifLightAlpha::Do (void)
{
	GLI_vSetLightAlphas ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stLittleAlpha, m_stBigAlpha );
	if (m_bRedo) Light::fn_pGetDialog()->fn_vEdit (m_poLight);
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->fn_vSetModify (TRUE);
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	m_bRedo=TRUE;
	return TRUE;
}

BOOL ModifLightAlpha::Undo (void)
{
	GLI_vSetLightAlphas ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stOldLittleAlpha, m_stOldBigAlpha );
	Light::fn_pGetDialog()->fn_vEdit (m_poLight);
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->fn_vSetModify (TRUE);
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

//----- Modif On/Off
ModifLightOnOff::ModifLightOnOff (Light* poLight, BOOL bState, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_STATE,"",pBlock)
{
	m_poLight = poLight;
	m_bState = bState;
	m_bRedo = FALSE;
	if (poLight) SetName(CString("Switch ")+poLight->GetName());
}

void ModifLightOnOff::fn_vSetLightOnOff ( BOOL bState )
{
	m_bState = bState;
//ANNECY CT 19/02/98{
	GLI_vSetLightPerso( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_bState );
//ENDANNECY CT}
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	m_poLight->GetInterface()->fn_GetDialogList()->fn_vRedrawElement(m_poLight->GetSuperObject(), FALSE);
}

BOOL ModifLightOnOff::Do (void)
{
//ANNECY CT 19/02/98{
	GLI_vSetLightPerso( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_bState );
//ENDANNECY CT}
	m_poLight->fn_vNotifySave ();
	if (m_bRedo) Light::fn_pGetDialog()->fn_vEdit (m_poLight);
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	m_poLight->GetInterface()->fn_GetDialogList()->fn_vRedrawElement(m_poLight->GetSuperObject(), FALSE);
	m_bRedo = TRUE;
	return TRUE;
}

BOOL ModifLightOnOff::Undo (void)
{
//ANNECY CT 19/02/98{
	GLI_vSetLightPerso( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), !m_bState );
//ENDANNECY CT}
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	m_poLight->GetInterface()->fn_GetDialogList()->fn_vRedrawElement(m_poLight->GetSuperObject(), FALSE);
	return TRUE;
}

//CHINA WFQ (MT) 16/02/98 {

ModifLight_Intensity_Min_Max::ModifLight_Intensity_Min_Max (Light* poLight, MTH_tdxReal& xIntensity_Min, MTH_tdxReal& xIntensity_Max, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_INTENSITY_MIN_MAX,"",pBlock)
{
	m_poLight = poLight;
	m_stIntensity_Min = xIntensity_Min;
	m_stIntensity_Max = xIntensity_Max;
	SetName(CString("Change Intensity Min/Max of ")+poLight->GetSuperObject()->GetName());
}

void ModifLight_Intensity_Min_Max::fn_vSetLight_Intensity_Min_Max ( MTH_tdxReal& xIntensity_Min, MTH_tdxReal& xIntensity_Max )
{
	m_stIntensity_Min = xIntensity_Min;
	m_stIntensity_Max = xIntensity_Max;
	GLI_vSetLight_Intensity_Min_Max ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stIntensity_Min, m_stIntensity_Max );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}


BOOL ModifLight_Intensity_Min_Max::Do (void)
{
	GLI_vGetLight_Intensity_Min_Max ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stOldIntensity_Min, &m_stOldIntensity_Max );
	GLI_vSetLight_Intensity_Min_Max ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stIntensity_Min, m_stIntensity_Max );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

BOOL ModifLight_Intensity_Min_Max::Undo (void)
{
	GLI_vSetLight_Intensity_Min_Max ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stOldIntensity_Min, m_stOldIntensity_Max );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}


//

ModifLight_Inter_Min_Pos::ModifLight_Inter_Min_Pos (Light* poLight, MTH3D_tdstVector xInter_Min_Pos, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_INTER_MIN,"",pBlock)
{
	m_poLight = poLight;
	m_stInter_Min_Pos = xInter_Min_Pos;
	SetName(CString("Change Inter Min of ")+poLight->GetSuperObject()->GetName());
}

void ModifLight_Inter_Min_Pos::fn_vSetLight_Inter_Min_Pos ( MTH3D_tdstVector xInter_Min_Pos )
{
	m_stInter_Min_Pos = xInter_Min_Pos;
	GLI_vSetLight_Inter_Min_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stInter_Min_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}


BOOL ModifLight_Inter_Min_Pos::Do (void)
{
	GLI_vGetLight_Inter_Min_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stOldInter_Min_Pos );
	GLI_vSetLight_Inter_Min_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stInter_Min_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

BOOL ModifLight_Inter_Min_Pos::Undo (void)
{
	GLI_vSetLight_Inter_Min_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stOldInter_Min_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

//

ModifLight_Inter_Max_Pos::ModifLight_Inter_Max_Pos (Light* poLight, MTH3D_tdstVector xInter_Max_Pos, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_INTER_MAX,"",pBlock)
{
	m_poLight = poLight;
	m_stInter_Max_Pos = xInter_Max_Pos;
	SetName(CString("Change Inter Max of ")+poLight->GetSuperObject()->GetName());
}

void ModifLight_Inter_Max_Pos::fn_vSetLight_Inter_Max_Pos ( MTH3D_tdstVector xInter_Max_Pos )
{
	m_stInter_Max_Pos = xInter_Max_Pos;
	GLI_vSetLight_Inter_Max_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stInter_Max_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}


BOOL ModifLight_Inter_Max_Pos::Do (void)
{
	GLI_vGetLight_Inter_Max_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stOldInter_Max_Pos );
	GLI_vSetLight_Inter_Max_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stInter_Max_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

BOOL ModifLight_Inter_Max_Pos::Undo (void)
{
	GLI_vSetLight_Inter_Max_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stOldInter_Max_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

//

ModifLight_Exter_Min_Pos::ModifLight_Exter_Min_Pos (Light* poLight, MTH3D_tdstVector xExter_Min_Pos, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_EXTER_MIN,"",pBlock)
{
	m_poLight = poLight;
	m_stExter_Min_Pos = xExter_Min_Pos;
	SetName(CString("Change Exter Min of ")+poLight->GetSuperObject()->GetName());
}

void ModifLight_Exter_Min_Pos::fn_vSetLight_Exter_Min_Pos( MTH3D_tdstVector xExter_Min_Pos )
{
	m_stExter_Min_Pos = xExter_Min_Pos;
	GLI_vSetLight_Exter_Min_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stExter_Min_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}


BOOL ModifLight_Exter_Min_Pos::Do (void)
{
	GLI_vGetLight_Exter_Min_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stOldExter_Min_Pos );
	GLI_vSetLight_Exter_Min_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stExter_Min_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

BOOL ModifLight_Exter_Min_Pos::Undo (void)
{
	GLI_vSetLight_Exter_Min_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stOldExter_Min_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

//

ModifLight_Exter_Max_Pos::ModifLight_Exter_Max_Pos (Light* poLight, MTH3D_tdstVector xExter_Max_Pos, BOOL pBlock) : CPA_Modif (TYPE_CHANGE_EXTER_MAX,"",pBlock)
{
	m_poLight = poLight;
	m_stExter_Max_Pos = xExter_Max_Pos;
	SetName(CString("Change Exter Max of ")+poLight->GetSuperObject()->GetName());
}

void ModifLight_Exter_Max_Pos::fn_vSetLight_Exter_Max_Pos ( MTH3D_tdstVector xExter_Max_Pos )
{
	m_stExter_Max_Pos = xExter_Max_Pos;
	GLI_vSetLight_Exter_Max_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stExter_Max_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
}


BOOL ModifLight_Exter_Max_Pos::Do (void)
{
	GLI_vGetLight_Exter_Max_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), &m_stOldExter_Max_Pos );
	GLI_vSetLight_Exter_Max_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stExter_Max_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

BOOL ModifLight_Exter_Max_Pos::Undo (void)
{
	GLI_vSetLight_Exter_Max_Pos ( (GLI_tdxHandleToLight)m_poLight->GetEngineStruct(), m_stOldExter_Max_Pos );
	m_poLight->fn_vNotifySave ();
	m_poLight->GetInterface()->fn_vComputeRLI ();
	m_poLight->GetInterface()->GetInterface()->fn_vUpdateAll (E_mc_JustDraw);
	return TRUE;
}

//ENDCHINA WFQ }
