2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2006-05-23 23:43:52 +00:00
|
|
|
*
|
2007-05-30 21:56:52 +00:00
|
|
|
* 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.
|
2006-05-23 23:43:52 +00: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 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-05-24 14:25:42 +00:00
|
|
|
#ifndef AGI_GRAPHICS_H
|
|
|
|
#define AGI_GRAPHICS_H
|
2006-05-23 23:43:52 +00:00
|
|
|
|
2007-09-02 22:47:53 +00:00
|
|
|
#include "agi/font.h"
|
2006-05-23 23:43:52 +00:00
|
|
|
|
|
|
|
namespace Agi {
|
|
|
|
|
|
|
|
#define GFX_WIDTH 320
|
|
|
|
#define GFX_HEIGHT 200
|
|
|
|
#define CHAR_COLS 8
|
|
|
|
#define CHAR_LINES 8
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
class AgiEngine;
|
|
|
|
|
|
|
|
class GfxMgr {
|
|
|
|
private:
|
2007-09-01 14:58:46 +00:00
|
|
|
AgiBase *_vm;
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2011-02-13 13:42:35 +00:00
|
|
|
uint8 _palette[256 * 3];
|
2007-01-16 12:40:51 +00:00
|
|
|
uint8 *_agiScreen;
|
|
|
|
unsigned char *_screen;
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
uint8 *_shakeH, *_shakeV;
|
2006-12-06 19:27:02 +00:00
|
|
|
|
2007-03-21 20:13:40 +00:00
|
|
|
uint8 _agipalPalette[16 * 3];
|
2007-03-22 22:03:21 +00:00
|
|
|
int _agipalFileNum;
|
2007-09-21 07:54:43 +00:00
|
|
|
int _currentCursorPalette; // 0 - palette not set, 1 - PC, 2 - Amiga
|
2007-03-21 20:13:40 +00:00
|
|
|
|
2007-07-10 18:08:35 +00:00
|
|
|
private:
|
|
|
|
void rawDrawButton(int x, int y, const char *s, int fgcolor, int bgcolor, bool border, int textOffset);
|
|
|
|
|
2006-12-06 19:27:02 +00:00
|
|
|
public:
|
2007-09-01 14:58:46 +00:00
|
|
|
GfxMgr(AgiBase *vm);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
void gfxPutBlock(int x1, int y1, int x2, int y2);
|
|
|
|
|
2007-09-23 16:43:43 +00:00
|
|
|
void putTextCharacter(int, int, int, unsigned char, int, int, bool checkerboard = false, const uint8 *font = curFont);
|
2006-12-06 19:27:02 +00:00
|
|
|
void shakeScreen(int);
|
|
|
|
void shakeStart();
|
|
|
|
void shakeEnd();
|
|
|
|
void saveScreen();
|
|
|
|
void restoreScreen();
|
|
|
|
|
|
|
|
int initVideo();
|
|
|
|
int deinitVideo();
|
|
|
|
void scheduleUpdate(int, int, int, int);
|
|
|
|
void doUpdate();
|
|
|
|
void putScreen();
|
|
|
|
void flushBlock(int, int, int, int);
|
|
|
|
void flushBlockA(int, int, int, int);
|
|
|
|
void putPixelsA(int, int, int, uint8 *);
|
|
|
|
void flushScreen();
|
|
|
|
void clearScreen(int);
|
|
|
|
void clearConsoleScreen(int);
|
|
|
|
void drawBox(int, int, int, int, int, int, int);
|
2007-07-10 18:08:35 +00:00
|
|
|
void drawDefaultStyleButton(int, int, const char *, int, int, int fgcolor = 0, int bgcolor = 0);
|
2007-07-10 18:32:24 +00:00
|
|
|
void drawCurrentStyleButton(int x, int y, const char *label, bool hasFocus, bool pressed = false, bool positive = true);
|
2006-12-06 19:27:02 +00:00
|
|
|
int testButton(int, int, const char *);
|
|
|
|
void drawRectangle(int, int, int, int, int);
|
|
|
|
void saveBlock(int, int, int, int, uint8 *);
|
|
|
|
void restoreBlock(int, int, int, int, uint8 *);
|
2007-11-23 10:51:16 +00:00
|
|
|
void initPalette(const uint8 *p, uint colorCount = 16, uint fromBits = 6, uint toBits = 8);
|
2007-03-21 20:13:40 +00:00
|
|
|
void setAGIPal(int);
|
2007-03-22 22:03:21 +00:00
|
|
|
int getAGIPalFileNum();
|
2006-12-06 19:27:02 +00:00
|
|
|
void drawFrame(int x1, int y1, int x2, int y2, int c1, int c2);
|
|
|
|
|
|
|
|
void putBlock(int x1, int y1, int x2, int y2);
|
|
|
|
void gfxSetPalette();
|
2009-06-06 17:39:42 +00:00
|
|
|
void setCursor(bool amigaStyleCursor = false, bool busy = false);
|
2007-09-05 21:57:57 +00:00
|
|
|
void setCursorPalette(bool amigaStylePalette = false);
|
2006-12-06 19:27:02 +00:00
|
|
|
|
|
|
|
void printCharacter(int, int, char, int, int);
|
|
|
|
int initMachine();
|
|
|
|
int deinitMachine();
|
|
|
|
};
|
2006-05-23 23:43:52 +00:00
|
|
|
|
|
|
|
} // End of namespace Agi
|
|
|
|
|
2007-01-16 12:40:51 +00:00
|
|
|
#endif /* AGI_GRAPHICS_H */
|