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