aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/graphics.h
blob: 1fdfbf7d97ea5235cc595e17baa501fcf8fd2dbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2006 The ScummVM project
 *
 * Copyright (C) 1999-2001 Sarien Team
 *
 * 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.
 *
 * $URL$
 * $Id$
 *
 */

#ifndef AGI_GRAPHICS_H
#define AGI_GRAPHICS_H

#include "common/stdafx.h"

namespace Agi {

#define GFX_WIDTH	320
#define GFX_HEIGHT	200
#define CHAR_COLS	8
#define CHAR_LINES	8

class AgiEngine;

class GfxMgr {
private:
	AgiEngine *_vm;

	uint8 _palette[32 * 3];
	uint8 *_agiScreen;
	unsigned char *_screen;

	uint8 *_shakeH, *_shakeV;

public:
	GfxMgr(AgiEngine *vm) {
		_vm = vm;
		_shakeH = NULL;
		_shakeV = NULL;
	}

	void gfxPutBlock(int x1, int y1, int x2, int y2);

	void putTextCharacter(int, int, int, unsigned int, int, int, bool checkerboard = false);
	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);
	void drawButton(int, int, const char *, int, int, int fgcolor = 0, int bgcolor = 0);
	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 *);
	void initPalette(uint8 *);
	void drawFrame(int x1, int y1, int x2, int y2, int c1, int c2);

	void putPixel(int, int, int);
	void putBlock(int x1, int y1, int x2, int y2);
	void gfxSetPalette();

	int keypress();
	int getKey();
	void printCharacter(int, int, char, int, int);
	void pollTimer();
	int initMachine();
	int deinitMachine();
};

} // End of namespace Agi

#endif /* AGI_GRAPHICS_H */