Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

[solved] Quad indexing bug on textures with columns != rows

A topic by Jakub Wasilewski created Jun 12, 2018 Views: 267 Replies: 1
Viewing posts 1 to 2
(1 edit)

Hey,

Just bought the asset and I'm taking it for a test-drive to see if everything I need it to do is possible. I hit upon a bug with quad rendering - if you use a texture with a number of columns that's not equal to the number of rows, indexing is off. If you have a 16 columns x 4 rows image, the row changes once every 4 indices instead of every 16 - <quad=foo,8> draws the image at (8,2) instead of (8,0).

Traced it down to this line in STMQuadData.cs - the division should be by the number of columns (the number of images in a row), not the number of rows.

int row = (int)Mathf.Floor((float)myIconIndex / (float)rows);
Developer

Oh oops, nice catch. I'll flip that!