mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
let CEditorSound
inherit CEditorComponent
This commit is contained in:
parent
d68029a252
commit
c3a07dd977
|
@ -549,7 +549,6 @@ bool CEditorMap::Load(const char *pFileName, int StorageType, const std::functio
|
|||
|
||||
// copy base info
|
||||
std::shared_ptr<CEditorSound> pSound = std::make_shared<CEditorSound>(m_pEditor);
|
||||
|
||||
if(pItem->m_External)
|
||||
{
|
||||
char aBuf[IO_MAX_PATH_LENGTH];
|
||||
|
|
|
@ -2,11 +2,14 @@
|
|||
|
||||
#include <engine/sound.h>
|
||||
|
||||
#include <game/editor/editor.h>
|
||||
CEditorSound::CEditorSound(CEditor *pEditor)
|
||||
{
|
||||
Init(pEditor);
|
||||
}
|
||||
|
||||
CEditorSound::~CEditorSound()
|
||||
{
|
||||
m_pEditor->Sound()->UnloadSample(m_SoundID);
|
||||
Sound()->UnloadSample(m_SoundID);
|
||||
free(m_pData);
|
||||
m_pData = nullptr;
|
||||
}
|
||||
|
|
|
@ -3,30 +3,19 @@
|
|||
|
||||
#include <base/system.h>
|
||||
|
||||
class CEditor;
|
||||
#include <game/editor/component.h>
|
||||
|
||||
class CEditorSound
|
||||
class CEditorSound : public CEditorComponent
|
||||
{
|
||||
public:
|
||||
CEditor *m_pEditor;
|
||||
|
||||
CEditorSound(CEditor *pEditor)
|
||||
{
|
||||
m_pEditor = pEditor;
|
||||
m_aName[0] = 0;
|
||||
m_SoundID = 0;
|
||||
|
||||
m_pData = nullptr;
|
||||
m_DataSize = 0;
|
||||
}
|
||||
|
||||
explicit CEditorSound(CEditor *pEditor);
|
||||
~CEditorSound();
|
||||
|
||||
int m_SoundID;
|
||||
char m_aName[IO_MAX_PATH_LENGTH];
|
||||
int m_SoundID = 0;
|
||||
char m_aName[IO_MAX_PATH_LENGTH] = "";
|
||||
|
||||
void *m_pData;
|
||||
unsigned m_DataSize;
|
||||
void *m_pData = nullptr;
|
||||
unsigned m_DataSize = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue