DIRECTOR: Fix MacArchive::getFileSize()

This commit is contained in:
Scott Percival 2024-02-02 22:01:26 +08:00
parent 40923700b5
commit 10b2abcd9b
3 changed files with 11 additions and 3 deletions

View File

@ -110,7 +110,7 @@ void Archive::listUnaccessedChunks() {
debugC(5, kDebugLoading, "Unaccessed Chunks in '%s':\n%s", _pathName.toString(g_director->_dirSeparator).c_str(), s.c_str());
}
int Archive::getFileSize() {
uint32 Archive::getFileSize() {
if (!_stream)
return 0;
@ -301,6 +301,13 @@ MacArchive::~MacArchive() {
delete _resFork;
}
uint32 MacArchive::getFileSize() {
if (!_resFork)
return 0;
return _resFork->getResForkDataSize();
}
void MacArchive::close() {
Archive::close();
delete _resFork;

View File

@ -62,7 +62,7 @@ public:
Common::Path getPathName() const { return _pathName; }
Common::String getFileName() const;
void setPathName(const Common::Path &name) { _pathName = name; }
int getFileSize();
virtual uint32 getFileSize();
bool isOpen() const { return _stream != 0; }
@ -102,6 +102,7 @@ public:
MacArchive();
~MacArchive() override;
uint32 getFileSize() override;
void close() override;
bool openFile(const Common::Path &path) override;
bool openStream(Common::SeekableReadStream *stream, uint32 startOffset = 0) override;

View File

@ -719,7 +719,7 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
d = 0; // Let's pretend the movie is compactified
break;
case kTheMovieFileSize:
d = movie->getArchive()->getFileSize();
d = (int)movie->getArchive()->getFileSize();
break;
case kTheMoviePath:
case kThePathName: