How do i get the width of a bitmap?
is there a handy function for this in allegro or do i have to make one myself?
... BITMAP *b; b->w
BITMAPClick it.
Thanks ,
oh, missed that part of the manual.. will look harder next time.
but what should i do if the bitmap is in a datafile?
(BITMAP*)datafiles::sprites_enemies[1].dat->w
doesn't work :/
Needs more brackets on that one IIRC.
(BITMAP*)(sprites_enemies[1].dat)->w
Something like that; I forget exactly.
The dat member is a void*, so it doesn't have a w member. However, the void* is really a BITMAP, so we cast it: (BITMAP*) datafiles::sprites_enemies[1].dat. From there, we take the w member: ((BITMAP*) datafiles::sprites_enemies[1].dat)->w. This is the order of operations, and it is said that the -> binds "tighter" than the (BITMAP*), so we have to use parentheses to switch the order.
still doesn't work :(
"`void*' is not a pointer-to-object type "
My post has the right way to do it...
totally sweet . thanks!