Hello to all.
I am trying to make Comicami work under AmigaOS 4.1upd6. I use th P96 library for the manipulation of the images, but I stuck at the IP96->p96LockBitMap, which crashes and lock my system. If I remark this function and a few of the rest that use the lock, then the program doesn't crash at all, no matter how many times I load it. Does anyone have a clue on what is going on?
Below is the function that uses it.
struct BitMap *P96_readimage_using_datatype(STRPTR fname, uint32 *Width, uint32 *Height) { Object *dt_Obj; dt_Obj = IDataTypes->NewDTObject(fname, DTA_GroupID, GID_PICTURE, PDTA_ModeID, PMODE_V43, TAG_DONE); if(dt_Obj != NULL) { struct BitMapHeader *bmhd = NULL; IDataTypes->GetDTAttrs(dt_Obj, PDTA_BitMapHeader, &bmhd, TAG_DONE); if(bmhd != NULL) { struct BitMap *bitmapsrc; IDOS->Printf("BMHD width: %ld, height: %ld \n", bmhd->bmh_Width, bmhd->bmh_Height); bitmapsrc = IP96->p96AllocBitMap( bmhd->bmh_Width, bmhd->bmh_Height, 32, 0, NULL, RGBFB_A8R8G8B8 ); if(bitmapsrc != NULL) { LONG P96_imglock; struct RenderInfo RenderInfoBuffer; struct pdtBlitPixelArray pbpa; IDOS->Printf("bitmapsrc loaded sucessfully \n"); IDOS->Printf("P96 Bitmap Lock\n"); P96_imglock = IP96->p96LockBitMap( bitmapsrc, (APTR)&RenderInfoBuffer, sizeof(RenderInfoBuffer) ); IDOS->Printf("Bitmap Lock worked\n"); pbpa.MethodID = PDTM_READPIXELARRAY; pbpa.pbpa_PixelData = RenderInfoBuffer.Memory; pbpa.pbpa_PixelFormat = PBPAFMT_ARGB; pbpa.pbpa_PixelArrayMod = RenderInfoBuffer.BytesPerRow, //bmhd->bmh_Width*4; pbpa.pbpa_Left = 0; pbpa.pbpa_Top = 0; pbpa.pbpa_Width = bmhd->bmh_Width; pbpa.pbpa_Height = bmhd->bmh_Height; IIntuition->IDoMethodA( dt_Obj, (APTR)&pbpa ); IP96->p96UnlockBitMap( bitmapsrc, P96_imglock ); IDataTypes->DisposeDTObject(dt_Obj); *Width = bmhd->bmh_Width; *Height = bmhd->bmh_Height; return bitmapsrc; } else { IDOS->Printf("NO bitmapsrc\n"); } } IDataTypes->DisposeDTObject(dt_Obj); } return NULL; }