// NeL - MMORPG Framework
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
#include "stddirect3d.h"
#include "nel/3d/vertex_buffer.h"
#include "nel/3d/light.h"
#include "nel/3d/index_buffer.h"
#include "nel/misc/rect.h"
#include "nel/misc/di_event_emitter.h"
#include "nel/misc/mouse_device.h"
#include "nel/3d/viewport.h"
#include "nel/3d/scissor.h"
#include "nel/3d/u_driver.h"
#include "driver_direct3d.h"
using namespace std;
using namespace NLMISC;
namespace NL3D
{
// ***************************************************************************
const D3DLIGHTTYPE RemapLightTypeNeL2D3D[3]=
{
D3DLIGHT_DIRECTIONAL, // CLight::DirectionalLight
D3DLIGHT_POINT, // CLight::PointLight
D3DLIGHT_SPOT, // CLight::SpotLight
};
// ***************************************************************************
void CDriverD3D::setLight (uint8 index, const CLight &light)
{
H_AUTO_D3D(CDriverD3D_setLight);
// bkup real light, for lightmap dynamic lighting purpose
if(index==0)
{
_UserLight0= light;
// because the D3D setup change, must dirt lightmap rendering
_LightMapDynamicLightDirty= true;
}
setLightInternal(index, light);
}
// ***************************************************************************
void CDriverD3D::enableLight (uint8 index, bool enable)
{
H_AUTO_D3D(CDriverD3D_enableLight);
// User call => set the User flag
if(index