Fix cond jump on uninitialized var.
Merge remote-tracking branch 'upstream/master' into renderdevice
Merge remote-tracking branch 'upstream/master' into renderdevice
Merge remote-tracking branch 'upstream/master' into renderdevice
Merge remote-tracking branch 'upstream/master' into renderdevice
Merge remote-tracking branch 'upstream/master' into renderdevice
Merge remote-tracking branch 'upstream/master' into renderdevice
Merge remote-tracking branch 'upstream/master' into renderdevice
Merge remote-tracking branch 'upstream/master' into renderdevice
Part1: RenderDevice Abstraction Refactor.

This is the first part of fixes for issue #969.

- Removed ISprite and replaced it with Sprite implementation
  from SDLRenderDevice. There is no need to make Sprite an interface
  due to it have the same functionality independently of render backend.

- Update Image to be factory of Sprite's, added Image::createSprite().
  Made constructor private and added Image as friend for compiletime
  control of who can instantiate a Image.

- Added reference counting on Image and logics for freeing a
  resource when last reference is released using RenderDevice::freeImage().

- Made Sprite to increase reference on source image in constructor and
  release the reference in destructor.

- Update RenderDevice to be a factory of Images's, made constructor
  of Image private and SDLRenderDevice a friend of Image. FIXME, this
  should be changed so that RenderDevice is friend instead.

- Added RenderDevice.cpp for implementations of Sprite, Image, RenderDevice

- Replaced all instantiations of Image to use the RenderDevice as factory

- Replaced all instantiations of Sprites to use the Image as factory

- Changed Menu to handle shared code for background of derived menus,
  setBackground(), setBackgroundClip() and setBackgroundDest()

- Made Menu::render() non pure virtual and added implementation to render
  background image if availabl in Menu baseclass.

- Updated all derivied menus of base class Menu to use the new background
  rendering implementation by calling Menu::render().

- Update all code that used Image and Sprite to use the new factories for
  allocation and release of resources.

I have tested this big refactor through valgrind and there is one leak left
in ImageManager class, this however will be removed completly and replaced
with same base functionality implementation in RenderDevice::loadGraphicsSurface()
Part2: RenderDevice Abstraction Refactor.
This is the second part of fixes for issue #969.

- Refactored Image to be completly abstracted

- Added implemenation of SDLImage derived from Image which now
  owns the SDL specific resource SDL_Surface

- Updated SDLRenderDevice implemenation to use the new SDLImage
  instead of old Image. static_cast<SDLImage *>(Image *) is used
  to get the derived SDLImage pointer.
Merge remote-tracking branch 'upstream/master' into renderdevice

Conflicts:
	src/SDLRenderDevice.cpp
Part3: RenderDevice Abstraction Refactor.
This is the third part of fixes for issue #969.

This change with the new image cache in RenderDevice will fix
problems reported on issue #972

- Added image cache implementation to RenderDevice,
  cacheLookup(), cacheStore() and cacheRemove() are added.

- Updated SDLRenderDevice to use the new image cache in base
  class. The cache is instrumented at load and free of an Image.

- Added helper loadTextureImage() to Utils, this will construct a
  filename to load noalpha or not, code migrated from ImageManager.

- Removed ImageManager completly now when we have a image cache in
  RenderDevice. Update all use of image manager to use the new
  loadTextureImage() util function.

- Added a few missing unref() of images to cleanup memleaks.
Merge remote-tracking branch 'upstream/master' into renderdevice

Conflicts:
	src/GameStateResolution.cpp
	src/SharedResources.cpp

Rewrote the CursorManager to use the new RenderDevice abstraction.
Fix crash when switching resolutions.
When background is deleted we need to clear background pointer.
Merge remote-tracking branch 'upstream/master' into renderdevice

Conflicts:
	src/CursorManager.cpp
Try to keep a constant game speed when rendering can't keep up

Fixes #985

This should handle 99.9% of slow-down, where logic would happen slower in
realtime. The 0.1% of cases where slow-down can still happen is when the
time for a frame to complete goes over a certain threshold (e.g. frames
where we load game data; this is explained more in the source comments).
Make indentation script work on header files.
Merge pull request #987 from hean01/master

Make indentation script work on header files.
Merge pull request #983 from Gallaecio/gl

Updated the Galician (gl) translation