grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / graphics / clearscreen.c
blob3471a3f630fd82a65d7f0eb1f1f7bc45a87f6590
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function ClearScreen()
6 Lang: English
7 */
8 #include <aros/debug.h>
9 #include <graphics/rastport.h>
10 #include "graphics_intern.h"
13 /*****************************************************************************
15 NAME */
16 #include <proto/graphics.h>
18 AROS_LH1(void, ClearScreen,
20 /* SYNOPSIS */
21 AROS_LHA(struct RastPort *, rp, A1),
23 /* LOCATION */
24 struct GfxBase *, GfxBase, 8, Graphics)
26 /* FUNCTION
28 Clear from the current position to the end of the rastport. Clearing
29 means setting the colour to 0 (or to BgPen if the drawmode is JAM2).
30 This includes a ClearEOL().
32 INPUTS
34 rp -- pointer to rastport
36 RESULT
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
46 Text(), ClearEOL(), SetRast(), graphics/text.h, graphics/rastport.h
48 INTERNALS
50 HISTORY
52 24.7.98 SDuvan implemented
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
58 ULONG ymin = rp->cp_y - rp->TxBaseline + rp->Font->tf_YSize;
59 ULONG height = GetBitMapAttr(rp->BitMap, BMA_HEIGHT);
60 ULONG width = GetBitMapAttr(rp->BitMap, BMA_WIDTH);
62 ClearEOL(rp);
64 if(height >= ymin)
66 ULONG oldDrMd = GetDrMd(rp);
68 SetDrMd(rp, oldDrMd ^ INVERSVID);
69 RectFill(rp, 0, ymin, width - 1, height - 1);
70 SetDrMd(rp, oldDrMd);
73 AROS_LIBFUNC_EXIT
74 } /* ClearScreen */