Browse Source

ssize_t isn't defined on windows, but we don't need it here

David Rose 14 years ago
parent
commit
0053d01843

+ 10 - 10
panda/src/vision/openCVTexture.cxx

@@ -310,14 +310,14 @@ do_update_frame(Texture::CData *cdata, int frame, int z) {
     do_modify_ram_image(cdata);
     do_modify_ram_image(cdata);
     ++(cdata->_image_modified);
     ++(cdata->_image_modified);
   }
   }
-  ssize_t dest_x_pitch = cdata->_num_components * cdata->_component_width;
-  ssize_t dest_y_pitch = cdata->_x_size * dest_x_pitch;
+  int dest_x_pitch = cdata->_num_components * cdata->_component_width;
+  int dest_y_pitch = cdata->_x_size * dest_x_pitch;
 
 
   if (page._color.is_valid()) {
   if (page._color.is_valid()) {
     nassertv(get_num_components() >= 3 && get_component_width() == 1);
     nassertv(get_num_components() >= 3 && get_component_width() == 1);
 
 
     const unsigned char *r, *g, *b;
     const unsigned char *r, *g, *b;
-    ssize_t x_pitch, y_pitch;
+    int x_pitch, y_pitch;
     if (page._color.get_frame_data(frame, r, g, b, x_pitch, y_pitch)) {
     if (page._color.get_frame_data(frame, r, g, b, x_pitch, y_pitch)) {
       nassertv(get_video_width() <= cdata->_x_size && get_video_height() <= cdata->_y_size);
       nassertv(get_video_width() <= cdata->_x_size && get_video_height() <= cdata->_y_size);
       nassertv(!cdata->_ram_images.empty())
       nassertv(!cdata->_ram_images.empty())
@@ -325,7 +325,7 @@ do_update_frame(Texture::CData *cdata, int frame, int z) {
 
 
       if (cdata->_num_components == 3 && x_pitch == 3) {
       if (cdata->_num_components == 3 && x_pitch == 3) {
         // The easy case--copy the whole thing in, row by row.
         // The easy case--copy the whole thing in, row by row.
-        ssize_t copy_bytes = get_video_width() * dest_x_pitch;
+        int copy_bytes = get_video_width() * dest_x_pitch;
         nassertv(copy_bytes <= dest_y_pitch && copy_bytes <= abs(y_pitch));
         nassertv(copy_bytes <= dest_y_pitch && copy_bytes <= abs(y_pitch));
 
 
         for (int y = 0; y < get_video_height(); ++y) {
         for (int y = 0; y < get_video_height(); ++y) {
@@ -339,8 +339,8 @@ do_update_frame(Texture::CData *cdata, int frame, int z) {
         // pixel, possibly leaving room for alpha.
         // pixel, possibly leaving room for alpha.
 
 
         for (int y = 0; y < get_video_height(); ++y) {
         for (int y = 0; y < get_video_height(); ++y) {
-          ssize_t dx = 0;
-          ssize_t sx = 0;
+          int dx = 0;
+          int sx = 0;
           for (int x = 0; x < get_video_width(); ++x) {
           for (int x = 0; x < get_video_width(); ++x) {
             dest[dx] = r[sx];
             dest[dx] = r[sx];
             dest[dx + 1] = g[sx];
             dest[dx + 1] = g[sx];
@@ -360,7 +360,7 @@ do_update_frame(Texture::CData *cdata, int frame, int z) {
     nassertv(get_component_width() == 1);
     nassertv(get_component_width() == 1);
 
 
     const unsigned char *source[3];
     const unsigned char *source[3];
-    ssize_t x_pitch, y_pitch;
+    int x_pitch, y_pitch;
     if (page._alpha.get_frame_data(frame, source[0], source[1], source[2],
     if (page._alpha.get_frame_data(frame, source[0], source[1], source[2],
                                    x_pitch, y_pitch)) {
                                    x_pitch, y_pitch)) {
       nassertv(get_video_width() <= cdata->_x_size && get_video_height() <= cdata->_y_size);
       nassertv(get_video_width() <= cdata->_x_size && get_video_height() <= cdata->_y_size);
@@ -378,8 +378,8 @@ do_update_frame(Texture::CData *cdata, int frame, int z) {
       for (int y = 0; y < get_video_height(); ++y) {
       for (int y = 0; y < get_video_height(); ++y) {
         // Start dx at _num_components - 1, which writes to the last
         // Start dx at _num_components - 1, which writes to the last
         // channel, i.e. the alpha channel.
         // channel, i.e. the alpha channel.
-        ssize_t dx = (cdata->_num_components - 1) * cdata->_component_width; 
-        ssize_t sx = 0;
+        int dx = (cdata->_num_components - 1) * cdata->_component_width; 
+        int sx = 0;
         for (int x = 0; x < get_video_width(); ++x) {
         for (int x = 0; x < get_video_width(); ++x) {
           dest[dx] = sch[sx];
           dest[dx] = sch[sx];
           dx += dest_x_pitch;
           dx += dest_x_pitch;
@@ -586,7 +586,7 @@ get_frame_data(int frame,
                const unsigned char *&r,
                const unsigned char *&r,
                const unsigned char *&g,
                const unsigned char *&g,
                const unsigned char *&b,
                const unsigned char *&b,
-               ssize_t &x_pitch, ssize_t &y_pitch) {
+               int &x_pitch, int &y_pitch) {
   nassertr(is_valid(), false);
   nassertr(is_valid(), false);
 
 
   if (is_from_file() && _next_frame != frame) {
   if (is_from_file() && _next_frame != frame) {

+ 1 - 1
panda/src/vision/openCVTexture.h

@@ -90,7 +90,7 @@ private:
                         const unsigned char *&r,
                         const unsigned char *&r,
                         const unsigned char *&g,
                         const unsigned char *&g,
                         const unsigned char *&b,
                         const unsigned char *&b,
-                        ssize_t &x_pitch, ssize_t &y_pitch);
+                        int &x_pitch, int &y_pitch);
 
 
     CvCapture *_capture;
     CvCapture *_capture;
     Filename _filename;
     Filename _filename;

+ 7 - 7
panda/src/vision/webcamVideoCursorOpenCV.cxx

@@ -73,15 +73,15 @@ fetch_buffer() {
   unsigned char *dest = buffer->_block;
   unsigned char *dest = buffer->_block;
   int num_components = get_num_components();
   int num_components = get_num_components();
   nassertr(num_components == 3, NULL);
   nassertr(num_components == 3, NULL);
-  ssize_t dest_x_pitch = num_components;  // Assume component_width == 1
-  ssize_t dest_y_pitch = _size_x * dest_x_pitch;
+  int dest_x_pitch = num_components;  // Assume component_width == 1
+  int dest_y_pitch = _size_x * dest_x_pitch;
 
 
   const unsigned char *r, *g, *b;
   const unsigned char *r, *g, *b;
-  ssize_t x_pitch, y_pitch;
+  int x_pitch, y_pitch;
   if (get_frame_data(r, g, b, x_pitch, y_pitch)) {
   if (get_frame_data(r, g, b, x_pitch, y_pitch)) {
     if (num_components == 3 && x_pitch == 3) {
     if (num_components == 3 && x_pitch == 3) {
       // The easy case--copy the whole thing in, row by row.
       // The easy case--copy the whole thing in, row by row.
-      ssize_t copy_bytes = _size_x * dest_x_pitch;
+      int copy_bytes = _size_x * dest_x_pitch;
       nassertr(copy_bytes <= dest_y_pitch && copy_bytes <= abs(y_pitch), NULL);
       nassertr(copy_bytes <= dest_y_pitch && copy_bytes <= abs(y_pitch), NULL);
       
       
       for (int y = 0; y < _size_y; ++y) {
       for (int y = 0; y < _size_y; ++y) {
@@ -95,8 +95,8 @@ fetch_buffer() {
       // pixel.
       // pixel.
       
       
       for (int y = 0; y < _size_y; ++y) {
       for (int y = 0; y < _size_y; ++y) {
-        ssize_t dx = 0;
-        ssize_t sx = 0;
+        int dx = 0;
+        int sx = 0;
         for (int x = 0; x < _size_x; ++x) {
         for (int x = 0; x < _size_x; ++x) {
           dest[dx] = r[sx];
           dest[dx] = r[sx];
           dest[dx + 1] = g[sx];
           dest[dx + 1] = g[sx];
@@ -140,7 +140,7 @@ bool WebcamVideoCursorOpenCV::
 get_frame_data(const unsigned char *&r,
 get_frame_data(const unsigned char *&r,
                const unsigned char *&g,
                const unsigned char *&g,
                const unsigned char *&b,
                const unsigned char *&b,
-               ssize_t &x_pitch, ssize_t &y_pitch) {
+               int &x_pitch, int &y_pitch) {
   nassertr(ready(), false);
   nassertr(ready(), false);
 
 
   IplImage *image = cvQueryFrame(_capture);
   IplImage *image = cvQueryFrame(_capture);

+ 1 - 1
panda/src/vision/webcamVideoCursorOpenCV.h

@@ -37,7 +37,7 @@ private:
   bool get_frame_data(const unsigned char *&r,
   bool get_frame_data(const unsigned char *&r,
                       const unsigned char *&g,
                       const unsigned char *&g,
                       const unsigned char *&b,
                       const unsigned char *&b,
-                      ssize_t &x_pitch, ssize_t &y_pitch);
+                      int &x_pitch, int &y_pitch);
 
 
   CvCapture *_capture;
   CvCapture *_capture;