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
|
diff -ur ../faces-DIST/compface/file.c ./compface/file.c
--- ../faces-DIST/compface/file.c Wed Jun 19 16:29:13 1991
+++ ./compface/file.c Fri Oct 1 14:32:06 1999
@@ -15,6 +15,8 @@
#include "compface.h"
+int xbitmap=0;
+
void
BigRead(fbuf)
register char *fbuf;
@@ -127,10 +129,19 @@
{
register char *s, *t;
register int i, bits, digits, words;
+ extern int xbitmap;
+ int digsperword = DIGSPERWORD;
+ int wordsperline = WORDSPERLINE;
s = F;
t = fbuf;
bits = digits = words = i = 0;
+ if (xbitmap) {
+ sprintf(t,"#define noname_width 48\n#define noname_height 48\nstatic char noname_bits[] = {\n ");
+ while (*t) t++;
+ digsperword = 2;
+ wordsperline = 15;
+ }
while (s < F + PIXELS)
{
if ((bits == 0) && (digits == 0))
@@ -138,25 +149,43 @@
*(t++) = '0';
*(t++) = 'x';
}
- if (*(s++))
- i = i * 2 + 1;
- else
- i *= 2;
+ if (xbitmap) {
+ if (*(s++))
+ i = (i >> 1) | 0x8;
+ else
+ i >>= 1;
+ }
+ else {
+ if (*(s++))
+ i = i * 2 + 1;
+ else
+ i *= 2;
+ }
if (++bits == BITSPERDIG)
{
- *(t++) = *(i + HexDigits);
+ if (xbitmap) {
+ t++;
+ t[-(digits & 1) * 2] = *(i + HexDigits);
+ }
+ else *(t++) = *(i + HexDigits);
bits = i = 0;
- if (++digits == DIGSPERWORD)
+ if (++digits == digsperword)
{
+ if (xbitmap && (s >= F + PIXELS)) break;
*(t++) = ',';
digits = 0;
- if (++words == WORDSPERLINE)
+ if (++words == wordsperline)
{
*(t++) = '\n';
+ if (xbitmap) *(t++) = ' ';
words = 0;
}
}
}
+ }
+ if (xbitmap) {
+ sprintf(t, "}\n");
+ while (*t) t++;
}
*(t++) = '\0';
}
|