Disabled debug for Poseidon by default.
[cake.git] / rom / graphics / allocscreenbitmap.c
blob699103ef4b05d7b06ada42b386c74c3ff6b4874d
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Private graphics function for allocating screen bitmaps
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include <exec/memory.h>
10 #include <graphics/rastport.h>
11 #include <proto/exec.h>
12 #include <proto/oop.h>
13 #include <oop/oop.h>
14 #include "gfxfuncsupport.h"
15 #include "dispinfo.h"
17 /*****************************************************************************
19 NAME */
20 #include <graphics/rastport.h>
21 #include <proto/graphics.h>
23 AROS_LH1(struct BitMap * , AllocScreenBitMap,
25 /* SYNOPSIS */
26 AROS_LHA(ULONG, modeid, D0),
28 /* LOCATION */
29 struct GfxBase *, GfxBase, 182, Graphics)
31 /* FUNCTION
32 Allocates a bitmap for use with a screen opened by OpenScreen()
34 INPUTS
35 modeid - the DisplayID of the screen to create
37 RESULT
38 bitmap - pointer to the newly created bitmap.
40 NOTES
41 This function is private and AROS specific.
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 INTERNALS
51 HISTORY
53 *****************************************************************************/
55 AROS_LIBFUNC_INIT
57 struct BitMap *nbm = NULL;
58 HIDDT_ModeID hiddmode;
60 /* First get the the gfxmode for this modeid */
61 hiddmode = get_hiddmode_for_amigamodeid(modeid, GfxBase);
63 if (vHidd_ModeID_Invalid != hiddmode)
65 /* Create the bitmap from the hidd mode */
66 OOP_Object *sync, *pf;
68 if (HIDD_Gfx_GetMode(SDD(GfxBase)->gfxhidd, hiddmode, &sync, &pf))
70 IPTR width, height, depth;
72 OOP_GetAttr(sync, aHidd_Sync_HDisp, &width);
73 OOP_GetAttr(sync, aHidd_Sync_VDisp, &height);
74 OOP_GetAttr(pf, aHidd_PixFmt_Depth, &depth);
76 /* Hack: a negative depth indicates to AllocBitMap, that
77 the friend bitmap param actually is the hiddmode */
79 nbm = AllocBitMap(width, height, -((LONG)depth), HIDD_BMF_SCREEN_BITMAP | BMF_DISPLAYABLE, (struct BitMap *)hiddmode);
83 return nbm;
85 AROS_LIBFUNC_EXIT
87 } /* AllocScreenBitMap */