Browse Source

some fixes to PandaIOStream

rdb 14 năm trước cách đây
mục cha
commit
70f6605442
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      pandatool/src/assimp/pandaIOStream.cxx

+ 6 - 2
pandatool/src/assimp/pandaIOStream.cxx

@@ -31,7 +31,11 @@ PandaIOStream(istream &stream) : _istream(stream) {
 ////////////////////////////////////////////////////////////////////
 size_t PandaIOStream::
 FileSize() const {
-  nassertr(false, 0);
+  streampos cur = _istream.tellg();
+  _istream.seekg(0, ios::end);
+  streampos end = _istream.tellg();
+  _istream.seekg(cur, ios::beg);
+  return end;
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -90,7 +94,7 @@ Seek(size_t offset, aiOrigin origin) {
 ////////////////////////////////////////////////////////////////////
 size_t PandaIOStream::
 Tell() const {
-  _istream.tellg();
+  return _istream.tellg();
 }
 
 ////////////////////////////////////////////////////////////////////