Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / muimaster / mui_beginrefresh.c
blobb9f5fd7f492beb003bd19fc400d0a2c98c964002
1 /*
2 Copyright © 2002-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/graphics.h>
7 #include <proto/layers.h>
8 #include <proto/intuition.h>
9 #include <proto/muimaster.h>
11 #include "mui.h"
12 #include "muimaster_intern.h"
14 /*****************************************************************************
16 NAME */
17 AROS_LH2(BOOL, MUI_BeginRefresh,
19 /* SYNOPSIS */
20 AROS_LHA( struct MUI_RenderInfo *, mri, A0),
21 AROS_LHA(ULONG, flags, D0),
23 /* LOCATION */
24 struct Library *, MUIMasterBase, 28, MUIMaster)
26 /* FUNCTION
28 INPUTS
30 RESULT
32 NOTES
34 EXAMPLE
36 BUGS
38 SEE ALSO
40 INTERNALS
42 HISTORY
44 *****************************************************************************/
46 AROS_LIBFUNC_INIT
48 struct Window *w = mri->mri_Window;
49 struct Layer *l;
51 if ((w == NULL) || !(w->Flags & WFLG_SIMPLE_REFRESH))
52 return 0;
54 l = w->WLayer;
56 /* doesn't need refreshing */
57 if (!(l->Flags & LAYERREFRESH))
58 return 0;
60 /* already refreshing */
61 if (mri->mri_Flags & MUIMRI_REFRESHMODE)
62 return 0;
64 mri->mri_Flags |= MUIMRI_REFRESHMODE;
65 LockLayerInfo(&w->WScreen->LayerInfo);
66 BeginRefresh(w);
67 return 1;
69 AROS_LIBFUNC_EXIT
71 } /* MUIA_BeginRefresh */