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 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (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, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef PRINCE_OBJECT_H 24 #define PRINCE_OBJECT_H 25 26 #include "image/image_decoder.h" 27 #include "graphics/surface.h" 28 29 namespace Prince { 30 31 class Object { 32 public: 33 Object(); 34 ~Object(); 35 36 int32 _x; 37 int32 _y; 38 int32 _z; 39 uint16 _width; 40 uint16 _height; 41 int32 _flags; 42 int32 _zoomTime; 43 Graphics::Surface *_zoomSurface; 44 45 // Used instead of offset in setData and getData 46 enum AttrId { 47 kObjectAddr = 0, 48 kObjectX = 4, 49 kObjectY = 6, 50 kObjectZ = 8, 51 kObjectFlags = 10, 52 kObjectZoomInSource = 12, 53 kObjectZoomInLen = 16, 54 kObjectZoomInAddr = 20, 55 kObjectZoomInTime = 24 56 }; 57 58 bool loadFromStream(Common::SeekableReadStream &stream); getSurface()59 Graphics::Surface *getSurface() const { return _surface; } 60 int32 getData(AttrId dataId); 61 void setData(AttrId dataId, int32 value); 62 63 private: 64 void loadSurface(Common::SeekableReadStream &stream); 65 Graphics::Surface *_surface; 66 }; 67 68 } // End of namespace Prince 69 70 #endif 71