ScummVM API documentation
secondaryvideo.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef NANCY_ACTION_SECONDARYVIDEO_H
23 #define NANCY_ACTION_SECONDARYVIDEO_H
24 
25 #include "engines/nancy/video.h"
26 #include "engines/nancy/action/actionrecord.h"
27 
28 namespace Nancy {
29 namespace Action {
30 
31 // Shows an (optionally) looping AVF video, which can move around
32 // the screen with the background frame. When hovered, the video can
33 // play a special animation instead of the normal looping one.
34 // Used for character animations _outside_ of conversations.
36 public:
37  static const byte kNoVideoHotspots = 1;
38  static const byte kVideoHotspots = 2;
39 
40  enum HoverState { kNoHover, kHover, kEndHover };
41 
43  virtual ~PlaySecondaryVideo() { _decoder.close(); }
44 
45  void init() override;
46  void updateGraphics() override;
47  void onPause(bool pause) override;
48  void handleInput(NancyInput &input) override;
49 
50  void readData(Common::SeekableReadStream &stream) override;
51  void execute() override;
52 
53  Common::Path _filename;
54  Common::Path _paletteFilename;
55  // Common::Path _bitmapOverlayFilename
56 
57  // TVD only
58  uint16 _videoFormat = kLargeVideoFormat;
59  uint16 _videoHotspots = kVideoHotspots;
60 
61  uint16 _loopFirstFrame = 0;
62  uint16 _loopLastFrame = 0;
63  uint16 _onHoverFirstFrame = 0;
64  uint16 _onHoverLastFrame = 0;
65  uint16 _onHoverEndFirstFrame = 0;
66  uint16 _onHoverEndLastFrame = 0;
67  SceneChangeDescription _sceneChange;
68 
70 
71 protected:
72  bool canHaveHotspot() const override { return true; }
73  Common::String getRecordTypeName() const override { return "PlaySecondaryVideo"; }
74  bool isViewportRelative() const override { return true; }
75 
76  Graphics::ManagedSurface _fullFrame;
77  HoverState _hoverState = kNoHover;
78  AVFDecoder _decoder;
79  int _currentViewportFrame = -1;
80  int _currentViewportScroll = -1;
81  bool _isInFrame = false;
82  bool _isHovered = false;
83 };
84 
85 } // End of namespace Action
86 } // End of namespace Nancy
87 
88 #endif // NANCY_ACTION_SECONDARYVIDEO_H
Definition: managed_surface.h:51
Definition: str.h:59
Definition: commontypes.h:151
Definition: array.h:52
Definition: path.h:52
Definition: stream.h:745
Definition: input.h:41
Definition: actionrecord.h:149
virtual void close()
Definition: video.h:41
Definition: secondaryvideo.h:35
Definition: actionmanager.h:32