Mercurial > fife-parpg
comparison engine/core/video/opengl/glimage.cpp @ 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 | 90005975cdbb |
children | ad7969d9460b |
comparison
equal
deleted
inserted
replaced
262:17eba3872550 | 263:10e0687a4cec |
---|---|
184 m_textureids = new GLuint[m_rows*m_cols]; | 184 m_textureids = new GLuint[m_rows*m_cols]; |
185 memset(m_textureids, 0x00, m_rows*m_cols*sizeof(GLuint)); | 185 memset(m_textureids, 0x00, m_rows*m_cols*sizeof(GLuint)); |
186 | 186 |
187 if(width%m_chunk_size) { | 187 if(width%m_chunk_size) { |
188 m_last_col_fill_ratio = static_cast<float>(width%m_chunk_size) / static_cast<float>(m_last_col_width); | 188 m_last_col_fill_ratio = static_cast<float>(width%m_chunk_size) / static_cast<float>(m_last_col_width); |
189 } else { // (width%m_chunk_size) / m_last_col_width == 0 == m_chunk_size (mod m_chunk_size) | |
190 m_last_col_fill_ratio = 1.0f; | |
191 } | |
192 | |
193 if (height%m_chunk_size) { | |
189 m_last_row_fill_ratio = static_cast<float>(height%m_chunk_size) / static_cast<float>(m_last_row_height); | 194 m_last_row_fill_ratio = static_cast<float>(height%m_chunk_size) / static_cast<float>(m_last_row_height); |
190 } | 195 } else { |
191 else { // (width%m_chunk_size) / m_last_col_width == 0 == m_chunk_size (mod m_chunk_size) | |
192 m_last_col_fill_ratio = 1.0f; | |
193 m_last_row_fill_ratio = 1.0f; | 196 m_last_row_fill_ratio = 1.0f; |
194 } | 197 } |
195 | 198 |
196 unsigned int chunk_width; | 199 unsigned int chunk_width; |
197 unsigned int chunk_height; | 200 unsigned int chunk_height; |