Make love.sound.newDecoder accept FileData, and make File->read return FileData

This commit is contained in:
Bart van Strien
2012-10-14 17:19:40 +02:00
parent e6711b2837
commit 33d7115887
7 changed files with 26 additions and 15 deletions
+2 -5
View File
@@ -51,10 +51,9 @@ const char *Sound::getName() const
return "love.sound.lullaby";
}
sound::Decoder *Sound::newDecoder(love::filesystem::File *file, int bufferSize)
sound::Decoder *Sound::newDecoder(love::filesystem::FileData *data, int bufferSize)
{
Data *data = file->read();
std::string ext = file->getExtension();
std::string ext = data->getExtension();
sound::Decoder *decoder = 0;
@@ -76,8 +75,6 @@ sound::Decoder *Sound::newDecoder(love::filesystem::File *file, int bufferSize)
// else if (OtherDecoder::accept(ext))
data->release();
return decoder;
}
+2 -2
View File
@@ -59,7 +59,7 @@ public:
const char *getName() const;
/// @copydoc love::sound::Sound::newDecoder
sound::Decoder *newDecoder(love::filesystem::File *file, int bufferSize);
sound::Decoder *newDecoder(love::filesystem::FileData *file, int bufferSize);
}; // Sound
@@ -67,4 +67,4 @@ public:
} // sound
} // love
#endif // LOVE_SOUND_LULLABY_SOUND_H
#endif // LOVE_SOUND_LULLABY_SOUND_H