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 struct DBEntry {
39  uint32 offset;
40  uint16 compressed;
41  uint32 size;
42 };
43 
46 struct Picture {
47  uint16 flags = 0;
48  uint16 rowoff = 0;
49  uint16 miscflags = 0;
50  uint32 compsize = 0;
52 };
53 
56 
58 class DBDArchive {
59 public:
60  DBDArchive();
61  ~DBDArchive();
62 
64  bool open(const Common::Path &dbdName, const Common::Path &dbxName, bool bigEndian = false);
65  void close();
66 
67  uint32 size() const { return _index.size(); }
68 
71  bool loadEntry(uint num, Picture &out);
72 
74  bool getPicture(uint num, Picture &out) { return loadEntry(num - 1, out); }
75 
78  bool loadAnimation(uint num, Animation &out);
79 
80 private:
81  Common::File _dbd;
83  bool _bigEndian = false;
84 };
85 
86 Common::SeekableReadStream *openMacResource(const Common::Path &path,
87  uint32 typeId,
88  uint16 resourceId);
89 
90 } // End of namespace EEM
91 
92 #endif
Definition: managed_surface.h:51
uint32 size
Total entry size on disk (incl. 14-byte header).
Definition: resource.h:41
uint16 compressed
Non-zero = PKWARE DCL ("Implode") packed payload.
Definition: resource.h:40
Definition: array.h:52
Definition: path.h:52
Definition: resource.h:46
Definition: stream.h:745
uint32 offset
Byte offset in the .DBD file.
Definition: resource.h:39
.DBD + .DBX archive pair (PICS, SITES, ANI, BALLOON, BUTTON).
Definition: resource.h:58
Definition: animation.h:30
Definition: file.h:47
Definition: algorithm.h:29
Definition: resource.h:38
bool getPicture(uint num, Picture &out)
1-based wrapper matching the engine&#39;s _GetPicture(num) -> _GetFromDB(num - 1).
Definition: resource.h:74