Преглед на файлове

attempts to fix win32 build

David Rose преди 14 години
родител
ревизия
65e9303415

+ 8 - 8
panda/src/event/pointerEventList.cxx

@@ -16,8 +16,8 @@
 #include "indent.h"
 #include "indent.h"
 #include "config_event.h"
 #include "config_event.h"
 #include "clockObject.h"
 #include "clockObject.h"
-#include "mathNumbers.h"
-#include <math.h>
+#include "deg_2_rad.h"
+#include "cmath.h"
 
 
 TypeHandle PointerEventList::_type_handle;
 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;
     pe._dy = ypos - _events.back()._ypos;
     double ddx = pe._dx;
     double ddx = pe._dx;
     double ddy = pe._dy;
     double ddy = pe._dy;
-    pe._length = sqrt(ddx*ddx + ddy*ddy);
+    pe._length = csqrt(ddx*ddx + ddy*ddy);
     if (pe._length > 0.0) {
     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 {
     } else {
       pe._direction = _events.back()._direction;
       pe._direction = _events.back()._direction;
     }
     }
@@ -137,7 +137,7 @@ encircles(int x, int y) const {
   int last = tot_events-1;
   int last = tot_events-1;
   double dx = _events[last]._xpos - x;
   double dx = _events[last]._xpos - x;
   double dy = _events[last]._ypos - y;
   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;
   double total = 0.0;
   for (int i=last; (i>=0) && (total < 360.0) && (total > -360.0); i--) {
   for (int i=last; (i>=0) && (total < 360.0) && (total > -360.0); i--) {
     dx = _events[i]._xpos - x;
     dx = _events[i]._xpos - x;
@@ -145,7 +145,7 @@ encircles(int x, int y) const {
     if ((dx==0.0)&&(dy==0.0)) {
     if ((dx==0.0)&&(dy==0.0)) {
       continue;
       continue;
     }
     }
-    double angle = atan2(dy,dx) * (180.0/MathNumbers::pi);
+    double angle = rad_2_deg(catan2(dy,dx));
     double deltang = delta_angle(lastang, angle);
     double deltang = delta_angle(lastang, angle);
     if (deltang * total < 0.0) {
     if (deltang * total < 0.0) {
       total = 0.0;
       total = 0.0;
@@ -197,7 +197,7 @@ total_turns(double sec) const {
 double PointerEventList::
 double PointerEventList::
 match_pattern(const string &ascpat, double rot, double seglen) {
 match_pattern(const string &ascpat, double rot, double seglen) {
   // Convert the pattern from ascii to a more usable form.
   // Convert the pattern from ascii to a more usable form.
-  pvector <double> pattern;
+  vector_double pattern;
   parse_pattern(ascpat, pattern);
   parse_pattern(ascpat, pattern);
   
   
   // Apply the rotation to the 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.
 //  Description: Parses a pattern as used by match_pattern.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PointerEventList::
 void PointerEventList::
-parse_pattern(const string &ascpat, pvector <double> &pattern) {
+parse_pattern(const string &ascpat, vector_double &pattern) {
   int chars = 0;
   int chars = 0;
   double dir = 180.0;
   double dir = 180.0;
   for (size_t i=0; i<ascpat.size(); i++) {
   for (size_t i=0; i<ascpat.size(); i++) {

+ 2 - 2
panda/src/event/pointerEventList.h

@@ -20,7 +20,7 @@
 #include "pointerEvent.h"
 #include "pointerEvent.h"
 #include "typedReferenceCount.h"
 #include "typedReferenceCount.h"
 #include "eventParameter.h"
 #include "eventParameter.h"
-#include "pvector.h"
+#include "vector_double.h"
 
 
 class ModifierPointers;
 class ModifierPointers;
 class Datagram;
 class Datagram;
@@ -67,7 +67,7 @@ public:
   void write(ostream &out, int indent_level = 0) const;
   void write(ostream &out, int indent_level = 0) const;
 
 
 private:
 private:
-  void parse_pattern(const string &ascpat, pvector <double> &pattern);
+  void parse_pattern(const string &ascpat, vector_double &pattern);
   typedef pdeque<PointerEvent> Events;
   typedef pdeque<PointerEvent> Events;
   Events _events;
   Events _events;
 
 

+ 2 - 2
panda/src/express/vector_double.cxx

@@ -14,8 +14,8 @@
 
 
 #include "vector_double.h"
 #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 TYPE double
 #define NAME vector_double
 #define NAME vector_double
 
 

+ 2 - 2
panda/src/express/vector_float.cxx

@@ -14,8 +14,8 @@
 
 
 #include "vector_float.h"
 #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 TYPE float
 #define NAME vector_float
 #define NAME vector_float
 
 

+ 2 - 2
panda/src/express/vector_uchar.cxx

@@ -14,8 +14,8 @@
 
 
 #include "vector_uchar.h"
 #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 TYPE unsigned char
 #define NAME vector_uchar
 #define NAME vector_uchar
 
 

+ 2 - 2
panda/src/linmath/deg_2_rad.h

@@ -20,8 +20,8 @@
 #include "mathNumbers.h"
 #include "mathNumbers.h"
 
 
 BEGIN_PUBLISH
 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 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; }
 INLINE_LINMATH float rad_2_deg( float f ) { return f * MathNumbers::rad_2_deg_f; }

+ 1 - 0
panda/src/putil/clockObject.h

@@ -27,6 +27,7 @@
 #include "thread.h"
 #include "thread.h"
 #include "referenceCount.h"
 #include "referenceCount.h"
 #include "pointerTo.h"
 #include "pointerTo.h"
+#include "vector_double.h"  // needed to see exported allocators for pdeque
 
 
 class EXPCL_PANDA_PUTIL TimeVal {
 class EXPCL_PANDA_PUTIL TimeVal {
 PUBLISHED:
 PUBLISHED: