In this thread , i will relate the things that i notice while i go deeper in the code
FOR THE AUDIO ENGINE, and also the changes that i will make ( with a reason why )
There is also a task in the roadmap for the audio part in 0.5.2 :
So ... perhaps i will find time or occasion to work in it .[OPEN] (klauss) sound refactoring Phase II would add mixer channels (a feature to get seamless blending with music, comm chatter and sfx)
I notice that the naming conventions are not so well designed , and don't help for the overall understanding .
Minor thing , but minor+minor+minor+minor = horror
So in my local dev , i started to rename some non-critical functions :
in main.cpp :
Code: Select all
/// could be renamed initAudioSceneManager()
// so do it
// old name is initSceneManager()
void initAudioSceneManager()
{ ...}
Code: Select all
/// could be renamed initAudioScenes()
// so do it
// old name is initScenes()
void initAudioScenes()
Code: Select all
AUDInit();
AUDListenerGain( game_options.sound_gain );
Music::InitMuzak();
initSceneManager();// ---> you understand what ?
initALRenderer();
initScenes();// ---> you understand what ?
So my new calls look like that :
Code: Select all
AUDInit();
AUDListenerGain( game_options.sound_gain );
Music::InitMuzak();
initAudioSceneManager();
initALRenderer();
initAudioScenes();
I will continue this thread with new changes later .
' hope you will like it !
edit : other case , similar of bad naming
Code: Select all
///another case of bad naming ...
///update to closeAudioRenderer()
///old is closeRenderer()
void closeAudioRenderer()
{
cerr << "Shutting down audio renderer..." << endl; // i added audio ...
Audio::SceneManager::getSingleton()->setRenderer( SharedPtr<Audio::Renderer>() );
}
Code: Select all
...
_Universe->Loop( bootstrap_first_loop );
//Unregister commands - and cleanup memory
UninitShipCommands();
closeRenderer(); // ----> which renderer ?
cleanup();
delete _Universe;
CleanupUnitTables();
return 0;
}
Code: Select all
...
_Universe->Loop( bootstrap_first_loop );
//Unregister commands - and cleanup memory
UninitShipCommands();
closeAudioRenderer(); //--> everybody know now ...
cleanup();
delete _Universe;
CleanupUnitTables();
return 0;
}