39 |
|
|
40 |
|
struct driver comm_driver, comm_default = { |
41 |
|
comm_close, comm_clear, comm_paintr, comm_getcur, |
42 |
< |
comm_comout, comm_comin, |
43 |
< |
MAXRES, MAXRES, 0 |
42 |
> |
comm_comout, comm_comin |
43 |
|
}; |
44 |
|
|
45 |
|
FILE *devin, *devout; |
86 |
|
fflush(devout); |
87 |
|
if (getw(devin) != COM_RECVM) |
88 |
|
return(NULL); |
89 |
+ |
fread(&comm_driver.pixaspect, sizeof(comm_driver.pixaspect), 1, devin); |
90 |
|
comm_driver.xsiz = getw(devin); |
91 |
|
comm_driver.ysiz = getw(devin); |
92 |
|
/* input handling */ |
123 |
|
int xres, yres; |
124 |
|
{ |
125 |
|
putc(COM_CLEAR, devout); |
126 |
< |
fwrite(&xres, sizeof(xres), 1, devout); |
127 |
< |
fwrite(&yres, sizeof(yres), 1, devout); |
126 |
> |
putw(xres, devout); |
127 |
> |
putw(yres, devout); |
128 |
|
fflush(devout); |
129 |
|
} |
130 |
|
|
139 |
|
|
140 |
|
putc(COM_PAINTR, devout); |
141 |
|
fwrite(col, sizeof(COLOR), 1, devout); |
142 |
< |
fwrite(&xmin, sizeof(xmin), 1, devout); |
143 |
< |
fwrite(&ymin, sizeof(ymin), 1, devout); |
144 |
< |
fwrite(&xmax, sizeof(xmax), 1, devout); |
145 |
< |
fwrite(&ymax, sizeof(ymax), 1, devout); |
142 |
> |
putw(xmin, devout); |
143 |
> |
putw(ymin, devout); |
144 |
> |
putw(xmax, devout); |
145 |
> |
putw(ymax, devout); |
146 |
|
if (nrays - lastflush >= WFLUSH) { |
147 |
|
fflush(devout); |
148 |
|
lastflush = nrays; |
161 |
|
if (getc(devin) != COM_GETCUR) |
162 |
|
reply_error("getcur"); |
163 |
|
c = getc(devin); |
164 |
< |
fread(xp, sizeof(*xp), 1, devin); |
165 |
< |
fread(yp, sizeof(*yp), 1, devin); |
164 |
> |
*xp = getw(devin); |
165 |
> |
*yp = getw(devin); |
166 |
|
return(c); |
167 |
|
} |
168 |
|
|