incube: Add DrawTextureCubeEx to draw sphere as inflated cube

There have been two methods to draw round astronomical objects;
DrawTextureSphere and DrawTextureSpheroid.  They were very different
implementation to render a shape, but neither one of them provide a way
to render height-varying terrain.  This branch is an attempt to create
the third type of method, DrawTextureCubeEx, to achieve it.

The astronomical body is rendered as an inflated cube; there are 6 faces
to each direction which are divided into meshes.  Vertices of divided
meshes are normalized in length to make the shape of a sphere.
incube: Polish DrawTextureCubeEx to draw modulated terrain
incube: Add skirts to hide gaps between panels
Import simplex noise implementation

From:
http://webstaff.itn.liu.se/~stegu/simplexnoise/

The original author is Stefan Gustavson, and the codes are in
public domain.

I have modified the source's extension to .cpp to make it be
able to build with Visual C++ without compile option tweaks,
since the source contains declaration after statements, which
is not allowed in ANSI C but C++.

Also added are static specifiers to perm variables to prevent
duplicate symbol errors at link time.
incube: Generate random height map with simplex fractal noise
incube: Use 3-D simplex noise to remove the need of skirts
incube: Use Vertex Buffer Objects to enhance performance
incube: Add texture mapping ability to DrawTextureCubeEx

Ceres demonstrates this functionality.
incube: Implement very basic Level-of-Detail for DrawTextureCubeEx

This LOD determination is done per cube face (there are 6 of them), so
you won't get high detail for opposite side of the celestial body when
you walk on it.

This LOD granularity should become higher as the player apporaches the
surface to allow layered LOD tree for optimized rendering.
incube: Implement Level-of-Detail in a cube face for DrawTextureCubeEx

Strangely, subdividing lod details actually makes it slower.
incube: Add skirts to hide gaps between LOD patches of DrawTextureCubeEx
incube: Add profiling codes to measure time to invoke DrawTextureCubeEx

Profiling result shows that vertex buffer objects (VBOs) with high vertex
count (80,000 vertices or so) make the rendering really slow in Radeon HD
6870, while it doesn't make much difference on GeForce GT 650M.

The reason is speculated to be related with memory cache, but I don't have
explicit explanation.
incube: Make intermediate LOD use individual VBO for performance

GeForce GT 650M doesn't gain benefit, though.
incube: Basic parallel processing for vertices generation

Generating vertices of a LOD patch takes some time, so doing it in the
main thread blocks real-time simulation for a moment.  We'd want to
parallelize it by performing the generation in a worker thread.

This is done by C++11's std::threads.  It works, but might be very
inefficient because a thread is created for each LOD patch.  There should
be threads of the same number as the processing cores who share jobs
collaboratively to disperse loads.

There's also an issue which causes runtime error in program exit.
It probably has something to do with std::thread's destructor.
incube: Introduce fixed worker threads to share jobs

As in the previous commit's comments, creating a thread for each LOD patch
is very inefficient.  We introduce fixed worker threads who collabolatively
share jobs.  'Collaborative' here means that free workers gets new job
before busy ones.

Also fixed the issue that the program crashes on exit by *not* destroying
thread objects in the destructor.  There might be a correct way to free
them, but my laziness disallow me searching it.
Normalize indentation
incube: Prevent holes when detailed patch is not yet loaded

While a parallel thread processes detailed mesh vertices for a patch,
rendering least detailed mesh is desirable, since the least detailed mesh
initialization is synchronized with the main thread, meaning there are
always least detailed meshes.
incube: Add profiling chart series for count of patches for each LOD
Clean up stellar_file.h by removing obsolete declarations and includes
Add utility functions to interpret values in SSD as script expression

Sqcalci is for interpreting integer values.  Sqcalcb is for interpreting
boolean values.  Double values should be passed to sqcalcd, but it's
currently defined as CoordSys::sqcalc(), which should be moved to
stellar_file.h.