Post édité : Problème résolu.
Salut,
Dans l'AmiDARK Engine, pour les images & textures, j'utilise les datatypes.
Sous AmigaOS 4.1 j'utilise ceci et tout fonctionne niquel :
AvailMethod = IDataTypes->GetDTMethods( dto );
if ( IDataTypes->FindMethod( AvailMethod, PDTM_READPIXELARRAY ) != 0 ){
bpa.MethodID = PDTM_READPIXELARRAY;
resread = IIntuition->IDoMethodA( dto, bpaptr );
}else{
printf( "Method PDTM_READPIXELARRAY not compatible with object" );
}
J'ai essayé d'adapter la méthode pour MorphOS mais cela crash:
AvailMethod = GetDTMethods( dto );
if ( FindMethod( AvailMethod, PDTM_READPIXELARRAY ) != 0 ){
bpa.MethodID = PDTM_READPIXELARRAY;
resread = DoDTMethodA( dto, NULL, NULL, bpaptr );
}else{
printf( "Method PDTM_READPIXELARRAY not compatible with object" );
}
Tout fonctionne sous MiniGL(AOS4) & TinyGL(MOS)
Je pense que ce la a à voir avec win & Req ou alors le msg ...
Normalement, cette fonction décompresse simplement une imagé chargé via un objet datatype, dans un buffer mémoire dont les infos sont dant la structure bpa. :
bpa.pbpa_PixelData = pt->Pixels;
bpa.pbpa_PixelFormat = PBPAFMT_RGBA;
bpa.pbpa_PixelArrayMod = bmh->bmh_Width * 4;
bpa.pbpa_Left = 0;
bpa.pbpa_Top = 0;
bpa.pbpa_Width = bmh->bmh_Width;
bpa.pbpa_Height = bmh->bmh_Height;
Mais je ne suis pas sûr que cela soit compatible MorphOS.
PS : Le crash est localisé sur la fonction suivante :
resread = DoDTMethodA( dto, NULL, NULL, bpaptr );
Car, si je la mets en commentaires (ou la supprime), il n'y a plus de crash à ce niveau lÃ.
Quelqu'un aurait une idée ?
Merci par avance.
@ +
AmiDARK