Page 57 of 69
Re: New map features
Posted: 18 Sep 2016 10:31
by JGR
Hi Cirdan, I've added a branch 'cirdan-blitter-scroll-fix' to
https://github.com/JGRennison/OpenTTD-patches which fixes this issue.
It's caused by a signed/unsigned arithmetic issue when calculating the src point when scrolling vertically downwards (scroll_y < 0) in the Blitter_*::Surface::scroll methods.
Re: New map features
Posted: 18 Sep 2016 13:00
by cirdan
You were fast—I was still looking at the code, wondering why the bug did not show up on my box, but it turns out that it is masked if integers and pointers are the same size. Thank you; I have merged your patch and pushed it to the repo, along with another commit to silence
this warning.
Re: New map features
Posted: 18 Sep 2016 15:10
by wallyweb
cirdan wrote:I have merged your (JGR) patch and pushed it to the repo, along with another commit to silence
this warning.
The bugicidal unguaranteed Win32 binaries are posted below:
and for those who want bridges over stations (
free-bridges.diff):
Enjoy
Re: New map features
Posted: 18 Sep 2016 18:03
by TrueSatan
Not on my compiling machine, will use this post as dummy to provide the compiled version l8er.
Thank you so much for (hopefully) fixing the problem
Cheers
Sure i will test a few things before posting and either post the executable or a bug report
Re: New map features
Posted: 18 Sep 2016 18:24
by cirdan
After looking at the code, the same bug could affect the smallmap. Could you test this before posting a binary?
Re: New map features
Posted: 18 Sep 2016 19:15
by JGR
cirdan wrote:After looking at the code, the same bug could affect the smallmap. Could you test this before posting a binary?
I tried the smallmap and got the result in the screenshot.
The vertical stripes seem to appear when tiles are marked dirty and redrawn. When paused the background stays black.
There aren't any crashes when scrolling though.
Re: New map features
Posted: 18 Sep 2016 19:35
by cirdan
Thanks for testing. Displaying the smallmap is the problem here, not scrolling. Even if there is no crash, random locations in memory may be being written to. I am working on a fix.
Re: New map features
Posted: 18 Sep 2016 19:39
by wallyweb
JGR wrote:cirdan wrote:After looking at the code, the same bug could affect the smallmap. Could you test this before posting a binary?
I tried the smallmap and got the result in the screenshot.
The vertical stripes seem to appear when tiles are marked dirty and redrawn. When paused the background stays black.
There aren't any crashes when scrolling though.
With my Win32 binaries I saw none of this. All was as expected.
Re: New map features
Posted: 18 Sep 2016 20:08
by cirdan
wallyweb wrote:With my Win32 binaries I saw none of this. All was as expected.
Yes, this is normal. The bug only affects 64-bit platforms, where pointers are usually wider than integers.
Re: New map features
Posted: 18 Sep 2016 21:09
by TrueSatan
As JGR has posted I got the same result on Minimap. Its black with strips of the normal minimap at random points.
Even tried to enabe graphs (never used before) and other windows.
Beside the minimap it runs okay so far.
Thanks and I will wait for the fix before posting a new version of the Ubuntu binary
Cheers
Re: New map features
Posted: 19 Sep 2016 14:41
by cirdan
The attached patch should fix the smallmap on 64-bit platforms. Can you give it a try?
Re: New map features
Posted: 19 Sep 2016 16:20
by JGR
cirdan wrote:The attached patch should fix the smallmap on 64-bit platforms. Can you give it a try?
All seems to work fine for me with this applied.
On an unrelated note, I get these warnings about maybe uninitialised variables when compiling:
- [+] Spoiler
Code: Select all
/home/jgr/openttd/trunk4/src/elrail.cpp: In function ‘void DrawCatenaryRailway(const TileInfo*)’:
/home/jgr/openttd/trunk4/src/elrail.cpp:572:27: warning: ‘sprite_halftile’ may be used uninitialized in this function [-Wmaybe-uninitialized]
AddSortableSpriteToDraw (ti->vd, wire_base + sss->image_offset[PCPconfig], PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
In file included from /home/jgr/openttd/trunk4/src/company_type.h:15:0,
from /home/jgr/openttd/trunk4/src/error.h:16,
from /home/jgr/openttd/trunk4/src/train_cmd.cpp:13:
/home/jgr/openttd/trunk4/src/core/enum_type.hpp: In function ‘bool TrainController(Train*, Vehicle*, bool)’:
/home/jgr/openttd/trunk4/src/core/enum_type.hpp:109:3: warning: ‘chosen_trackdir’ may be used uninitialized in this function [-Wmaybe-uninitialized]
m_val = (storage_type)e;
^
/home/jgr/openttd/trunk4/src/train_cmd.cpp:3610:13: note: ‘chosen_trackdir’ was declared here
Trackdir chosen_trackdir;
Re: New map features
Posted: 19 Sep 2016 17:55
by cirdan
JGR wrote:All seems to work fine for me with this applied.
Thank you, I have pushed the fix to the repository.
JGR wrote:On an unrelated note, I get these warnings about maybe uninitialised variables when compiling:
Yes, I am aware of those, and they are false positives. I could silence them by initialising the relevant variables with a constant, but I am not too keen on writing worse code to appease the compiler.
Re: New map features
Posted: 19 Sep 2016 19:56
by wallyweb
cirdan wrote: I have pushed the fix to the repository.
More bugicide ...
Unguaranteed Windows 32bit binaries:
JGR's tracerestrict version is available
here.
Enjoy!
Re: New map features
Posted: 19 Sep 2016 19:58
by TrueSatan
Looks fine over here so I post the usual 64bit version for Ubuntu 14.04
Still see no reason to switch to 16.04 haha
Thanks JGR and Cirdan for the fast fixes.
And as well JGR tracerestriction branch.
Cheers
Re: New map features
Posted: 19 Sep 2016 20:13
by JGR
wallyweb wrote:JGR's tracerestrict version will be posted here when we have his push.
TrueSatan wrote:JGR tracerestriction will be posted as soon as JGR has updated the branch
This is on Github now.
Re: New map features
Posted: 19 Sep 2016 21:54
by wallyweb
JGR wrote:This is on Github now.
For those who want the JGR tracerestricted Windows 32 bit bugicide we have:
The original cirdan variety is available
here.
Enjoy.
Re: New map features
Posted: 08 Jan 2017 21:27
by Pyoro
This might be something that's due to self-compiling/patching, but I have crashes when building a rail X crossing directly on a bridge head, and then removing only the crossing track. Works fine for roads and demolishing the entire bridge, though.
...
Kinda almost feel like this came up before, but, eh, I don't know. Maybe someone can double-check with the builds posted here?
Re: New map features
Posted: 08 Jan 2017 21:47
by cirdan
Confirmed, the crash happens when trying to update the signals around the segment that contains the bridge head. The attached patch should fix this. Note that it may take some time until I can push this to the repository.
Re: New map features
Posted: 08 Jan 2017 22:06
by Pyoro
Now that's what I call great costumer service
... thanks.