mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-28 20:36:42 +00:00
Avoid using vector<>::data(), which requires C++11
This commit is contained in:
parent
8c4f78cc05
commit
b3caf82714
2 changed files with 6 additions and 6 deletions
|
@ -189,7 +189,7 @@ void MpgSnd_Decoder::readAll(std::vector<char> &output)
|
||||||
{
|
{
|
||||||
size_t pos = output.size();
|
size_t pos = output.size();
|
||||||
output.resize(pos + mSndInfo.frames*mSndInfo.channels*2);
|
output.resize(pos + mSndInfo.frames*mSndInfo.channels*2);
|
||||||
sf_readf_short(mSndFile, (short*)(output.data()+pos), mSndInfo.frames);
|
sf_readf_short(mSndFile, (short*)(&output[0]+pos), mSndInfo.frames);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Fallback in case we don't know the total already
|
// Fallback in case we don't know the total already
|
||||||
|
|
|
@ -222,8 +222,8 @@ void OpenAL_SoundStream::play()
|
||||||
for(ALuint i = 0;i < sNumBuffers;i++)
|
for(ALuint i = 0;i < sNumBuffers;i++)
|
||||||
{
|
{
|
||||||
size_t got;
|
size_t got;
|
||||||
got = mDecoder->read(data.data(), data.size());
|
got = mDecoder->read(&data[0], data.size());
|
||||||
alBufferData(mBuffers[i], mFormat, data.data(), got, mSampleRate);
|
alBufferData(mBuffers[i], mFormat, &data[0], got, mSampleRate);
|
||||||
}
|
}
|
||||||
throwALerror();
|
throwALerror();
|
||||||
|
|
||||||
|
@ -299,11 +299,11 @@ bool OpenAL_SoundStream::process()
|
||||||
if(finished)
|
if(finished)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
got = mDecoder->read(data.data(), data.size());
|
got = mDecoder->read(&data[0], data.size());
|
||||||
finished = (got < data.size());
|
finished = (got < data.size());
|
||||||
if(got > 0)
|
if(got > 0)
|
||||||
{
|
{
|
||||||
alBufferData(bufid, mFormat, data.data(), got, mSampleRate);
|
alBufferData(bufid, mFormat, &data[0], got, mSampleRate);
|
||||||
alSourceQueueBuffers(mSource, 1, &bufid);
|
alSourceQueueBuffers(mSource, 1, &bufid);
|
||||||
}
|
}
|
||||||
} while(processed > 0);
|
} while(processed > 0);
|
||||||
|
@ -595,7 +595,7 @@ ALuint OpenAL_Output::getBuffer(const std::string &fname)
|
||||||
alGenBuffers(1, &buf);
|
alGenBuffers(1, &buf);
|
||||||
throwALerror();
|
throwALerror();
|
||||||
|
|
||||||
alBufferData(buf, format, data.data(), data.size(), srate);
|
alBufferData(buf, format, &data[0], data.size(), srate);
|
||||||
mBufferCache[fname] = buf;
|
mBufferCache[fname] = buf;
|
||||||
mBufferRefs[buf] = 1;
|
mBufferRefs[buf] = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue