ScummVM API documentation
image.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 MADS_CORE_IMAGE_H
23 #define MADS_CORE_IMAGE_H
24 
25 #include "common/stream.h"
26 
27 namespace MADS {
28 
29 struct Image {
30  int16 flags; /* refers to the index of the corresponding frame in the anim struct */
31  /* ^^ only true for images which have been anim_loaded... */
32  /* anim_view dumps these images into lists using flags to tell */
33  /* when they should be put; the flags then become actual flags */
34  /* like IMAGE_INCOMING, IMAGE_STATIC, or about to be erased, or ... */
35  byte segment_id; /* i'm a part of this segment */
36  byte series_id; /* this is my series */
37  int16 sprite_id; /* sprite within the series */
38  int16 x, y;
39  byte depth;
40  byte scale;
41 
42  static constexpr size_t SIZE = 2 + 1 + 1 + 2 + 2 + 2 + 1 + 1;
43  void load(Common::SeekableReadStream *src);
44 
45  bool equals(const Image &rhs) const {
46  return series_id == rhs.series_id && sprite_id == rhs.sprite_id &&
47  x == rhs.x && y == rhs.y && depth == rhs.depth && scale == rhs.scale;
48  }
49 };
50 
51 typedef Image *ImagePtr;
52 
53 } // namespace MADS
54 
55 #endif
Definition: image.h:29
Definition: stream.h:745
Definition: anim_timer.h:27
Definition: movie_decoder.h:32