Merge pull request #654 from RobertBColton/master

Fixes Image Saving and Loading
Merge pull request #657 from RobertBColton/master

Overloads general surface functions. I would like more consistency while declaring the default color though. Here Robert uses c_white, while in sprite and background 16777215 was used. Because technically we could support color in many formats, I guess c_white is the more proper way, so we might need to change the sprite and background functions. On the other hand c_white requires a GScolors.h include and extra includes are usually bad.
Merge pull request #660 from RobertBColton/master

Direct3D 9 Textures.
Doesn't break GL1 or GL3.
Merge pull request #661 from RobertBColton/master

Switching internal image format to BGRA from RGBA
Merge pull request #662 from RobertBColton/master

Fixes PNG Saving
Merge pull request #663 from RobertBColton/master

Fix Cocoa
Fixed CPU usage when out of focus

Fixes the bug that CPU usage increase dramatically when the game is
frozen. The game is frozen when out of focus by default. So if I have an
empty game that takes like 1%, when I make it loose focus it goes to 17%
(probably at least 1 of my 8 cores on max). It looses focus also when
minimized, so minimizing a game with "Freeze the game when it looses
focus" option makes it jump to 17%.

This happens because the "freeze" thing happens in main loop and is
checked with:

>if (enigma::gameFroze) continue;

This basically means that it's running an empty loop as fast as
possible, thus using all the resources it can. It can be fixed by doing
adding a delay in the loop. I added 100000us, which means it will only
run the loop 10 times a second. We can increase/decrease the delay if
needed. But now the game uses 0% of CPU when frozen or minimized.
Fixed window_set_pos and implemented minimization

-Fixed window_set_position(). It used wrong window handler. Some users
still use the wrong one. Why are there 2 handlers in that file?
-Added window_set_minimized() and window_get_minimized().

window_set_visible seems broken and in GM hides the window from both the
screen and the task bar (in Win8 you can only see the window in task
manager). In ENIGMA it just show a black window. To make it work the
same as GM, we need to use ShowWindow() with HIDE parameter instead of a
style.
Merge remote-tracking branch 'upstream/master'