r4493@vps: verhaegs | 2007-04-19 14:44:00 -0400
[AROS.git] / rom / graphics / clearscreen.c
blob737ff3c1fb5590a871e01a8b7216741d827c2f8f
1 /*
2 Copyright © 1995-2001, 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>
16 #ifdef DEBUG
17 #undef DEBUG
18 #endif
20 #define DEBUG 0
21 #include <aros/debug.h>
24 AROS_LH1(void, ClearScreen,
26 /* SYNOPSIS */
27 AROS_LHA(struct RastPort *, rp, A1),
29 /* LOCATION */
30 struct GfxBase *, GfxBase, 8, Graphics)
32 /* FUNCTION
34 Clear from the current position to the end of the rastport. Clearing
35 means setting the colour to 0 (or to BgPen if the drawmode is JAM2).
36 This includes a ClearEOL().
38 INPUTS
40 rp -- pointer to rastport
42 RESULT
44 NOTES
46 EXAMPLE
48 BUGS
50 SEE ALSO
52 Text(), ClearEOL(), SetRast(), graphics/text.h, graphics/rastport.h
54 INTERNALS
56 HISTORY
58 24.7.98 SDuvan implemented
60 *****************************************************************************/
62 AROS_LIBFUNC_INIT
63 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
65 ULONG ymin = rp->cp_y - rp->TxBaseline + rp->Font->tf_YSize;
66 ULONG height = GetBitMapAttr(rp->BitMap, BMA_HEIGHT);
67 ULONG width = GetBitMapAttr(rp->BitMap, BMA_WIDTH);
69 ClearEOL(rp);
71 if(height >= ymin)
73 ULONG oldDrMd = GetDrMd(rp);
75 SetDrMd(rp, oldDrMd ^ INVERSVID);
76 RectFill(rp, 0, ymin, width - 1, height - 1);
77 SetDrMd(rp, oldDrMd);
80 AROS_LIBFUNC_EXIT
81 } /* ClearScreen */