Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion oggsound/include/OgreOggISound.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ namespace OgreOggSound
inline ALuint getSource() const { return mSource; }
/** Gets the sounds file name
*/
virtual const Ogre::String& getFileName( void ) const { return mAudioStream ? Ogre::BLANKSTRING : mAudioStream->getName(); }
virtual const Ogre::String& getFileName( void ) const { return mAudioStream ? mAudioStream->getName() : Ogre::BLANKSTRING; }
/** Gets the sounds priority
*/
inline Ogre::uint8 getPriority() const { return mPriority; }
Expand Down
14 changes: 7 additions & 7 deletions oggsound/include/OgreOggListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ namespace OgreOggSound
Overridden function from MovableObject, returns a
Sound object string for identification.
*/
virtual const Ogre::String& getMovableType(void) const;
const Ogre::String& getMovableType(void) const override;
/** Gets the bounding box of this object.
@remarks
Overridden function from MovableObject, provides a
bounding box for this object.
*/
virtual const Ogre::AxisAlignedBox& getBoundingBox(void) const;
const Ogre::AxisAlignedBox& getBoundingBox(void) const override;
/** Gets the bounding radius of this object.
@remarks
Overridden function from MovableObject, provides the
bounding radius for this object.
*/
virtual float getBoundingRadius(void) const;
float getBoundingRadius(void) const override;
#if !AV_OGRE_NEXT_VERSION
void _updateRenderQueue(Ogre::RenderQueue *queue) override {}
void visitRenderables(Ogre::Renderable::Visitor* visitor, bool debugRenderables) override {}
Expand All @@ -117,22 +117,22 @@ namespace OgreOggSound
@remarks
Overridden function from MovableObject.
*/
virtual void _notifyAttached(
void _notifyAttached(
Ogre::Node* node
#if !AV_OGRE_NEXT_VERSION
, bool isTagPoint = false
#endif
);
) override;
#if !AV_OGRE_NEXT_VERSION
/** Moved callback
@remarks
Overridden function from MovableObject.
*/
virtual void _notifyMoved(void);
void _notifyMoved(void) override;
#else
/** Does nothing but is need for being derived from MovableObject
*/
virtual void _updateRenderQueue(Ogre::RenderQueue *queue, Ogre::Camera *camera, const Ogre::Camera *lodCamera) {}
void _updateRenderQueue(Ogre::RenderQueue *queue, Ogre::Camera *camera, const Ogre::Camera *lodCamera) override {}
#endif
/** Returns scenemanager which created this listener.
*/
Expand Down
2 changes: 1 addition & 1 deletion oggsound/include/OgreOggSoundFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace OgreOggSound
OgreOggSoundFactory() {}
~OgreOggSoundFactory() {}

static Ogre::String FACTORY_TYPE_NAME;
static const Ogre::String FACTORY_TYPE_NAME;

const Ogre::String& getType(void) const;

Expand Down
2 changes: 1 addition & 1 deletion oggsound/src/OgreOggSoundFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

namespace OgreOggSound
{
Ogre::String OgreOggSoundFactory::FACTORY_TYPE_NAME = "OgreOggISound";
const Ogre::String OgreOggSoundFactory::FACTORY_TYPE_NAME = "OgreOggISound";

//-----------------------------------------------------------------------
const Ogre::String& OgreOggSoundFactory::getType(void) const
Expand Down
25 changes: 17 additions & 8 deletions oggsound/src/OgreOggSoundManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ namespace OgreOggSound
#endif
{
Ogre::SceneManager* s = mListener->getSceneManager();
s->destroyAllMovableObjectsByType("OgreOggISound");
s->destroyAllMovableObjectsByType(OgreOggSoundFactory::FACTORY_TYPE_NAME);
}
_destroyListener();
}
Expand All @@ -242,20 +242,29 @@ namespace OgreOggSound
int minorVersion;

// Version Info
alcGetIntegerv(NULL, ALC_MINOR_VERSION, sizeof(minorVersion), &minorVersion);
ALCenum error = alcGetError(NULL);
ALCdevice* device;
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
device = NULL;
#else
device = alcOpenDevice(NULL);
#endif
alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(minorVersion), &minorVersion);
ALCenum error = alcGetError(device);
if (error != ALC_NO_ERROR)
{
OGRE_LOG_ERROR("Unable to get OpenAL Minor Version number");
return false;
}
alcGetIntegerv(NULL, ALC_MAJOR_VERSION, sizeof(majorVersion), &majorVersion);
error = alcGetError(NULL);
alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(majorVersion), &majorVersion);
error = alcGetError(device);
if (error != ALC_NO_ERROR)
{
OGRE_LOG_ERROR("Unable to get OpenAL Major Version number");
return false;
}
#if OGRE_PLATFORM != OGRE_PLATFORM_WIN32
alcCloseDevice(device);
#endif

/*
** OpenAL versions prior to 1.0 DO NOT support device enumeration, so we
Expand Down Expand Up @@ -583,7 +592,7 @@ namespace OgreOggSound

return sound;
}
else if ( file.find(".ogg") != file.npos || file.find(".OGG") != file.npos )
else if ( Ogre::StringUtil::endsWith(file, ".ogg", true) )
{
if(stream)
sound = OGRE_NEW_T(OgreOggStreamSound, Ogre::MEMCATEGORY_GENERAL)(
Expand Down Expand Up @@ -633,7 +642,7 @@ namespace OgreOggSound
#endif
return sound;
}
else if ( file.find(".wav") != file.npos || file.find(".WAV") != file.npos )
else if ( Ogre::StringUtil::endsWith(file, ".wav", true) )
{
if(stream)
sound = OGRE_NEW_T(OgreOggStreamWavSound, Ogre::MEMCATEGORY_GENERAL)(
Expand Down Expand Up @@ -1062,7 +1071,7 @@ namespace OgreOggSound
// All sources in use
// Re-use an active source
// Use either a non-playing source or a lower priority source
else
else if (!mActiveSounds.empty())
{
// Get iterator for list
ActiveList::iterator iter = mActiveSounds.begin();
Expand Down