draw_border_function();
UpdateScreen_WithFrameDelay(&dst_rect2);
+
+ if (PendingEscapeKeyEvent())
+ break;
}
}
}
// only update the region of the screen that is affected from fading
UpdateScreen_WithFrameDelay(&dst_rect2);
+
+ if (PendingEscapeKeyEvent())
+ break;
}
}
else // fading in, fading out or cross-fading
// only update the region of the screen that is affected from fading
UpdateScreen_WithFrameDelay(&dst_rect);
+
+ if (PendingEscapeKeyEvent())
+ break;
}
}
SDL_PushEvent((SDL_Event *)&event);
}
+boolean PendingEscapeKeyEvent(void)
+{
+ if (PendingEvent())
+ {
+ Event event;
+
+ // check if any key press event is pending
+ if (SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYDOWN, SDL_KEYDOWN) != 1)
+ return FALSE;
+
+ // check if pressed key is "Escape" key
+ if (event.key.keysym.sym == KSYM_Escape)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
// ============================================================================
// joystick functions
void StartTextInput(int, int, int, int);
void StopTextInput(void);
void PushUserEvent(int, int, int);
+boolean PendingEscapeKeyEvent(void);
void InitJoysticks(void);
boolean ReadJoystick(int, int *, int *, boolean *, boolean *);