aboutsummaryrefslogtreecommitdiff
path: root/sky/text.h
blob: 4be27c423747e07eb2df73ec8c035cfd581017de (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
100
101
102
103
104
105
106
107
108
109
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2003 The ScummVM project
 *
 * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Header$
 *
 */

#ifndef SKYTEXT_H
#define SKYTEXT_H

#include "sky/disk.h"

class SkyText {
public:
	SkyText(SkyDisk *skyDisk, uint32 gameVersion);
	void getText(uint32 textNr, void **itemList, uint16 language);
	void displayText(uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
	void displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color);
	void makeGameCharacter(char textChar, uint8 *charSet, uint8 *&data, uint8 color);

protected:
	bool getTBit();
	void fnSetFont(uint32 fontNr);
	virtual char getTextChar() = 0;

	SkyDisk *_skyDisk;
	uint32	_gameVersion;
	uint8	_inputValue;
	uint8	_shiftBits;
	uint8	*_textItemPtr;

	struct charSet {
		uint8 *addr;
		uint32 charHeight;
		uint32 charSpacing;
	} _mainCharacterSet, _linkCharacterSet, _controlCharacterSet;	
	
	uint32	_curCharSet;
	uint8	*_characterSet;
	uint8	_charHeight;
	uint8	*_preAfterTableArea;

	char _textBuffer[1024];
	uint8 _centreTable[40];
	
	uint8	*_mouseTextData;	//space for the mouse text
	uint8	_dtCol;
	uint16	_dtLineWidth;	//width of line in pixels
	uint32	_dtLines;	//no of lines to do
	uint32	_dtLineSize;	//size of one line in bytes
	uint8	*_dtData;	//address of textdata
	uint32	_dtLetters;	//no of chars in message
	char	*_dtText;	//pointer to text
	uint32	_dtCharSpacing;	//character seperation adjustment
	uint32	_dtWidth;	//width of chars in last line (for editing (?))
	uint32	_dtLastWidth;
	bool	_dtCentre;	//set for centre text
};

class SkyText_v00267 : public SkyText {
public:
	SkyText_v00267(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
protected:
	char getTextChar();
};

class SkyText_v00288 : public SkyText {
public:
	SkyText_v00288(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
protected:
	char getTextChar();
};

class SkyText_v00303 : public SkyText {
public:
	SkyText_v00303(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
protected:
	char getTextChar();
};

class SkyText_v00331 : public SkyText {
public:
	SkyText_v00331(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
protected:
	char getTextChar();
};

class SkyText_v00372 : public SkyText {
public:
	SkyText_v00372(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
protected:
	char getTextChar();
};

#endif