[Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Have a question about our Software Developer Kit? Ask them here.

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby colinw » Thu Sep 24, 2015 2:38 am

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.
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 158
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby zzd10h » Thu Sep 24, 2015 7:40 am

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
zzd10h
 
Posts: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby salass00 » Thu Sep 24, 2015 1:36 pm

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: 477
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby salass00 » Thu Sep 24, 2015 1:53 pm

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
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 477
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby broadblues » Thu Sep 24, 2015 2:30 pm

@zzd10h are you sure AllocBitmapTags() is the only version 54 function in use?
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 461
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby zzd10h » Thu Sep 24, 2015 3:30 pm

@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: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby zzd10h » Thu Sep 24, 2015 6:34 pm

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
zzd10h
 
Posts: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby salass00 » Thu Sep 24, 2015 7:12 pm

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().
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 477
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Previous

Return to SDK Support

Who is online

Users browsing this forum: No registered users and 1 guest