Mail Archives: djgpp/1998/03/26/05:26:14
>> I guess what you wanted was something like this:
>> blit((BITMAP *)data[selecto].dat, screen, 0, 0, 0, 0, 320, 200);
>
>Actually, the typecast is not neccessary, AFAIK.
>simply using
>
>blit(data[selecto].dat, screen, 0, 0, 0, 0, 320, 200);
>
>should work fine, and it's slightly less long to type.
Yes, maybe I was mislead my this piece of information form the Allegro
docs...
---
If you are programming in C++ you will get an error because the dat field
is
a void pointer and draw_sprite() expects a BITMAP pointer. You can get
around this with a cast, eg:
draw_sprite(screen, (BITMAP *)data[THE_IMAGE].dat, x, y);
---
Anyway, I had some bad experiences with pointers while programming under
windows 3.1 and I put explicit casts to avoid problems every time I can.
ciao
Giacomo
- Raw text -