PDA

Click to See Complete Forum and Search --> : DirectMusic is slowing down the game


wengang
Apr 25th, 2000, 08:29 PM
Don't kill me for asking yet another question about DirectMusic, but now that i have everything working and my game (Tetris) is complete, but after I compiled it, there is one small problem.

I have the MIDI playing in the background throughout the game. A timer restarts the Music every XXX seconds (the length of the MIDI) . but every time the Midi restarts, it holds the game up for a second or even more.

I am just wondering that's typical or if there is sth I should code differently. I was basically under the impression that using DirectMusic would make the game more efficient by keeping the song loaded and ready, but it doesn't seem to be loaded when it restarts.

Any thoughts?

KENNNY
Apr 27th, 2000, 02:42 AM
what did you set AutoMasterDownload to?
Because if it's true, I think the song is unloaded from the port when it's been played, so it has to be downloaded every time it's played.
you can set it to false and download songs manually, so they stay in the port. That should sort it out...

wengang
Apr 28th, 2000, 11:48 PM
Kenny, the reason it sounds like i don't know what I'm talking about is because I don't. This is code I copied off Microsoft's website and put in my game. The last part looks like this:

Call gObjDMPerformance.SetMasterAutoDownload(True)
Call objSeg.Download(gObjDMPerformance)
Call gObjDMPerformance.PlaySegment(objSeg, 0, 0)

So if I change that value to "False" Then how do i manually download the song each time to play? I.E. what would the code look like? Thanks again for replying.

KENNNY
May 1st, 2000, 06:08 AM
you dont need to call
Call objSeg.Download(gObjDMPerformance)

because you set AutoMasterDownlaod to true.
I use AutoMaster set to true, and its fine. Try taking out the Download line :)

wengang
May 3rd, 2000, 07:48 AM
Kenny,

that was it!

thanks another million .