diff options
author | Max Horn | 2003-07-21 21:28:47 +0000 |
---|---|---|
committer | Max Horn | 2003-07-21 21:28:47 +0000 |
commit | 0b1b753797f00df4f685ebefd8745f7462623c15 (patch) | |
tree | 8204f52413a5fdfbd81b2979badcac65fead7988 /scumm | |
parent | 760bfb2245c1296d94c36c63f843968143f7d831 (diff) | |
download | scummvm-rg350-0b1b753797f00df4f685ebefd8745f7462623c15.tar.gz scummvm-rg350-0b1b753797f00df4f685ebefd8745f7462623c15.tar.bz2 scummvm-rg350-0b1b753797f00df4f685ebefd8745f7462623c15.zip |
added getResourceSize method
svn-id: r9109
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/resource.cpp | 7 | ||||
-rw-r--r-- | scumm/scumm.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 8fdba761f5..8d5d81faaf 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -1269,6 +1269,13 @@ int Scumm::getResourceRoomNr(int type, int idx) { return res.roomno[type][idx]; } +int Scumm::getResourceSize(int type, int idx) { + byte *ptr = getResourceAddress(type, idx); + MemBlkHeader *hdr = (MemBlkHeader *)(ptr - sizeof(MemBlkHeader)); + + return hdr->size; +} + byte *Scumm::getResourceAddress(int type, int idx) { byte *ptr; diff --git a/scumm/scumm.h b/scumm/scumm.h index 31aa501677..1fa4620bdf 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -623,6 +623,7 @@ protected: byte *createResource(int type, int index, uint32 size); int loadResource(int type, int i); void nukeResource(int type, int i); + int getResourceSize(int type, int idx); public: bool isGlobInMemory(int type, int index) const; |