Fix T38315: keymap configuration export did not export deactivated items correct.
Fix T38011 and cleanup of Lens Distortion node code.

The area-of-interest calculation for that node didn't work reliably.
It tries to estimate the distorted rectangular area based on min/max
distortion and dispersion values, but this fails in some cases and
leaves uninitialized buffer chunks. So now simply use the full input
rect as the area, even though it may not be as efficient - at least it
works ...

Also cleaned up the code somewhat to make it understandable, using
separate functions for common stuff instead of cryptic walls of math.
Revert "Fix T37920: BGE LibLoad failed for meshes with no materials"

This reverts commit 6a473305af22468abfc4c4f8f3002dc0a97fffd7.

Caused T38296, need to investigate this further but for now
better not leave blender in unstable state.
Fix for particle emission bug, reported on IRC by Thomas Beck
(@plasmasolutions): When the particle emitter is parented to a fast
moving object, the emission locations will not be interpolated over
subframes. This works if the particle emitter is animated itself.
Particle system evaluates the emitter location for each subframe, but
has to do this for the parent objects as well to get reliable results.
Fix T38318: blender internal viewport now uses viewport, not render visibility.

This is the same as cycles and more consistent with it also using viewport
resolution.
Fix tool properties region drawing even if the toolbar is hidden.

This would show as a line on the side of the 3D view with high DPI / retina,
not easy to notice.
Fix T37198: Vorbis encoding is broken

Issue was caused by wrong PTS calculation. This commit
makes this calculation closer to what's happening in
FFmpeg itself.

Seems everything is working now including newer FFmpeg,
but there's one thing which still doesn't work: writing
avi files with h264 codec and Vorbis audio doesn't play
correct in mplayer here. But didn't manage to get this
working even using FFmpeg CLI, so this might be just a
bug in FFmpeg/mplayer. Since this file works fine in
blender just fine wouldn't consider this is crucial thing
to look into at this moment.
Fix T38319: no camera error message for render not showing correctly.
Fix T37940: Curve Render bug in Blender Internal Render.

Issue was caused by curve object really scale up. It was
caused by 677f519 to make scaled down curves work fine.

After some tweaks to epsilon value scaled up curves seems
to work as well.
Fix T38323: blender viewport render in particle hair edit mode renders halos.

Currently it's not supported to do viewport render of particles while in
particle edit mode, hide the particle instead of rendering halos.
Fix T38316: Half of a Face is Missing on Newly Created Cubes or Cylinders.

Own bug from rBc691551249f3. Now at least I understand why `test_index_face()` is needed for tessellated quads!

Added a bunch of comments to explain the issue, as it's far from an obvious one...

We loose some performances, but it's still much quicker than org code.
Memory allocation: do not use mmap for memory allocation on 64 bit.

On Windows we can only do mmap memory allocation up to 4 GB, which causes a
crash when doing very large renders on 64 bit systems with a lot of memory.

As far as I can tell the reason to use mmap is to get around address space
limitation on some 32 bit operating systems, and I can't see a reason to use
it on 64 bit. For the original explanation see here:
http://orange.blender.org/blog/stupid-memory-problems

Fixes T37841.
Fix T38311: cycles BVH cache crash on Windows.
Tab theme colors

patch D234 from Jonathan Williamson with edits

- de-duplicate rna_def_userdef_theme_space_gradient and rna_def_userdef_theme_space_generic
- ui_theme_init_new_do now always sets theme settings (no need to test),
  used by bpy.ops.ui.reset_default_theme()
Themes: update for tab colors
Fix T38325: Game Engine Bitmap fonts failed for characters >128
BGE Bitmap Text: add in check if the character is outside the range
Fix T38110: GameEngine keyboard sensor ignores unicode characters
Fix T38328: GLSL display shows texture mapping completely messed up in some cases

Own stupid typo in rB28ca299d4dfc...
WM: add WM_operatortype_remove_ptr to remove a known operator