2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Graphics function SetMaxPen()
8 #include <graphics/rastport.h>
9 #include "graphics_intern.h"
11 /*****************************************************************************
14 #include <proto/graphics.h>
16 AROS_LH2(void, SetMaxPen
,
19 AROS_LHA(struct RastPort
*, rp
, A0
),
20 AROS_LHA(ULONG
, maxpen
, D0
),
23 struct GfxBase
*, GfxBase
, 165, Graphics
)
26 Set the maximum pen value for a rastport. This will instruct the
27 graphics.library that the owner of the rastport will not be rendering
28 in any colors whose index is >maxpen. Therefore speed optimizations
29 on certain operations are possible and will be done.
31 Basically this call sets the rastport mask, if this would improve speed.
32 On devices where masking would slow things down (chunky pixels), it will
36 rp = pointer to a valid RastPort structure
37 maxpen = longword pen value
54 *****************************************************************************/
60 /* maxpen==0 is nonsense */
64 /* calculate the Mask */
65 /* maxpen | Mask | highest bit
76 /* look for the highest bit */
78 while ((BYTE
)maxpen
!= 0)
81 Mask
= (Mask
<< 1) | 0x01;