From 9e236b8946881f2b52e40b4de242aad65d93ede3 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 23 Mar 2013 21:13:26 +0000 Subject: [PATCH] gpu: fix several bugs introduced by the tileset refactoring. --- src/tileset.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tileset.cpp b/src/tileset.cpp index 04f3cf9f..961c0123 100644 --- a/src/tileset.cpp +++ b/src/tileset.cpp @@ -80,8 +80,8 @@ TileSet::TileSet(char const *path, ivec2 size, ivec2 count) { if (size.x <= 0 || size.y <= 0) size = ivec2(32, 32); - m_data->count.x = m_data->m_image_size.x / max(size.x, m_data->m_image_size.x); - m_data->count.y = m_data->m_image_size.y / max(size.y, m_data->m_image_size.y); + m_data->count.x = m_data->m_image_size.x / min(size.x, m_data->m_image_size.x); + m_data->count.y = m_data->m_image_size.y / min(size.y, m_data->m_image_size.y); m_data->m_tile_size = size; }