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