New map features

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
JGR
Tycoon
Tycoon
Posts: 2558
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: New map features

Post 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.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post 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.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:I have merged your (JGR) patch and pushed it to the repo, along with another commit to silence this warning.
:bow:

The bugicidal unguaranteed Win32 binaries are posted below:
OpenTTD-REBASED-r27601-g1ece0fb9-Win32.7z
Non gMo bugicidal
(5.48 MiB) Downloaded 49 times
and for those who want bridges over stations (free-bridges.diff):
OpenTTD-FreeBridge-g1ece0fb9M-Win32.7z
** CAUTION ** Contains free-bridges.diff
Known to cause uninhibited fun
(5.48 MiB) Downloaded 56 times
Enjoy
:D
Last edited by wallyweb on 19 Sep 2016 19:46, edited 1 time in total.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post 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 :)
Last edited by TrueSatan on 18 Sep 2016 18:42, edited 1 time in total.
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

After looking at the code, the same bug could affect the smallmap. Could you test this before posting a binary?
User avatar
JGR
Tycoon
Tycoon
Posts: 2558
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: New map features

Post 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.
Attachments
Unnamed, 1945-02-05.png
(618.16 KiB) Not downloaded yet
Ex TTDPatch Coder
Patch Pack, Github
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post 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.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post 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.
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post 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.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post 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
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

The attached patch should fix the smallmap on 64-bit platforms. Can you give it a try?
Attachments
blitter-fix.diff
(6.87 KiB) Downloaded 47 times
User avatar
JGR
Tycoon
Tycoon
Posts: 2558
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: New map features

Post 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;
Ex TTDPatch Coder
Patch Pack, Github
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post 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.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote: I have pushed the fix to the repository.
:bow:

More bugicide ... :mrgreen:
Unguaranteed Windows 32bit binaries:
OpenTTD-REBASED-r27601-g95852d54-Win32.7z
Non gMo bugicidal
(5.48 MiB) Downloaded 43 times
OpenTTD-FreeBridge-g95852d54M-Win32.7z
** CAUTION ** Contains free-bridges.diff
Known to cause uninhibited fun
(5.48 MiB) Downloaded 42 times
JGR's tracerestrict version is available here.

Enjoy!
:D
Last edited by wallyweb on 19 Sep 2016 22:12, edited 2 times in total.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post 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.

:bow:

Cheers
Attachments
openttd-custom-g95852d54-UNIX.tar.xz
Version: g95852d54
Ubuntu 14.04 64bit
(4.66 MiB) Downloaded 35 times
openttd-custom-gde262117-tracerestrict-cirdan-UNIX.tar.xz
Version: gde262117-tracerestrict
Ubuntu 14.04 64 bit
(4.68 MiB) Downloaded 112 times
Last edited by TrueSatan on 19 Sep 2016 22:24, edited 3 times in total.
User avatar
JGR
Tycoon
Tycoon
Posts: 2558
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: New map features

Post 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.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

JGR wrote:This is on Github now.
:bow:

For those who want the JGR tracerestricted Windows 32 bit bugicide we have:
OpenTTD-gde262117-tracerestrict-cirdan-Win32.7z
Non gMo tracerestrict bugicidal
(5.5 MiB) Downloaded 39 times
OpenTTD-gde262117M-FreeBridge-tracerestrict-cirdan-Win32.7z
tracerestrict bugicidal enhanced with free-bridges.diff
(5.5 MiB) Downloaded 55 times
The original cirdan variety is available here.

Enjoy.
:D
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: New map features

Post 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?
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post 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.
Attachments
crossing-bridgehead.diff
(626 Bytes) Downloaded 47 times
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: New map features

Post by Pyoro »

Now that's what I call great costumer service ;) ... thanks.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests