[Fixed] Using Datatypes experience crashs :(
  • Caterpillar
    Caterpillar
    AmiDARK
    Posts: 38 from 2011/10/29
    From: South France
    Hi All,

    In the AmiDARK Engine, I use DataTypes to allow the load of images for 2D, Textures, etc ...

    under Amiga OS 4.1 i use this and it work perfectly :
    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" );
    }

    I tried to adapt it to Morphos OS but, when I run it 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" );
    }

    Everyting run under MiniGL (AOS4) & TinyGL (MOS).
    I think it has to do with the win & req needed ....
    Normally this function simply use datatype to uncompress a picture into a memory buffer ( bpaptr contain all informations needed )
    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;
    but I'm not sure this system is compatible with MorphOS.

    PS : It really crash with this function :
    resread = DoDTMethodA( dto, NULL, NULL, bpaptr );
    Because if I put this link as remark, program don't crash at this point.

    Anyone have an idea of replacement/fix for this ?

    Thank you per advance,

    Kindest Regards,
    AmiDARK


    [ Edité par AmiDARK 01.11.2011 - 13:23 ]

    [ Edité par AmiDARK 01.11.2011 - 13:36 ]

    [ Edité par AmiDARK 01.11.2011 - 22:55 ]
  • »01.11.11 - 13:22
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    pampers
    Posts: 1061 from 2009/2/26
    From: Tczew, Poland
    Why not use http://krashan.ppa.pl/reggae/ instead?
    MorphOS 3.x
  • »01.11.11 - 17:49
    Profile Visit Website
  • Caterpillar
    Caterpillar
    AmiDARK
    Posts: 38 from 2011/10/29
    From: South France
    Hi Pampers.

    For having AmiDARK Engine working on both AmigaOS4.1 & MorphOS with the same code (without having too many dependencies out of the OS itself.

    Kindest Regards,
    AmiDARK
  • »01.11.11 - 18:37
    Profile Visit Website
  • MorphOS Developer
    Henes
    Posts: 507 from 2003/6/14
    datatypes.library/DoDtMethodA() can not be used as a replacement for amiga.lib/DoMethodA(). I guess it would also crash on other OSes.

    Why not simply continue to use DoMethodA()? The function is part of the amiga.lib (libabox on MorphOS but it is automatically linked, you have nothing to do) so do not forget to Include clib/alib_protos.h as usual.
  • »01.11.11 - 18:49
    Profile Visit Website
  • Caterpillar
    Caterpillar
    AmiDARK
    Posts: 38 from 2011/10/29
    From: South France
    All :
    Will try this.

    EDIT : It work ok.
    The strangest thing is that I used an Intution OS4 function to do the job and not an amiga.lib one ;)

    Thank you. :)

    Kindest Regards,
    AmiDARK

    [ Edité par AmiDARK 01.11.2011 - 22:55 ]
  • »01.11.11 - 22:02
    Profile Visit Website