diff --git a/dtool/src/prc/streamWrapper.h b/dtool/src/prc/streamWrapper.h index a5010457b1..c416109b24 100644 --- a/dtool/src/prc/streamWrapper.h +++ b/dtool/src/prc/streamWrapper.h @@ -65,7 +65,7 @@ PUBLISHED: ~IStreamWrapper(); INLINE std::istream *get_istream() const; - MAKE_PROPERTY(std::istream, get_istream); + MAKE_PROPERTY(istream, get_istream); public: void read(char *buffer, std::streamsize num_bytes); @@ -92,7 +92,7 @@ PUBLISHED: ~OStreamWrapper(); INLINE std::ostream *get_ostream() const; - MAKE_PROPERTY(std::ostream, get_ostream); + MAKE_PROPERTY(ostream, get_ostream); public: void write(const char *buffer, std::streamsize num_bytes); @@ -128,7 +128,7 @@ PUBLISHED: ~StreamWrapper(); INLINE std::iostream *get_iostream() const; - MAKE_PROPERTY(std::iostream, get_iostream); + MAKE_PROPERTY(iostream, get_iostream); private: std::iostream *_iostream; diff --git a/panda/src/collide/collisionHandlerGravity.I b/panda/src/collide/collisionHandlerGravity.I index 48c172959f..da449937cd 100644 --- a/panda/src/collide/collisionHandlerGravity.I +++ b/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 * want to know whether the object is on the ground and at rest. - * - * See Also: is_in_outer_space() */ INLINE PN_stdfloat CollisionHandlerGravity:: 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 - * 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 * calling is_on_ground() frequently anyway. */ diff --git a/panda/src/downloader/httpChannel.cxx b/panda/src/downloader/httpChannel.cxx index 754d10b53c..bd0e1c3110 100644 --- a/panda/src/downloader/httpChannel.cxx +++ b/panda/src/downloader/httpChannel.cxx @@ -123,6 +123,7 @@ HTTPChannel(HTTPClient *client) : _cipher_list = _client->get_cipher_list(); _last_status_code = 0; _last_run_time = 0.0f; + _download_dest = DD_none; _download_to_ramfile = nullptr; _download_to_stream = nullptr; } diff --git a/panda/src/downloader/httpCookie.h b/panda/src/downloader/httpCookie.h index 7c7ea85f09..26570e4aad 100644 --- a/panda/src/downloader/httpCookie.h +++ b/panda/src/downloader/httpCookie.h @@ -76,6 +76,14 @@ PUBLISHED: 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: bool parse_cookie_param(const std::string ¶m, bool first_param); diff --git a/panda/src/downloader/virtualFileHTTP.cxx b/panda/src/downloader/virtualFileHTTP.cxx index 527e9c619b..dcb9036d87 100644 --- a/panda/src/downloader/virtualFileHTTP.cxx +++ b/panda/src/downloader/virtualFileHTTP.cxx @@ -140,6 +140,26 @@ open_read_file(bool auto_unwrap) const { 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. * Returns true on success, false on failure. diff --git a/panda/src/downloader/virtualFileHTTP.h b/panda/src/downloader/virtualFileHTTP.h index eaf63f0465..219390f4aa 100644 --- a/panda/src/downloader/virtualFileHTTP.h +++ b/panda/src/downloader/virtualFileHTTP.h @@ -51,6 +51,8 @@ public: virtual std::streamsize get_file_size() const; virtual time_t get_timestamp() const; + virtual bool read_file(vector_uchar &result, bool auto_unwrap) const; + private: bool fetch_file(std::ostream *buffer_stream) const; std::istream *return_file(std::istream *buffer_stream, bool auto_unwrap) const; diff --git a/panda/src/linmath/lmatrix4_src.I b/panda/src/linmath/lmatrix4_src.I index 94515ce394..8c20d6d807 100644 --- a/panda/src/linmath/lmatrix4_src.I +++ b/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):: operator -= (const FLOATNAME(LMatrix4) &other) {