ScummVM API documentation
resource.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 EEM_RESOURCE_H
23 #define EEM_RESOURCE_H
24 
25 #include "common/array.h"
26 #include "common/file.h"
27 #include "common/path.h"
28 #include "common/scummsys.h"
29 
30 #include "graphics/managed_surface.h"
31 
32 namespace Common {
33 class SeekableReadStream;
34 }
35 
36 namespace EEM {
37 
38 bool openDataFile(Common::File &file, const Common::Path &path);
39 
40 struct DBEntry {
41  uint32 offset;
42  uint16 compressed;
43  uint32 size;
44 };
45 
48 struct Picture {
49  uint16 flags = 0;
50  uint16 rowoff = 0;
51  uint16 miscflags = 0;
52  uint32 compsize = 0;
54 };
55 
58 
60 class DBDArchive {
61 public:
62  DBDArchive();
63  ~DBDArchive();
64 
66  bool open(const Common::Path &dbdName, const Common::Path &dbxName, bool bigEndian = false);
67  void close();
68 
69  uint32 size() const { return _index.size(); }
70 
73  bool loadEntry(uint num, Picture &out);
74 
76  bool getPicture(uint num, Picture &out) { return loadEntry(num - 1, out); }
77 
80  bool loadAnimation(uint num, Animation &out);
81 
82 private:
83  Common::File _dbd;
85  bool _bigEndian = false;
86 };
87 
88 Common::SeekableReadStream *openMacResource(const Common::Path &path,
89  uint32 typeId,
90  uint16 resourceId);
91 
93 Common::SeekableReadStream *decompressMacSound(Common::SeekableReadStream &stream);
94 
95 } // End of namespace EEM
96 
97 #endif
Definition: managed_surface.h:51
uint32 size
Total entry size on disk (incl. 14-byte header).
Definition: resource.h:43
uint16 compressed
Non-zero = PKWARE DCL ("Implode") packed payload.
Definition: resource.h:42
Definition: array.h:52
Definition: path.h:52
Definition: resource.h:48
Definition: stream.h:745
uint32 offset
Byte offset in the .DBD file.
Definition: resource.h:41
.DBD + .DBX archive pair (PICS, SITES, ANI, BALLOON, BUTTON).
Definition: resource.h:60
Definition: animation.h:30
Definition: file.h:47
Definition: algorithm.h:29
Definition: resource.h:40
bool getPicture(uint num, Picture &out)
1-based wrapper matching the engine&#39;s _GetPicture(num) -> _GetFromDB(num - 1).
Definition: resource.h:76