Smallmap zoom/Minimap zoom
Moderator: OpenTTD Developers
Re: Smallmap zoom/Minimap zoom
OK, I haven't found out what's wrong there. I just can't get the vehicles to stay where they belong in the smallmap. It has something to do with the additional accuracy I've introduced by changing PixelToTile into PixelToWorld so that it gives potentially non-tile-aligned world coordinates. This is necessary for zoom-in. I'm pushing an isolated update of smallmap-zoom-in now, so that you can see for yourself. I might be able to have another look sometime next week, but I'm fairly busy ATM.
- Attachments
-
- smallmap-zoom-in_r19096.diff
- smallmap-zoom-in with glitching vehicles
- (13.64 KiB) Downloaded 115 times
The guy on the picture is not me, it's Alonso.
Re: Smallmap zoom/Minimap zoom
Zoom-in makes it quite a bit more complicated. I cannot say what is wrong with it 
I am aware of two possible causes of your problems.
For the second problem I created a new routine, attached to the mesg, along with some test-code that sets tile (56, 19) to the top-left at (x, y) when you press 'center map' (each time for a different x/y value). Make a map with something special at that position that you can recognize.
In the patch I applied to trunk (r19104), this routine is called ComputeScroll(). It uses PixelToTile() rather than copying the computation and does not directly set the parameters, so it is a bit more difficult to understand than this stand-alone test routine.
I hope you find it useful.

I am aware of two possible causes of your problems.
- this->scroll_x and this->scroll_y are not truncated to multiples of TILE_SIZE * this->zoom
- PixelToTile() does not do perfect pixel positioning.
For the second problem I created a new routine, attached to the mesg, along with some test-code that sets tile (56, 19) to the top-left at (x, y) when you press 'center map' (each time for a different x/y value). Make a map with something special at that position that you can recognize.
In the patch I applied to trunk (r19104), this routine is called ComputeScroll(). It uses PixelToTile() rather than copying the computation and does not directly set the parameters, so it is a bit more difficult to understand than this stand-alone test routine.
I hope you find it useful.
- Attachments
-
- pixel_perfect_positioning.patch
- Put the tile exactly where you want it.
- (1.7 KiB) Downloaded 115 times
Re: Smallmap zoom/Minimap zoom
The problem is resolved now.
The guy on the picture is not me, it's Alonso.
Re: Smallmap zoom/Minimap zoom
Glad to hear that.
Re: Smallmap zoom/Minimap zoom
The URLs of my patch space and git repository have changed:
git repository: git://github.com/fonsinchen/openttd-cargodist.git
The zoom-in patch is at http://github.com/fonsinchen/openttd-ca ... om-in.diff
The version the zoom-in patch applies to can be found at http://github.com/fonsinchen/openttd-ca ... ERSION.txt
git repository: git://github.com/fonsinchen/openttd-cargodist.git
The zoom-in patch is at http://github.com/fonsinchen/openttd-ca ... om-in.diff
The version the zoom-in patch applies to can be found at http://github.com/fonsinchen/openttd-ca ... ERSION.txt
The guy on the picture is not me, it's Alonso.
Who is online
Users browsing this forum: No registered users and 1 guest