diff options
author | Filippos Karapetis | 2009-10-16 07:42:23 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-10-16 07:42:23 +0000 |
commit | 422b732dbadde0b23aaec05b39edec9e1c81f91e (patch) | |
tree | 80ce8d6063e6e60cd4e273210ac5bf9d66e56136 /graphics/video | |
parent | 9934b70733f3322e1136d805f927fb0f628d1dfc (diff) | |
download | scummvm-rg350-422b732dbadde0b23aaec05b39edec9e1c81f91e.tar.gz scummvm-rg350-422b732dbadde0b23aaec05b39edec9e1c81f91e.tar.bz2 scummvm-rg350-422b732dbadde0b23aaec05b39edec9e1c81f91e.zip |
Added a new convenience method to the video player, which adds the event of skipping videos with the escape key by default, thereby simplifying the video playing code in all places where it's used
svn-id: r45151
Diffstat (limited to 'graphics/video')
-rw-r--r-- | graphics/video/video_player.cpp | 11 | ||||
-rw-r--r-- | graphics/video/video_player.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/graphics/video/video_player.cpp b/graphics/video/video_player.cpp index 81c025d22f..a8c4ccba89 100644 --- a/graphics/video/video_player.cpp +++ b/graphics/video/video_player.cpp @@ -225,6 +225,17 @@ bool VideoPlayer::playVideo(Common::List<Common::Event> &stopEvents) { return !_skipVideo; } +bool VideoPlayer::playVideo() { + Common::Event stopEvent; + Common::List<Common::Event> stopEvents; + stopEvents.clear(); + stopEvent.type = Common::EVENT_KEYDOWN; + stopEvent.kbd = Common::KEYCODE_ESCAPE; + stopEvents.push_back(stopEvent); + + return playVideo(stopEvents); +} + void VideoPlayer::performPostProcessing(byte *screen) { } diff --git a/graphics/video/video_player.h b/graphics/video/video_player.h index eb02032b50..333c39f700 100644 --- a/graphics/video/video_player.h +++ b/graphics/video/video_player.h @@ -192,6 +192,12 @@ public: */ bool playVideo(Common::List<Common::Event> &stopEvents); + /** + * Provides the same functionality as the video player, and it adds the + * event of skipping the video with the escape key by default + */ + bool playVideo(); + protected: /** * Perform postprocessing once the frame data is copied to the screen, |