[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Music and events



> This list has been quiet for too long, so I'll post something silly. :)
> I've had slight problems with getting USEREVENT:s delivered in our
> application, and the problem's still there. I'm lost, and I think Pete is
> too...

argh, it hurts, it hurts.
i have doublechecked the pygame code and i believe pygame is not
the problem here, something inside SDL? maybe i'll look deeper into
the SDL code if the chance arises.


> Currently we're forced to take the penalty hit that comes from throwing
> all MOUSEMOTION:s into the state machine and letting them get discarded
> there (after som processing and a few method calls).

all i can think is keep your own internal list of events to block.
and you can break out early...

    if event.type in globals.ignore_events:
        break

then you can easily maintain this list elsewhere in the code

    globals.ignore_events.append(MOUSEMOTION)
    globals.ignore_events.remove(MOUSEMOTION)

actually, using a dictionary might be faster, but with only 1
or 2 values in the list it's likely not going to matter.


> There was some problem with the music too wrt stopping it. They seem to
> still be there in the version I have. I stop() the music before exiting,
> and our app exits proberly...

again, this is strange. i've looked into the mixer/music quitting
code, and it should definitely be closing cleanly. in fact i even
added a call to Mix_HaltMusic(), which it shouldn't need, but is
the same thing music.stop() is calling. 

perhaps the recently checked in cleanup for music reference counting
will make a difference (but i don't see the problems as related?)



____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org