mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Data:clone ported to minor
minor tweaks --HG-- branch : minor
This commit is contained in:
@@ -108,12 +108,27 @@ SoundData::SoundData(void *d, int samples, int sampleRate, int bitDepth, int cha
|
||||
load(samples, sampleRate, bitDepth, channels, d);
|
||||
}
|
||||
|
||||
SoundData::SoundData(const SoundData &c)
|
||||
: data(0)
|
||||
, size(0)
|
||||
, sampleRate(0)
|
||||
, bitDepth(0)
|
||||
, channels(0)
|
||||
{
|
||||
load(c.getSampleCount(), c.getSampleRate(), c.getBitDepth(), c.getChannels(), c.getData());
|
||||
}
|
||||
|
||||
SoundData::~SoundData()
|
||||
{
|
||||
if (data != 0)
|
||||
free(data);
|
||||
}
|
||||
|
||||
Data *SoundData::clone() const
|
||||
{
|
||||
return new SoundData(*this);
|
||||
}
|
||||
|
||||
void SoundData::load(int samples, int sampleRate, int bitDepth, int channels, void *newData)
|
||||
{
|
||||
if (samples <= 0)
|
||||
|
||||
Reference in New Issue
Block a user