summaryrefslogtreecommitdiffstats
path: root/src/sound
diff options
context:
space:
mode:
authorPiotr Dziwiński <piotr.dziwinski@nsn.com>2013-02-16 22:37:43 +0100
committerPiotr Dziwiński <piotr.dziwinski@nsn.com>2013-02-17 12:11:56 +0100
commit001d37b257b126dd6ef1dced70f94ff3d2806d28 (patch)
tree1025979c635c899f196d606f7d74170e33ef4f3a /src/sound
parent45040318b026f8864d244e39f1703685ad688470 (diff)
downloadcolobot-001d37b257b126dd6ef1dced70f94ff3d2806d28.tar.gz
colobot-001d37b257b126dd6ef1dced70f94ff3d2806d28.tar.bz2
colobot-001d37b257b126dd6ef1dced70f94ff3d2806d28.zip
CInstanceManager refactoring
* removed classes managed by CInstanceManager except for CObject, CPyro, CBrain and CPhysics because of dependencies * refactored instance searching to use existing singleton instances of CApplication, CEngine and CRobotMain and calling their getter functions
Diffstat (limited to 'src/sound')
-rw-r--r--src/sound/oalsound/alsound.cpp10
-rw-r--r--src/sound/oalsound/alsound.h1
-rw-r--r--src/sound/oalsound/buffer.cpp1
-rw-r--r--src/sound/oalsound/channel.cpp3
-rw-r--r--src/sound/sound.h8
5 files changed, 4 insertions, 19 deletions
diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp
index 2e44eef..83cbeb6 100644
--- a/src/sound/oalsound/alsound.cpp
+++ b/src/sound/oalsound/alsound.cpp
@@ -15,8 +15,6 @@
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-// alsound.cpp
-
#include "alsound.h"
@@ -29,18 +27,12 @@ ALSound::ALSound()
mAudioVolume = 1.0f;
mMusicVolume = 1.0f;
mMute = false;
- mCurrentMusic = nullptr;
- auto pointer = CInstanceManager::GetInstancePointer();
- if (pointer != nullptr)
- CInstanceManager::GetInstancePointer()->AddInstance(CLASS_SOUND, this);
+ mCurrentMusic = nullptr;
}
ALSound::~ALSound()
{
- auto pointer = CInstanceManager::GetInstancePointer();
- if (pointer != nullptr)
- CInstanceManager::GetInstancePointer()->DeleteInstance(CLASS_SOUND, this);
CleanUp();
}
diff --git a/src/sound/oalsound/alsound.h b/src/sound/oalsound/alsound.h
index 530aa5e..bdf06b1 100644
--- a/src/sound/oalsound/alsound.h
+++ b/src/sound/oalsound/alsound.h
@@ -24,7 +24,6 @@
#include <AL/al.h>
-#include "common/iman.h"
#include "common/logger.h"
#include "sound/sound.h"
diff --git a/src/sound/oalsound/buffer.cpp b/src/sound/oalsound/buffer.cpp
index d76b24a..edc3d74 100644
--- a/src/sound/oalsound/buffer.cpp
+++ b/src/sound/oalsound/buffer.cpp
@@ -14,7 +14,6 @@
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-// buffer.cpp
#include "buffer.h"
diff --git a/src/sound/oalsound/channel.cpp b/src/sound/oalsound/channel.cpp
index 2b9af9b..3c8bc50 100644
--- a/src/sound/oalsound/channel.cpp
+++ b/src/sound/oalsound/channel.cpp
@@ -14,7 +14,6 @@
// * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-// channel.cpp
#include "channel.h"
@@ -349,4 +348,4 @@ void Channel::PopEnvelope()
void Channel::SetLoop(bool loop) {
mLoop = loop;
-} \ No newline at end of file
+}
diff --git a/src/sound/sound.h b/src/sound/sound.h
index d152f76..70139ea 100644
--- a/src/sound/sound.h
+++ b/src/sound/sound.h
@@ -26,7 +26,6 @@
#include "math/vector.h"
-#include "common/iman.h"
#include "common/logger.h"
#include <string>
@@ -156,11 +155,8 @@ enum SoundNext
class CSoundInterface
{
public:
- inline CSoundInterface() {
- CInstanceManager::GetInstance().AddInstance(CLASS_SOUND, this);
- //m_iMan->AddInstance(CLASS_SOUND, this);
- };
- inline virtual ~CSoundInterface() {};
+ inline CSoundInterface() {}
+ inline virtual ~CSoundInterface() {}
/** Function to initialize sound device
* \param b3D - enable support for 3D sound