extract CEditorSound into separate header file

This commit is contained in:
marmare314 2023-08-28 18:02:09 +02:00
parent 5f60d68e8b
commit d68029a252
7 changed files with 40 additions and 25 deletions

View file

@ -2330,6 +2330,7 @@ if(CLIENT)
mapitems/map.cpp
mapitems/map_io.cpp
mapitems/sound.cpp
mapitems/sound.h
popups.cpp
proof_mode.cpp
proof_mode.h

View file

@ -32,6 +32,7 @@
#include <game/localization.h>
#include <game/editor/mapitems/image.h>
#include <game/editor/mapitems/sound.h>
#include "auto_map.h"
#include "editor.h"

View file

@ -330,30 +330,7 @@ public:
};
class CEditorImage;
class CEditorSound
{
public:
CEditor *m_pEditor;
CEditorSound(CEditor *pEditor)
{
m_pEditor = pEditor;
m_aName[0] = 0;
m_SoundID = 0;
m_pData = nullptr;
m_DataSize = 0;
}
~CEditorSound();
int m_SoundID;
char m_aName[IO_MAX_PATH_LENGTH];
void *m_pData;
unsigned m_DataSize;
};
class CEditorSound;
class CEditorMap
{

View file

@ -12,6 +12,7 @@
#include <game/mapitems_ex.h>
#include "image.h"
#include "sound.h"
template<typename T>
static int MakeVersion(int i, const T &v)

View file

@ -1,7 +1,9 @@
#include <game/editor/editor.h>
#include "sound.h"
#include <engine/sound.h>
#include <game/editor/editor.h>
CEditorSound::~CEditorSound()
{
m_pEditor->Sound()->UnloadSample(m_SoundID);

View file

@ -0,0 +1,32 @@
#ifndef GAME_EDITOR_MAPITEMS_SOUND_H
#define GAME_EDITOR_MAPITEMS_SOUND_H
#include <base/system.h>
class CEditor;
class CEditorSound
{
public:
CEditor *m_pEditor;
CEditorSound(CEditor *pEditor)
{
m_pEditor = pEditor;
m_aName[0] = 0;
m_SoundID = 0;
m_pData = nullptr;
m_DataSize = 0;
}
~CEditorSound();
int m_SoundID;
char m_aName[IO_MAX_PATH_LENGTH];
void *m_pData;
unsigned m_DataSize;
};
#endif

View file

@ -13,6 +13,7 @@
#include <game/client/ui_scrollregion.h>
#include <game/editor/mapitems/image.h>
#include <game/editor/mapitems/sound.h>
#include "editor.h"