2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
10 #include <aros/debug.h>
12 #include <proto/oop.h>
13 #include <proto/utility.h>
15 #include <cybergraphx/cybergraphics.h>
16 #include <hidd/graphics.h>
18 #include "cybergraphics_intern.h"
23 ULONG rl_num
; // no. of rects in this list
24 struct RectList
*rl_next
; // pointer to next list
25 struct Rectangle rect1
; // First Rectangle in the list
28 /*****************************************************************************
31 #include <proto/cybergraphics.h>
33 AROS_LH2(void, UnLockBitMapTagList
,
36 AROS_LHA(APTR
, Handle
, A0
),
37 AROS_LHA(struct TagItem
*, Tags
, A1
),
40 struct Library
*, CyberGfxBase
, 30, Cybergraphics
)
43 Releases exclusive access to a bitmap. Options for the unlocking
44 process are given in a taglist. The possible tags are as follows:
45 UBMI_UPDATERECTS (struct RectList *) - pointer to a series of
46 rectangle lists that need to be refreshed.
47 UBMI_REALLYUNLOCK (BOOL) - if FALSE, the bitmap will not be
48 unlocked; only rectangle updates will be done.
51 Handle - handle to the bitmap to unlock.
52 Tags - a taglist as described above.
64 UnLockBitMap(), LockBitMapTagList()
68 *****************************************************************************/
73 BOOL reallyunlock
= TRUE
;
74 struct RectList
*rl
= NULL
;
75 struct BitMap
*bm
= (struct BitMap
*)Handle
;
77 D(bug("[Cybergfx] %s(0x%p, 0x%p)\n", __PRETTY_FUNCTION__
, bm
, Tags
));
79 if ((bm
) && (IS_HIDD_BM(bm
)))
81 while ((tag
= NextTagItem(&Tags
)))
85 case UBMI_REALLYUNLOCK
:
86 reallyunlock
= (BOOL
)tag
->ti_Data
;
89 case UBMI_UPDATERECTS
:
91 rl
= (struct RectList
*)tag
->ti_Data
;
96 D(bug("[Cybergfx] %s: !!! UNKNOWN TAG %08x !!!\n", __PRETTY_FUNCTION__
, tag
->ti_Tag
));
103 D(bug("[Cybergfx] %s: Calling HIDD_BM_ReleaseDirectAccess...\n", __PRETTY_FUNCTION__
));
104 HIDD_BM_ReleaseDirectAccess(HIDD_BM_OBJ(bm
));
111 struct Rectangle
*rectCurrent
;
114 D(bug("[Cybergfx] %s: RectList @ 0x%p\n", __PRETTY_FUNCTION__
, rl
));
116 if ((count
= rl
->rl_num
) > 0)
118 D(bug("[Cybergfx] %s: %d entries\n", __PRETTY_FUNCTION__
, rl
->rl_num
));
120 for (rectCurrent
= &rl
->rect1
; count
> 0; count
--)
122 D(bug("[Cybergfx] %s: Updating BitMap Rect [%d, %d -> %d, %d]\n", __PRETTY_FUNCTION__
, rectCurrent
->MinX
, rectCurrent
->MinY
, rectCurrent
->MaxX
, rectCurrent
->MaxY
));
123 UpdateBitMap(bm
, rectCurrent
->MinX
, rectCurrent
->MinY
, rectCurrent
->MaxX
- rectCurrent
->MinX
+ 1, rectCurrent
->MaxY
- rectCurrent
->MinY
+ 1);
124 rectCurrent
= &rectCurrent
[1];
132 D(bug("[Cybergfx] %s: Updating full bitmap\n", __PRETTY_FUNCTION__
));
133 UpdateBitMap(bm
, 0, 0, GetCyberMapAttr(bm
, CYBRMATTR_WIDTH
), GetCyberMapAttr(bm
, CYBRMATTR_HEIGHT
));
138 D(bug("[Cybergfx] %s: Called on Illegal BitMap @ 0x%p\n", __PRETTY_FUNCTION__
, bm
));
142 } /* UnLockBitMapTagList */