mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Switch to zip archive format for resource data, prep work for moving from PICT/snd to BMP/WAV
This commit is contained in:
@@ -8,10 +8,38 @@ class PLPasStr;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
struct MMHandleBlock;
|
||||
struct ResourceCompiledRef;
|
||||
class ResourceFile;
|
||||
class ResTypeID;
|
||||
class ZipFileProxy;
|
||||
|
||||
struct ResourceArchiveRef
|
||||
{
|
||||
ResourceArchiveRef();
|
||||
|
||||
MMHandleBlock *m_handle;
|
||||
size_t m_size;
|
||||
int16_t m_resID;
|
||||
};
|
||||
|
||||
class ResourceArchive final
|
||||
{
|
||||
public:
|
||||
static ResourceArchive *Create(ZipFileProxy *zipFileProxy, IOStream *stream);
|
||||
void Destroy();
|
||||
|
||||
THandle<void> GetResource(const ResTypeID &resTypeID, int id, bool load);
|
||||
|
||||
private:
|
||||
ResourceArchive(ZipFileProxy *zipFileProxy, IOStream *stream, ResourceArchiveRef *resourceHandles);
|
||||
~ResourceArchive();
|
||||
|
||||
ZipFileProxy *m_zipFileProxy;
|
||||
IOStream *m_stream;
|
||||
ResourceArchiveRef *m_resourceHandles;
|
||||
};
|
||||
|
||||
class ResourceManager
|
||||
{
|
||||
@@ -21,7 +49,7 @@ namespace PortabilityLayer
|
||||
|
||||
virtual void SetResLoad(bool load) = 0;
|
||||
|
||||
virtual ResourceFile *LoadResFile(VirtualDirectory_t virtualDir, const PLPasStr &filename) const = 0;
|
||||
virtual ResourceArchive *LoadResFile(VirtualDirectory_t virtualDir, const PLPasStr &filename) const = 0;
|
||||
virtual short OpenResFork(VirtualDirectory_t virtualDir, const PLPasStr &filename) = 0;
|
||||
virtual void CloseResFile(short ref) = 0;
|
||||
virtual PLError_t CreateBlankResFile(VirtualDirectory_t virtualDir, const PLPasStr &filename) = 0;
|
||||
@@ -32,7 +60,7 @@ namespace PortabilityLayer
|
||||
virtual void SetCurrentResFile(short ref) = 0;
|
||||
|
||||
virtual void DissociateHandle(MMHandleBlock *hdl) const = 0;
|
||||
virtual const ResourceCompiledRef *ResourceForHandle(MMHandleBlock *hdl) const = 0;
|
||||
virtual const ResourceArchiveRef *ResourceForHandle(MMHandleBlock *hdl) const = 0;
|
||||
|
||||
static ResourceManager *GetInstance();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user