MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / BackgroundDownload

Method BackgroundDownload

neo/framework/FileSystem.cpp:3570–3592  ·  view source on GitHub ↗

================= idFileSystemLocal::BackgroundDownload ================= */

Source from the content-addressed store, hash-verified

3568=================
3569*/
3570void 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=================

Callers 2

HandleDownloadsMethod · 0.80

Calls 5

Sys_EnterCriticalSectionFunction · 0.50
Sys_TriggerEventFunction · 0.50
Sys_LeaveCriticalSectionFunction · 0.50
SeekMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected