[Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Have a question about our Software Developer Kit? Ask them here.
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 181
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by colinw »

zzd10h wrote: but it complains about
warning: passing argument 6 of 'IGraphics->AllocBitMap' from incompatible pointer type.
Thank you for your help.
Of course, he said it was a kludge. struct BitMap * -is not a- struct TagItem *
You are going to have to add a cast to it.
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by zzd10h »

Right, thank you

Code: Select all

bitmap_vignette = AllocBitMap( bmh->bmh_Width, bmh->bmh_Height,32, BMF_CHECKVALUE, (struct BitMap *)tags); 			 
compiles well and works under FE.

But again freezes under 4.1.6 :cry:
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 521
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by salass00 »

zzd10h wrote:

Code: Select all

struct TagItem tags[3] ;
tags[0].ti_Tag = BMATags_Displayable ;
tags[0].ti_Data = TRUE ;
tags[1].ti_Tag = BMATags_PixelFormat ;
tags[1].ti_Data = RGBFB_A8R8G8B8 ;
tags[2].ti_Tag = TAG_DONE; 								
										  
bitmap_vignette = AllocBitMap( bmh->bmh_Width, bmh->bmh_Height,32, BMF_CHECKVALUE, tags); 	
Instead of using BMATags_Displayable you can just set the BMF_DISPLAYABLE flag when using AllocBitMap(). Apart from that and the missing cast I can't see anything wrong with the code.

For new code you should also use PIXF_#? defines instead of RGBFB_#? ones.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 521
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by salass00 »

zzd10h wrote:

Code: Select all

bitmap_vignette = AllocBitMap( bmh->bmh_Width, bmh->bmh_Height,32, BMF_CHECKVALUE, (struct BitMap *)tags); 			 
compiles well and works under FE.

But again freezes under 4.1.6 :cry:
Can you say what version of rtg.library your update 6 system has?
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 591
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by broadblues »

@zzd10h are you sure AllocBitmapTags() is the only version 54 function in use?
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by zzd10h »

@Salass @Broadblues

I'm not in front of my X1000, I will check this evening.

@Broadblues,
I use too LockBitMapTags(bitmap_vignette ,LBM_BaseAddress, &buffer,LBM_BytesPerRow,&srcBytesPerRow, TAG_END);

it seems that you are right, thank you, I don't have my X1000 but I have the previous Autodocs and I don't find this function in graphics.doc (and i don't find an equivalent except the Picasso96 p96LockBitMap & p96GetBitMapAttr.

I use the LockBitMapTags "buffer" and the "srcBytesPerRow" for

Code: Select all

            IDoMethod(dtype, 
              PDTM_READPIXELARRAY,
              // renderInfo.Memory,  // filled by p96 functions p96LockBitMap 
              buffer,                          // filled by gfx functions LockBitMapTags
              PBPAFMT_ARGB,
              srcBytesPerRow,           // filled by p96GetBitMapAttr or LockBitMapTags
              0,
              0,
              bmh->bmh_Width,
              bmh->bmh_Height); 
edit : I will try later to use p96LockBitMap & p96GetBitMapAttr instead of LockBitMapTags.
Unfortunately, p96LockBitMap seems to be obsolete too (not the case of p96GetBitMapAttr() ?)
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by zzd10h »

My 4.1.6 graphics.library is 53.6

Great !

Using AllocBitmap(), p96LockBitMap(), p96GetBitMapAttr() & p96UnlockBitmap(), it works under FE and 4.1.6.

Of course, I have obsolete warning at compilation about p96LockBitMap() & p96UnlockBitMap().

Thank you all.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 521
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by salass00 »

zzd10h wrote:My 4.1.6 graphics.library is 53.6
Versions of graphics.library prior to V54 don't contain any RTG code whatsoever and rely on RTG code to be patched in by rtg.library (a Picasso96 component). AllocBitMap() is one such function.

This is why I asked for the rtg.library version and not graphics.library.

Anyway it's good that you found the cause of your problem and that it wasn't related to AllocBitMap().
Post Reply