|
From: Lasse Kärkkäi. <tr...@us...> - 2011-02-07 00:45:21
|
Module: performous Branch: opengl2 Commit: 0608e9eee182e78178fd3f06bb933aa6529ec5ca Author: Lasse Karkkainen <tro...@tr...> Date: Mon Feb 7 00:19:48 2011 +0100 Make Surface::load only adjust dimensions when the aspect ratio hasn't been defined before. --- game/surface.cc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/game/surface.cc b/game/surface.cc index 77da12b..674cf22 100644 --- a/game/surface.cc +++ b/game/surface.cc @@ -125,7 +125,7 @@ void Surface::load(unsigned int width, unsigned int height, pix::Format format, using namespace pix; // Initialize dimensions m_width = width; m_height = height; - dimensions = Dimensions(ar != 0.0f ? ar : float(width) / height).fixedWidth(1.0f); + if (dimensions.ar() == 0.0) dimensions = Dimensions(ar != 0.0f ? ar : float(width) / height).fixedWidth(1.0f); // Load the data into texture UseTexture texture(m_texture); PixFmt const& f = getPixFmt(format); |