mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fix repack problem
This commit is contained in:
parent
b1fdbd2747
commit
47148678a1
@ -1073,8 +1073,6 @@ streampos Multifile::Subfile::
|
|||||||
write_data(ostream &write, istream *read, streampos fpos) {
|
write_data(ostream &write, istream *read, streampos fpos) {
|
||||||
nassertr(write.tellp() == fpos, fpos);
|
nassertr(write.tellp() == fpos, fpos);
|
||||||
|
|
||||||
_data_start = fpos;
|
|
||||||
|
|
||||||
istream *source = _source;
|
istream *source = _source;
|
||||||
ifstream source_file;
|
ifstream source_file;
|
||||||
if (source == (istream *)NULL && !_source_filename.empty()) {
|
if (source == (istream *)NULL && !_source_filename.empty()) {
|
||||||
@ -1100,6 +1098,7 @@ write_data(ostream &write, istream *read, streampos fpos) {
|
|||||||
_flags |= SF_data_invalid;
|
_flags |= SF_data_invalid;
|
||||||
} else {
|
} else {
|
||||||
// Read the data from the original Multifile.
|
// Read the data from the original Multifile.
|
||||||
|
read->seekg(_data_start);
|
||||||
for (size_t p = 0; p < _data_length; p++) {
|
for (size_t p = 0; p < _data_length; p++) {
|
||||||
int byte = read->get();
|
int byte = read->get();
|
||||||
if (read->eof() || read->fail()) {
|
if (read->eof() || read->fail()) {
|
||||||
@ -1123,6 +1122,10 @@ write_data(ostream &write, istream *read, streampos fpos) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We can't set _data_start until down here, after we have read the
|
||||||
|
// Subfile. (In case we are running during repack()).
|
||||||
|
_data_start = fpos;
|
||||||
|
|
||||||
_source = (istream *)NULL;
|
_source = (istream *)NULL;
|
||||||
_source_filename = Filename();
|
_source_filename = Filename();
|
||||||
source_file.close();
|
source_file.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user