Are these changes on GitHub, or...?
Script error in '', line: 0
// slower:function Draw() { for (blah) { DrawA(); DrawB(); DrawC(); }}// faster:function Draw() { for (blah) { DrawA(); } for (blah) { DrawB(); } for (blah) { DrawC(); }}
function Draw() { BeginBatch(BATCH_ORDERTEX_ASC); for (blah) { DrawA(); DrawB(); DrawC(); } EndBatch(); // it is here textures are committed, rather than some place above.}
Ok, so weird trick, in SphereSFML you can repeat loops like this to maximize performance:Code: (javascript) [Select]// slower:function Draw() { for (blah) { DrawA(); DrawB(); DrawC(); }}// faster:function Draw() { for (blah) { DrawA(); } for (blah) { DrawB(); } for (blah) { DrawC(); }}
Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\Users\Bruce\Documents\GitHub\sphere-sfml\Engine\Engine\bin\x86\Debug\Engine.vshost.exe'.Additional information: The runtime has encountered a fatal error. The address of the error was at 0x74c58880, on thread 0x24d4. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
Okay, so two things.First: How is it that minisphere, less than a month-old project, runs Specs better than Sphere-SFML which is going on 2 years old?
At the end of the day I'm not sure you are atlasing textures or sprite batching them, so the speed you get is allegro's awesomeness out-of-the-box. I'm sure my engine is better at everything else, including the map engine. I just need to fix the surfaces issues.
This way sprite batching would be a natural part of the API rather than just haphazardly retrofit onto the backend.
As for the crash, if you look at the screenshot, what it looks like is SFML is trying to draw the mask rect outside of the surface bounds, eventually leading to a buffer overrun and subsequent segfault. I also notice Sphere-SFML doesn't seem to honor SetClippingRectangle calls...
But that slow compilation is not without a benefit: the game runs at about 8000 fps on my rig in SSFML and only at about 3500 fps in minisphere.