int ReadFile::RWOps_Seek(SDL_RWops* context, int offset, int whence)
{
    ReadFile* file = (ReadFile*) context->hidden.unknown.data1;
    try { // catch exceptions
        switch(whence) {
        case SEEK_SET: file->seek(offset); break;
        case SEEK_CUR: file->seek(file->tell() + offset); break;
        case SEEK_END: file->seek(file->fileLength() + offset); break;
        }
    } catch(...) {
        LOG(("Unexpected exception while seeking in file."));
        return -1;
    }

    return file->tell();
}