- sound code and most of texture code converted to FileRdr.
This allowed to remove a lot of bad pointer voodoo in the music loader, because the new class does not allow duplication of the reader object
This commit is contained in:
parent
26e948357e
commit
5fa63c396d
46 changed files with 333 additions and 307 deletions
|
|
@ -81,12 +81,12 @@ protected:
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
static bool CheckIfPatch(FileReader & file)
|
||||
static bool CheckIfPatch(FileRdr & file)
|
||||
{
|
||||
if (file.GetLength() < 13) return false; // minimum length of a valid Doom patch
|
||||
|
||||
uint8_t *data = new uint8_t[file.GetLength()];
|
||||
file.Seek(0, SEEK_SET);
|
||||
file.Seek(0, FileRdr::SeekSet);
|
||||
file.Read(data, file.GetLength());
|
||||
|
||||
const patch_t *foo = (const patch_t *)data;
|
||||
|
|
@ -129,12 +129,12 @@ static bool CheckIfPatch(FileReader & file)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FTexture *PatchTexture_TryCreate(FileReader & file, int lumpnum)
|
||||
FTexture *PatchTexture_TryCreate(FileRdr & file, int lumpnum)
|
||||
{
|
||||
patch_t header;
|
||||
|
||||
if (!CheckIfPatch(file)) return NULL;
|
||||
file.Seek(0, SEEK_SET);
|
||||
file.Seek(0, FileRdr::SeekSet);
|
||||
file >> header.width >> header.height >> header.leftoffset >> header.topoffset;
|
||||
return new FPatchTexture(lumpnum, &header);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue