Browse Source

HAVE_PYTHON

David Rose 20 years ago
parent
commit
eb8f9aef49

+ 2 - 0
direct/src/distributed/cDistributedSmoothNodeBase.I

@@ -31,6 +31,7 @@ set_repository(CConnectionRepository *repository,
   _ai_id = ai_id;
   _ai_id = ai_id;
 }
 }
 
 
+#ifdef HAVE_PYTHON
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CDistributedSmoothNodeBase::set_clock_delta
 //     Function: CDistributedSmoothNodeBase::set_clock_delta
 //       Access: Published, Static
 //       Access: Published, Static
@@ -41,6 +42,7 @@ INLINE void CDistributedSmoothNodeBase::
 set_clock_delta(PyObject *clock_delta) {
 set_clock_delta(PyObject *clock_delta) {
   _clock_delta = clock_delta;
   _clock_delta = clock_delta;
 }
 }
+#endif  // HAVE_PYTHON
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CDistributedSmoothNodeBase::only_changed
 //     Function: CDistributedSmoothNodeBase::only_changed

+ 5 - 0
direct/src/distributed/cDistributedSmoothNodeBase.cxx

@@ -28,7 +28,10 @@ static const double network_time_precision = 100.0;  // Matches ClockDelta.py
 CConnectionRepository *CDistributedSmoothNodeBase::_repository = NULL;
 CConnectionRepository *CDistributedSmoothNodeBase::_repository = NULL;
 bool CDistributedSmoothNodeBase::_is_ai;
 bool CDistributedSmoothNodeBase::_is_ai;
 CHANNEL_TYPE CDistributedSmoothNodeBase::_ai_id;
 CHANNEL_TYPE CDistributedSmoothNodeBase::_ai_id;
+
+#ifdef HAVE_PYTHON
 PyObject *CDistributedSmoothNodeBase::_clock_delta = NULL;
 PyObject *CDistributedSmoothNodeBase::_clock_delta = NULL;
+#endif
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CDistributedSmoothNodeBase::Constructor
 //     Function: CDistributedSmoothNodeBase::Constructor
@@ -269,10 +272,12 @@ begin_send_update(DCPacker &packer, const string &field_name) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void CDistributedSmoothNodeBase::
 void CDistributedSmoothNodeBase::
 finish_send_update(DCPacker &packer) {
 finish_send_update(DCPacker &packer) {
+#ifdef HAVE_PYTHON
   PyObject *clock_delta = PyObject_GetAttrString(_clock_delta, "delta");
   PyObject *clock_delta = PyObject_GetAttrString(_clock_delta, "delta");
   nassertv(clock_delta != NULL);
   nassertv(clock_delta != NULL);
   double delta = PyFloat_AsDouble(clock_delta);
   double delta = PyFloat_AsDouble(clock_delta);
   Py_DECREF(clock_delta);
   Py_DECREF(clock_delta);
+#endif  // HAVE_PYTHON
 
 
   double local_time = ClockObject::get_global_clock()->get_frame_time();
   double local_time = ClockObject::get_global_clock()->get_frame_time();
 
 

+ 4 - 0
direct/src/distributed/cDistributedSmoothNodeBase.h

@@ -43,8 +43,10 @@ PUBLISHED:
   set_repository(CConnectionRepository *repository,
   set_repository(CConnectionRepository *repository,
                  bool is_ai, CHANNEL_TYPE ai_id);
                  bool is_ai, CHANNEL_TYPE ai_id);
 
 
+#ifdef HAVE_PYTHON
   INLINE static void
   INLINE static void
   set_clock_delta(PyObject *clock_delta);
   set_clock_delta(PyObject *clock_delta);
+#endif
 
 
   void initialize(const NodePath &node_path, DCClass *dclass,
   void initialize(const NodePath &node_path, DCClass *dclass,
                   CHANNEL_TYPE do_id);
                   CHANNEL_TYPE do_id);
@@ -87,7 +89,9 @@ private:
   static CConnectionRepository *_repository;
   static CConnectionRepository *_repository;
   static bool _is_ai;
   static bool _is_ai;
   static CHANNEL_TYPE _ai_id;
   static CHANNEL_TYPE _ai_id;
+#ifdef HAVE_PYTHON
   static PyObject *_clock_delta;
   static PyObject *_clock_delta;
+#endif
 
 
   LPoint3f _store_xyz;
   LPoint3f _store_xyz;
   LVecBase3f _store_hpr;
   LVecBase3f _store_hpr;