ABOUT al_draw_rotated_bitmap()

Thank you for your help, my progress is very fast.

But there is another problem.On the functions provided by ALLEGRO.

This is a function that can be used to rotate the picture.

However, my angle add, then my speed reduction, even if only 0.1 angle.

In the end, I became a tortoise.:(

I repeatedly checked my code.No speed reduction.

This is bug？Or function characteristic？

-------------------------------------------------

I just simply turn al_draw_bitmap into al_draw_rotated_bitmap.

My first blind guess would be you're doing a unit conversion (from degrees to radians) BUT you forgot to add a .0 to the number so it's automatically converting it to an integer (chopping off all the precision!).

al_draw_rotated_bitmap(my_bitmap, 0, 0, x, y, my_angle*360/2, 0); //no al_draw_rotated_bitmap(my_bitmap, 0, 0, x, y, my_angle*360/2.0, 0); //yes al_draw_rotated_bitmap(my_bitmap, 0, 0, x, y, my_angle*360.0/2.0, 0); //yes al_draw_rotated_bitmap(my_bitmap, 0, 0, x, y, my_angle*360.0/2, 0); //yes

where my_angle was originally in degrees, and you are converting it to radians using *360/2.

Well I hope you're not converting like that. ;P

double deg = rad*180.0/M_PI;

double rad = deg*M_PI/180.0;

Whoops!

Katko,

C'mon, it's basic fundamental math skills here people. How many degrees are there in a circle? How many radians? If they are the same then they are equal. Put one on each side of an equation. Then divide both sides by one side or the other. You get 1 = 360.0 Degrees / 2.0*PI Radians which also equals it's own inverse. Now if you multiply a number by one you haven't changed it! If you want to go from degrees to radians, you divide by 360 and multiply by 2*PI. Conversely, multiply by 360 degrees and divide by 2*PI radians.

You're gonna have to show more code. We can't guess what you're doing.

@Chris Katko

That means his principle？

I need to keep the accuracy of the arc.

Using float, the precision will be lost.

It will still reduce the speed.

Float only guarantees six bits.

------------------------------

Anyway, my speed will still be reduced.

I can only use a stupid way.

Revise his speed at a time.

------------------------------

old code：

------------------------------

Maybe,pi=3.1415926.Speed reduction is not recognized by eyes.

But in that way, the efficiency is down.

Sorry to drop in abruptly but the expression

arc - pi / 2.0

Should evaluate always to 0, as I don't see arc being changed anywhere in the (small) code you posted

If you're having a __speed__ problem, on a modern system the al_draw_rotated_bitmap alone shouldn't be causing that.