I am trying to draw frames which I would then rotate from a bitmap, however, the image only seems to be drawn in the corner of the screen not in the place that the sprite has the position put.
My method to draw frames and rotate is :
void drawFrame(SPRITE *spr,ALLEGRO_BITMAP *source, int columns)
int fx = (spr->curFrame % columns) * spr->width;
int fy = spr->animRow * spr->height;
ALLEGRO_BITMAP *bitmap = al_create_bitmap(32,32);
al_draw_bitmap_region(source,fx,fy,spr->width, spr->height,spr->x-spr->width / 2, spr->y-spr->height/2,0);
al_draw_rotated_bitmap(bitmap, spr->width/2, spr->height/2,spr->x-spr->width / 2, spr->y-spr->height/2,ALLEGRO_PI, 0);
al_draw_rectangle(spr->x - spr->width/2, spr->y - spr->height/2,spr->x + spr->width/2, spr->y + spr->height/2,al_map_rgb(255,255,255),1.0);
It just doesn't seem to follow the actual x at all, it basically goes constantly to 0 width and 0 height, is there a better (functional) way of doing this? My whole code is : http://pastebin.com/XAhf9HAT
Thanks for the help.