PDA

View Full Version : DrawRotate is slow



Ebbe
25-01-2005, 03:06 PM
I want a 2d car to be able to turn around and drive in all 8 directions, but if I use sprites and DrawRotate, it is very slow.
The alternative is to have pictures for all 8 directions and then show them when the car is in the right angle and use DrawRotate for the inbetweens..

But that is alot of code and images. Is there a easier way?


Ebbe

PS. I hope people know what I am talking about..

DraculaLin
25-01-2005, 03:37 PM
You must change your DXImageList property.
like this:
DXImageList.Items[0].SystemMemory:=True;

PS:
This is only for your car image,does not for all images.

Ebbe
25-01-2005, 04:38 PM
Great!
That really helped :)

Crisp_N_Dry
25-01-2005, 08:32 PM
The best way of doing this is as follows:

At the start of your program rotate your car by increments of say 10 degrees (Or as much or little as you want) and store each rotated frame in your imagelist or an array or wherever. Then, when it comes to the main game loop, all you have to do is blit the appropriate image to the surface which is fast. From what I gather from your post you are redoing the rotation at every frame, it's no wonder it's very slow. Hope this helps.

ijcro
26-01-2005, 09:23 AM
Hi,

here http://www.micrel.cz/Dx/delphix.exe is simple program for demonstration software and hardware speed difference in DelphiX. Written in Delphi2005 + (un)DelphiX + extender for DelphiX (only two lines code have to added, original code no changed). Extender is tested now and can be it released in short time.

Any comments welcome.