Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
107 user(s) are online (96 user(s) are browsing Forums)

Members: 1
Guests: 106

emeck, more...

Support us!

Headlines

 
  Register To Post  

Home away from home
Home away from home


See User information
Need help loading Animbrushed using datatype system?

What I need to is load one frame, decode the planar graphics to the native video mode (16 or 32bit).

Does any one know how to do it?

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Need help loading Animbrushed using datatype system.
Home away from home
Home away from home


See User information
@LiveForIt

Are there any working examples out there, Anim brushes, must have been popular whit game development.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Home away from home
Home away from home


See User information
@LiveForIt

Quote:

LiveForIt wrote:
Need help loading Animbrushed using datatype system?

What I need to is load one frame, decode the planar graphics to the native video mode (16 or 32bit).

Does any one know how to do it?


You need to use the animation datatype. Have a look in the datatype folder of the include files in the SDK. Unfortunately I have no good example on how to use it; I was planning to write one after I had finished writing an animation datatype replacement (which would have a new, more powerful API). Unfortunately that's not finished yet.

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Need help loading Animbrushed using datatype system.
Home away from home
Home away from home


See User information
@Hans

bob_type *load_dt_animbrushchar *name )
{
 
Object    *dto;
 
struct BitMapHeader *bm_header;
 
struct BitMap   *dt_bitmap;
 
struct BitMap   *new_bitmap;
 
struct RastPort   RP;
 
int     lock;
 
struct RenderInfo  rinf;
 
char     *byte;
 
char     tmp;
 
short    stmp;
 
short    r;
 
short    g;
 
short    b;
 
char     *alfa;
 
ULONG    num_images,num;
 
ULONG    num_colors;
 
ULONG    anim_dept;
 
ULONG    *color_regs;
 
unsigned char   *plain;
 
int     p,color;
 
int     format,dept;
 
int     pixel_size;
 
int     rgb_color;
 
bob_type    *new_bob NULL;
 
bob_type    *last_bob NULL;
 
bob_type    *ret NULL;
 
type_bit    *bob_func NULL;
 
int     x,y,xoff,yoff;
 
 
printf"load datatype image %s\n",name);

 if(
dto = (void *) NewDTObjectnameDTA_GroupIDGID_ANIMATIONTAG_DONE))
 {
  
SetDTAttrs ( (void *) dtoNULL,NULLPDTA_DestMode, (ULONGPMODE_V43,TAG_DONE);

  
GetDTAttrs ( (void *) dto,
   
ADTA_Frames,  &num_images,
   
ADTA_NumColors, &num_colors,
   
ADTA_CRegs,  &color_regs,
   
ADTA_Depth,  &anim_dept,
   
TAG_DONE);

  
printf("Num images %d\n",num_images);
  
printf("Num colours %d\n",num_colors);
  
printf("Num anim depth %d\n",anim_dept);


  for (
color 0color<num_colors;color++)
  {
   
printf ("%d %x,%x,%x\n",colorcolor_regs[color*3+0]>>24,color_regs[color*3+1]>>24,color_regs[color*3+2]>>24 );
  }

  if (
num_images<1)
  {
   
printf("Not an animation?\n");
   
num_images 1;
  }

  for (
num=0;num<num_images;num++)
  {
   
printf("num %d\n",num);
   
DoDTMethod ( (void *) dto,NULL,NULL,ADTM_LOCATE,num,TRUE);

   
GetDTAttrs ( (void *) dto,PDTA_BitMapHeader, (ULONG *) &bm_headerADTA_KeyFrame, (ULONG) &dt_bitmap,TAG_DONE);

   
// find bit format in dto.
   
pixel_size p96GetBitMapAttr(__screen_bitmap,P96BMA_BYTESPERPIXEL);


   
printf("screens pixel size %d\n",pixel_size);

   if (!
bm_header)
   {
    
printf("no bm header\n");
    break;
   }

 
   if (
new_bob = (void *) malloc(sizeof(bob_type)))
   {
    
make_bitmap_alfa(new_bobbm_header -> bmh_Widthbm_header -> bmh_Heightpixel_size);
    if (
ret == 0ret new_bob// set return value

    
printf"datatype bitmap 0x%x\n"dt_bitmap);
    
printf"bob bitmap 0x%x\n"new_bob -> bitmap);

    
DoDTMethod ( (void *) dto,NULL,NULL,ADTM_LOADFRAME);

    
bob_func new_bob -> geo.c;
    
bob_func -> lock(new_bob);

    
printf"bob bitmap mem 0x%x\n"new_bob -> memory);

    for(
y=0;y<new_bob -> geo.h;y++)
    {
     for (
x=0;x<new_bob -> geo.w;x++)
     {
      
color 0;

      for (
p=0;p<anim_dept;p++)
      { 
       
plain = (unsigned char *) (((ULONGdt_bitmap -> Planes[p]) + ( dt_bitmap -> BytesPerRow y)); 
       
color += plain>> ] & (255) ? (1<<p) : ;
      }

      
rgb_color bob_func-> color(new_bob,color_regs[color*3+0]>>24,color_regs[color*3+1]>>24,color_regs[color*3+2]>>24 );

      
printf("%d,%d\n",x,y);

      
bob_func-> pixel(new_bobrgb_color ,x,y);

     }
    }

    
bob_func -> unlock(new_bob);

    
DoDTMethod ( (void *) dto,NULL,NULL,ADTM_UNLOADFRAME);

    if (
last_bob) { last_bob -> next new_bob; }
    
last_bob new_bob;

   }
  }

  
DisposeDTObject(dto);
 }
 else
 {
  
printf("%s is loaded as image, not a animbrush!\n");
  
ret  load_dt_imagename );
 }

 return 
ret;
}

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Need help loading Animbrushed using datatype system.
Just popping in
Just popping in


See User information
@LiveForIt

Maybe you can also access it via Picture Datatype using the PDTA_WhichPicture TagItem. It is worh a try.

Go to top
Re: Need help loading Animbrushed using datatype system.
Not too shy to talk
Not too shy to talk


See User information
@Wanderer

That does not work for Anims, only for ILBMs inside a LIST or CAT.

Go to top
Re: Need help loading Animbrushed using datatype system.
Home away from home
Home away from home


See User information
@Wanderer

Quote:

Wanderer wrote:
@LiveForIt

Maybe you can also access it via Picture Datatype using the PDTA_WhichPicture TagItem. It is worh a try.


Picture datatype will only read the first image.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Need help loading Animbrushed using datatype system.
Home away from home
Home away from home


See User information
@Hans

Hi Hans can you explain how to use ADTM_LOADFRAME?

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Need help loading Animbrushed using datatype system.
Just can't stay away
Just can't stay away


See User information
@LiveForIt

Quote:
Quote:
Wanderer wrote:

Maybe you can also access it via Picture Datatype using the PDTA_WhichPicture TagItem. It is worh a try.


Picture datatype will only read the first image.
No, for image formats which support it, for example GIF (anims) and TIFF, picture.datatype can return all images in it using PDTA_WhichPicture.
For example MultiView supports it, it displays the total number of pictures and the number of the currently displayed one in the window title ("foobar (x/y)") and you can switch between them using the '<' and '>' keys.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project