Hey all, I'm lookin' to start up a non-grid strategy game, and I've hit a problem with rotating the bmp's for units so that they face the right way. Here's the code that I have, but it doesn't work:
Code:
PALETTE pal;
get_palette(pal);
BITMAP * bmp = load_bmp(filename.c_str(),pal);
fix_image_pal(bmp,pal);
fixed angle = 0, scale = fixed((SCREEN_W/4)/(bmp->w/2));
while (!key[KEY_ESC]) {
clear_bitmap(buffer);
rotate_sprite(buffer,bmp,SCREEN_W/2-(bmp->w/2),SCREEN_H/2-(bmp->h/2),angle);
if (++angle >= 256) angle = 0;
textprintf_centre(buffer,font,SCREEN_W/2,SCREEN_H/4,15,"angle = %d",angle);
blit(buffer,screen,0,0,0,0,SCREEN_W,SCREEN_H);
}
When I run this the picture just sits in the middle, not rotating. I also attached a zip with all of everything you'd need to see this in action (except alleg40.dll). I was wondering if anybody knows why this isn't working or how I could fix it, thx.