Reimplement Bounding Box calculation using the software renderer.
Fix linux build and various warnings.

Increase savestate version.
Get buildbot to compile.
Several small optimizations.
Fixed a small bug.
Fix compile errors after rebase.
Merge pull request #1095 from crudelios/sw-bbox

Reimplement Bounding Box calculation using the software renderer.