Merge branch 'master' into bots

Conflicts:
	src/gamelogic/game/g_cmds.c
Don't create unused renderbuffers.

The engine binds textures to these FBOs, so the renderbuffers weren't
used. Also they generated warnings during startup as ALPHA16F is not supported
by all GPUs.
Prefer ‘-Og’ and ‘-g3’, where supported, for debug builds.

-g3 adds debug info regarding macro expansion.
-Og = -O1 without debug-unfriendly optimisations; needs gcc >= 4.8.
Tidy up CMakeFiles usage; use the main CMakeFiles for most subprojects.
Tell basepak.sh about build directories.
Use hw gamma by default on Windows
Rework network port handling.

Unless acting as a server, let the system select port numbers.
Client binaries will re-open their sockets when entering and leaving server mode.
Client port numbers are not persistent across server mode.

Servers will not try to open ports < 1024.

The “opening socket” messages are reworked a little.

PORT_ANY is now defined as 0 to match standard networking usage.

Currently in-use port nos. are in net_currentPort and net_currentPort6.
Reconnection: save connect command; don't break this when starting a demo.

This fixes two problems:
* reconnection where both ends can use both IPv4 and IPv6
  - connect -6 unv.example.com // using IPv6
  - reconnect                  // but now IPv4?
* reconnection breakage due to demo playback
  Starting the demo overrode the saved server name.
  This led to the demo name being used as the server name.
Add FS_FOpenFileRead_Impure for local non-VM use.
/demo – demo files are never pure, so use FS_FOpenFileRead_Impure.

This fixes the /demo command when used while still connected to a pure server.
Clean up static variable usage in FS_FOpenFileRead_Filtered.
Refactor shadowing a bit and place inverse lights based on a trace.
Mark r_deferredShading as CVAR_CHEAT
Fix TTY console colouring.
Eliminate FS_Read2, which does nothing not done by FS_Read.
Fix shadowmap image for ESM16 and VSM16 modes

Obvious typo
Revert "Don't create unused renderbuffers."

This reverts commit 73b0a16f8f5a3055cfc1907c8c62d6e69cdd8649.
The offending commit caused glCheckFramebufferStatusEXT in R_CheckFBO to complain about a missing draw buffer
Merge branch 'master' into bots

Conflicts:
	src/gamelogic/game/g_main.c
Fix tty client build.
Merge branch 'bots' into bots+viech