2013-05-20 02:45:54 +00: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.
|
|
|
|
*
|
|
|
|
* 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 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2014-02-18 01:43:50 +00:00
|
|
|
*
|
2013-05-20 02:45:54 +00: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.
|
2014-02-18 01:43:50 +00:00
|
|
|
*
|
2013-05-20 02:45:54 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VOYEUR_GRAPHICS_H
|
|
|
|
#define VOYEUR_GRAPHICS_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2013-05-23 13:13:28 +00:00
|
|
|
#include "common/array.h"
|
2013-12-06 02:49:12 +00:00
|
|
|
#include "common/rect.h"
|
2014-01-09 04:31:34 +00:00
|
|
|
#include "common/serializer.h"
|
2013-05-20 02:45:54 +00:00
|
|
|
#include "graphics/surface.h"
|
|
|
|
|
|
|
|
namespace Voyeur {
|
|
|
|
|
2013-05-23 13:13:28 +00:00
|
|
|
#define SCREEN_WIDTH 320
|
|
|
|
#define SCREEN_HEIGHT 200
|
|
|
|
#define PALETTE_COUNT 256
|
|
|
|
#define PALETTE_SIZE (256 * 3)
|
|
|
|
|
2013-05-25 01:54:40 +00:00
|
|
|
class VoyeurEngine;
|
2013-05-25 13:58:03 +00:00
|
|
|
class GraphicsManager;
|
2013-06-01 01:03:16 +00:00
|
|
|
class DisplayResource;
|
2013-05-30 03:21:07 +00:00
|
|
|
class PictureResource;
|
|
|
|
class ViewPortResource;
|
2013-06-06 01:28:51 +00:00
|
|
|
class ViewPortListResource;
|
2013-06-11 01:29:12 +00:00
|
|
|
class FontResource;
|
2013-06-15 15:39:28 +00:00
|
|
|
class FontInfoResource;
|
2013-06-13 02:13:52 +00:00
|
|
|
class CMapResource;
|
2013-06-11 01:29:12 +00:00
|
|
|
|
2013-06-15 02:01:59 +00:00
|
|
|
class DrawInfo {
|
|
|
|
public:
|
|
|
|
int _penColor;
|
|
|
|
Common::Point _pos;
|
|
|
|
public:
|
2014-02-19 23:37:11 +00:00
|
|
|
DrawInfo(int penColor, const Common::Point &pos);
|
2013-06-11 01:29:12 +00:00
|
|
|
};
|
2013-05-25 13:58:03 +00:00
|
|
|
|
|
|
|
typedef void (GraphicsManager::*GraphicMethodPtr)();
|
2013-05-30 03:21:07 +00:00
|
|
|
typedef void (GraphicsManager::*ViewPortSetupPtr)(ViewPortResource *);
|
2013-06-01 16:35:50 +00:00
|
|
|
typedef void (GraphicsManager::*ViewPortAddPtr)(ViewPortResource *, int idx, const Common::Rect &bounds);
|
2013-05-30 03:21:07 +00:00
|
|
|
typedef void (GraphicsManager::*ViewPortRestorePtr)(ViewPortResource *);
|
2013-05-23 13:13:28 +00:00
|
|
|
|
2013-05-20 02:45:54 +00:00
|
|
|
class GraphicsManager {
|
|
|
|
public:
|
2013-05-25 01:54:40 +00:00
|
|
|
VoyeurEngine *_vm;
|
2013-05-23 13:13:28 +00:00
|
|
|
byte _VGAColors[PALETTE_SIZE];
|
2013-05-29 03:57:16 +00:00
|
|
|
PictureResource *_backgroundPage;
|
2013-05-26 00:51:53 +00:00
|
|
|
int _SVGAMode;
|
2013-06-06 01:28:51 +00:00
|
|
|
ViewPortListResource *_viewPortListPtr;
|
2013-06-01 01:03:16 +00:00
|
|
|
ViewPortResource **_vPort;
|
2013-05-31 22:40:04 +00:00
|
|
|
bool _saveBack;
|
2013-05-30 12:31:06 +00:00
|
|
|
Common::Rect *_clipPtr;
|
2013-06-01 01:31:33 +00:00
|
|
|
uint _planeSelect;
|
2013-06-01 23:38:50 +00:00
|
|
|
Graphics::Surface _screenSurface;
|
2013-06-13 02:13:52 +00:00
|
|
|
CMapResource *_backColors;
|
2013-06-15 15:39:28 +00:00
|
|
|
FontInfoResource *_fontPtr;
|
2014-01-18 19:38:33 +00:00
|
|
|
PictureResource *_fontChar;
|
2013-06-15 02:01:59 +00:00
|
|
|
DrawInfo *_drawPtr;
|
|
|
|
DrawInfo _defaultDrawInfo;
|
2013-05-25 01:54:40 +00:00
|
|
|
private:
|
2013-06-01 16:35:50 +00:00
|
|
|
void restoreBack(Common::Array<Common::Rect> &rectList, int rectListCount,
|
|
|
|
PictureResource *srcPic, PictureResource *destPic);
|
2013-05-22 12:29:24 +00:00
|
|
|
public:
|
|
|
|
GraphicsManager();
|
2013-06-01 23:38:50 +00:00
|
|
|
~GraphicsManager();
|
2013-05-25 01:54:40 +00:00
|
|
|
void setVm(VoyeurEngine *vm) { _vm = vm; }
|
2013-05-23 13:13:28 +00:00
|
|
|
void sInitGraphics();
|
2013-05-22 12:29:24 +00:00
|
|
|
|
2013-05-30 03:21:07 +00:00
|
|
|
void setupMCGASaveRect(ViewPortResource *viewPort);
|
2013-06-01 16:35:50 +00:00
|
|
|
void addRectOptSaveRect(ViewPortResource *viewPort, int idx, const Common::Rect &bounds);
|
2013-05-30 03:21:07 +00:00
|
|
|
void restoreMCGASaveRect(ViewPortResource *viewPort);
|
2013-06-01 16:35:50 +00:00
|
|
|
void addRectNoSaveBack(ViewPortResource *viewPort, int idx, const Common::Rect &bounds);
|
2013-05-30 12:31:06 +00:00
|
|
|
|
2013-06-20 03:02:40 +00:00
|
|
|
void sDrawPic(DisplayResource *srcDisplay, DisplayResource *destDisplay, const Common::Point &initialOffset);
|
2013-06-13 02:13:52 +00:00
|
|
|
void fillPic(DisplayResource *display, byte onOff = 0);
|
2013-06-01 01:31:33 +00:00
|
|
|
void sDisplayPic(PictureResource *pic);
|
2013-12-19 03:01:16 +00:00
|
|
|
void drawANumber(DisplayResource *display, int num, const Common::Point &pt);
|
2013-06-01 01:03:16 +00:00
|
|
|
void flipPage();
|
2013-06-06 01:28:51 +00:00
|
|
|
void clearPalette();
|
2013-06-22 15:57:51 +00:00
|
|
|
void setPalette(const byte *palette, int start, int count);
|
2014-01-20 23:31:50 +00:00
|
|
|
void setPalette128(const byte *palette, int start, int count);
|
2013-06-08 21:51:41 +00:00
|
|
|
void resetPalette();
|
2013-06-21 01:24:30 +00:00
|
|
|
void setColor(int idx, byte r, byte g, byte b);
|
2013-12-18 13:53:44 +00:00
|
|
|
void setOneColor(int idx, byte r, byte g, byte b);
|
2014-01-03 00:28:31 +00:00
|
|
|
void setColors(int start, int count, const byte *pal);
|
2013-06-06 01:28:51 +00:00
|
|
|
void screenReset();
|
2013-12-15 03:27:16 +00:00
|
|
|
void fadeDownICF1(int steps);
|
2014-02-19 23:37:11 +00:00
|
|
|
void fadeUpICF1(int steps = 0);
|
2013-12-15 03:27:16 +00:00
|
|
|
void fadeDownICF(int steps);
|
2013-12-28 03:01:06 +00:00
|
|
|
void drawDot();
|
2014-01-09 04:31:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronizes the game data
|
|
|
|
*/
|
|
|
|
void synchronize(Common::Serializer &s);
|
2013-05-20 02:45:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Voyeur
|
|
|
|
|
2013-05-23 13:13:28 +00:00
|
|
|
#endif /* VOYEUR_GRAPHICS_H */
|