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 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (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, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef BLADERUNNER_OVERLAYS_H 24 #define BLADERUNNER_OVERLAYS_H 25 26 #include "common/array.h" 27 #include "common/str.h" 28 29 namespace Graphics { 30 struct Surface; 31 } 32 33 namespace BladeRunner { 34 35 class BladeRunnerEngine; 36 class SaveFileReadStream; 37 class SaveFileWriteStream; 38 class VQAPlayer; 39 40 class Overlays { 41 friend class Debugger; 42 43 static const int kOverlayVideos = 5; 44 45 struct Video { 46 bool loaded; 47 VQAPlayer *vqaPlayer; 48 Common::String name; 49 int32 hash; 50 int loopId; 51 int enqueuedLoopId; 52 bool loopForever; 53 int frame; 54 }; 55 56 BladeRunnerEngine *_vm; 57 Common::Array<Video> _videos; 58 59 public: 60 Overlays(BladeRunnerEngine *vm); 61 bool init(); 62 ~Overlays(); 63 64 int play(const Common::String &name, int loopId, bool loopForever, bool startNow, int a6); 65 void resume(bool isLoadingGame); 66 void remove(const Common::String &name); 67 void removeAll(); 68 void tick(); 69 70 void save(SaveFileWriteStream &f); 71 void load(SaveFileReadStream &f); 72 73 private: 74 int findByHash(int32 hash) const; 75 int findEmpty() const; 76 77 void resetSingle(int i); 78 void reset(); 79 }; 80 81 } // End of namespace BladeRunner 82 83 #endif 84