minor updates
[mesa.git] / src / mesa / drivers / glide / fxddspan.c
1 /* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.3
6 *
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 *
27 * Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
28 * terms stated above.
29 *
30 * Thank you for your contribution, David!
31 *
32 * Please make note of the above copyright/license statement. If you
33 * contributed code or bug fixes to this code under the previous (GNU
34 * Library) license and object to the new license, your code will be
35 * removed at your request. Please see the Mesa docs/COPYRIGHT file
36 * for more information.
37 *
38 * Additional Mesa/3Dfx driver developers:
39 * Daryll Strauss <daryll@precisioninsight.com>
40 * Keith Whitwell <keith@precisioninsight.com>
41 *
42 * See fxapi.h for more revision/author details.
43 */
44
45
46 /* fxdd.c - 3Dfx VooDoo Mesa span and pixel functions */
47
48
49 #ifdef HAVE_CONFIG_H
50 #include "conf.h"
51 #endif
52
53 #if defined(FX)
54
55 #include "fxdrv.h"
56
57 #ifdef _MSC_VER
58 #ifdef _WIN32
59 #pragma warning( disable : 4090 4022 )
60 /* 4101 : "different 'const' qualifier"
61 * 4022 : "pointer mistmatch for actual parameter 'n'
62 */
63 #endif
64 #endif
65
66
67 #if !defined(FXMESA_USE_ARGB)
68
69
70 #if defined(FX_GLIDE3) && defined(XF86DRI)
71
72 static FxBool writeRegionClipped(fxMesaContext fxMesa, GrBuffer_t dst_buffer,
73 FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format,
74 FxU32 src_width, FxU32 src_height, FxI32 src_stride,
75 void *src_data)
76 {
77 int i, x, w, srcElt;
78 void *data;
79
80 if (src_width==1 && src_height==1) { /* Easy case writing a point */
81 for (i=0; i<fxMesa->numClipRects; i++) {
82 if ((dst_x>=fxMesa->pClipRects[i].x1) &&
83 (dst_x<fxMesa->pClipRects[i].x2) &&
84 (dst_y>=fxMesa->pClipRects[i].y1) &&
85 (dst_y<fxMesa->pClipRects[i].y2)) {
86 FX_grLfbWriteRegion(dst_buffer, dst_x, dst_y, src_format,
87 1, 1, src_stride, src_data);
88 return GL_TRUE;
89 }
90 }
91 } else if (src_height==1) { /* Writing a span */
92 if (src_format==GR_LFB_SRC_FMT_8888) srcElt=4;
93 else if (src_format==GR_LFB_SRC_FMT_ZA16) srcElt=2;
94 else {
95 fprintf(stderr, "Unknown src_format passed to writeRegionClipped\n");
96 return GL_FALSE;
97 }
98 for (i=0; i<fxMesa->numClipRects; i++) {
99 if (dst_y>=fxMesa->pClipRects[i].y1 && dst_y<fxMesa->pClipRects[i].y2) {
100 if (dst_x<fxMesa->pClipRects[i].x1) {
101 x=fxMesa->pClipRects[i].x1;
102 data=((char*)src_data)+srcElt*(x - dst_x);
103 w=src_width-(x-dst_x);
104 } else {
105 x=dst_x;
106 data=src_data;
107 w=src_width;
108 }
109 if (x+w>fxMesa->pClipRects[i].x2) {
110 w=fxMesa->pClipRects[i].x2-x;
111 }
112 FX_grLfbWriteRegion(dst_buffer, x, dst_y, src_format, w, 1,
113 src_stride, data);
114 }
115 }
116 } else { /* Punt on the case of arbitrary rectangles */
117 return GL_FALSE;
118 }
119 return GL_TRUE;
120 }
121
122 #else
123
124 #define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
125 FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
126
127 #endif
128
129
130 /* KW: Rearranged the args in the call to grLfbWriteRegion().
131 */
132 #define LFB_WRITE_SPAN_MESA(dst_buffer, \
133 dst_x, \
134 dst_y, \
135 src_width, \
136 src_stride, \
137 src_data) \
138 writeRegionClipped(fxMesa, dst_buffer, \
139 dst_x, \
140 dst_y, \
141 GR_LFB_SRC_FMT_8888, \
142 src_width, \
143 1, \
144 src_stride, \
145 src_data) \
146
147
148 #else /* !defined(FXMESA_USE_RGBA) */
149
150 #define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
151 FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
152
153
154 #define MESACOLOR_TO_ARGB(c) ( \
155 ( ((unsigned int)(c[ACOMP]))<<24 ) | \
156 ( ((unsigned int)(c[RCOMP]))<<16 ) | \
157 ( ((unsigned int)(c[GCOMP]))<<8 ) | \
158 ( (unsigned int)(c[BCOMP])) )
159
160 inline void LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer,
161 FxU32 dst_x,
162 FxU32 dst_y,
163 FxU32 src_width,
164 FxI32 src_stride,
165 void *src_data )
166 {
167 /* Covert to ARGB */
168 GLubyte (*rgba)[4] = src_data;
169 GLuint argb[MAX_WIDTH];
170 int i;
171
172 for (i = 0; i < src_width; i++)
173 {
174 argb[i] = MESACOLOR_TO_ARGB(rgba[i]);
175 }
176 writeRegionClipped( /*fxMesa,*/ NULL, dst_buffer,
177 dst_x,
178 dst_y,
179 GR_LFB_SRC_FMT_8888,
180 src_width,
181 1,
182 src_stride,
183 (void*)argb);
184 }
185
186 #endif /* !defined(FXMESA_USE_RGBA) */
187
188
189 /************************************************************************/
190 /***** Span functions *****/
191 /************************************************************************/
192
193
194 static void fxDDWriteRGBASpan(const GLcontext *ctx,
195 GLuint n, GLint x, GLint y,
196 const GLubyte rgba[][4], const GLubyte mask[])
197 {
198 fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
199 GLuint i;
200 GLint bottom=fxMesa->height+fxMesa->y_offset-1;
201
202 if (MESA_VERBOSE&VERBOSE_DRIVER) {
203 fprintf(stderr,"fxmesa: fxDDWriteRGBASpan(...)\n");
204 }
205
206 x+=fxMesa->x_offset;
207 if (mask) {
208 int span=0;
209
210 for (i=0;i<n;i++) {
211 if (mask[i]) {
212 ++span;
213 } else {
214 if (span > 0) {
215 LFB_WRITE_SPAN_MESA( fxMesa->currentFB, x+i-span, bottom-y,
216 /* GR_LFB_SRC_FMT_8888,*/ span, /*1,*/ 0, (void *) rgba[i-span] );
217 span = 0;
218 }
219 }
220 }
221
222 if (span > 0)
223 LFB_WRITE_SPAN_MESA( fxMesa->currentFB, x+n-span, bottom-y,
224 /* GR_LFB_SRC_FMT_8888, */ span, /*1,*/ 0, (void *) rgba[n-span] );
225 } else
226 LFB_WRITE_SPAN_MESA( fxMesa->currentFB, x, bottom-y,/* GR_LFB_SRC_FMT_8888,*/
227 n,/* 1,*/ 0, (void *) rgba );
228 }
229
230
231 static void fxDDWriteRGBSpan(const GLcontext *ctx,
232 GLuint n, GLint x, GLint y,
233 const GLubyte rgb[][3], const GLubyte mask[])
234 {
235 fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
236 GLuint i;
237 GLint bottom=fxMesa->height+fxMesa->y_offset-1;
238 GLubyte rgba[MAX_WIDTH][4];
239
240 if (MESA_VERBOSE&VERBOSE_DRIVER) {
241 fprintf(stderr,"fxmesa: fxDDWriteRGBSpan()\n");
242 }
243
244 x+=fxMesa->x_offset;
245 if (mask) {
246 int span=0;
247
248 for (i=0;i<n;i++) {
249 if (mask[i]) {
250 rgba[span][RCOMP] = rgb[i][0];
251 rgba[span][GCOMP] = rgb[i][1];
252 rgba[span][BCOMP] = rgb[i][2];
253 rgba[span][ACOMP] = 255;
254 ++span;
255 } else {
256 if (span > 0) {
257 LFB_WRITE_SPAN_MESA( fxMesa->currentFB, x+i-span, bottom-y,
258 /*GR_LFB_SRC_FMT_8888,*/ span,/* 1,*/ 0, (void *) rgba );
259 span = 0;
260 }
261 }
262 }
263
264 if (span > 0)
265 LFB_WRITE_SPAN_MESA( fxMesa->currentFB, x+n-span, bottom-y,
266 /*GR_LFB_SRC_FMT_8888,*/ span,/* 1,*/ 0, (void *) rgba );
267 } else {
268 for (i=0;i<n;i++) {
269 rgba[i][RCOMP]=rgb[i][0];
270 rgba[i][GCOMP]=rgb[i][1];
271 rgba[i][BCOMP]=rgb[i][2];
272 rgba[i][ACOMP]=255;
273 }
274
275 LFB_WRITE_SPAN_MESA( fxMesa->currentFB, x, bottom-y,/* GR_LFB_SRC_FMT_8888,*/
276 n,/* 1,*/ 0, (void *) rgba );
277 }
278 }
279
280
281 static void fxDDWriteMonoRGBASpan(const GLcontext *ctx,
282 GLuint n, GLint x, GLint y,
283 const GLubyte mask[])
284 {
285 fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
286 GLuint i;
287 GLint bottom=fxMesa->height+fxMesa->y_offset-1;
288 GLuint data[MAX_WIDTH];
289
290 if (MESA_VERBOSE&VERBOSE_DRIVER) {
291 fprintf(stderr,"fxmesa: fxDDWriteMonoRGBASpan(...)\n");
292 }
293
294 x+=fxMesa->x_offset;
295 if (mask) {
296 int span=0;
297
298 for (i=0;i<n;i++) {
299 if (mask[i]) {
300 data[span] = (GLuint) fxMesa->color;
301 ++span;
302 } else {
303 if (span > 0) {
304 writeRegionClipped(fxMesa, fxMesa->currentFB, x+i-span, bottom-y,
305 GR_LFB_SRC_FMT_8888, span, 1, 0,
306 (void *) data );
307 span = 0;
308 }
309 }
310 }
311
312 if (span > 0)
313 writeRegionClipped(fxMesa, fxMesa->currentFB, x+n-span, bottom-y,
314 GR_LFB_SRC_FMT_8888, span, 1, 0,
315 (void *) data );
316 } else {
317 for (i=0;i<n;i++) {
318 data[i]=(GLuint) fxMesa->color;
319 }
320
321 writeRegionClipped(fxMesa, fxMesa->currentFB, x, bottom-y, GR_LFB_SRC_FMT_8888,
322 n, 1, 0, (void *) data );
323 }
324 }
325
326
327 #if 0
328 static void fxDDReadRGBASpan(const GLcontext *ctx,
329 GLuint n, GLint x, GLint y, GLubyte rgba[][4])
330 {
331 fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
332 GLushort data[MAX_WIDTH];
333 GLuint i;
334 GLint bottom=fxMesa->height+fxMesa->y_offset-1;
335
336 printf("read span %d, %d, %d\n", x,y,n);
337 if (MESA_VERBOSE&VERBOSE_DRIVER) {
338 fprintf(stderr,"fxmesa: fxDDReadRGBASpan(...)\n");
339 }
340
341 assert(n < MAX_WIDTH);
342
343 x+=fxMesa->x_offset;
344 FX_grLfbReadRegion( fxMesa->currentFB, x, bottom-y, n, 1, 0, data);
345
346 for (i=0;i<n;i++) {
347 GLushort pixel = data[i];
348 rgba[i][RCOMP] = FX_PixelToR[pixel];
349 rgba[i][GCOMP] = FX_PixelToG[pixel];
350 rgba[i][BCOMP] = FX_PixelToB[pixel];
351 rgba[i][ACOMP] = 255;
352 }
353 }
354 #endif
355
356
357 /*
358 * Read a span of 16-bit RGB pixels. Note, we don't worry about cliprects
359 * since OpenGL says obscured pixels have undefined values.
360 */
361 static void read_R5G6B5_span(const GLcontext *ctx,
362 GLuint n, GLint x, GLint y, GLubyte rgba[][4])
363 {
364 fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
365 GrLfbInfo_t info;
366 BEGIN_BOARD_LOCK();
367 if (grLfbLock(GR_LFB_READ_ONLY,
368 fxMesa->currentFB,
369 GR_LFBWRITEMODE_ANY,
370 GR_ORIGIN_UPPER_LEFT,
371 FXFALSE,
372 &info)) {
373 const GLint winX = fxMesa->x_offset;
374 const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
375 #ifdef XF86DRI
376 const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
377 ? (fxMesa->screen_width) : (info.strideInBytes / 2);
378 #else
379 const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
380 #endif
381 const GLushort *data16 = (const GLushort *) info.lfbPtr
382 + (winY - y) * srcStride
383 + (winX + x);
384 const GLuint *data32 = (const GLuint *) data16;
385 GLuint i, j;
386 GLuint extraPixel = (n & 1);
387 n -= extraPixel;
388 for (i = j = 0; i < n; i += 2, j++) {
389 GLuint pixel = data32[j];
390 GLuint pixel0 = pixel & 0xffff;
391 GLuint pixel1 = pixel >> 16;
392 rgba[i][RCOMP] = FX_PixelToR[pixel0];
393 rgba[i][GCOMP] = FX_PixelToG[pixel0];
394 rgba[i][BCOMP] = FX_PixelToB[pixel0];
395 rgba[i][ACOMP] = 255;
396 rgba[i+1][RCOMP] = FX_PixelToR[pixel1];
397 rgba[i+1][GCOMP] = FX_PixelToG[pixel1];
398 rgba[i+1][BCOMP] = FX_PixelToB[pixel1];
399 rgba[i+1][ACOMP] = 255;
400 }
401 if (extraPixel) {
402 GLushort pixel = data16[n];
403 rgba[n][RCOMP] = FX_PixelToR[pixel];
404 rgba[n][GCOMP] = FX_PixelToG[pixel];
405 rgba[n][BCOMP] = FX_PixelToB[pixel];
406 rgba[n][ACOMP] = 255;
407 }
408
409 grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB);
410 }
411 END_BOARD_LOCK();
412 }
413
414
415 /************************************************************************/
416 /***** Pixel functions *****/
417 /************************************************************************/
418
419 static void fxDDWriteRGBAPixels(const GLcontext *ctx,
420 GLuint n, const GLint x[], const GLint y[],
421 CONST GLubyte rgba[][4], const GLubyte mask[])
422 {
423 fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
424 GLuint i;
425 GLint bottom=fxMesa->height+fxMesa->y_offset-1;
426
427 if (MESA_VERBOSE&VERBOSE_DRIVER) {
428 fprintf(stderr,"fxmesa: fxDDWriteRGBAPixels(...)\n");
429 }
430
431 for(i=0;i<n;i++)
432 if(mask[i])
433 LFB_WRITE_SPAN_MESA(fxMesa->currentFB, x[i]+fxMesa->x_offset, bottom-y[i],
434 1, 1, (void *)rgba[i]);
435 }
436
437 static void fxDDWriteMonoRGBAPixels(const GLcontext *ctx,
438 GLuint n, const GLint x[], const GLint y[],
439 const GLubyte mask[])
440 {
441 fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
442 GLuint i;
443 GLint bottom=fxMesa->height+fxMesa->y_offset-1;
444
445 if (MESA_VERBOSE&VERBOSE_DRIVER) {
446 fprintf(stderr,"fxmesa: fxDDWriteMonoRGBAPixels(...)\n");
447 }
448
449 for(i=0;i<n;i++)
450 if(mask[i])
451 writeRegionClipped(fxMesa, fxMesa->currentFB,x[i]+fxMesa->x_offset,bottom-y[i],
452 GR_LFB_SRC_FMT_8888,1,1,0,(void *) &fxMesa->color);
453 }
454
455 static void fxDDReadRGBAPixels(const GLcontext *ctx,
456 GLuint n, const GLint x[], const GLint y[],
457 GLubyte rgba[][4], const GLubyte mask[])
458 {
459 fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
460 GLuint i;
461 GLint bottom=fxMesa->height+fxMesa->y_offset-1;
462
463 if (MESA_VERBOSE&VERBOSE_DRIVER) {
464 fprintf(stderr,"fxmesa: fxDDReadRGBAPixels(...)\n");
465 }
466
467 for(i=0;i<n;i++) {
468 if(mask[i]) {
469 GLushort pixel;
470 FX_grLfbReadRegion(fxMesa->currentFB,x[i],bottom-y[i],1,1,0,&pixel);
471 rgba[i][RCOMP] = FX_PixelToR[pixel];
472 rgba[i][GCOMP] = FX_PixelToG[pixel];
473 rgba[i][BCOMP] = FX_PixelToB[pixel];
474 rgba[i][ACOMP] = 255;
475 }
476 }
477 }
478
479
480 /************************************************************************/
481 /***** Depth functions *****/
482 /************************************************************************/
483
484 void fxDDWriteDepthSpan(GLcontext *ctx,
485 GLuint n, GLint x, GLint y, const GLdepth depth[],
486 const GLubyte mask[])
487 {
488 fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
489 GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
490
491 if (MESA_VERBOSE & VERBOSE_DRIVER) {
492 fprintf(stderr, "fxmesa: fxDDWriteDepthSpan(...)\n");
493 }
494
495 x += fxMesa->x_offset;
496
497 if (mask) {
498 GLint i;
499 for (i = 0; i < n; i++) {
500 if (mask[i]) {
501 GLshort d = depth[i];
502 writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x + i, bottom - y,
503 GR_LFB_SRC_FMT_ZA16, 1, 1, 0, (void *) &d);
504 }
505 }
506 }
507 else {
508 GLushort depth16[MAX_WIDTH];
509 GLint i;
510 for (i = 0; i < n; i++) {
511 depth16[i] = depth[i];
512 }
513 writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x, bottom - y,
514 GR_LFB_SRC_FMT_ZA16, n, 1, 0, (void *) depth16);
515 }
516 }
517
518
519 void fxDDReadDepthSpan(GLcontext *ctx,
520 GLuint n, GLint x, GLint y, GLdepth depth[])
521 {
522 fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
523 GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
524 GLushort depth16[MAX_WIDTH];
525 GLuint i;
526
527 if (MESA_VERBOSE & VERBOSE_DRIVER) {
528 fprintf(stderr, "fxmesa: fxDDReadDepthSpan(...)\n");
529 }
530
531 x += fxMesa->x_offset;
532 FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16);
533 for (i = 0; i < n; i++) {
534 depth[i] = depth16[i];
535 }
536 }
537
538
539
540 void fxDDWriteDepthPixels(GLcontext *ctx,
541 GLuint n, const GLint x[], const GLint y[],
542 const GLdepth depth[], const GLubyte mask[])
543 {
544 fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
545 GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
546 GLuint i;
547
548 if (MESA_VERBOSE & VERBOSE_DRIVER) {
549 fprintf(stderr, "fxmesa: fxDDWriteDepthPixels(...)\n");
550 }
551
552 for (i = 0; i < n; i++) {
553 if (mask[i]) {
554 int xpos = x[i] + fxMesa->x_offset;
555 int ypos = bottom - y[i];
556 GLushort d = depth[i];
557 writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, xpos, ypos,
558 GR_LFB_SRC_FMT_ZA16, 1, 1, 0, (void *) &d);
559 }
560 }
561 }
562
563
564 void fxDDReadDepthPixels(GLcontext *ctx, GLuint n,
565 const GLint x[], const GLint y[], GLdepth depth[])
566 {
567 fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
568 GLint bottom = fxMesa->height + fxMesa->y_offset - 1;
569 GLuint i;
570
571 if (MESA_VERBOSE & VERBOSE_DRIVER) {
572 fprintf(stderr, "fxmesa: fxDDReadDepthPixels(...)\n");
573 }
574
575 for (i = 0; i < n; i++) {
576 int xpos = x[i] + fxMesa->x_offset;
577 int ypos = bottom - y[i];
578 GLushort d;
579 FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &d);
580 depth[i] = d;
581 }
582 }
583
584
585
586
587 /************************************************************************/
588
589
590 void fxSetupDDSpanPointers(GLcontext *ctx)
591 {
592 ctx->Driver.WriteRGBASpan =fxDDWriteRGBASpan;
593 ctx->Driver.WriteRGBSpan =fxDDWriteRGBSpan;
594 ctx->Driver.WriteMonoRGBASpan =fxDDWriteMonoRGBASpan;
595 ctx->Driver.WriteRGBAPixels =fxDDWriteRGBAPixels;
596 ctx->Driver.WriteMonoRGBAPixels =fxDDWriteMonoRGBAPixels;
597
598 ctx->Driver.WriteCI8Span =NULL;
599 ctx->Driver.WriteCI32Span =NULL;
600 ctx->Driver.WriteMonoCISpan =NULL;
601 ctx->Driver.WriteCI32Pixels =NULL;
602 ctx->Driver.WriteMonoCIPixels =NULL;
603
604 /* ctx->Driver.ReadRGBASpan =fxDDReadRGBASpan;*/
605 ctx->Driver.ReadRGBASpan = read_R5G6B5_span;
606 ctx->Driver.ReadRGBAPixels =fxDDReadRGBAPixels;
607
608 ctx->Driver.ReadCI32Span =NULL;
609 ctx->Driver.ReadCI32Pixels =NULL;
610 }
611
612
613 #else
614
615
616 /*
617 * Need this to provide at least one external definition.
618 */
619
620 int gl_fx_dummy_function_span(void)
621 {
622 return 0;
623 }
624
625 #endif /* FX */