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 TITANIC_MOVIE_CLIP_H
24 #define TITANIC_MOVIE_CLIP_H
25 
26 #include "titanic/core/list.h"
27 
28 namespace Titanic {
29 
30 enum ClipFlag {
31 	CLIPFLAG_HAS_END_FRAME = 1,
32 	CLIPFLAG_4 = 4,
33 	CLIPFLAG_HAS_START_FRAME = 8,
34 	CLIPFLAG_PLAY = 0x10
35 };
36 
37 class CGameObject;
38 
39 /**
40  * Movie clip
41  */
42 class CMovieClip : public ListItem {
43 private:
44 	Common::List<void *> _items;
45 	CString _string2;
46 	CString _string3;
47 public:
48 	CString _name;
49 	int _startFrame;
50 	int _endFrame;
51 public:
52 	CLASSDEF;
53 	CMovieClip();
54 	CMovieClip(const CString &name, int startFrame, int endFrame);
55 
56 	/**
57 	 * Save the data for the class to file
58 	 */
59 	void save(SimpleFile *file, int indent) override;
60 
61 	/**
62 	 * Load the data for the class from file
63 	 */
64 	void load(SimpleFile *file) override;
65 };
66 
67 /**
68  * Movie clip list
69  */
70 class CMovieClipList: public List<CMovieClip> {
71 public:
72 	/**
73 	 * Finds and returns a movie clip in the list by name
74 	 */
75 	CMovieClip *findByName(const Common::String &name) const;
76 
77 	/**
78 	 * Returns true if a clip exists in the list with a given name
79 	 * and starting frame number
80 	 */
81 	bool existsByStart(const CString &name, int startFrame = 0) const;
82 
83 	/**
84 	 * Returns true if a clip exists in the list with a given name
85 	 * and starting frame number
86 	 */
87 	bool existsByEnd(const CString &name, int endFrame = 0) const;
88 };
89 
90 } // End of namespace Titanic
91 
92 #endif /* TITANIC_MOVIE_CLIP_H */
93