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

void SimpleResourceFile::load ( const std::wstring &  name,
Buffer buffer 
) [virtual]

Load data into the buffer.

Parameters:
name name of resource
buffer buffer for resource data

Definition at line 301 of file resources.cpp.

References Buffer::getData(), ResourceFile::DirectoryEntry::level, ResourceFile::DirectoryEntry::offset, ResourceFile::DirectoryEntry::packedSize, Buffer::setSize(), and ResourceFile::DirectoryEntry::unpackedSize.

{
    DirectoryMap::iterator i = directory.find(name);
    if (i != directory.end()) {
        DirectoryEntry &e = (*i).second;
        outBuf.setSize(e.unpackedSize);
        ResourceFile::load((char*)outBuf.getData(), e.offset, 
                e.packedSize, e.unpackedSize, e.level);
    } else
        throw Exception(L"Resource '" + name + L"' not found");
}


Generated by  Doxygen 1.6.0   Back to index