mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 06:32:32 +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.
25 lines
750 B
C++
25 lines
750 B
C++
#ifndef NALL_STREAM_AUTO_HPP
|
|
#define NALL_STREAM_AUTO_HPP
|
|
|
|
namespace nall {
|
|
|
|
#define autostream(...) (*makestream(__VA_ARGS__))
|
|
|
|
inline auto makestream(const string& path) -> std::unique_ptr<stream> {
|
|
if(path.iendsWith(".gz")) return std::unique_ptr<stream>(new gzipstream(filestream{path}));
|
|
if(path.iendsWith(".zip")) return std::unique_ptr<stream>(new zipstream(filestream{path}));
|
|
return std::unique_ptr<stream>(new mmapstream(path));
|
|
}
|
|
|
|
inline auto makestream(uint8* data, uint size) -> std::unique_ptr<stream> {
|
|
return std::unique_ptr<stream>(new memorystream(data, size));
|
|
}
|
|
|
|
inline auto makestream(const uint8* data, uint size) -> std::unique_ptr<stream> {
|
|
return std::unique_ptr<stream>(new memorystream(data, size));
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|