andrewphorn/ClassiCube-Client — pull request #300 by fragmer (2014-10-30 09:52:19+00:00)
Title: Reduced memory pressure. Fixed #263. Added adaptive vsync.

1) Memory pressure has been reduced by decreasing the amount of temporary objects. GC should trigger less often, resulting in fewer lag spikes. Here is a profiling record of a 3-minute walk through a 512x512x64 level: [before](http://i.imgur.com/99DhLAy.png) and [after](http://i.imgur.com/awTRkWV.png) optimizations.

2) Fixed ENV_SET_COLOR packets received during the level-loading process causing a NullPointerException. This fixes #263. PacketHandler now creates a Level object ("newLeveL" field) when LEVEL_INIT arrives, but does not set minecraft.level to that object until LEVEL_FINALIZE. Packet handlers should use this variable to set level settings during the loading process.

3) Made vsync adaptive. If actual framerate drops below 1/2 desired framerate, vsync will be turned off to improve responsiveness.