Workaround for includes conflict that stopped compilation with GCC 3.
[tangerine.git] / rom / graphics / setrgbconversionfunctiona.c
blob8a2fe2ec9dcda022a372b1abeb858589e8bf8ff7
1 /*
2 Copyright 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Function to replace pixel conversion routine
6 Lang: english
7 */
9 #include "graphics_intern.h"
10 #include <proto/graphics.h>
11 #include <proto/oop.h>
13 /*****************************************************************************
15 NAME */
17 AROS_LH4(APTR, SetRGBConversionFunctionA,
19 /* SYNOPSIS */
20 AROS_LHA(ULONG, srcPixFmt, D0),
21 AROS_LHA(ULONG, dstPixFmt, D1),
22 AROS_LHA(APTR, function, A0),
23 AROS_LHA(struct TagItem *, tags, A1),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 198, Graphics)
28 /* FUNCTION
29 Replace RGB pixel conversion routine used for converting from
30 srcPixFmt to dstPixFmt.
32 INPUTS
33 srcPixFmt, dstPixFmt - One of the truecolor vHidd_StdPixFmt_#?
34 function - function of type HIDDT_RGBConversionFunction
35 tags - none defined yet
37 RESULT
38 Previous conversion routine or (APTR)-1 on failure (bad value
39 for srcPixFmt and/or dstPixFmt)
41 NOTES
42 The conversion function must return 1 if it did the conversion,
43 or 0 if for whatever reason it did not do it or want to do it.
44 Then the fallback pixel conversion routine will be used.
46 EXAMPLE
47 See AROS/test/patchrgbconv.c
49 BUGS
51 SEE ALSO
52 <hidd/graphics.h>
54 INTERNALS
56 HISTORY
58 *****************************************************************************/
60 AROS_LIBFUNC_INIT
62 (void)tags;
63 OOP_Object *bm = SDD(GfxBase)->bm_bak;
65 if (!bm)
66 bm = SDD(GfxBase)->framebuffer;
67 if (!bm)
68 return NULL;
70 return (APTR)HIDD_BM_SetRGBConversionFunction(bm,
71 (HIDDT_StdPixFmt)srcPixFmt,
72 (HIDDT_StdPixFmt)dstPixFmt,
73 (HIDDT_RGBConversionFunction)function);
75 AROS_LIBFUNC_EXIT
77 } /* SetRGBConversionFunctionA */