Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] Re: audio hotswap v3 (PR#2319)
Home

[Freeciv-Dev] Re: audio hotswap v3 (PR#2319)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: audio hotswap v3 (PR#2319)
From: "Rafa³ Bursig via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 20 Jan 2003 12:50:30 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Dnia 2003.01.20 16:24 Per I. Mathisen via RT napisa³(a):
> 
> I haven't tested it with the SDL client, and I made some changes to
> SDL
> initialization, so Rafal please look at this.
> 
Hi

I don't know if calling SDL_QuitSubSystem(SDL_INIT_AUDIO) to quit will 
be good method quit sdl ( normaly SDL_Quit() )

I ask about it in sdl mail list and got this :
/* ========================================= */
>> > I have some problem with sdl sound plugin in freeciv.
>> > This pugin can work with others clients ( than SDLClient ) and can
>> > be hotswap or reload during game.
>> 
>> > Must I use SDL_Init(SDL_INIT_AUDIO) funt. or I can run only
>> > SDL_InitSubSystem(SDL_INIT_AUDIO)) ( without run SDL_Init(...) ) ?
>> 
>> > The same question to SDL_Quit() and SDL_QuitSubSystem(...);
>> 
>> > exp.
>> > gtk client with sdl sound plugin.
>> 
>> > Run Client.
>> > Start SDL sound plugin ( run only > 
>> SDL_InitSubSystem(SDL_INIT_AUDIO))
>> > - init sdl)
>> > start game...
>> > Stop SDL sound plugin ( run only SDL_QuitSubSystem(SDL_INIT_AUDIO))
>> > - quit sdl)
>> > Start other sound plugin...
>> 
>> Yes, this should be fine on UNIX.  Windows has dependencies between
>> the window and the sound device, but that's not the case on other
>> platforms.
>> 
> Thanks ...
> 
> But it is save when I use such sdl init ( and quit ) method with 
> win32 client ( WinAPI ) ?
> 
  It should work.  You might have to call the internal SDL function
DX5_SoundFocus() with the window handle before initializing audio.
  See ya,
        -Sam Lantinga, Software Engineer, Blizzard Entertainment
/* ============================================= */

In that way we can replace :
1) quit_sdl_audio(); =>  SDL_QuitSubSystem(SDL_INIT_AUDIO);
1) init_sdl_audio(); =>

/* check if we are in win32 envir. */
#ifdef WIN32_NATIVE
   DX5_SoundFocus();
#endif
   if ( SDL_InitSubSystem(SDL_INIT_AUDIO) < 0 )
   {
     return FALSE;
   }
   atexit(SDL_Quit);

Rafal

----------------------------------------------------------------------
Poczta nowych mozliwosci >>> http://link.interia.pl/f16bc 





[Prev in Thread] Current Thread [Next in Thread]