2011-02-20 02:31:34 -05:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2011-09-09 14:02:23 -04:00
|
|
|
* Additional copyright for this file:
|
|
|
|
* Copyright (C) 1995-1997 Presto Studios, Inc.
|
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2016-09-03 12:46:38 +02:00
|
|
|
*
|
2011-02-20 02:31:34 -05:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2016-09-03 12:46:38 +02:00
|
|
|
*
|
2011-02-20 02:31:34 -05:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-02-20 02:31:34 -05:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PEGASUS_GRAPHICS_H
|
|
|
|
#define PEGASUS_GRAPHICS_H
|
|
|
|
|
|
|
|
#include "common/rect.h"
|
|
|
|
#include "common/str.h"
|
|
|
|
#include "common/system.h"
|
|
|
|
#include "graphics/surface.h"
|
|
|
|
|
2011-10-02 20:52:09 -04:00
|
|
|
#include "pegasus/constants.h"
|
2011-02-20 02:31:34 -05:00
|
|
|
#include "pegasus/pegasus.h"
|
2011-09-09 14:02:23 -04:00
|
|
|
#include "pegasus/util.h"
|
2011-02-20 02:31:34 -05:00
|
|
|
|
|
|
|
namespace Pegasus {
|
|
|
|
|
2011-09-30 01:14:11 -04:00
|
|
|
class Cursor;
|
2011-09-10 10:41:36 -04:00
|
|
|
class DisplayElement;
|
2011-02-20 02:31:34 -05:00
|
|
|
class PegasusEngine;
|
2012-07-05 20:36:34 -04:00
|
|
|
class ScreenFader;
|
2011-02-20 02:31:34 -05:00
|
|
|
|
|
|
|
class GraphicsManager {
|
2011-09-30 01:14:11 -04:00
|
|
|
friend class Cursor;
|
2011-02-20 02:31:34 -05:00
|
|
|
public:
|
|
|
|
GraphicsManager(PegasusEngine *vm);
|
|
|
|
~GraphicsManager();
|
|
|
|
|
2011-09-09 14:02:23 -04:00
|
|
|
void addDisplayElement(DisplayElement *element);
|
|
|
|
void removeDisplayElement(DisplayElement *element);
|
|
|
|
void invalRect(const Common::Rect &rect);
|
2011-12-16 14:17:50 -05:00
|
|
|
DisplayOrder getBackOfActiveLayer() const { return _backLayer; }
|
|
|
|
DisplayOrder getFrontOfActiveLayer() const { return _frontLayer; }
|
2011-09-15 20:50:21 -04:00
|
|
|
void updateDisplay();
|
2011-10-18 09:37:56 -04:00
|
|
|
Graphics::Surface *getCurSurface() { return _curSurface; }
|
|
|
|
void setCurSurface(Graphics::Surface *surface) { _curSurface = surface; }
|
2011-09-15 20:50:21 -04:00
|
|
|
Graphics::Surface *getWorkArea() { return &_workArea; }
|
2011-12-16 14:17:50 -05:00
|
|
|
DisplayElement *findDisplayElement(const DisplayElementID id);
|
2011-10-16 23:44:48 -04:00
|
|
|
void shakeTheWorld(TimeValue time, TimeScale scale);
|
2011-10-28 01:43:05 -04:00
|
|
|
void enableErase();
|
|
|
|
void disableErase();
|
2012-07-05 20:36:34 -04:00
|
|
|
void enableUpdates();
|
|
|
|
void disableUpdates();
|
2011-10-02 20:52:09 -04:00
|
|
|
|
|
|
|
// These default to black
|
2012-07-05 20:41:01 -04:00
|
|
|
void doFadeOutSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, bool isBlack = true);
|
|
|
|
void doFadeInSync(const TimeValue = kOneSecondPerThirtyTicks, const TimeScale = kThirtyTicksPerSecond, bool isBlack = true);
|
2011-09-15 20:50:21 -04:00
|
|
|
|
2012-09-26 04:10:32 +02:00
|
|
|
private:
|
2011-02-20 02:31:34 -05:00
|
|
|
PegasusEngine *_vm;
|
|
|
|
|
2017-08-26 08:33:51 +02:00
|
|
|
bool _erase;
|
2011-09-09 14:02:23 -04:00
|
|
|
Common::Rect _dirtyRect;
|
2011-12-16 14:17:50 -05:00
|
|
|
DisplayOrder _backLayer, _frontLayer;
|
2011-09-09 14:02:23 -04:00
|
|
|
DisplayElement *_firstDisplayElement, *_lastDisplayElement;
|
2011-10-18 09:37:56 -04:00
|
|
|
Graphics::Surface _workArea, *_curSurface;
|
2011-10-16 23:44:48 -04:00
|
|
|
|
|
|
|
// Shake Shake Shake!
|
|
|
|
static const int kMaxShakeOffsets = 17;
|
|
|
|
Common::Point _shakeOffsets[kMaxShakeOffsets];
|
|
|
|
void newShakePoint(int32 index1, int32 index2, int32 maxRadius);
|
2012-07-05 20:36:34 -04:00
|
|
|
|
|
|
|
bool _updatesEnabled;
|
|
|
|
ScreenFader *_screenFader;
|
2011-02-20 02:31:34 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Pegasus
|
|
|
|
|
|
|
|
#endif
|