Skip to content

Commit

Permalink
Fixed loading of music from virtual files
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 13, 2003
1 parent 4bfe82e commit f97f24a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doomsday/Src/s_mus.c
Expand Up @@ -267,7 +267,17 @@ int Mus_GetExt(ded_music_t *def, char *path)

// Try the resource locator.
if(R_FindResource(RC_MUSIC, def->lumpname, NULL, path))
{
// We must read the song into a buffer, because the path may
// be a virtual file and FMOD doesn't know anything about those.
DFILE *file = F_Open(path, "rb");
ptr = iext->SongBuffer(len = F_Length(file));
F_Read(ptr, len, file);
F_Close(file);
// Clear the path so the caller knows it's in the buffer.
strcpy(path, "");
return true; // Got it!
}

lumpnum = W_CheckNumForName(def->lumpname);
if(lumpnum < 0) return false; // No such lump.
Expand Down

0 comments on commit f97f24a

Please sign in to comment.