Browse Source

fix build break

David Rose 24 years ago
parent
commit
29afc8d547

+ 1 - 0
panda/src/dxgsg/dxGraphicsStateGuardian.cxx

@@ -759,6 +759,7 @@ dx_init( void) {
     _available_clip_plane_ids = PTA(PlaneNode*)::empty_array(_max_clip_planes);
     _available_clip_plane_ids = PTA(PlaneNode*)::empty_array(_max_clip_planes);
     _clip_plane_enabled = new bool[_max_clip_planes];
     _clip_plane_enabled = new bool[_max_clip_planes];
     _cur_clip_plane_enabled = new bool[_max_clip_planes];
     _cur_clip_plane_enabled = new bool[_max_clip_planes];
+    int i;
     for (i = 0; i < _max_clip_planes; i++) {
     for (i = 0; i < _max_clip_planes; i++) {
         _available_clip_plane_ids[i] = NULL;
         _available_clip_plane_ids[i] = NULL;
         _clip_plane_enabled[i] = false;
         _clip_plane_enabled[i] = false;

+ 0 - 14
panda/src/dxgsg8/dxGraphicsStateGuardian8.I

@@ -39,20 +39,6 @@ enable_line_smooth(bool val) {
   }
   }
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian::enable_lighting
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-INLINE void DXGraphicsStateGuardian::
-enable_lighting(bool val) {
-  if (_lighting_enabled != val) {
-    scrn.pD3DDevice->SetRenderState(D3DRS_LIGHTING, (DWORD)val);
-    if(_lighting_enabled = val)
-      _lighting_enabled_this_frame = true;
-  }
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: DXGraphicsStateGuardian::enable_dither
 //     Function: DXGraphicsStateGuardian::enable_dither
 //       Access:
 //       Access:

+ 32 - 21
panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx

@@ -467,7 +467,7 @@ DXGraphicsStateGuardian(GraphicsWindow *win) : GraphicsStateGuardian(win) {
     _pFPSFont=NULL;
     _pFPSFont=NULL;
     _bShowFPSMeter = false;
     _bShowFPSMeter = false;
 
 
-    _max_light_range = __D3DLIGHT_RANGE_MAX;
+    //    _max_light_range = __D3DLIGHT_RANGE_MAX;
 
 
     // non-dx obj values inited here should not change if resize is 
     // non-dx obj values inited here should not change if resize is 
     // called and dx objects need to be recreated (otherwise they
     // called and dx objects need to be recreated (otherwise they
@@ -1045,25 +1045,6 @@ clear(const RenderBuffer &buffer, const DisplayRegion *region) {
     pop_display_region(old_dr);
     pop_display_region(old_dr);
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: DXGraphicsStateGuardian::enable_light
-//       Access:
-//  Description:
-////////////////////////////////////////////////////////////////////
-bool DXGraphicsStateGuardian::
-enable_light(int light_id, bool val) {
-  HRESULT hr = scrn.pD3DDevice->LightEnable( light_id, val  );
-
-#ifdef GSG_VERBOSE
-  dxgsg_cat.debug() << "LightEnable(" << light_id << "=" << val << ")" << endl;
-#endif
-  
-  if (FAILED(hr)) {
-    dxgsg_cat.error() << "LightEnable(" << light_id << "=" << val << ") failed, " <<D3DERRORSTRING(hr);
-    return false;
-  }
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: DXGraphicsStateGuardian::prepare_display_region
 //     Function: DXGraphicsStateGuardian::prepare_display_region
 //       Access: Public, Virtual
 //       Access: Public, Virtual
@@ -4335,7 +4316,7 @@ void DXGraphicsStateGuardian::apply_light( Spotlight *light ) {
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void DXGraphicsStateGuardian::apply_light( AmbientLight* light ) {
 void DXGraphicsStateGuardian::apply_light( AmbientLight* light ) {
-    _cur_ambient_light = _cur_ambient_light + light->get_color();
+  //    _cur_ambient_light = _cur_ambient_light + light->get_color();
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -5399,6 +5380,36 @@ get_fog_mode_type(Fog::Mode m) const {
     return D3DFOG_EXP;
     return D3DFOG_EXP;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: DXGraphicsStateGuardian::enable_lighting
+//       Access: Protected, Virtual
+//  Description: Intended to be overridden by a derived class to
+//               enable or disable the use of lighting overall.  This
+//               is called by issue_light() according to whether any
+//               lights are in use or not.
+////////////////////////////////////////////////////////////////////
+void DXGraphicsStateGuardian::
+enable_lighting(bool enable) {
+  scrn.pD3DDevice->SetRenderState(D3DRS_LIGHTING, (DWORD)enable);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: DXGraphicsStateGuardian::enable_light
+//       Access: Protected, Virtual
+//  Description: Intended to be overridden by a derived class to
+//               enable the indicated light id.  A specific Light will
+//               already have been bound to this id via bind_light().
+////////////////////////////////////////////////////////////////////
+void DXGraphicsStateGuardian::
+enable_light(int light_id, bool enable) {
+  HRESULT res = scrn.pD3DDevice->LightEnable(light_id, enable);
+
+#ifdef GSG_VERBOSE
+  dxgsg_cat.debug()
+    << "LightEnable(" << light << "=" << val << ")" << endl;
+#endif
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: DXGraphicsStateGuardian::free_pointers
 //     Function: DXGraphicsStateGuardian::free_pointers
 //       Access: Public
 //       Access: Public

+ 3 - 2
panda/src/dxgsg8/dxGraphicsStateGuardian8.h

@@ -179,6 +179,9 @@ public:
   DXScreenData scrn;
   DXScreenData scrn;
 
 
 protected:
 protected:
+  virtual void enable_lighting(bool enable);
+  virtual void enable_light(int light_id, bool enable);
+
   void free_pointers();            // free local internal buffers
   void free_pointers();            // free local internal buffers
   void free_dxgsg_objects(void);   // free the DirectX objects we create
   void free_dxgsg_objects(void);   // free the DirectX objects we create
   virtual PT(SavedFrameBuffer) save_frame_buffer(const RenderBuffer &buffer,
   virtual PT(SavedFrameBuffer) save_frame_buffer(const RenderBuffer &buffer,
@@ -241,10 +244,8 @@ protected:
   INLINE void call_dxLightModelAmbient(const Colorf& color);
   INLINE void call_dxLightModelAmbient(const Colorf& color);
   INLINE void call_dxAlphaFunc(D3DCMPFUNC func, DWORD ref);
   INLINE void call_dxAlphaFunc(D3DCMPFUNC func, DWORD ref);
   INLINE void call_dxBlendFunc(D3DBLEND sfunc, D3DBLEND dfunc);
   INLINE void call_dxBlendFunc(D3DBLEND sfunc, D3DBLEND dfunc);
-  INLINE void enable_lighting(bool val);
   INLINE void enable_dither(bool val);
   INLINE void enable_dither(bool val);
   INLINE void enable_stencil_test(bool val);
   INLINE void enable_stencil_test(bool val);
-  bool enable_light(int light, bool val);
   void report_texmgr_stats();
   void report_texmgr_stats();
   void draw_multitri(Geom *geom, D3DPRIMITIVETYPE tri_id);
   void draw_multitri(Geom *geom, D3DPRIMITIVETYPE tri_id);