[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.h,1.272,1.273 resource.cpp,1.111,1.112

Max Horn fingolfin at users.sourceforge.net
Mon Jul 21 14:29:15 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv9550

Modified Files:
	scumm.h resource.cpp 
Log Message:
added getResourceSize method

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -d -r1.272 -r1.273
--- scumm.h	20 Jul 2003 00:02:24 -0000	1.272
+++ scumm.h	21 Jul 2003 21:28:47 -0000	1.273
@@ -623,6 +623,7 @@
 	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;

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- resource.cpp	19 Jul 2003 18:18:01 -0000	1.111
+++ resource.cpp	21 Jul 2003 21:28:47 -0000	1.112
@@ -1269,6 +1269,13 @@
 	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;
 





More information about the Scummvm-git-logs mailing list