Bug #4387

32bpp_zoom_ground template offsets

Added by dnicholls over 7 years ago.

Status:NewStart date:2012-10-09
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


I think the template tmpl_32bpp_zoom_ground in sprites\templates\sprite_templates.pnml calculates xoffset and yoffset incorrectly.


template tmpl_32bpp_zoom_ground(zoom, file) { [0, 0, 64*zoom, 64*zoom, -32*zoom+1, -32*zoom, file] }

I think the correct calculation should be:

template tmpl_32bpp_zoom_ground(zoom, file) { [0, 0, 64*zoom, 64*zoom, -32*zoom+zoom, -32*zoom-zoom, file] }

The attached images show sprite 3981 with the current offsets (A) and the corrected offsets (B). The sprite is surrounded by instances of a different normal zoom sprite which doesn't have any alternative sprites but does have the correct offsets, so it should look correct at all zoom levels. The remaining black areas in the B images are just where the edge of the non-zoomed sprite doesn't join the smooth edge of the zoomed sprite, which is a separate issue (if these sprites also had zoomed in versions, the issue wouldn't be visible).

zoom_level_normal.png is additionally zoomed in by 4x so the difference is clear.

The text in the B images gives the new offsets relative to the current ones. The new formula follows from those observations.

zoom_level_normal.png (99.8 KB) dnicholls, 2012-10-09 20:04

zoom_level_in_2X.png (155 KB) dnicholls, 2012-10-09 20:04

zoom_level_in_4X.png (537 KB) dnicholls, 2012-10-09 20:04

Also available in: Atom PDF