Procházet zdrojové kódy

*** empty log message ***

Mike Goslin před 25 roky
rodič
revize
f3b6fdc154

+ 13 - 0
panda/src/downloader/downloader.cxx

@@ -207,6 +207,19 @@ disconnect_from_server(void) {
   _connected = false;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: Downloader::change_buffer_size
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+void Downloader::
+change_buffer_size(int size) {
+  if (_buffer->get_length() == size)
+    return;
+  _buffer.clear();
+  _buffer = new Buffer(size);
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: Downloader::request_download
 //       Access: Public

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

@@ -46,6 +46,8 @@ PUBLISHED:
 			int last_byte, int total_bytes, 
 			bool partial_content = true);
 
+  void change_buffer_size(int size);
+
   INLINE void set_bandwidth(float bytes);
   INLINE float get_bandwidth(void) const;
   INLINE void enable_download(bool val);