mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Fix: images were not being loaded from zip files.
wxImage::LoadFile requires the file to be seekable to peek at the header. We work around this by buffering the header in a wrapper class.
This commit is contained in:
@@ -144,8 +144,9 @@ void Package::clearKeepFlag() {
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Package : inside
|
||||
// ----------------------------------------------------------------------------- : Streams
|
||||
|
||||
/// Class to use as a superclass
|
||||
class FileInputStream_aux {
|
||||
protected:
|
||||
wxFileInputStream file_stream;
|
||||
@@ -164,8 +165,7 @@ public:
|
||||
, wxZipInputStream(file_stream)
|
||||
{}
|
||||
ZipFileInputStream(const String& filename, wxZipEntry* entry)
|
||||
: FileInputStream_aux(filename)
|
||||
, wxZipInputStream(file_stream)
|
||||
: ZipFileInputStream(filename)
|
||||
{
|
||||
OpenEntry(*entry);
|
||||
}
|
||||
@@ -184,6 +184,8 @@ public:
|
||||
{}
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : Package : inside
|
||||
|
||||
unique_ptr<wxInputStream> Package::openIn(const String& file) {
|
||||
if (!file.empty() && file.GetChar(0) == _('/')) {
|
||||
// absolute path, open file from another package
|
||||
|
||||
Reference in New Issue
Block a user