|
Width of a bitmap |
Albin Engström
Member #8,110
December 2006
|
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? |
X-G
Member #856
December 2000
|
... BITMAP *b; b->w -- |
CGamesPlay
Member #2,559
July 2002
|
BITMAPClick it. -- Ryan Patterson - <http://cgamesplay.com/> |
Albin Engström
Member #8,110
December 2006
|
Thanks , but what should i do if the bitmap is in a datafile? |
23yrold3yrold
Member #1,134
March 2001
|
Needs more brackets on that one IIRC. -- |
CGamesPlay
Member #2,559
July 2002
|
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. -- Ryan Patterson - <http://cgamesplay.com/> |
Albin Engström
Member #8,110
December 2006
|
|
CGamesPlay
Member #2,559
July 2002
|
My post has the right way to do it... -- Ryan Patterson - <http://cgamesplay.com/> |
Albin Engström
Member #8,110
December 2006
|
totally sweet . thanks! |
|