ScummVM API documentation
resources.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 MADS_RESOURCES_H
23 #define MADS_RESOURCES_H
24 
25 #include "common/scummsys.h"
26 #include "common/file.h"
27 #include "common/serializer.h"
28 #include "common/str.h"
29 
30 namespace MADS {
31 
32 class MADSEngine;
33 
34 enum RESPREFIX {
35  RESPREFIX_GL = 1, RESPREFIX_SC = 2, RESPREFIX_RM = 3
36 };
37 
38 enum EXTTYPE {
39  EXT_NONE = -1, EXT_SS = 1, EXT_AA = 2, EXT_DAT = 3, EXT_HH = 4,
40  EXT_ART = 5, EXT_INT = 6
41 };
42 
43 class Resources {
44 public:
48  static void init(MADSEngine *vm);
49 
50  static Common::Path formatName(RESPREFIX resType, int id, const Common::String &ext);
51  static Common::Path formatName(int prefix, char asciiCh, int id,
52  EXTTYPE extType, const Common::String &suffix);
53  static Common::Path formatResource(const Common::String &resName, const Common::String &hagFilename);
54  static Common::Path formatAAName(int idx);
55 };
56 
60 class File : public Common::File {
61 public:
65  File() : Common::File() {}
66 
70  File(const Common::Path &filename) { openFile(filename); }
71 
75  void openFile(const Common::Path &filename);
76 };
77 
78 class SynchronizedList : public Common::Array<int> {
79 public:
83  void synchronize(Common::Serializer &s);
84 };
85 
86 } // End of namespace MADS
87 
88 #endif /* MADS_RESOURCES_H */
Definition: str.h:59
Definition: array.h:52
Definition: resources.h:60
Definition: path.h:52
Definition: resources.h:78
Definition: resources.h:43
Definition: serializer.h:79
static void init(MADSEngine *vm)
File(const Common::Path &filename)
Definition: resources.h:70
Definition: file.h:47
Definition: algorithm.h:29
Definition: mads.h:87
File()
Definition: resources.h:65
Definition: action.h:28