2012-09-08 11:43:33 +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 HOPKINS_GRAPHICS_H
|
|
|
|
#define HOPKINS_GRAPHICS_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "common/endian.h"
|
2012-09-19 11:34:23 +00:00
|
|
|
#include "common/rect.h"
|
2012-09-08 11:43:33 +00:00
|
|
|
#include "common/str.h"
|
2012-09-08 14:12:27 +00:00
|
|
|
#include "graphics/surface.h"
|
2012-09-08 11:43:33 +00:00
|
|
|
|
|
|
|
namespace Hopkins {
|
|
|
|
|
2012-09-09 09:55:05 +00:00
|
|
|
#define PALETTE_SIZE 256
|
2012-09-10 10:26:24 +00:00
|
|
|
#define PALETTE_BLOCK_SIZE (PALETTE_SIZE * 3)
|
2012-09-15 11:42:20 +00:00
|
|
|
#define PALETTE_EXT_BLOCK_SIZE 800
|
2012-11-16 07:32:40 +00:00
|
|
|
static const byte kSetOffset = 251;
|
|
|
|
static const byte kByteStop = 252;
|
|
|
|
static const byte k8bVal = 253;
|
|
|
|
static const byte k16bVal = 254;
|
2012-09-09 09:55:05 +00:00
|
|
|
|
2012-09-08 13:43:35 +00:00
|
|
|
struct RGB8 {
|
|
|
|
byte r;
|
|
|
|
byte g;
|
|
|
|
byte b;
|
|
|
|
};
|
|
|
|
|
2012-09-19 11:34:23 +00:00
|
|
|
class HopkinsEngine;
|
|
|
|
|
2012-09-08 13:43:35 +00:00
|
|
|
class GraphicsManager {
|
2012-09-09 09:55:05 +00:00
|
|
|
private:
|
2012-09-19 11:34:23 +00:00
|
|
|
HopkinsEngine *_vm;
|
|
|
|
|
2012-12-19 01:15:32 +00:00
|
|
|
void loadScreen(const Common::String &file);
|
2012-09-08 13:43:35 +00:00
|
|
|
public:
|
2012-12-19 01:15:32 +00:00
|
|
|
int _lockCounter;
|
2012-09-08 13:43:35 +00:00
|
|
|
bool SDL_MODEYES;
|
|
|
|
int XSCREEN;
|
|
|
|
int YSCREEN;
|
|
|
|
int WinScan;
|
2012-09-13 11:08:54 +00:00
|
|
|
byte SD_PIXELS[PALETTE_SIZE * 2];
|
2012-09-08 13:43:35 +00:00
|
|
|
byte *PAL_PIXELS;
|
2012-12-19 07:00:22 +00:00
|
|
|
int _lineNbr;
|
2012-12-23 19:36:08 +00:00
|
|
|
byte _colorTable[PALETTE_EXT_BLOCK_SIZE];
|
2012-12-23 18:08:23 +00:00
|
|
|
byte _palette[PALETTE_EXT_BLOCK_SIZE];
|
2012-12-23 19:36:08 +00:00
|
|
|
byte _oldPalette[PALETTE_EXT_BLOCK_SIZE];
|
2012-12-19 01:15:32 +00:00
|
|
|
Graphics::Surface *_videoPtr;
|
|
|
|
byte *_vesaScreen;
|
|
|
|
byte *_vesaBuffer;
|
2013-01-01 12:53:07 +00:00
|
|
|
int _scrollOffset;
|
2012-09-09 09:55:05 +00:00
|
|
|
int SCROLL;
|
|
|
|
byte HEADER_PCX[128];
|
2013-01-01 20:03:24 +00:00
|
|
|
bool _largeScreenFl;
|
2012-09-09 09:55:05 +00:00
|
|
|
int OLD_SCROLL;
|
2012-12-19 01:15:32 +00:00
|
|
|
bool MANU_SCROLL;
|
2012-12-30 17:51:47 +00:00
|
|
|
int _scrollSpeed;
|
2012-12-19 07:00:22 +00:00
|
|
|
int _lineNbr2;
|
2012-09-09 09:55:05 +00:00
|
|
|
int Agr_x, Agr_y;
|
|
|
|
int Agr_Flag_x, Agr_Flag_y;
|
2013-01-03 21:32:22 +00:00
|
|
|
int _fadeDefaultSpeed;
|
2012-09-15 00:27:15 +00:00
|
|
|
int FADE_LINUX;
|
2012-12-19 01:15:32 +00:00
|
|
|
bool _skipVideoLockFl;
|
2012-09-15 03:23:46 +00:00
|
|
|
int no_scroll;
|
2012-09-19 11:34:23 +00:00
|
|
|
Common::Rect dstrect[50];
|
2012-09-20 10:54:03 +00:00
|
|
|
int min_x, min_y;
|
|
|
|
int max_x, max_y;
|
|
|
|
int clip_x, clip_y;
|
|
|
|
int clip_x1, clip_y1;
|
|
|
|
bool clip_flag;
|
2012-09-21 10:54:26 +00:00
|
|
|
int Red_x, Red_y;
|
|
|
|
int Red;
|
2012-12-17 23:37:52 +00:00
|
|
|
int _width;
|
2012-09-21 10:54:26 +00:00
|
|
|
int Compteur_y;
|
|
|
|
int spec_largeur;
|
2012-12-26 21:02:48 +00:00
|
|
|
bool _noFadingFl;
|
2012-09-08 13:43:35 +00:00
|
|
|
public:
|
|
|
|
GraphicsManager();
|
2012-09-08 14:12:27 +00:00
|
|
|
~GraphicsManager();
|
2012-09-19 11:34:23 +00:00
|
|
|
void setParent(HopkinsEngine *vm);
|
2012-09-08 13:43:35 +00:00
|
|
|
|
2012-12-19 01:15:32 +00:00
|
|
|
void setGraphicalMode(int width, int height);
|
|
|
|
void lockScreen();
|
|
|
|
void unlockScreen();
|
|
|
|
void clearScreen();
|
|
|
|
void loadImage(const Common::String &file);
|
|
|
|
void loadVgaImage(const Common::String &file);
|
2012-12-23 19:36:08 +00:00
|
|
|
void initColorTable(int minIndex, int maxIndex, byte *palette);
|
2012-12-19 01:15:32 +00:00
|
|
|
void scrollScreen(int amount);
|
2012-10-23 20:09:12 +00:00
|
|
|
void Trans_bloc(byte *destP, const byte *srcP, int count, int minThreshold, int maxThreshold);
|
2012-09-28 12:15:59 +00:00
|
|
|
void Trans_bloc2(byte *surface, byte *col, int size);
|
2012-09-13 11:08:54 +00:00
|
|
|
void A_PCX640_480(byte *surface, const Common::String &file, byte *palette, bool typeFlag);
|
2012-11-17 09:49:07 +00:00
|
|
|
void A_PCX320(byte *surface, const Common::String &file, byte *palette);
|
2012-12-23 18:08:23 +00:00
|
|
|
void clearPalette();
|
2012-09-13 11:08:54 +00:00
|
|
|
void SCANLINE(int pitch);
|
2012-09-09 09:55:05 +00:00
|
|
|
void m_scroll16(const byte *surface, int xs, int ys, int width, int height, int destX, int destY);
|
|
|
|
void m_scroll16A(const byte *surface, int xs, int ys, int width, int height, int destX, int destY);
|
2012-09-20 13:30:28 +00:00
|
|
|
void Copy_Vga16(const byte *surface, int xp, int yp, int width, int height, int destX, int destY);
|
2012-12-23 19:36:08 +00:00
|
|
|
void fadeIn(const byte *palette, int step, const byte *surface);
|
|
|
|
void fadeOut(const byte *palette, int step, const byte *surface);
|
2013-01-03 21:32:22 +00:00
|
|
|
void fadeInShort();
|
|
|
|
void fadeOutShort();
|
|
|
|
void fadeInLong();
|
|
|
|
void fadeOutLong();
|
|
|
|
void fadeOutDefaultLength(const byte *surface);
|
|
|
|
void fadeInDefaultLength(const byte *surface);
|
2012-12-26 07:27:32 +00:00
|
|
|
void fadeInBreakout();
|
|
|
|
void fateOutBreakout();
|
2012-09-10 10:26:24 +00:00
|
|
|
void setpal_vga256(const byte *palette);
|
2012-09-15 03:23:46 +00:00
|
|
|
void setpal_vga256_linux(const byte *palette, const byte *surface);
|
|
|
|
void SETCOLOR3(int palIndex, int r, int g, int b);
|
2012-09-28 23:33:42 +00:00
|
|
|
void SETCOLOR4(int palIndex, int r, int g, int b);
|
2012-12-23 19:36:08 +00:00
|
|
|
void changePalette(const byte *palette);
|
2012-12-26 07:27:32 +00:00
|
|
|
uint16 mapRGB(byte r, byte g, byte b);
|
2012-09-10 10:26:24 +00:00
|
|
|
void DD_VBL();
|
2012-10-13 05:41:51 +00:00
|
|
|
void Copy_WinScan_Vbe3(const byte *srcData, byte *destSurface);
|
2012-10-13 02:04:05 +00:00
|
|
|
void Copy_Video_Vbe16(const byte *srcData);
|
|
|
|
void Copy_Video_Vbe16a(const byte *srcData);
|
2012-10-29 22:08:25 +00:00
|
|
|
void Capture_Mem(const byte *srcSurface, byte *destSurface, int xs, int ys, int width, int height);
|
2012-12-14 00:49:22 +00:00
|
|
|
|
2012-09-21 21:48:21 +00:00
|
|
|
/**
|
|
|
|
* Draws a sprite onto the screen
|
|
|
|
* @param surface Destination surface
|
|
|
|
* @param spriteData The raw data for a sprite set
|
|
|
|
* @param xp X co-ordinate. For some reason, starts from 300 = first column
|
|
|
|
* @param yp Y co-ordinate. FOr some reason, starts from 300 = top row
|
|
|
|
* @param spriteIndex Index of the sprite to draw
|
|
|
|
*/
|
|
|
|
void Sprite_Vesa(byte *surface, const byte *spriteData, int xp, int yp, int spriteIndex);
|
|
|
|
|
2012-09-15 03:23:46 +00:00
|
|
|
void FIN_VISU();
|
|
|
|
void VISU_ALL();
|
2012-09-17 06:53:21 +00:00
|
|
|
void RESET_SEGMENT_VESA();
|
2013-01-01 23:57:00 +00:00
|
|
|
void addVesaSegment(int x1, int y1, int x2, int y2);
|
|
|
|
void displayVesaSegment();
|
2012-11-17 09:49:07 +00:00
|
|
|
void AFFICHE_SPEEDVGA(const byte *objectData, int xp, int yp, int idx);
|
2012-09-19 11:34:23 +00:00
|
|
|
void CopyAsm(const byte *surface);
|
2013-01-05 15:02:25 +00:00
|
|
|
void copy16bFromSurfaceScaleX2(const byte *surface);
|
2012-10-24 23:43:31 +00:00
|
|
|
void Restore_Mem(byte *destSurface, const byte *src, int xp, int yp, int width, int height);
|
2012-12-15 21:46:09 +00:00
|
|
|
int zoomIn(int v, int percentage);
|
|
|
|
int zoomOut(int v, int percentage);
|
2012-11-01 11:35:33 +00:00
|
|
|
void Affiche_Perfect(byte *surface, const byte *srcData, int xp300, int yp300, int frameIndex, int zoom1, int zoom2, int modeFlag);
|
2012-12-25 01:25:13 +00:00
|
|
|
void fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex);
|
2012-09-28 12:15:59 +00:00
|
|
|
void SCOPY(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY);
|
2012-09-23 00:59:52 +00:00
|
|
|
void Copy_Mem(const byte *srcSurface, int x1, int y1, unsigned int width, int height, byte *destSurface, int destX, int destY);
|
2012-12-24 00:43:37 +00:00
|
|
|
void displayFont(byte *surface, const byte *spriteData, int xp, int yp, int characterIndex, int colour);
|
2012-09-28 12:15:59 +00:00
|
|
|
void INI_ECRAN(const Common::String &file);
|
|
|
|
void INI_ECRAN2(const Common::String &file);
|
2012-10-29 22:08:25 +00:00
|
|
|
void OPTI_INI(const Common::String &file, int mode);
|
2012-09-28 12:15:59 +00:00
|
|
|
void NB_SCREEN();
|
2012-10-03 12:15:39 +00:00
|
|
|
void SHOW_PALETTE();
|
2012-10-04 22:09:09 +00:00
|
|
|
void Copy_WinScan_Vbe(const byte *srcP, byte *destP);
|
|
|
|
void Copy_Video_Vbe(const byte *src);
|
2012-10-24 10:54:54 +00:00
|
|
|
void Reduc_Ecran(const byte *srcSruface, byte *destSurface, int xp, int yp, int width, int height, int zoom);
|
2012-12-17 23:37:52 +00:00
|
|
|
void drawHorizontalLine(byte *surface, int xp, int yp, unsigned int width, byte col);
|
|
|
|
void drawVerticalLine(byte *surface, int xp, int yp, int height, byte col);
|
2012-09-09 09:55:05 +00:00
|
|
|
};
|
|
|
|
|
2012-09-08 11:43:33 +00:00
|
|
|
} // End of namespace Hopkins
|
|
|
|
|
|
|
|
#endif /* HOPKINS_GRAPHICS_H */
|