-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKEYVIDEO.C
More file actions
93 lines (82 loc) · 2.05 KB
/
KEYVIDEO.C
File metadata and controls
93 lines (82 loc) · 2.05 KB
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
#ifndef __Malte_Video_Key__
#define __Malte_Video_Key__
#include <VIDEO\TEXT\BIOS.H>
#include <VIDEO\TEXT\DIRECT.H>
extern struct
{
Byte ColorKey;
Byte ColorShade;
Byte LeftChar;
Byte RightChar;
Byte Shade;
}
VideoKey;
void _PutVideoKey(Byte X1, Byte Y, Byte X2)
{
SetColor(VideoKey.ColorKey);
_SetCube(X1,Y,VideoKey.LeftChar);
_BarSpaceHori(X1+1,Y,X2-1);
_SetCube(X2,Y,VideoKey.RightChar);
if(VideoKey.Shade == 1)
{
SetColor(VideoKey.ColorShade);
_SetCube(X2+1,Y,'Ü');
_BarTextHori(X1+1,Y+1,X2+1,'ß');
}
}
#ifndef __PASCAL__
void _PutVideoKeyText(Byte X1, Byte Y, Byte X2, Byte *Text)
#else
void _PutVideoKeyText(Byte X1, Byte Y, Byte X2, String Text)
#endif
{
SetColor(VideoKey.ColorKey);
_SetCube(X1,Y,VideoKey.LeftChar);
_BarSpaceHori(X1+1,Y,X2-1);
_SetCube(X2,Y,VideoKey.RightChar);
#ifndef __PASCAL__
_WriteText(X1+(((X2-X1+1)-strlen(Text)) / 2),Y,Text);
#else
_WriteText(X1+(((X2-X1+1)-Text[0]) >> 1),Y,Text);
#endif
if(VideoKey.Shade == 1)
{
SetColor(VideoKey.ColorShade);
_SetCube(X2+1,Y,'Ü');
_BarTextHori(X1+1,Y+1,X2+1,'ß');
}
}
#ifndef __PASCAL__
void _PutVideoKeyTextNoShade(Byte X1, Byte Y, Byte X2, Byte *Text)
#else
void _PutVideoKeyTextNoShade(Byte X1, Byte Y, Byte X2, String Chn)
#endif
{
SetColor(VideoKey.ColorKey);
_SetCube(X1,Y,VideoKey.LeftChar);
_BarSpaceHori(X1+1,Y,X2-1);
_SetCube(X2,Y,VideoKey.RightChar);
#ifndef __PASCAL__
_WriteText(X1+(((X2-X1+1)-strlen(Text)) >> 1),Y,Text);
#else
_WriteText(X1+(((X2-X1+1)-Chn[0]) >> 1),Y,Chn);
#endif
}
#ifndef __PASCAL__
void SetColorKey(Byte ColorKey, Byte ColorShade)
{
VideoKey.ColorKey = ColorKey; VideoKey.ColorShade = ColorShade;
}
void SetShadeKey(Byte Shade)
{
VideoKey.Shade = Shade;
}
void SetVideoKey(Byte LeftKey, Byte RightKey, Byte Color, Byte ColorOmbre)
{
VideoKey.ColorShade = ColorOmbre;
VideoKey.ColorKey = Color;
VideoKey.LeftChar = LeftKey;
VideoKey.RightChar = RightKey;
}
#endif
#endif