Browse Source

Merge branch 'release/1.10.x'

rdb 4 years ago
parent
commit
8afd0e526f

+ 3 - 3
dtool/src/prc/streamWrapper.h

@@ -65,7 +65,7 @@ PUBLISHED:
   ~IStreamWrapper();
   ~IStreamWrapper();
 
 
   INLINE std::istream *get_istream() const;
   INLINE std::istream *get_istream() const;
-  MAKE_PROPERTY(std::istream, get_istream);
+  MAKE_PROPERTY(istream, get_istream);
 
 
 public:
 public:
   void read(char *buffer, std::streamsize num_bytes);
   void read(char *buffer, std::streamsize num_bytes);
@@ -92,7 +92,7 @@ PUBLISHED:
   ~OStreamWrapper();
   ~OStreamWrapper();
 
 
   INLINE std::ostream *get_ostream() const;
   INLINE std::ostream *get_ostream() const;
-  MAKE_PROPERTY(std::ostream, get_ostream);
+  MAKE_PROPERTY(ostream, get_ostream);
 
 
 public:
 public:
   void write(const char *buffer, std::streamsize num_bytes);
   void write(const char *buffer, std::streamsize num_bytes);
@@ -128,7 +128,7 @@ PUBLISHED:
   ~StreamWrapper();
   ~StreamWrapper();
 
 
   INLINE std::iostream *get_iostream() const;
   INLINE std::iostream *get_iostream() const;
-  MAKE_PROPERTY(std::iostream, get_iostream);
+  MAKE_PROPERTY(iostream, get_iostream);
 
 
 private:
 private:
   std::iostream *_iostream;
   std::iostream *_iostream;

+ 1 - 3
panda/src/collide/collisionHandlerGravity.I

@@ -52,8 +52,6 @@ get_reach() const {
  *
  *
  * The object might not necessarily be at rest.  Use is_on_ground() if you
  * The object might not necessarily be at rest.  Use is_on_ground() if you
  * want to know whether the object is on the ground and at rest.
  * want to know whether the object is on the ground and at rest.
- *
- * See Also: is_in_outer_space()
  */
  */
 INLINE PN_stdfloat CollisionHandlerGravity::
 INLINE PN_stdfloat CollisionHandlerGravity::
 get_airborne_height() const {
 get_airborne_height() const {
@@ -73,7 +71,7 @@ is_on_ground() const {
 
 
 /**
 /**
  * How hard did the object hit the ground.  This value is set on impact with
  * How hard did the object hit the ground.  This value is set on impact with
- * the ground.  You may want to watch (poll) on is_on_groun() and when that is
+ * the ground.  You may want to watch (poll) on is_on_ground() and when that is
  * true, call get_impact_velocity(). Normally I avoid polling, but we are
  * true, call get_impact_velocity(). Normally I avoid polling, but we are
  * calling is_on_ground() frequently anyway.
  * calling is_on_ground() frequently anyway.
  */
  */

+ 1 - 0
panda/src/downloader/httpChannel.cxx

@@ -123,6 +123,7 @@ HTTPChannel(HTTPClient *client) :
   _cipher_list = _client->get_cipher_list();
   _cipher_list = _client->get_cipher_list();
   _last_status_code = 0;
   _last_status_code = 0;
   _last_run_time = 0.0f;
   _last_run_time = 0.0f;
+  _download_dest = DD_none;
   _download_to_ramfile = nullptr;
   _download_to_ramfile = nullptr;
   _download_to_stream = nullptr;
   _download_to_stream = nullptr;
 }
 }

+ 8 - 0
panda/src/downloader/httpCookie.h

@@ -76,6 +76,14 @@ PUBLISHED:
 
 
   void output(std::ostream &out) const;
   void output(std::ostream &out) const;
 
 
+PUBLISHED:
+  MAKE_PROPERTY(name, get_name, set_name);
+  MAKE_PROPERTY(value, get_value, set_value);
+  MAKE_PROPERTY(domain, get_domain, set_domain);
+  MAKE_PROPERTY(path, get_path, set_path);
+  MAKE_PROPERTY2(expires, has_expires, get_expires, set_expires, clear_expires);
+  MAKE_PROPERTY(secure, get_secure, set_secure);
+
 private:
 private:
   bool parse_cookie_param(const std::string &param, bool first_param);
   bool parse_cookie_param(const std::string &param, bool first_param);
 
 

+ 20 - 0
panda/src/downloader/virtualFileHTTP.cxx

@@ -140,6 +140,26 @@ open_read_file(bool auto_unwrap) const {
   return return_file(strstream, auto_unwrap);
   return return_file(strstream, auto_unwrap);
 }
 }
 
 
+/**
+ * Fills up the indicated pvector with the contents of the file, if it is a
+ * regular file.  Returns true on success, false otherwise.
+ */
+bool VirtualFileHTTP::
+read_file(vector_uchar &result, bool auto_unwrap) const {
+  if (_status_only) {
+    return false;
+  }
+
+  Ramfile ramfile;
+  if (!_channel->download_to_ram(&ramfile, false)) {
+    return false;
+  }
+
+  const string &data = ramfile.get_data();
+  std::copy(data.begin(), data.end(), std::back_inserter(result));
+  return true;
+}
+
 /**
 /**
  * Downloads the entire file from the web server into the indicated iostream.
  * Downloads the entire file from the web server into the indicated iostream.
  * Returns true on success, false on failure.
  * Returns true on success, false on failure.

+ 2 - 0
panda/src/downloader/virtualFileHTTP.h

@@ -51,6 +51,8 @@ public:
   virtual std::streamsize get_file_size() const;
   virtual std::streamsize get_file_size() const;
   virtual time_t get_timestamp() const;
   virtual time_t get_timestamp() const;
 
 
+  virtual bool read_file(vector_uchar &result, bool auto_unwrap) const;
+
 private:
 private:
   bool fetch_file(std::ostream *buffer_stream) const;
   bool fetch_file(std::ostream *buffer_stream) const;
   std::istream *return_file(std::istream *buffer_stream, bool auto_unwrap) const;
   std::istream *return_file(std::istream *buffer_stream, bool auto_unwrap) const;

+ 1 - 1
panda/src/linmath/lmatrix4_src.I

@@ -1021,7 +1021,7 @@ operator += (const FLOATNAME(LMatrix4) &other) {
 }
 }
 
 
 /**
 /**
- * Performs a memberwise addition between two matrices.
+ * Performs a memberwise subtraction between two matrices.
  */
  */
 INLINE_LINMATH FLOATNAME(LMatrix4) &FLOATNAME(LMatrix4)::
 INLINE_LINMATH FLOATNAME(LMatrix4) &FLOATNAME(LMatrix4)::
 operator -= (const FLOATNAME(LMatrix4) &other) {
 operator -= (const FLOATNAME(LMatrix4) &other) {