1 /*
2  *  This file is part of Dune Legacy.
3  *
4  *  Dune Legacy is free software: you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation, either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  Dune Legacy is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with Dune Legacy.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef WSAVIDEOEVENT_H
19 #define WSAVIDEOEVENT_H
20 
21 #include <CutScenes/VideoEvent.h>
22 #include <FileClasses/Wsafile.h>
23 
24 /**
25     This VideoEvent is used for playing a wsa video.
26 */
27 class WSAVideoEvent : public VideoEvent {
28 public:
29 
30     /**
31         Constructor
32         \param  pWsafile            The video to play
33         \param  bCenterVertical     true = center the video vertically on the screen, false = blit the video frames at the top of the screen (default is true)
34     */
35     WSAVideoEvent(Wsafile* pWsafile, bool bCenterVertical = true);
36 
37     /// destructor
38     virtual ~WSAVideoEvent();
39 
40     /**
41         This method draws the video effect.
42         \return the milliseconds until the next frame shall be drawn.
43     */
44     virtual int draw();
45 
46     /**
47         This method checks if this VideoEvent is already finished
48         \return true, if there are no more frames to draw with this VideoEvent
49     */
50     virtual bool isFinished();
51 private:
52     int currentFrame;               ///< the current frame number relative to the start of this WSAVideoEvent
53     Wsafile* pWsafile;              ///< the video to play
54     SDL_Texture* pStreamingTexture; ///< the texture used for rendering from
55     bool bCenterVertical;           ///< true = center the video vertically on the screen, false = blit the video frames at the top of the screen
56 };
57 
58 #endif // WSAVIDEOEVENT_H
59