ScummVM API documentation
actorresource.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 #ifndef DRAGONS_ACTORRESOURCE_H
22 #define DRAGONS_ACTORRESOURCE_H
23 
24 #include "common/scummsys.h"
25 #include "graphics/surface.h"
26 #include "common/stream.h"
27 
28 namespace Dragons {
29 
30 class BigfileArchive;
31 class ActorResource;
32 
33 struct ActorFrame {
34  int16 xOffset;
35  int16 yOffset;
36  uint16 width;
37  uint16 height;
38  byte *frameDataOffset;
39  uint16 flags;
40  uint16 field_c;
41  int16 field_e;
42  int16 field_10;
43 };
44 
45 enum FrameFlags {
46  FRAME_FLAG_FLIP_X = 0x800
47 };
48 
50 private:
51  BigfileArchive *_bigFileArchive;
52 
53 public:
54  ActorResourceLoader(BigfileArchive *bigFileArchive);
55  ActorResource *load(uint32 resourceId);
56 };
57 
59 public:
60  uint32 _id;
61 private:
62  byte *_data;
63  int32 _fileSize;
64  ActorFrame *_frames;
65  uint16 _framesCount;
66  byte _palette[512];
67  uint16 _sequenceTableOffset;
68  //uint16 _sequenceCount;
69 
70 public:
71  ActorResource();
72  ~ActorResource();
73  bool load(uint32 id, byte *dataStart, Common::SeekableReadStream &stream);
74  Graphics::Surface *loadFrame(ActorFrame &frameNumber, byte *palette);
75  ActorFrame *loadFrameHeader(uint16 frameOffset);
76 
77  ActorFrame *getFrameHeader(uint16 frameNumber);
78  byte *getSequenceData(int16 sequenceId);
79  byte *getSequenceDataAtOffset(uint32 offset);
80  const char *getFilename();
81  byte *getPalette();
82 
83 private:
84 };
85 
86 } // End of namespace Dragons
87 
88 #endif //DRAGONS_ACTORRESOURCE_H
Definition: surface.h:67
Definition: bigfile.h:42
Definition: actorresource.h:49
Definition: stream.h:745
Definition: actorresource.h:58
Definition: actorresource.h:33
Definition: actor.h:28