From 65e9303415e1027264643a60143a2f383edfd228 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 11 Oct 2011 15:41:53 +0000 Subject: [PATCH] attempts to fix win32 build --- panda/src/event/pointerEventList.cxx | 16 ++++++++-------- panda/src/event/pointerEventList.h | 4 ++-- panda/src/express/vector_double.cxx | 4 ++-- panda/src/express/vector_float.cxx | 4 ++-- panda/src/express/vector_uchar.cxx | 4 ++-- panda/src/linmath/deg_2_rad.h | 4 ++-- panda/src/putil/clockObject.h | 1 + 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/panda/src/event/pointerEventList.cxx b/panda/src/event/pointerEventList.cxx index abb2fcf0df..00cc7d7c18 100644 --- a/panda/src/event/pointerEventList.cxx +++ b/panda/src/event/pointerEventList.cxx @@ -16,8 +16,8 @@ #include "indent.h" #include "config_event.h" #include "clockObject.h" -#include "mathNumbers.h" -#include +#include "deg_2_rad.h" +#include "cmath.h" TypeHandle PointerEventList::_type_handle; @@ -105,9 +105,9 @@ add_event(bool in_win, int xpos, int ypos, int seq, double time) { pe._dy = ypos - _events.back()._ypos; double ddx = pe._dx; double ddy = pe._dy; - pe._length = sqrt(ddx*ddx + ddy*ddy); + pe._length = csqrt(ddx*ddx + ddy*ddy); if (pe._length > 0.0) { - pe._direction = normalize_angle(atan2(-ddy,ddx) * (180.0 / MathNumbers::pi)); + pe._direction = normalize_angle(rad_2_deg(catan2(-ddy,ddx))); } else { pe._direction = _events.back()._direction; } @@ -137,7 +137,7 @@ encircles(int x, int y) const { int last = tot_events-1; double dx = _events[last]._xpos - x; double dy = _events[last]._ypos - y; - double lastang = atan2(dy, dx) * (180.0/MathNumbers::pi); + double lastang = rad_2_deg(catan2(dy, dx)); double total = 0.0; for (int i=last; (i>=0) && (total < 360.0) && (total > -360.0); i--) { dx = _events[i]._xpos - x; @@ -145,7 +145,7 @@ encircles(int x, int y) const { if ((dx==0.0)&&(dy==0.0)) { continue; } - double angle = atan2(dy,dx) * (180.0/MathNumbers::pi); + double angle = rad_2_deg(catan2(dy,dx)); double deltang = delta_angle(lastang, angle); if (deltang * total < 0.0) { total = 0.0; @@ -197,7 +197,7 @@ total_turns(double sec) const { double PointerEventList:: match_pattern(const string &ascpat, double rot, double seglen) { // Convert the pattern from ascii to a more usable form. - pvector pattern; + vector_double pattern; parse_pattern(ascpat, pattern); // Apply the rotation to the pattern. @@ -214,7 +214,7 @@ match_pattern(const string &ascpat, double rot, double seglen) { // Description: Parses a pattern as used by match_pattern. //////////////////////////////////////////////////////////////////// void PointerEventList:: -parse_pattern(const string &ascpat, pvector &pattern) { +parse_pattern(const string &ascpat, vector_double &pattern) { int chars = 0; double dir = 180.0; for (size_t i=0; i &pattern); + void parse_pattern(const string &ascpat, vector_double &pattern); typedef pdeque Events; Events _events; diff --git a/panda/src/express/vector_double.cxx b/panda/src/express/vector_double.cxx index df122b12dd..d75298b0e2 100644 --- a/panda/src/express/vector_double.cxx +++ b/panda/src/express/vector_double.cxx @@ -14,8 +14,8 @@ #include "vector_double.h" -#define EXPCL EXPCL_PANDA_PUTIL -#define EXPTP EXPTP_PANDA_PUTIL +#define EXPCL EXPCL_PANDAEXPRESS +#define EXPTP EXPTP_PANDAEXPRESS #define TYPE double #define NAME vector_double diff --git a/panda/src/express/vector_float.cxx b/panda/src/express/vector_float.cxx index 56e2139611..9f8b211f77 100644 --- a/panda/src/express/vector_float.cxx +++ b/panda/src/express/vector_float.cxx @@ -14,8 +14,8 @@ #include "vector_float.h" -#define EXPCL EXPCL_PANDA_PUTIL -#define EXPTP EXPTP_PANDA_PUTIL +#define EXPCL EXPCL_PANDAEXPRESS +#define EXPTP EXPTP_PANDAEXPRESS #define TYPE float #define NAME vector_float diff --git a/panda/src/express/vector_uchar.cxx b/panda/src/express/vector_uchar.cxx index abb7559b83..de7ca45972 100644 --- a/panda/src/express/vector_uchar.cxx +++ b/panda/src/express/vector_uchar.cxx @@ -14,8 +14,8 @@ #include "vector_uchar.h" -#define EXPCL EXPCL_PANDA -#define EXPTP EXPTP_PANDA +#define EXPCL EXPCL_PANDAEXPRESS +#define EXPTP EXPTP_PANDAEXPRESS #define TYPE unsigned char #define NAME vector_uchar diff --git a/panda/src/linmath/deg_2_rad.h b/panda/src/linmath/deg_2_rad.h index ae117bb2c4..bc941a9089 100644 --- a/panda/src/linmath/deg_2_rad.h +++ b/panda/src/linmath/deg_2_rad.h @@ -20,8 +20,8 @@ #include "mathNumbers.h" BEGIN_PUBLISH -INLINE_LINMATH double deg_2_rad( double f ) { return f * MathNumbers::deg_2_rad; } -INLINE_LINMATH double rad_2_deg( double f ) { return f * MathNumbers::rad_2_deg; } +INLINE_LINMATH double deg_2_rad( double f ) { return f * MathNumbers::deg_2_rad_d; } +INLINE_LINMATH double rad_2_deg( double f ) { return f * MathNumbers::rad_2_deg_d; } INLINE_LINMATH float deg_2_rad( float f ) { return f * MathNumbers::deg_2_rad_f; } INLINE_LINMATH float rad_2_deg( float f ) { return f * MathNumbers::rad_2_deg_f; } diff --git a/panda/src/putil/clockObject.h b/panda/src/putil/clockObject.h index b59968919e..69d92d0805 100644 --- a/panda/src/putil/clockObject.h +++ b/panda/src/putil/clockObject.h @@ -27,6 +27,7 @@ #include "thread.h" #include "referenceCount.h" #include "pointerTo.h" +#include "vector_double.h" // needed to see exported allocators for pdeque class EXPCL_PANDA_PUTIL TimeVal { PUBLISHED: