Logo Search packages:      
Sourcecode: einstein version File versions  Download package

void * ResVariant::getRef (  ) 

Get pointer to unpacked resource data. Must be freed after use this delRef()

Definition at line 340 of file resources.cpp.

Referenced by ResourcesCollection::getRef(), and getRef().

{
    if (! refCnt) {
        char* d = (char*)malloc(unpackedSize + sizeof(void*));
        if (! d)
            throw Exception(L"ResVariant::getRef memory allocation error");
        ResVariant *self = this;
        file->load(d + sizeof(self), offset, packedSize, unpackedSize,
                level);
        memcpy(d, &self, sizeof(self));
        data = d + sizeof(self);
    }
        
    refCnt++;
    return data;
}


Generated by  Doxygen 1.6.0   Back to index