[Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Have a question about our Software Developer Kit? Ask them here.
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

[Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Post by zzd10h »

Hi,
when new FE SDK was published I changed all my Picasso functions to graphics ones.

Under FE, no problem, by changing :

Code: Select all

bitmap_vignette = p96AllocBitMap( bmh->bmh_Width, bmh->bmh_Height, 32, BMF_DISPLAYABLE, NULL, RGBFB_A8R8G8B8 );
to

Code: Select all

bitmap_vignette = AllocBitMapTags( bmh->bmh_Width, bmh->bmh_Height,32, BMATags_Displayable, TRUE, BMATags_PixelFormat,RGBFB_A8R8G8B8);
Works well, no gcc warning about obsolete picasso96 functions and overall, program runs well.

But under 4.1.6, the same program freezes the system.

As BMATags_PixelFormat is not known in the previous 4.1.6 SDK, I can't recompile the graphics AllocBitmap under 4.1.6.

By restoring Picasso96 functions and by compiling the program with the newest FE SDK, makes it work again under 4.1.6.

1) Therefore, is this AllocBitmapTags() works under 4.1.6 ?

2) Or is it a way to make the diferrence between OS level in the code ?
#ifdef __amigaos4.1.6__
or
#ifdef __amigaos4.1.8__

Thank you by advance.
Guillaume
Last edited by zzd10h on Tue Sep 22, 2015 11:26 pm, edited 1 time in total.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 181
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Post by colinw »

I think a TAG_END may help..
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Post by zzd10h »

Thank you Colin for your reply.

You are right, I added a TAG_END (shame on me :? )

Code: Select all

bitmap_vignette = AllocBitMapTags( bmh->bmh_Width, bmh->bmh_Height,32, BMATags_Displayable, TRUE, BMATags_PixelFormat,RGBFB_A8R8G8B8,TAG_END); 
It still works under FE

Under 4.1.6, no more freeze but an ISI at this exact AllocBitmapTags instruction.

Thank you
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 181
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Post by colinw »

zzd10h wrote: It still works under FE
Under 4.1.6, no more freeze but an ISI at this exact AllocBitmapTags instruction.
Thank you
According to the autodocs, AllocBitmapTags() only existed from graphics.library verion 53.7 (6.5.2013)
I don't remember what graphics version was included in 4.1.6

You should always employ a version check if it's likely your program depends on a specific mimimum
version of a component, especially when it's likely that earlier versions may still be in use somewhere.

See; include_h/exec/libraries.h -> LIB_IS_AT_LEAST() macro.
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Post by zzd10h »

I didn't though (wrongly) that AllocBitMapTags() was a new function...

Thank you, too, for the tip about lib_at_least
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
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 »

Works well, no gcc warning about obsolete picasso96 functions and overall, program runs well.

But under 4.1.6, the same program freezes the system.
The new gfx functions need FE or greater (gfxlib 54.148 giver or take a revision).

If you want to program to run pre FE you will have to use P96 still.
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

For older graphics.library versions where the AllocBitMapTags() function isn't available there's a kind of hack/cludge you can use with AllocBitMap() if you don't want to use Picasso96API.library.

I don't remember the exact details since I've never had to use it for anything but essentially what you have to do IIRC is set the flags parameter (and maybe some others as well?) to some magic value(s) and then you can set the friend bitmap parameter to a taglist with extra RTG parameters. The AllocBitMapTags() function is just a convenient way to bypass all this legacy crap.
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by zzd10h »

@Salass0
thank you for the advice but I don't succeed to find how to pass the Pixel format to this function.

@Broadblues
yes, you are right, I will still use P96 for 4.1.6 programs.
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:@Salass0
thank you for the advice but I don't succeed to find how to pass the Pixel format to this function.
The flags parameter should be set to BMF_CHECKVALUE (this is described in <graphics/gfx.h>).

For the tag list (specfied using the friend bitmap parameter) you should use the same tags as you would use for AllocBitMapTags().
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Post by zzd10h »

Sorry my ignorance, but I made that :

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); 	

but it complains about

warning: passing argument 6 of 'IGraphics->AllocBitMap' from incompatible pointer type


Thank you for your help.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
Post Reply