mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 22:52:34 +01:00
byuu says: Changelog: - SFC: "uint8 read(uint addr)" -> "uint8 read(uint addr, uint8 data)" - hiro: mHorizontalLayout::setGeometry() return value - hiro/GTK: ListView,TreeView::setFocused() does not grab focus of first item Notes: - nall/windows/utf8.hpp needs using uint = unsigned; at the top to compile - sfc/balanced, sfc/performance won't compile yet Seems Cx4 games broke a while back. Not from this WIP, either. I'll go back and find out what's wrong now.
35 lines
611 B
C++
35 lines
611 B
C++
#ifndef NALL_STREAM_GZIP_HPP
|
|
#define NALL_STREAM_GZIP_HPP
|
|
|
|
#include <nall/decode/gzip.hpp>
|
|
|
|
namespace nall {
|
|
|
|
struct gzipstream : memorystream {
|
|
using stream::read;
|
|
using stream::write;
|
|
|
|
gzipstream(const stream& stream) {
|
|
uint size = stream.size();
|
|
auto data = new uint8[size];
|
|
stream.read(data, size);
|
|
|
|
Decode::GZIP archive;
|
|
bool result = archive.decompress(data, size);
|
|
delete[] data;
|
|
if(!result) return;
|
|
|
|
psize = archive.size;
|
|
pdata = new uint8_t[psize];
|
|
memcpy(pdata, archive.data, psize);
|
|
}
|
|
|
|
~gzipstream() {
|
|
if(pdata) delete[] pdata;
|
|
}
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|