sound/music player now responsible for calling oal_Init, due to delay-loading.
This was SVN commit r985.
This commit is contained in:
parent
6637011982
commit
4e7b132bfd
@ -10,15 +10,18 @@
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// called as late as possible, i.e. the first time sound/music is played
|
||||
// (either from module init there, or from the play routine itself).
|
||||
// this delays library load, leading to faster perceived app startup.
|
||||
// registers an atexit routine for cleanup.
|
||||
// no harm if called more than once.
|
||||
int oal_Init()
|
||||
{
|
||||
ONCE(alutInit(0, 0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int oal_Shutdown()
|
||||
{
|
||||
alutExit();
|
||||
ONCE({
|
||||
alutInit(0, 0);
|
||||
atexit(alutExit);
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -6,5 +6,3 @@
|
||||
#endif
|
||||
|
||||
extern int oal_Init();
|
||||
|
||||
extern int oal_Shutdown();
|
||||
|
@ -112,6 +112,8 @@ CMusicPlayer::~CMusicPlayer(void)
|
||||
|
||||
void CMusicPlayer::open(char *filename)
|
||||
{
|
||||
oal_Init();
|
||||
|
||||
// If a new file is opened while another is already in memory,
|
||||
// close the old one first.
|
||||
if (is_open)
|
||||
|
Loading…
Reference in New Issue
Block a user