ScummVM API documentation
sprite.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 * $URL: https://scummvm-startrek.googlecode.com/svn/trunk/graphics.h $
21 * $Id: graphics.h 2 2009-09-12 20:13:40Z clone2727 $
22 *
23 */
24
25#ifndef STARTREK_SPRITE_H
26#define STARTREK_SPRITE_H
27
28#include "startrek/bitmap.h"
29
30#include "common/ptr.h"
31#include "common/rect.h"
32#include "common/serializer.h"
33#include "common/stream.h"
34
36
37namespace StarTrek {
38
39
40// Note: Rects in Star Trek are considered to have their bottom-right pixel contained in
41// the rectangle, but ScummVM rects are not. Functions from Trek have been adapted to use
42// ScummVM's rect format. Be wary of off-by-1 errors...
43
45public:
46 Common::Point pos;
47 uint16 drawPriority;
48 uint16 drawPriority2; // If two sprites' drawPriorities are equal, this is checked.
49 Common::String field8;
50 Bitmap *bitmap;
51 uint16 drawMode;
52 uint16 textColor;
53 bool bitmapChanged;
54 bool rect2Valid;
55 bool isOnScreen;
56 bool field16; // When set, sprite isn't drawn next refresh? (Gets reset to 0 after)
57 Common::Rect lastDrawRect; // Rect encompassing the sprite last time it was drawn
58 Common::Rect drawRect; // Rect encompassing the sprite currently
59 Common::Rect rectangle2;
60 int16 drawX, drawY;
61
62 Sprite();
63 virtual ~Sprite();
64
65 void setBitmap(Bitmap *b);
66 void setBitmap(Common::MemoryReadStreamEndian *stream);
67 void setXYAndPriority(int16 x, int16 y, int16 priority);
68 void dontDrawNextFrame();
69
74
77};
78
79} // End of namespace StarTrek
80
81#endif
Definition: memstream.h:103
Definition: serializer.h:352
Definition: serializer.h:80
Definition: ptr.h:159
Definition: str.h:59
Definition: sprite.h:44
void saveLoadWithSerializer(Common::Serializer &ser) override
NOTE: even after calling this, "bitmap" must be reloaded by the caller.
Common::Rect getRect()
Definition: action.h:27
Definition: rect.h:144
Definition: rect.h:536
Definition: bitmap.h:31