Sorry but I am about to rain on your parade. I am afraid you guys are attributing magic to SDL that does not exist.
Quote:
Originally Posted by colin9876
U know the BurningSand code is not very long, the dll library does most of it. Look at the micro version of BurningSand on the website its only 10lines long!!
|
It's MUCH more than ten lines of appallingly tortured C code when unravelled and all that it is using the SDL library for is to get and set pixels on an SDL surface i.e. a bitmap. Any magic that exists in Burning Sand is in the logic of the physics engine and has nothing to do with SDL which is merely used as a conduit to the display.
With B4PPC you are facing a performance problem. The trade off-for the simplicity of B4PPC is the lack of performance and we are talking literally orders of magnitude here. To show you what you are up against I took your tt.sbp and moved the timer and destroy code into a library. Actually I cheated a bit by missing out the "rnd" and just did "py(i)=py(i)+1". This can smoothly handle about 500 points on my PPC but that gives no time left over for the physics calculations! This library uses a .NET standard bitmap and its GetPixel and SetPixel methods which are not very efficient. It could be improved by a factor of at least 10 by going in at a lower level. If you run this on a desktop keep the cursor away from the right side and bottom or you may get a crash - I didn't bother too much with limit checking.
So I am afraid that the bottom line is that to get a viable BS to run under B4PPC you would have to write it in a library - which rather defeats the point of the excercise of writing it in B4PPC!
