Page 2 of 2

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Posted: Thu Sep 24, 2015 1:38 am
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.

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Posted: Thu Sep 24, 2015 6:40 am
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:

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Posted: Thu Sep 24, 2015 12:36 pm
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.

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Posted: Thu Sep 24, 2015 12:53 pm
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?

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Posted: Thu Sep 24, 2015 1:30 pm
by broadblues
@zzd10h are you sure AllocBitmapTags() is the only version 54 function in use?

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Posted: Thu Sep 24, 2015 2:30 pm
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() ?)

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Posted: Thu Sep 24, 2015 5:34 pm
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.

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Posted: Thu Sep 24, 2015 6:12 pm
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().