So I am only on episode 50 - way way before Casey addresses optimisation.
However since Casey added the background bitmap, each frame ramps up to 130+ ms a frame making the game unusable. I've been getting around this by simply removing the background and the hero draw only hits the ms a small amount so I have left that in.
Specifically its the bitwise operators when performing the linear blend that is causing the speed issues.
| float sr = (float)((*source >> 16) & 0xFF);
float sg = (float)((*source >> 8) & 0xFF);
float sb = (float)((*source >> 0) & 0xFF);
float dr = (float)((*dest >> 16) & 0xFF);
float dg = (float)((*dest >> 8) & 0xFF);
float db = (float)((*dest >> 0) & 0xFF);
float r = (1.0f - a) * dr + a * sr;
float g = (1.0f - a) * dg + a * sg;
float b = (1.0f - a) * db + a * sb
|
;
I only have a laptop i7 running @ 1.90Ghz but surely it can handle something this simple? Interestingly it seems to only cause a big problem when built with Visual Studio. If I build using Casey's bat file, the slow down isn't as bad.
I am not too sure why this would be? I can't identify what flag Casey has set that I haven't set in Visual Studio that would cause this? Since he has Od set which disables any optimisations!?
Any one had this issue or have any ideas how I can make this more usable without turning on optimisations?