diff options
Diffstat (limited to 'graphics/asymptote/v3dfile.cc')
-rw-r--r-- | graphics/asymptote/v3dfile.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/graphics/asymptote/v3dfile.cc b/graphics/asymptote/v3dfile.cc index f9a66e84e6..73ac829aeb 100644 --- a/graphics/asymptote/v3dfile.cc +++ b/graphics/asymptote/v3dfile.cc @@ -316,9 +316,12 @@ void gzv3dfile::close() { if(!destroyed) { finalize(); + + std::vector<uint8_t> const resultingData = memxdrfile.createCopyOfCurrentData(); + memxdrfile.close(); gzFile file=gzopen(name.c_str(), "wb9"); - gzwrite(file,data(),length()); + gzwrite(file, resultingData.data(), resultingData.size()); gzclose(file); if(settings::verbose > 0) cout << "Wrote " << name << endl; @@ -326,16 +329,6 @@ void gzv3dfile::close() } } -char const* gzv3dfile::data() const -{ - return memxdrfile.stream(); -} - -size_t const& gzv3dfile::length() const -{ - return memxdrfile.getLength(); -} - uint32_t LightHeader::getWordSize(bool singleprecision) const { return (singleprecision ? 1 : 2)*3+3; |