Skip to content

Give OgreOggListener its own Movable Object Type name - #48

Merged
paroj merged 1 commit into
OGRECave:masterfrom
chillywillysoft:MOT
Jun 23, 2026
Merged

Give OgreOggListener its own Movable Object Type name#48
paroj merged 1 commit into
OGRECave:masterfrom
chillywillysoft:MOT

Conversation

@chillywillysoft

Copy link
Copy Markdown
Contributor

OgreOggListener's override of MovableObject::getMovableType() returns the same name as OgreOggISound. One of the main reasons for getting the type is to be able to cast the pointer to a pointer to a specific derived class, which this shared name prevents. A current workaround is to compare the pointer to the singleton's listener:

	for (Ogre::MovableObject * mo : sn->getAttachedObjects())
	{
		if ((mo->getMovableType() == OgreOggSound::OgreOggSoundFactory::FACTORY_TYPE_NAME) &&
			(mo != OgreOggSound::OgreOggSoundManager::getSingleton().getListener()))
		{
			OgreOggSound::OgreOggISound * sound = static_cast<OgreOggSound::OgreOggISound *>(mo);
		}
	}

This PR gives the Listener its own name. It also changes the constants' names to the new MOT_* style. It breaks existing code so I understand if you don't want to merge this one.

…constant names.

Note that destroyAllMovableObjectsByType() does not destroy the Listener since it wasn't created through the SceneManager. It is destroyed by _destroyListener()
@paroj

paroj commented Jun 23, 2026

Copy link
Copy Markdown
Member

sorry, I somehow forgot about this one. feel free to ping me, if you wait for an extended time without any response

@paroj
paroj merged commit f76b73a into OGRECave:master Jun 23, 2026
1 check passed
@chillywillysoft
chillywillysoft deleted the MOT branch July 28, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants