fix DirectX lighting some more

This commit is contained in:
David Rose 2005-05-02 00:52:57 +00:00
parent 7d8cbc7a10
commit 856a53bd5c
4 changed files with 13 additions and 8 deletions

View File

@ -4060,14 +4060,19 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) {
alight.dvRange = D3DLIGHT_RANGE_MAX;
alight.dvFalloff = 1.0f;
alight.dvTheta = 0.0f;
alight.dvPhi = lens->get_hfov();
alight.dvPhi = deg_2_rad(lens->get_hfov());
const LVecBase3f &att = light_obj->get_attenuation();
alight.dvAttenuation0 = (D3DVALUE)att[0];
alight.dvAttenuation1 = (D3DVALUE)att[1];
alight.dvAttenuation2 = (D3DVALUE)att[2];
HRESULT res = _pScrn->pD3DDevice->SetLight(light_id, &alight);
HRESULT hr = _pScrn->pD3DDevice->SetLight(light_id, &alight);
if (FAILED(hr)) {
wdxdisplay7_cat.warning()
<< "Could not set light properties for " << light
<< " to id " << light_id << "\n";
}
}
#if 0

View File

@ -4328,7 +4328,7 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) {
alight.Range = __D3DLIGHT_RANGE_MAX;
alight.Falloff = 1.0f;
alight.Theta = 0.0f;
alight.Phi = lens->get_hfov();
alight.Phi = deg_2_rad(lens->get_hfov());
const LVecBase3f &att = light_obj->get_attenuation();
alight.Attenuation0 = att[0];
@ -4667,7 +4667,7 @@ do_auto_rescale_normal() {
////////////////////////////////////////////////////////////////////
bool DXGraphicsStateGuardian8::
slot_new_light(int light_id) {
return (light_id < _max_lights);
return ((unsigned int)light_id < _max_lights);
}
////////////////////////////////////////////////////////////////////
@ -4734,7 +4734,7 @@ enable_light(int light_id, bool enable) {
////////////////////////////////////////////////////////////////////
bool DXGraphicsStateGuardian8::
slot_new_clip_plane(int plane_id) {
return (plane_id < _max_clip_planes);
return ((unsigned int)plane_id < _max_clip_planes);
}
////////////////////////////////////////////////////////////////////

View File

@ -307,8 +307,8 @@ protected:
D3DBLEND _blend_source_func;
D3DBLEND _blend_dest_func;
int _max_lights;
int _max_clip_planes;
unsigned int _max_lights;
unsigned int _max_clip_planes;
bool _line_smooth_enabled;
bool _color_material_enabled;

View File

@ -3500,7 +3500,7 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) {
alight.Range = __D3DLIGHT_RANGE_MAX;
alight.Falloff = 1.0f;
alight.Theta = 0.0f;
alight.Phi = lens->get_hfov();
alight.Phi = deg_2_rad(lens->get_hfov());
const LVecBase3f &att = light_obj->get_attenuation();
alight.Attenuation0 = att[0];