Fixed white space on the left/top of background images with an origin of "0.5 0.5". Hopefully.

Added additional error output when SDL renderer fails to create window.
This commit is contained in:
Alec Lofquist 2014-06-10 17:36:03 +00:00
parent 4efbafdad9
commit 678cd10029
2 changed files with 3 additions and 3 deletions

View file

@ -66,7 +66,7 @@ namespace Renderer
if(sdlWindow == NULL)
{
LOG(LogError) << "Error creating SDL window!";
LOG(LogError) << "Error creating SDL window!\n\t" << SDL_GetError();
return false;
}

View file

@ -189,8 +189,8 @@ void ImageComponent::updateVertices()
const float width = round(bottomRight.x() - topLeft.x());
const float height = round(bottomRight.y() - topLeft.y());
topLeft[0] = round(topLeft[0]);
topLeft[1] = round(topLeft[1]);
topLeft[0] = floor(topLeft[0]);
topLeft[1] = floor(topLeft[1]);
bottomRight[0] = topLeft[0] + width;
bottomRight[1] = topLeft[1] + height;