ScummVM API documentation
graphics.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 * Additional copyright for this file:
8 * Copyright (C) 1995-1997 Presto Studios, Inc.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 */
24
25#ifndef PEGASUS_GRAPHICS_H
26#define PEGASUS_GRAPHICS_H
27
28#include "common/rect.h"
29#include "common/str.h"
30#include "common/system.h"
31#include "graphics/surface.h"
32
33#include "pegasus/constants.h"
34#include "pegasus/pegasus.h"
35#include "pegasus/util.h"
36
37namespace Pegasus {
38
39class Cursor;
40class DisplayElement;
41class PegasusEngine;
42class ScreenFader;
43
45friend class Cursor;
46public:
49
50 void addDisplayElement(DisplayElement *element);
51 void removeDisplayElement(DisplayElement *element);
52 void invalRect(const Common::Rect &rect);
53 DisplayOrder getBackOfActiveLayer() const { return _backLayer; }
54 DisplayOrder getFrontOfActiveLayer() const { return _frontLayer; }
55 void updateDisplay();
56 Graphics::Surface *getCurSurface() { return _curSurface; }
57 void setCurSurface(Graphics::Surface *surface) { _curSurface = surface; }
58 Graphics::Surface *getWorkArea() { return &_workArea; }
59 DisplayElement *findDisplayElement(const DisplayElementID id);
60 void shakeTheWorld(TimeValue time, TimeScale scale);
61 void enableErase();
62 void disableErase();
63 void enableUpdates();
64 void disableUpdates();
65
66 // These default to black
67 void doFadeOutSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, bool isBlack = true);
68 void doFadeInSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, bool isBlack = true);
69
70private:
71 PegasusEngine *_vm;
72
73 bool _erase;
74 Common::Rect _dirtyRect;
75 DisplayOrder _backLayer, _frontLayer;
76 DisplayElement *_firstDisplayElement, *_lastDisplayElement;
77 Graphics::Surface _workArea, *_curSurface;
78
79 // Shake Shake Shake!
80 static const int kMaxShakeOffsets = 17;
81 Common::Point _shakeOffsets[kMaxShakeOffsets];
82 void newShakePoint(int32 index1, int32 index2, int32 maxRadius);
83
84 bool _updatesEnabled;
85 ScreenFader *_screenFader;
86};
87
88} // End of namespace Pegasus
89
90#endif
Definition: cursor.h:44
Definition: elements.h:43
Definition: graphics.h:44
Definition: pegasus.h:70
Definition: rect.h:144
Definition: rect.h:536
Definition: atari-cursor.h:35
Definition: surface.h:67