From eb8f9aef49838373cea628c3e0003d281c421ed4 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 6 Jul 2005 15:05:21 +0000 Subject: [PATCH] HAVE_PYTHON --- direct/src/distributed/cDistributedSmoothNodeBase.I | 2 ++ direct/src/distributed/cDistributedSmoothNodeBase.cxx | 5 +++++ direct/src/distributed/cDistributedSmoothNodeBase.h | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.I b/direct/src/distributed/cDistributedSmoothNodeBase.I index bdbcc04c1c..0a65fb5380 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.I +++ b/direct/src/distributed/cDistributedSmoothNodeBase.I @@ -31,6 +31,7 @@ set_repository(CConnectionRepository *repository, _ai_id = ai_id; } +#ifdef HAVE_PYTHON //////////////////////////////////////////////////////////////////// // Function: CDistributedSmoothNodeBase::set_clock_delta // Access: Published, Static @@ -41,6 +42,7 @@ INLINE void CDistributedSmoothNodeBase:: set_clock_delta(PyObject *clock_delta) { _clock_delta = clock_delta; } +#endif // HAVE_PYTHON //////////////////////////////////////////////////////////////////// // Function: CDistributedSmoothNodeBase::only_changed diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.cxx b/direct/src/distributed/cDistributedSmoothNodeBase.cxx index 6f75352d02..edaed0a1e9 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.cxx +++ b/direct/src/distributed/cDistributedSmoothNodeBase.cxx @@ -28,7 +28,10 @@ static const double network_time_precision = 100.0; // Matches ClockDelta.py CConnectionRepository *CDistributedSmoothNodeBase::_repository = NULL; bool CDistributedSmoothNodeBase::_is_ai; CHANNEL_TYPE CDistributedSmoothNodeBase::_ai_id; + +#ifdef HAVE_PYTHON PyObject *CDistributedSmoothNodeBase::_clock_delta = NULL; +#endif //////////////////////////////////////////////////////////////////// // Function: CDistributedSmoothNodeBase::Constructor @@ -269,10 +272,12 @@ begin_send_update(DCPacker &packer, const string &field_name) { //////////////////////////////////////////////////////////////////// void CDistributedSmoothNodeBase:: finish_send_update(DCPacker &packer) { +#ifdef HAVE_PYTHON PyObject *clock_delta = PyObject_GetAttrString(_clock_delta, "delta"); nassertv(clock_delta != NULL); double delta = PyFloat_AsDouble(clock_delta); Py_DECREF(clock_delta); +#endif // HAVE_PYTHON double local_time = ClockObject::get_global_clock()->get_frame_time(); diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.h b/direct/src/distributed/cDistributedSmoothNodeBase.h index 363aa6d639..58abe1dfcb 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.h +++ b/direct/src/distributed/cDistributedSmoothNodeBase.h @@ -43,8 +43,10 @@ PUBLISHED: set_repository(CConnectionRepository *repository, bool is_ai, CHANNEL_TYPE ai_id); +#ifdef HAVE_PYTHON INLINE static void set_clock_delta(PyObject *clock_delta); +#endif void initialize(const NodePath &node_path, DCClass *dclass, CHANNEL_TYPE do_id); @@ -87,7 +89,9 @@ private: static CConnectionRepository *_repository; static bool _is_ai; static CHANNEL_TYPE _ai_id; +#ifdef HAVE_PYTHON static PyObject *_clock_delta; +#endif LPoint3f _store_xyz; LVecBase3f _store_hpr;