ScummVM API documentation
movie_object.h
1 
2 /* ScummVM - Graphic Adventure Engine
3  *
4  * ScummVM is the legal property of its developers, whose names
5  * are too numerous to list here. Please refer to the COPYRIGHT
6  * file distributed with this source distribution.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef BAGEL_BAGLIB_MOVIE_OBJECT_H
24 #define BAGEL_BAGLIB_MOVIE_OBJECT_H
25 
26 #include "bagel/baglib/object.h"
27 #include "bagel/baglib/sound_object.h"
28 
29 namespace Bagel {
30 
31 #define ASYNCH_DONT_QUEUE 0x0001
32 #define ASYNCH_PLAY_IMMEDIATE 0x0002
33 #define ASYNCH_DONT_OVERRIDE 0x0004
34 
38 class CBagMovieObject : public CBagObject {
39 public:
40  enum class dispType { MOVIE, EXAMINE, PDA_MSG, ASYNCH_PDA_MSG };
41 
42 private:
43  dispType _xDisplayType;
44  byte _bFlyThru;
45  int16 _nAsynchFlags;
46  bool _bIncrement : 1; // Increment timer for this movie?
47  bool _bOnBlack : 1; // Play movie on a black background.
48  CBagSoundObject *_pSndObj; // associated sound object
49 
50 public:
52  virtual ~CBagMovieObject();
53 
54  // Associated sound object access members
55  void setAssociatedSound(CBagSoundObject *p) {
56  _pSndObj = p;
57  }
58 
59  CBagSoundObject *getAssociatedSound() const {
60  return _pSndObj;
61  }
62 
63  ParseCodes setInfo(CBagIfstream &istr) override;
64 
65  bool runObject() override;
66 
67  // Return true if this asynch zelda movie can play right now
68  bool asynchPDAMovieCanPlay();
69 
70  // Special routines for handling asynch zelda movies
71  void setDontQueue() {
72  _nAsynchFlags |= ASYNCH_DONT_QUEUE;
73  }
74 
75  void setDontOverride() {
76  _nAsynchFlags |= ASYNCH_DONT_OVERRIDE;
77  }
78 
79  void setPlayImmediate() {
80  _nAsynchFlags |= ASYNCH_PLAY_IMMEDIATE;
81  }
82 
83  void setIncrement(bool b = true) {
84  _bIncrement = b;
85  }
86 
87  void setOnBlack(bool b = true) {
88  _bOnBlack = b;
89  }
90 
91  bool isDontQueue() const {
92  return (_nAsynchFlags & ASYNCH_DONT_QUEUE) != 0;
93  }
94 
95  bool isDontOverride() const {
96  return (_nAsynchFlags & ASYNCH_DONT_OVERRIDE) != 0;
97  }
98 
99  bool isPlayImmediate() const {
100  return (_nAsynchFlags & ASYNCH_PLAY_IMMEDIATE) != 0;
101  }
102 
103  bool isIncrement() const {
104  return _bIncrement;
105  }
106 
107  bool isOnBlack() const {
108  return _bOnBlack;
109  }
110 };
111 
112 } // namespace Bagel
113 
114 #endif
Definition: object.h:85
Definition: movie_object.h:38
Definition: ifstream.h:31
Definition: bagel.h:31
Definition: sound_object.h:35