Minor Tetzle update

Posted on December 22, 2008, under Tetzle

I made a release of Tetzle yesterday that fixes two long-standing bugs: firstly, the mouse cursor should no longer drift off of pieces while you are moving them; secondly, the tiles should look correct no matter how zoomed the board is. Both bugs stem from the same issue: the width of the tiles don’t evenly divide, and floating point errors were cropping in.

For instance, if you have a tile that is 64 pixels wide and you want to show it as 6 pixels wide, you multiply it by 0.09375. But if the tile is 65 pixels wide, you need to multiply it by a number that can’t be properly represented as a float. And so most of the tiles will show up as 6 pixels, but some of them will be 7 and stretch the tile border to match. My quick solution was to scale the tiles on the CPU and round the values to integers before passing them to OpenGL. For the 1.3 release I plan to use a faster solution, but I wanted to release a stop-gap bugfix before then.

2 comments

gallaecio says:

December 31, 2008 at 11:04 am

Hi, I want you to know I really like this game you are developing. It looks like quite simple, but It’s really funny. And I love chosing my own images. Happy New Year!

Graeme says:

December 31, 2008 at 2:57 pm

Thank you, I’m glad you like it. Happy New Year!

Categories