changeset 263:10e0687a4cec

Fixed a bug in the OpenGl renderer where the last chunk of images would not be displayed when image_height % chunk_size was 0.
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 11 Jun 2009 17:12:12 +0000
parents 17eba3872550
children ea85ddce2b36
files engine/core/video/opengl/glimage.cpp
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/video/opengl/glimage.cpp	Tue Jun 09 13:31:59 2009 +0000
+++ b/engine/core/video/opengl/glimage.cpp	Thu Jun 11 17:12:12 2009 +0000
@@ -186,10 +186,13 @@
 
 		if(width%m_chunk_size) {
 			m_last_col_fill_ratio = static_cast<float>(width%m_chunk_size) / static_cast<float>(m_last_col_width);
-			m_last_row_fill_ratio = static_cast<float>(height%m_chunk_size) / static_cast<float>(m_last_row_height);
+		} else {  // (width%m_chunk_size) / m_last_col_width == 0 == m_chunk_size (mod m_chunk_size)
+			m_last_col_fill_ratio = 1.0f;
 		}
-		else {  // (width%m_chunk_size) / m_last_col_width == 0 == m_chunk_size (mod m_chunk_size)
-			m_last_col_fill_ratio = 1.0f;
+
+		if (height%m_chunk_size) {
+			m_last_row_fill_ratio = static_cast<float>(height%m_chunk_size) / static_cast<float>(m_last_row_height);
+		} else {
 			m_last_row_fill_ratio = 1.0f;
 		}