FreeBASIC  0.91.0
gfx_put_pset.c
Go to the documentation of this file.
1 /* PSET drawing method for PUT statement */
2 
3 #include "fb_gfx.h"
4 
5 
6 #ifdef HOST_X86
7 
8 #include "x86/fb_gfx_mmx.h"
9 
10 extern void fb_hPutPSetMMX(unsigned char *src, unsigned char *dest, int w, int h, int src_pitch, int dest_pitch, int alpha, BLENDER *blender, void *param);
11 
12 #endif
13 
14 
15 /*:::::*/
16 void fb_hPutPSetC(unsigned char *src, unsigned char *dest, int w, int h, int src_pitch, int dest_pitch, int alpha, BLENDER *blender, void *param)
17 {
18  for (; h; h--) {
19  fb_hPixelCpy(dest, src, w);
20  src += src_pitch;
21  dest += dest_pitch;
22  }
23 }
24 
25 
26 /*:::::*/
27 void fb_hPutPSet(unsigned char *src, unsigned char *dest, int w, int h, int src_pitch, int dest_pitch, int alpha, BLENDER *blender, void *param)
28 {
29  static PUTTER *all_putters[] = {
31 #ifdef HOST_X86
32  fb_hPutPSetMMX, fb_hPutPSetMMX, NULL, fb_hPutPSetMMX,
33 #endif
34  };
35  PUTTER *putter;
37 
38  if (!context->putter[PUT_MODE_PSET]) {
39 #ifdef HOST_X86
40  if (__fb_gfx->flags & HAS_MMX)
41  context->putter[PUT_MODE_PSET] = &all_putters[4];
42  else
43 #endif
44  context->putter[PUT_MODE_PSET] = &all_putters[0];
45  }
46  putter = context->putter[PUT_MODE_PSET][context->target_bpp - 1];
47 
48  putter(src, dest, w, h, src_pitch, dest_pitch, alpha, blender, param);
49 }