ScummVM API documentation
object.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 PRINCE_OBJECT_H
23 #define PRINCE_OBJECT_H
24 
25 #include "image/image_decoder.h"
26 #include "graphics/surface.h"
27 
28 namespace Prince {
29 
30 class Object {
31 public:
32  Object();
33  ~Object();
34 
35  int32 _x;
36  int32 _y;
37  int32 _z;
38  uint16 _width;
39  uint16 _height;
40  int32 _flags;
41  int32 _zoomTime;
42  Graphics::Surface *_zoomSurface;
43 
44  // Used instead of offset in setData and getData
45  enum AttrId {
46  kObjectAddr = 0,
47  kObjectX = 4,
48  kObjectY = 6,
49  kObjectZ = 8,
50  kObjectFlags = 10,
51  kObjectZoomInSource = 12,
52  kObjectZoomInLen = 16,
53  kObjectZoomInAddr = 20,
54  kObjectZoomInTime = 24
55  };
56 
57  bool loadFromStream(Common::SeekableReadStream &stream);
58  Graphics::Surface *getSurface() const { return _surface; }
59  int32 getData(AttrId dataId);
60  void setData(AttrId dataId, int32 value);
61 
62 private:
63  void loadSurface(Common::SeekableReadStream &stream);
64  Graphics::Surface *_surface;
65 };
66 
67 } // End of namespace Prince
68 
69 #endif
Definition: surface.h:67
Definition: object.h:30
Definition: stream.h:745
Definition: animation.h:30