ScummVM API documentation
decfile.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  * This file is dual-licensed.
22  * In addition to the GPLv3 license mentioned above, this code is also
23  * licensed under LGPL 2.1. See LICENSES/COPYING.LGPL file for the
24  * full text of the license.
25  *
26  */
27 
28 #ifndef GOB_DECFILE_H
29 #define GOB_DECFILE_H
30 
31 #include "common/system.h"
32 
33 namespace Common {
34  class String;
35  class SeekableReadStreamEndian;
36 }
37 
38 namespace Gob {
39 
40 class GobEngine;
41 class Surface;
42 class CMPFile;
43 
51 class DECFile {
52 public:
53  DECFile(GobEngine *vm, const Common::String &fileName,
54  uint16 width, uint16 height, uint8 bpp = 1);
55  ~DECFile();
56 
58  void draw(Surface &dest) const;
59 
61  void drawBackdrop(Surface &dest) const;
62 
64  void drawLayer(Surface &dest, uint16 layer, uint16 part,
65  uint16 x, uint16 y, int32 transp = -1) const;
66 
67 private:
68  struct Part {
69  uint8 layer;
70  uint8 part;
71 
72  uint16 x;
73  uint16 y;
74  bool transp;
75  };
76 
79 
80  GobEngine *_vm;
81 
82  uint16 _width;
83  uint16 _height;
84  uint8 _bpp;
85 
86  byte _hasPadding;
87 
88  CMPFile *_backdrop;
89 
90  LayerArray _layers;
91  PartArray _parts;
92 
93 
94  void load(Common::SeekableReadStreamEndian &dec, const Common::String &fileName);
95 
96  void loadBackdrop(Common::SeekableReadStreamEndian &dec);
97 
99 
100  void loadParts(Common::SeekableReadStreamEndian &dec);
101  void loadPart(Part &part, Common::SeekableReadStreamEndian &dec);
102 };
103 
104 } // End of namespace Gob
105 
106 #endif // GOB_DECFILE_H
Definition: decfile.h:51
Definition: gob.h:163
Definition: str.h:59
Definition: anifile.h:40
Definition: cmpfile.h:49
Definition: algorithm.h:29
Definition: surface.h:100
Definition: stream.h:944