mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
Huge engine change, replace all std::shared_ptrs
Create a new shared pointer type stdext::shared_object_ptr and stdext::shared_obj using boost::intrusive_ptr Advantages: * half memory usage * faster and lightweight Disadvantages: * using weak_ptr is not supported anymore * compiling seems slower
This commit is contained in:
@@ -38,11 +38,11 @@ class StreamSoundSource;
|
||||
class CombinedSoundSource;
|
||||
class OggSoundFile;
|
||||
|
||||
typedef std::shared_ptr<SoundSource> SoundSourcePtr;
|
||||
typedef std::shared_ptr<SoundFile> SoundFilePtr;
|
||||
typedef std::shared_ptr<SoundBuffer> SoundBufferPtr;
|
||||
typedef std::shared_ptr<StreamSoundSource> StreamSoundSourcePtr;
|
||||
typedef std::shared_ptr<CombinedSoundSource> CombinedSoundSourcePtr;
|
||||
typedef std::shared_ptr<OggSoundFile> OggSoundFilePtr;
|
||||
typedef stdext::shared_object_ptr<SoundSource> SoundSourcePtr;
|
||||
typedef stdext::shared_object_ptr<SoundFile> SoundFilePtr;
|
||||
typedef stdext::shared_object_ptr<SoundBuffer> SoundBufferPtr;
|
||||
typedef stdext::shared_object_ptr<StreamSoundSource> StreamSoundSourcePtr;
|
||||
typedef stdext::shared_object_ptr<CombinedSoundSource> CombinedSoundSourcePtr;
|
||||
typedef stdext::shared_object_ptr<OggSoundFile> OggSoundFilePtr;
|
||||
|
||||
#endif
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <framework/util/databuffer.h>
|
||||
|
||||
class SoundBuffer
|
||||
class SoundBuffer : public stdext::shared_object
|
||||
{
|
||||
public:
|
||||
SoundBuffer();
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "declarations.h"
|
||||
#include <framework/core/filestream.h>
|
||||
|
||||
class SoundFile
|
||||
class SoundFile : public stdext::shared_object
|
||||
{
|
||||
public:
|
||||
SoundFile(const FileStreamPtr& fileStream);
|
||||
|
@@ -24,8 +24,9 @@
|
||||
#define SOUNDSOURCE_H
|
||||
|
||||
#include "declarations.h"
|
||||
#include "soundbuffer.h"
|
||||
|
||||
class SoundSource
|
||||
class SoundSource : public stdext::shared_object
|
||||
{
|
||||
protected:
|
||||
SoundSource(uint sourceId) : m_sourceId(sourceId) { }
|
||||
|
Reference in New Issue
Block a user