================= idFileSystemLocal::BackgroundDownload ================= */
| 3568 | ================= |
| 3569 | */ |
| 3570 | void idFileSystemLocal::BackgroundDownload( backgroundDownload_t *bgl ) { |
| 3571 | if ( bgl->opcode == DLTYPE_FILE ) { |
| 3572 | if ( dynamic_cast<idFile_Permanent *>(bgl->f) ) { |
| 3573 | // add the bgl to the background download list |
| 3574 | Sys_EnterCriticalSection(); |
| 3575 | bgl->next = backgroundDownloads; |
| 3576 | backgroundDownloads = bgl; |
| 3577 | Sys_TriggerEvent(); |
| 3578 | Sys_LeaveCriticalSection(); |
| 3579 | } else { |
| 3580 | // read zipped file directly |
| 3581 | bgl->f->Seek( bgl->file.position, FS_SEEK_SET ); |
| 3582 | bgl->f->Read( bgl->file.buffer, bgl->file.length ); |
| 3583 | bgl->completed = true; |
| 3584 | } |
| 3585 | } else { |
| 3586 | Sys_EnterCriticalSection(); |
| 3587 | bgl->next = backgroundDownloads; |
| 3588 | backgroundDownloads = bgl; |
| 3589 | Sys_TriggerEvent(); |
| 3590 | Sys_LeaveCriticalSection(); |
| 3591 | } |
| 3592 | } |
| 3593 | |
| 3594 | /* |
| 3595 | ================= |
no test coverage detected