mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-11 14:38:24 +02:00
SDL_RegisterEvents() now returns 0 if it couldn't allocate any user events.
This commit is contained in:
@@ -1447,13 +1447,11 @@ SDL_bool SDL_EventEnabled(Uint32 type)
|
||||
|
||||
Uint32 SDL_RegisterEvents(int numevents)
|
||||
{
|
||||
Uint32 event_base;
|
||||
Uint32 event_base = 0;
|
||||
|
||||
if ((numevents > 0) && (SDL_userevents + numevents <= SDL_EVENT_LAST)) {
|
||||
event_base = SDL_userevents;
|
||||
SDL_userevents += numevents;
|
||||
} else {
|
||||
event_base = (Uint32)-1;
|
||||
}
|
||||
return event_base;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user