mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-30 10:06:35 +03:00
Added Vertex Buffer support ( cVertexBuffer base class (interface), cVertexBufferOGL fallback if gpu doesn't support VBO's, cVertexBufferVBO uses ARB Vertex Buffer Object ).
Added a Memory Manager to trace memory leaks. Fixed some memory leaks detected with the new memory manager. Added an allocator for STL ( to use it with the custom allocation seted in the memory manager ). Fixed Makefiles ( i wroke them ).
This commit is contained in:
@@ -64,10 +64,10 @@ bool cSoundBuffer::LoadFromPack( cPack* Pack, const std::string& FilePackPath )
|
||||
|
||||
bool cSoundBuffer::LoadFromMemory( const char* Data, std::size_t SizeInBytes ) {
|
||||
// Create the sound file
|
||||
std::auto_ptr<cSoundFile> File( cSoundFile::CreateRead( Data, SizeInBytes ) );
|
||||
cSoundFile * File = cSoundFile::CreateRead( Data, SizeInBytes );
|
||||
|
||||
// Open the sound file
|
||||
if ( File.get() ) {
|
||||
if ( NULL != File ) {
|
||||
// Get the sound parameters
|
||||
std::size_t NbSamples = File->GetSamplesCount();
|
||||
unsigned int ChannelsCount = File->GetChannelsCount();
|
||||
@@ -80,9 +80,14 @@ bool cSoundBuffer::LoadFromMemory( const char* Data, std::size_t SizeInBytes ) {
|
||||
cLog::instance()->Write( "Sound file loaded from memory." );
|
||||
|
||||
// Update the internal buffer with the new samples
|
||||
eeDelete( File );
|
||||
|
||||
return Update( ChannelsCount, SampleRate );
|
||||
} else {
|
||||
cLog::instance()->Write( "Failed to read audio data from file in memory" );
|
||||
|
||||
eeDelete( File );
|
||||
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user