From 75b53542f2669d00caf2f98cfdbc9f1c91a6277f Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Wed, 24 Nov 2021 11:00:06 +0100 Subject: ImageEngine: Remove unneeded check for tiled image. Regular images are also tiled images, but with a default tile that leads to the same result. --- .../blender/draw/engines/image/image_drawing_mode.hh | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh b/source/blender/draw/engines/image/image_drawing_mode.hh index d81b0971982..528e47b7a1e 100644 --- a/source/blender/draw/engines/image/image_drawing_mode.hh +++ b/source/blender/draw/engines/image/image_drawing_mode.hh @@ -50,19 +50,13 @@ class DefaultDrawingMode : public AbstractDrawingMode { GPUBatch *geom = DRW_cache_quad_get(); - const bool is_tiled_texture = image && image->source == IMA_SRC_TILED; - if (is_tiled_texture) { - const float translate_x = image_mat[3][0]; - const float translate_y = image_mat[3][1]; - LISTBASE_FOREACH (ImageTile *, tile, &image->tiles) { - const int tile_x = ((tile->tile_number - 1001) % 10); - const int tile_y = ((tile->tile_number - 1001) / 10); - image_mat[3][0] = (float)tile_x + translate_x; - image_mat[3][1] = (float)tile_y + translate_y; - DRW_shgroup_call_obmat(grp, geom, image_mat); - } - } - else { + const float translate_x = image_mat[3][0]; + const float translate_y = image_mat[3][1]; + LISTBASE_FOREACH (ImageTile *, tile, &image->tiles) { + const int tile_x = ((tile->tile_number - 1001) % 10); + const int tile_y = ((tile->tile_number - 1001) / 10); + image_mat[3][0] = (float)tile_x + translate_x; + image_mat[3][1] = (float)tile_y + translate_y; DRW_shgroup_call_obmat(grp, geom, image_mat); } } -- cgit v1.2.3