1 | |
---|
2 | /* file MEMCH.C |
---|
3 | * ======= |
---|
4 | * |
---|
5 | * version 9, 20-May-92 |
---|
6 | * |
---|
7 | * memory channel of graphics output |
---|
8 | * K. Stammler, 9-AUG-91 |
---|
9 | */ |
---|
10 | |
---|
11 | #include <stdio.h> |
---|
12 | #include <string.h> |
---|
13 | #include BASECNST |
---|
14 | #include BC_SYSBASE |
---|
15 | #include "mfusrdef.h" |
---|
16 | #include "graphbas.h" |
---|
17 | #include "mmusrdef.h" |
---|
18 | #include "gcerrors.h" |
---|
19 | |
---|
20 | |
---|
21 | #define mmh_illchan(c) ((c)<0 || (c)>=GBC_MAXWDW) |
---|
22 | |
---|
23 | #define ID_MOVETO 1 |
---|
24 | #define ID_DRAWTO 2 |
---|
25 | #define ID_ARRAY 3 |
---|
26 | #define ID_TEXT 4 |
---|
27 | #define ID_SETSTYLE 5 |
---|
28 | #define ID_SETCOO 6 |
---|
29 | #define ID_SETPIXEL 7 |
---|
30 | |
---|
31 | /* global variables */ |
---|
32 | static int mmv_init=0; /* initialised channels */ |
---|
33 | /* setcoo values, to be restored on playback calls */ |
---|
34 | /* currcoo contains the current active coo's (set by setcoo) */ |
---|
35 | static GBC_COO mmv_currcoo_x[GBC_MAXWDW+1]; |
---|
36 | static GBC_COO mmv_currcoo_y[GBC_MAXWDW+1]; |
---|
37 | static GBC_COO mmv_currcoo_w[GBC_MAXWDW+1]={10.0,10.0,10.0,10.0,10.0,10.0,10.0}; |
---|
38 | static GBC_COO mmv_currcoo_h[GBC_MAXWDW+1]={10.0,10.0,10.0,10.0,10.0,10.0,10.0}; |
---|
39 | /* startcoo contains the coo's valid at the most recent erase command */ |
---|
40 | static GBC_COO mmv_startcoo_x[GBC_MAXWDW+1]; |
---|
41 | static GBC_COO mmv_startcoo_y[GBC_MAXWDW+1]; |
---|
42 | static GBC_COO mmv_startcoo_w[GBC_MAXWDW+1]={10.0,10.0,10.0,10.0,10.0,10.0,10.0}; |
---|
43 | static GBC_COO mmv_startcoo_h[GBC_MAXWDW+1]={10.0,10.0,10.0,10.0,10.0,10.0,10.0}; |
---|
44 | |
---|
45 | |
---|
46 | /*------------------------------------------------------------------------*/ |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | void mm_init( int wdw, STATUS *status ) |
---|
51 | |
---|
52 | /* opens memory channel |
---|
53 | * |
---|
54 | * parameters of routine |
---|
55 | * int wdw; input; channel number |
---|
56 | * STATUS *status; output; return status |
---|
57 | */ |
---|
58 | { |
---|
59 | /* local variables */ |
---|
60 | int i; /* counter */ |
---|
61 | |
---|
62 | /* executable code */ |
---|
63 | |
---|
64 | if (mmh_illchan(wdw)) return; |
---|
65 | mf_open( wdw, TRUE, "w", status ); |
---|
66 | if (Severe(status)) return; |
---|
67 | mmv_init |= (1 << wdw); |
---|
68 | |
---|
69 | for (i=0; i<=GBC_MAXWDW; i++) { |
---|
70 | mmv_startcoo_x[i] = 0.; |
---|
71 | mmv_startcoo_y[i] = 0.; |
---|
72 | mmv_startcoo_w[i] = 10.; |
---|
73 | mmv_startcoo_h[i] = 10.; |
---|
74 | mmv_currcoo_x[i] = 0.; |
---|
75 | mmv_currcoo_y[i] = 0.; |
---|
76 | mmv_currcoo_w[i] = 10.; |
---|
77 | mmv_currcoo_h[i] = 10.; |
---|
78 | } /*endif*/ |
---|
79 | |
---|
80 | } /* end of mm_init */ |
---|
81 | |
---|
82 | |
---|
83 | |
---|
84 | /*------------------------------------------------------------------------*/ |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | void mm_exit( int wdw ) |
---|
89 | |
---|
90 | /* closes memory channel |
---|
91 | * |
---|
92 | * parameters of routine |
---|
93 | * int wdw; input; channel number |
---|
94 | */ |
---|
95 | { |
---|
96 | /* local variables */ |
---|
97 | STATUS locstat=BC_NOERROR; /* local status */ |
---|
98 | |
---|
99 | /* executable code */ |
---|
100 | |
---|
101 | if (mmh_illchan(wdw)) return; |
---|
102 | mf_close( wdw, &locstat ); |
---|
103 | if (Severe(&locstat)) return; |
---|
104 | mmv_init &= ~(1 << wdw); |
---|
105 | |
---|
106 | } /* end of mm_exit */ |
---|
107 | |
---|
108 | |
---|
109 | |
---|
110 | /*------------------------------------------------------------------------*/ |
---|
111 | |
---|
112 | |
---|
113 | |
---|
114 | void mm_finish( void ) |
---|
115 | |
---|
116 | /* closes all channels |
---|
117 | * |
---|
118 | * no parameters |
---|
119 | */ |
---|
120 | { |
---|
121 | /* local variables */ |
---|
122 | int i; /* counter */ |
---|
123 | |
---|
124 | /* executable code */ |
---|
125 | |
---|
126 | /* close all channels */ |
---|
127 | for (i=0;i<GBC_MAXWDW;i++) |
---|
128 | if ((1<<i) & mmv_init) |
---|
129 | mm_exit( i ); |
---|
130 | |
---|
131 | mmv_init = 0; |
---|
132 | |
---|
133 | } /* end of mm_finish */ |
---|
134 | |
---|
135 | |
---|
136 | |
---|
137 | /*------------------------------------------------------------------------*/ |
---|
138 | |
---|
139 | |
---|
140 | |
---|
141 | void mm_setcoo( int wdw, GBC_COO x, GBC_COO y, GBC_COO w, GBC_COO h, |
---|
142 | STATUS *status ) |
---|
143 | |
---|
144 | /* sets user coordinate system |
---|
145 | * |
---|
146 | * parameters of routine |
---|
147 | * int wdw; input; window number |
---|
148 | * GBC_COO x, y, w, h; input; coordinates |
---|
149 | * STATUS *status; output; return status |
---|
150 | */ |
---|
151 | { |
---|
152 | /* executable code */ |
---|
153 | |
---|
154 | if (mmh_illchan(wdw)) return; |
---|
155 | mf_writeint( wdw, ID_SETCOO, status ); |
---|
156 | if (Severe(status)) return; |
---|
157 | mf_writereal( wdw, x, status ); |
---|
158 | if (Severe(status)) return; |
---|
159 | mf_writereal( wdw, y, status ); |
---|
160 | if (Severe(status)) return; |
---|
161 | mf_writereal( wdw, w, status ); |
---|
162 | if (Severe(status)) return; |
---|
163 | mf_writereal( wdw, h, status ); |
---|
164 | if (Severe(status)) return; |
---|
165 | |
---|
166 | mmv_currcoo_x[wdw] = x; |
---|
167 | mmv_currcoo_y[wdw] = y; |
---|
168 | mmv_currcoo_w[wdw] = w; |
---|
169 | mmv_currcoo_h[wdw] = h; |
---|
170 | |
---|
171 | } /* end of mm_setcoo */ |
---|
172 | |
---|
173 | |
---|
174 | |
---|
175 | /*------------------------------------------------------------------------*/ |
---|
176 | |
---|
177 | |
---|
178 | |
---|
179 | void mm_moveto( int wdw, GBC_COO x, GBC_COO y ) |
---|
180 | |
---|
181 | /* moves to (x,y) |
---|
182 | * |
---|
183 | * parameters of routine |
---|
184 | * int wdw; input; channel number |
---|
185 | * GBC_COO x, y; input; coordinates |
---|
186 | */ |
---|
187 | { |
---|
188 | /* local variables */ |
---|
189 | STATUS locstat=BC_NOERROR; /* local status */ |
---|
190 | |
---|
191 | /* executable code */ |
---|
192 | |
---|
193 | if (mmh_illchan(wdw)) return; |
---|
194 | mf_writeint( wdw, ID_MOVETO, &locstat ); |
---|
195 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
196 | mf_writereal( wdw, x, &locstat ); |
---|
197 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
198 | mf_writereal( wdw, y, &locstat ); |
---|
199 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
200 | |
---|
201 | } /* end of mm_moveto */ |
---|
202 | |
---|
203 | |
---|
204 | |
---|
205 | /*------------------------------------------------------------------------*/ |
---|
206 | |
---|
207 | |
---|
208 | |
---|
209 | void mm_drawto( int wdw, int style, GBC_COO x, GBC_COO y ) |
---|
210 | |
---|
211 | /* draws to (x,y) |
---|
212 | * |
---|
213 | * parameters of routine |
---|
214 | * int wdw; input; channel number |
---|
215 | * int style; input; style block number |
---|
216 | * GBC_COO x, y; input; coordinates |
---|
217 | */ |
---|
218 | { |
---|
219 | /* local variables */ |
---|
220 | STATUS locstat=BC_NOERROR; /* local status */ |
---|
221 | |
---|
222 | /* executable code */ |
---|
223 | |
---|
224 | if (mmh_illchan(wdw)) return; |
---|
225 | mf_writeint( wdw, ID_DRAWTO, &locstat ); |
---|
226 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
227 | mf_writeint( wdw, style, &locstat ); |
---|
228 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
229 | mf_writereal( wdw, x, &locstat ); |
---|
230 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
231 | mf_writereal( wdw, y, &locstat ); |
---|
232 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
233 | |
---|
234 | } /* end of mm_drawto */ |
---|
235 | |
---|
236 | |
---|
237 | |
---|
238 | /*------------------------------------------------------------------------*/ |
---|
239 | |
---|
240 | |
---|
241 | |
---|
242 | void mm_setpixel( int wdw, int style, GBC_COO x, GBC_COO y ) |
---|
243 | |
---|
244 | /* sets pixel at user coordinates (x,y) |
---|
245 | * |
---|
246 | * parameters of routine |
---|
247 | * int wdw; input; channel number |
---|
248 | * int style; input; style block number |
---|
249 | * GBC_COO x, y; input; coordinates |
---|
250 | */ |
---|
251 | { |
---|
252 | /* local variables */ |
---|
253 | STATUS locstat=BC_NOERROR; /* local status */ |
---|
254 | |
---|
255 | /* executable code */ |
---|
256 | |
---|
257 | if (mmh_illchan(wdw)) return; |
---|
258 | mf_writeint( wdw, ID_SETPIXEL, &locstat ); |
---|
259 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
260 | mf_writeint( wdw, style, &locstat ); |
---|
261 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
262 | mf_writereal( wdw, x, &locstat ); |
---|
263 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
264 | mf_writereal( wdw, y, &locstat ); |
---|
265 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
266 | |
---|
267 | } /* end of mm_setpixel */ |
---|
268 | |
---|
269 | |
---|
270 | |
---|
271 | /*------------------------------------------------------------------------*/ |
---|
272 | |
---|
273 | |
---|
274 | |
---|
275 | void mm_arrayplot( int wdw, int style, long cnt, int red, |
---|
276 | GBC_COO xoff, GBC_COO xinc, GBC_COO yoff, GBC_COO yarr[], |
---|
277 | float yzoom, STATUS *status ) |
---|
278 | |
---|
279 | /* plots an array of sample data |
---|
280 | * |
---|
281 | * parameters of routine |
---|
282 | * int wdw; input; output channels |
---|
283 | * int style; input; line style ID |
---|
284 | * long cnt; input; length of data array |
---|
285 | * int red; input; reduction factor for plotting |
---|
286 | * GBC_COO xoff; input; x-position of first sample |
---|
287 | * GBC_COO xinc; input; x increment |
---|
288 | * GBC_COO yoff; input; y-position of first sample |
---|
289 | * GBC_COO yarr[]; input; sample data |
---|
290 | * GBC_COO yzoom; input; zoom factor of sample data |
---|
291 | * STATUS *status; output; return status |
---|
292 | */ |
---|
293 | { |
---|
294 | /* local variables */ |
---|
295 | long i; /* counter */ |
---|
296 | |
---|
297 | /* executable code */ |
---|
298 | |
---|
299 | mf_writeint( wdw, ID_ARRAY, status ); |
---|
300 | if (Severe(status)) return; |
---|
301 | mf_writeint( wdw, style, status ); |
---|
302 | if (Severe(status)) return; |
---|
303 | mf_writelong( wdw, cnt, status ); |
---|
304 | if (Severe(status)) return; |
---|
305 | mf_writeint( wdw, red, status ); |
---|
306 | if (Severe(status)) return; |
---|
307 | mf_writereal( wdw, xoff, status ); |
---|
308 | if (Severe(status)) return; |
---|
309 | mf_writereal( wdw, xinc, status ); |
---|
310 | if (Severe(status)) return; |
---|
311 | mf_writereal( wdw, yoff, status ); |
---|
312 | for (i=0;i<cnt;i++) mf_writereal( wdw, *yarr++, status ); |
---|
313 | if (Severe(status)) return; |
---|
314 | mf_writereal( wdw, yzoom, status ); |
---|
315 | if (Severe(status)) return; |
---|
316 | |
---|
317 | } /* end of mm_arrayplot */ |
---|
318 | |
---|
319 | |
---|
320 | |
---|
321 | /*------------------------------------------------------------------------*/ |
---|
322 | |
---|
323 | |
---|
324 | |
---|
325 | void mm_erase( int wdw ) |
---|
326 | |
---|
327 | /* erases channel |
---|
328 | * |
---|
329 | * parameter of routine |
---|
330 | * int wdw; input; channel number |
---|
331 | */ |
---|
332 | { |
---|
333 | /* local variables */ |
---|
334 | STATUS locstat=BC_NOERROR; /* local status */ |
---|
335 | |
---|
336 | /* executable code */ |
---|
337 | |
---|
338 | mf_rewind( wdw, &locstat ); |
---|
339 | if (Severe(&locstat)) printf( "*** MM rewind error ***\n" ); |
---|
340 | mmv_startcoo_x[wdw] = mmv_currcoo_x[wdw]; |
---|
341 | mmv_startcoo_y[wdw] = mmv_currcoo_y[wdw]; |
---|
342 | mmv_startcoo_w[wdw] = mmv_currcoo_w[wdw]; |
---|
343 | mmv_startcoo_h[wdw] = mmv_currcoo_h[wdw]; |
---|
344 | |
---|
345 | } /* end of mm_erase */ |
---|
346 | |
---|
347 | |
---|
348 | |
---|
349 | /*------------------------------------------------------------------------*/ |
---|
350 | |
---|
351 | |
---|
352 | |
---|
353 | void mm_text( int wdw, int style, GBC_COO x, GBC_COO y, char text[] ) |
---|
354 | |
---|
355 | /* writes text at position (x,y) |
---|
356 | * |
---|
357 | * parameters of routine |
---|
358 | * int wdw; input; channel number |
---|
359 | * int style; input; style block number |
---|
360 | * GBC_COO x, y; input; coordinates |
---|
361 | * char text[]; input; text to be printed |
---|
362 | */ |
---|
363 | { |
---|
364 | /* local variables */ |
---|
365 | STATUS locstat=BC_NOERROR; /* local status */ |
---|
366 | |
---|
367 | /* executable code */ |
---|
368 | |
---|
369 | mf_writeint( wdw, ID_TEXT, &locstat ); |
---|
370 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
371 | mf_writeint( wdw, style, &locstat ); |
---|
372 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
373 | mf_writereal( wdw, x, &locstat ); |
---|
374 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
375 | mf_writereal( wdw, y, &locstat ); |
---|
376 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
377 | mf_writestr( wdw, text, &locstat ); |
---|
378 | if (Severe(&locstat)) printf( "*** MM store error ***\n" ); |
---|
379 | |
---|
380 | } /* end of mm_text */ |
---|
381 | |
---|
382 | |
---|
383 | |
---|
384 | /*------------------------------------------------------------------------*/ |
---|
385 | |
---|
386 | |
---|
387 | |
---|
388 | void mm_setstyle( int wdw, int style, char item[], char value[], STATUS *status ) |
---|
389 | |
---|
390 | /* writes text at position (x,y) |
---|
391 | * |
---|
392 | * parameters of routine |
---|
393 | * int wdw; input; channel number |
---|
394 | * int style; input; style block number |
---|
395 | * char item[]; input; item name |
---|
396 | * char value[]; input; value |
---|
397 | * STATUS *status; output; return status |
---|
398 | */ |
---|
399 | { |
---|
400 | /* local variables */ |
---|
401 | |
---|
402 | /* executable code */ |
---|
403 | |
---|
404 | mf_writeint( wdw, ID_SETSTYLE, status ); |
---|
405 | if (Severe(status)) printf( "*** MM store error ***\n" ); |
---|
406 | mf_writeint( wdw, style, status ); |
---|
407 | if (Severe(status)) printf( "*** MM store error ***\n" ); |
---|
408 | mf_writestr( wdw, item, status ); |
---|
409 | if (Severe(status)) printf( "*** MM store error ***\n" ); |
---|
410 | mf_writestr( wdw, value, status ); |
---|
411 | if (Severe(status)) printf( "*** MM store error ***\n" ); |
---|
412 | |
---|
413 | } /* end of mm_setstyle */ |
---|
414 | |
---|
415 | |
---|
416 | |
---|
417 | /*------------------------------------------------------------------------*/ |
---|
418 | |
---|
419 | |
---|
420 | |
---|
421 | void mm_playback( int src, int dst, PAINTBOX *pb, char outf[], STATUS *status ) |
---|
422 | |
---|
423 | /* redraws vectors sored in memory |
---|
424 | * |
---|
425 | * parameters of routine |
---|
426 | * int src; input; source channel |
---|
427 | * int dst; input; destination channel |
---|
428 | * PAINTBOX *pb; input; paintbox routines |
---|
429 | * char outf[]; output; name of output file (if any) |
---|
430 | * STATUS *status; output; return status |
---|
431 | */ |
---|
432 | { |
---|
433 | /* local variables */ |
---|
434 | STATUS locstat; /* local status */ |
---|
435 | int cmd_id; /* command ID */ |
---|
436 | float rpar[4]; /* float parameters */ |
---|
437 | int ipar[2]; /* integer parameters */ |
---|
438 | long lpar; /* long parameter */ |
---|
439 | char spar[BC_LINELTH+1]; /* string parameter */ |
---|
440 | char spar2[BC_LINELTH+1];/* 2. string parameter */ |
---|
441 | GBC_COO *yptr, *ycop; /* pointer to sample array */ |
---|
442 | long i; /* counter */ |
---|
443 | |
---|
444 | /* executable code */ |
---|
445 | |
---|
446 | if (pb->wpb.pbtype == GBC_WPAINT) { |
---|
447 | (pb->wpb.prepare)( dst, status ); |
---|
448 | if (Severe(status)) return; |
---|
449 | (pb->wpb.setcoo)( dst, mmv_startcoo_x[src], mmv_startcoo_y[src], |
---|
450 | mmv_startcoo_w[src], mmv_startcoo_h[src], status ); |
---|
451 | } else { |
---|
452 | (pb->ppb.prepare)( status ); |
---|
453 | if (Severe(status)) return; |
---|
454 | (pb->ppb.setcoo)( mmv_startcoo_x[src], mmv_startcoo_y[src], |
---|
455 | mmv_startcoo_w[src], mmv_startcoo_h[src], status ); |
---|
456 | } /*endif*/ |
---|
457 | if (Severe(status)) return; |
---|
458 | |
---|
459 | /* if no hardcopy stream return */ |
---|
460 | if (!mf_isopen(src)) return; |
---|
461 | |
---|
462 | mf_close( src, status ); |
---|
463 | if (Severe(status)) return; |
---|
464 | mf_open( src, TRUE, "r", status ); |
---|
465 | if (Severe(status)) return; |
---|
466 | |
---|
467 | locstat = BC_NOERROR; |
---|
468 | FOREVER { |
---|
469 | cmd_id = mf_readint( src, &locstat ); |
---|
470 | if (locstat != BC_NOERROR) break; |
---|
471 | switch (cmd_id) { |
---|
472 | case ID_MOVETO: |
---|
473 | rpar[0] = mf_readreal( src, status ); |
---|
474 | rpar[1] = mf_readreal( src, status ); |
---|
475 | if (Severe(status)) break; |
---|
476 | if (pb->wpb.pbtype == GBC_WPAINT) { |
---|
477 | (pb->wpb.moveto)( dst, rpar[0], rpar[1] ); |
---|
478 | } else { |
---|
479 | (pb->ppb.moveto)( rpar[0], rpar[1] ); |
---|
480 | } /*endif*/ |
---|
481 | break; |
---|
482 | case ID_DRAWTO: |
---|
483 | ipar[0] = mf_readint( src, status ); |
---|
484 | rpar[0] = mf_readreal( src, status ); |
---|
485 | rpar[1] = mf_readreal( src, status ); |
---|
486 | if (Severe(status)) break; |
---|
487 | if (pb->wpb.pbtype == GBC_WPAINT) { |
---|
488 | (pb->wpb.drawto)( dst, ipar[0], rpar[0], rpar[1] ); |
---|
489 | } else { |
---|
490 | (pb->ppb.drawto)( ipar[0], rpar[0], rpar[1] ); |
---|
491 | } /*endif*/ |
---|
492 | break; |
---|
493 | case ID_ARRAY: |
---|
494 | ipar[0] = mf_readint( src, status ); |
---|
495 | lpar = mf_readlong( src, status ); |
---|
496 | ipar[1] = mf_readint( src, status ); |
---|
497 | rpar[0] = mf_readreal( src, status ); |
---|
498 | rpar[1] = mf_readreal( src, status ); |
---|
499 | rpar[2] = mf_readreal( src, status ); |
---|
500 | if (Severe(status)) break; |
---|
501 | yptr = (GBC_COO *)sy_allocmem( lpar, (int)sizeof(GBC_COO), status ); |
---|
502 | if (Severe(status)) { |
---|
503 | mf_close( src, status ); |
---|
504 | return; |
---|
505 | } /*endif*/ |
---|
506 | ycop = yptr; |
---|
507 | for (i=0;i<lpar;i++) *yptr++ = mf_readreal( src, status ); |
---|
508 | rpar[3] = mf_readreal( src, status ); |
---|
509 | if (Severe(status)) break; |
---|
510 | if (pb->wpb.pbtype == GBC_WPAINT) { |
---|
511 | (pb->wpb.arrayplot)( dst, ipar[0], lpar, ipar[1], rpar[0], |
---|
512 | rpar[1], rpar[2], ycop, rpar[3], status ); |
---|
513 | } else { |
---|
514 | (pb->ppb.arrayplot)( ipar[0], lpar, ipar[1], rpar[0], |
---|
515 | rpar[1], rpar[2], ycop, rpar[3], status ); |
---|
516 | } /*endif*/ |
---|
517 | sy_deallocmem( ycop ); |
---|
518 | if (Severe(status)) { |
---|
519 | mf_close( src, status ); /* fclose( fp ); */ |
---|
520 | return; |
---|
521 | } /*endif*/ |
---|
522 | break; |
---|
523 | case ID_TEXT: |
---|
524 | ipar[0] = mf_readint( src, status ); |
---|
525 | rpar[0] = mf_readreal( src, status ); |
---|
526 | rpar[1] = mf_readreal( src, status ); |
---|
527 | mf_readstr( src, spar, status ); |
---|
528 | if (Severe(status)) break; |
---|
529 | if (pb->wpb.pbtype == GBC_WPAINT) { |
---|
530 | (pb->wpb.text)( dst, ipar[0], rpar[0], rpar[1], spar ); |
---|
531 | } else { |
---|
532 | (pb->ppb.text)( ipar[0], rpar[0], rpar[1], spar ); |
---|
533 | } /*endif*/ |
---|
534 | break; |
---|
535 | case ID_SETSTYLE: |
---|
536 | ipar[0] = mf_readint( src, status ); |
---|
537 | mf_readstr( src, spar, status ); |
---|
538 | mf_readstr( src, spar2, status ); |
---|
539 | if (Severe(status)) break; |
---|
540 | if (pb->wpb.pbtype == GBC_WPAINT) { |
---|
541 | (pb->wpb.setstyle)( dst, ipar[0], spar, spar2, status ); |
---|
542 | } else { |
---|
543 | (pb->ppb.setstyle)( ipar[0], spar, spar2, status ); |
---|
544 | } /*endif*/ |
---|
545 | break; |
---|
546 | case ID_SETCOO: |
---|
547 | rpar[0] = mf_readreal( src, status ); |
---|
548 | rpar[1] = mf_readreal( src, status ); |
---|
549 | rpar[2] = mf_readreal( src, status ); |
---|
550 | rpar[3] = mf_readreal( src, status ); |
---|
551 | if (Severe(status)) break; |
---|
552 | if (pb->wpb.pbtype == GBC_WPAINT) { |
---|
553 | (pb->wpb.setcoo)( dst, rpar[0],rpar[1],rpar[2],rpar[3], status ); |
---|
554 | } else { |
---|
555 | (pb->ppb.setcoo)( rpar[0],rpar[1],rpar[2],rpar[3], status ); |
---|
556 | } /*endif*/ |
---|
557 | break; |
---|
558 | default: |
---|
559 | *status = GCE_UDID; |
---|
560 | mf_close( src, status ); |
---|
561 | return; |
---|
562 | } /*endswitch*/ |
---|
563 | if (Severe(status)) break; |
---|
564 | } /*endwhile*/ |
---|
565 | |
---|
566 | if (pb->wpb.pbtype == GBC_WPAINT) { |
---|
567 | (pb->wpb.cleanup)( dst, outf, status ); |
---|
568 | } else { |
---|
569 | (pb->ppb.cleanup)( outf, status ); |
---|
570 | } /*endif*/ |
---|
571 | |
---|
572 | mf_close( src, status ); |
---|
573 | mf_open( src, TRUE, "a", status ); |
---|
574 | |
---|
575 | } /* end of mm_playback */ |
---|
576 | |
---|
577 | |
---|
578 | |
---|
579 | /*------------------------------------------------------------------------*/ |
---|