Clear the argument array before passing it to ReadArgs(). No more junk
[AROS.git] / rom / hyperlayers / layers_init.c
blobb583349b2d44aedd95f22b20a8d36b5948aea829
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Layers Resident and initialization.
6 Lang: english
7 */
9 #include LC_LIBDEFS_FILE
10 #include <graphics/gfxbase.h>
11 #include <proto/exec.h>
12 #include <aros/symbolsets.h>
14 #include "layers_intern.h"
16 static int LayersInit(LIBBASETYPEPTR LIBBASE)
18 GfxBase = (APTR)OpenLibrary("graphics.library", 41);
19 if (GfxBase == NULL)
20 return FALSE;
22 UtilityBase = (APTR)OpenLibrary("utility.library", 0);
23 if (UtilityBase == NULL) {
24 CloseLibrary((APTR)GfxBase);
25 return FALSE;
28 LIBBASE->lb_ClipRectPool = CreatePool(MEMF_CLEAR|MEMF_PUBLIC|MEMF_SEM_PROTECTED, sizeof(struct ClipRect) * 50, sizeof(struct ClipRect) * 50);
29 if (!LIBBASE->lb_ClipRectPool) {
30 CloseLibrary((struct Library *)UtilityBase);
31 CloseLibrary((struct Library *)GfxBase);
32 return FALSE;
35 /* Install ourself as graphics.library's layer manager */
36 GfxBase->gb_LayersBase = (APTR)LIBBASE;
38 return TRUE;
41 ADD2INITLIB(LayersInit, 0);