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.
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
* 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
|
|
|
|
|
2013-05-30 03:21:07 +00:00
|
|
|
//#include "voyeur/files.h"
|
2013-05-25 01:54:40 +00:00
|
|
|
#include "voyeur/game.h"
|
2013-05-20 02:45:54 +00:00
|
|
|
#include "common/scummsys.h"
|
2013-05-23 13:13:28 +00:00
|
|
|
#include "common/array.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-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-22 12:29:24 +00:00
|
|
|
bool _palFlag;
|
2013-05-23 13:13:28 +00:00
|
|
|
byte _VGAColors[PALETTE_SIZE];
|
|
|
|
Common::Array<byte *> _colorChain;
|
2013-05-29 03:57:16 +00:00
|
|
|
PictureResource *_backgroundPage;
|
2013-05-26 00:51:53 +00:00
|
|
|
int _SVGAPage;
|
|
|
|
int _SVGAMode;
|
2013-05-31 22:40:04 +00:00
|
|
|
int _SVGAReset;
|
2013-06-06 01:28:51 +00:00
|
|
|
ViewPortListResource *_viewPortListPtr;
|
2013-06-01 01:03:16 +00:00
|
|
|
ViewPortResource **_vPort;
|
2013-05-30 12:31:06 +00:00
|
|
|
bool _MCGAMode;
|
2013-05-31 22:40:04 +00:00
|
|
|
bool _saveBack;
|
2013-05-30 12:31:06 +00:00
|
|
|
Common::Rect *_clipPtr;
|
2013-05-31 22:40:04 +00:00
|
|
|
int _screenOffset;
|
2013-06-01 01:31:33 +00:00
|
|
|
uint _planeSelect;
|
2013-06-01 16:35:50 +00:00
|
|
|
int _sImageShift;
|
2013-06-01 23:38:50 +00:00
|
|
|
Graphics::Surface _screenSurface;
|
2013-05-25 01:54:40 +00:00
|
|
|
private:
|
|
|
|
static void fadeIntFunc();
|
|
|
|
static void vDoCycleInt();
|
2013-05-25 13:58:03 +00:00
|
|
|
|
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-05-31 22:40:04 +00:00
|
|
|
void EMSMapPageHandle(int v1, int v2, int v3);
|
2013-06-01 17:01:09 +00:00
|
|
|
void sDrawPic(DisplayResource *srcDisplay, DisplayResource *destDisplay, const Common::Point &offset);
|
2013-06-08 21:51:41 +00:00
|
|
|
void GraphicsManager::fillPic(DisplayResource *display, byte onOff);
|
2013-06-01 01:31:33 +00:00
|
|
|
void sDisplayPic(PictureResource *pic);
|
2013-06-01 01:03:16 +00:00
|
|
|
void flipPage();
|
2013-06-06 01:28:51 +00:00
|
|
|
void clearPalette();
|
2013-06-08 21:51:41 +00:00
|
|
|
void resetPalette();
|
|
|
|
void setColor(int idx, int r, int g, int b);
|
2013-06-06 01:28:51 +00:00
|
|
|
void screenReset();
|
2013-05-20 02:45:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Voyeur
|
|
|
|
|
2013-05-23 13:13:28 +00:00
|
|
|
#endif /* VOYEUR_GRAPHICS_H */
|