diff --git a/panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx b/panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx index 300bb5f233..3a295f3d27 100644 --- a/panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx +++ b/panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx @@ -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 diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index d333ad3c69..dd46bcee64 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -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); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.h b/panda/src/dxgsg8/dxGraphicsStateGuardian8.h index 5a4b50f451..c279fc24ea 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.h +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.h @@ -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; diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index 1267f36225..6feee16a69 100755 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -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];