diff options
| author | Ludvig Strigeus | 2001-10-10 10:02:33 +0000 |
|---|---|---|
| committer | Ludvig Strigeus | 2001-10-10 10:02:33 +0000 |
| commit | 061f9c1289fac34d45887a8cd6ffd627446dcd7f (patch) | |
| tree | b389a05921a175b1499a0a6664e56095bc92a3c8 /resource.cpp | |
| parent | 1fb297d3f62a3334999b1ccf408f27deacbada8d (diff) | |
| download | scummvm-rg350-061f9c1289fac34d45887a8cd6ffd627446dcd7f.tar.gz scummvm-rg350-061f9c1289fac34d45887a8cd6ffd627446dcd7f.tar.bz2 scummvm-rg350-061f9c1289fac34d45887a8cd6ffd627446dcd7f.zip | |
alternative mouse cursor
basic save&load
svn-id: r3416
Diffstat (limited to 'resource.cpp')
| -rw-r--r-- | resource.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/resource.cpp b/resource.cpp index 603311b951..1afb2351a6 100644 --- a/resource.cpp +++ b/resource.cpp @@ -17,8 +17,13 @@ * * Change Log: * $Log$ - * Revision 1.1 2001/10/09 14:30:14 strigeus - * Initial revision + * Revision 1.2 2001/10/10 10:02:33 strigeus + * alternative mouse cursor + * basic save&load + * + * Revision 1.1.1.1 2001/10/09 14:30:14 strigeus + * + * initial revision * * */ @@ -357,8 +362,6 @@ int Scumm::loadResource(int type, int index) { do { for (i=0; i<5; i++) { - _resIndexToLoad = index; - _resTypeToLoad = type; openRoom(roomNr); fileSeek(_fileHandle, fileOffs + _fileOffset, SEEK_SET); @@ -459,7 +462,7 @@ byte *Scumm::getResourceAddress(int type, int index) { if (!ptr) return NULL; - return ptr + 8; + return ptr + sizeof(ResHeader); } void Scumm::setResourceFlags(int type, int index, byte flag) { @@ -479,17 +482,21 @@ byte *Scumm::createResource(int type, int index, uint32 size) { validateResource("allocating", type, index); nukeResource(type, index); + + checkHeap(); - ptr = (byte*)alloc(size + 8); + ptr = (byte*)alloc(size + sizeof(ResHeader)); if (ptr==NULL) { error("Out of memory while allocating %d", size); } res.address[type][index] = ptr; + ((ResHeader*)ptr)->size = size; + setResourceFlags(type, index, 1); - return ptr + 8; /* skip header */ + return ptr + sizeof(ResHeader); /* skip header */ } void Scumm::validateResource(const char *str, int type, int index) { |
