Started on caching uniforms/attributes

First iteration on caching uniforms and attributes.
Now there are std::map's in shader program struct that links names to
locations (so when calling glsl_get_uniform_location we don't have to
call the slow GL function) and another map to link locations to uniform
structs. These structs hold information about the uniform (very useful
for debugging) as well as the content of the uniform. So while the
content is updated we can cache it and get rid of many redundant
glUniform calls.
As we hold information about the type (scalar, vec2, vec3 etc.) as well
as the data type (int, float) then we can print useful debug messages
when a user uses the wrong glsl_uniform function with the given uniform.
The same with attributes, but they are not cached yet.

Todo: Make attributes also cached and add functions for matrix uniforms.
Fixed typo in Ortho and made it faster

There was a typo in matrix functions where ortho was written
incorrectly. At the same time I made d3d_set_projection_ortho() a little
faster.
Fixes GL3 lights

-Fixed GL3 lights and at least in Mario example they work the same way
as in GL1. It required some changes in both the shader and the light
system.
-Made light system faster - now it only updates lights that need
updating. I still need to finish the cache system for this to work
effectivly. But even now it greatly increases the performance.
Previously with broken lights GL3 was down to 170FPS in Mario example,
now with working lights it's back to 950FPS.

There could still be problems with point lights. But Mario does seem to
look ok (altough he seems a little brighter in the menu).
More caching and bug fixes

-More GLSL uniform caching.
-Added debug checks for background and sprite loading.
-Better error messages.
Fixes get_timer()

-Fixes get_timer() so it updates the exact moment the function is called
and not only between steps. Useful for benchmarking. Additional changes
comming.
Up-to-date

Updated the whole thing to newest master.
Additional caching and default shader

-Additional caching for uniforms in vector form. Added functions to set
them - glsl_uniformXfv, glsl_uniformXiv and glsl_uniformXuiv. Speeds up
lights slightly.
-Added a function to override default shader. Should allow users via LGM
or via an extension to create their own lights system. As an example I
plan to make a "Per-pixel lighting extension".
-Removed more deprecated matrix functions from surfaces. glPushAttrib
still remains though.
-Some additional fixes.
Fixes GL3 for AMD

The only fix I found was to send color attribute always, even if no
color is specified. This should in turn be slower, so I don't want this
as a permanent fix. Is it possible that color is send and yet
useColor=false? Especially considering it seems that only models were
affected (i.e., the ones loaded by d3d_model_load and drawn with
d3d_model_draw). Maybe the bug is there?
Fixes custom shaders

-Forgot to get uniforms and attributes for custom shaders.
-Added matrix uniforms to pixel shader prefix as well. Useful for things
like per-pixel lighting.
-Added a better error message for the shader compiler.
Fix String Dimnsion Functions *DO NOT MERGE*
The string dimension functions were using unsigned integers internally
whilst calculating the dimensions, what they should have been doing was
using a float and then returning the ceiled result. They now work
perfectly and I tested thoroughly with keyboard_string and various fonts.
I also reformatted this file it was kind of fucked up from the last time I
edited it, it is all good now.
Cleanup command line and get it functioning for Windows, it now actually
builds a test game.
Fixes lights for texturless and colorless objects

-Shader was slightly wrong, so objects without color or texture (so only
using bound color) didn't render with lights.
-Added few getters like d3d_model_has_color, _has_texture, _has_normals
which return wheter the 3D model has these attributes specified. Used in
color setting functions, so draw_set_color() would end batching if the
previous batch didn't have a specified color. Allows things like:
draw_set_color(c_white);
d3d_model_ellipsoid(...);
draw_set_color(c_lime);
d3d_model_ellipsoid(...);
Previously that drawed 2 lime colored ellipsoids, now it will correctly
draw one white and one lime. This is an extension to the color problem
that was dissucesed a year ago -
http://enigma-dev.org/forums/index.php?topic=1375.msg13778#msg13778
-Light enabling and disabling now correctly end batching. Maybe other
light functions should do that too.
cleanup
Improvements to CLI
Backup
Wtf
Cleanup, basic outline working.
Fixes Direct3D issues, the depth buffer was turned on by default which it
wasn't in OGL, this was causing display reset issues.
Whoops, forgot GL3
GM actually uses an inverse depth buffer for ortho projections, Studio
operates the same, for now I just inverted znear and zfar.