Hi Travis,
I've just downloaded and read your C++ port of Chopper Patrol, and I'm
left with some questions. Unfortunately, like alot of other sample
SFML games I've seen everything is all wrapped up in the main
function, and all of the sounds in this case are static. That is you
never have to unload all of the game sounds, and load a lot of new
ones when the next level loads as is the case in games like Mysteries
of the Ancients.
For example, in Mysteries of the Ancients when you select pistol from
the inventory menu or select 1 on the keyboard all of the weapon sound
buffers are destroyed and then are recreated on the fly with all the
sounds for the pistol. The Same happens regardless if you select the
pistol, magnum, shotgun, whatever. That way I only have to worry about
SecondaryBuffers like g_fire, g_empty, g_draw, and g_holster which are
loaded and unloaded depending on which sound is needed at the current
time. With SFML I have not been able to find a way to do this.
To clarify things some. Let's assume we have an SFML audio buffer like
sf::Buffer g_fire;
which is global. Now, at some point in my game I am going to load the
sound of the pistol into the global buffer like
g_fire.LoadFromFile("Sounds/Fire_Pistol.wav");
which loads our pistol sound into our global sound buffer. However,
let's assume some one wants to switch to the magnum. In DirectX I can
simply close the buffer like
g_fire->Close();
g_fire = NULL;
that closes the buffer and resets the pointer to NULL. Which I think
is the problem here. In DirectX SecondaryBuffers are pointers not
objects so are never destroyed until you delete them. They allow you
to close the SecondaryBuffer but you still can use the g_fire pointer
to load a new file into the SecondaryBuffer without losing control of
the global SecondaryBuffer object. How on earth can you do something
like this in SFML?
Basically, what I am looking for is a way to close an SFML buffer equal to doing
g_fire->Close();
that doesn't destroy the actual buffer. That is if I did something like
g_fire.Close();
g_fire.LoadFromFile("some_file.wav");
it should work, but doesn't. I haven't been able to find anything that
remotely works like that in SFML. Any help?

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gam...@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to