Author Topic: smart hide cursor - lots of artefacts  (Read 132 times)

0 Members and 1 Guest are viewing this topic.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4247
  • Total likes: 175
  • Helpful: 149
  • Languages: EN, DE, AT
smart hide cursor - lots of artefacts
« on: October 06, 2017, 12:31:17 PM »
Seems like most of the map is not redrawn. See screenshot, which was taken after resizing the window.

Edit: this is a version without multithreading. It works fine with a multithreaded compile.
Parsley, sage, rosemary, and maggikraut.

Offline TurfIt

Re: smart hide cursor - lots of artefacts
« Reply #1 on: October 07, 2017, 02:23:14 AM »
Scrolling the map around creates a much more interesting effect for a screenshot!

Clearly nobody who self builds single threaded uses the smart hide cursor setting... Much better when the ground outside the hide radius is actually drawn - try r8300.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4804
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: smart hide cursor - lots of artefacts
« Reply #2 on: October 07, 2017, 08:12:12 AM »
I didn't know there was such a thing as smart hiding. Then again, I never trust claims that anything a computer does is smart.

Offline DrSuperGood

Re: smart hide cursor - lots of artefacts
« Reply #3 on: October 07, 2017, 09:43:35 AM »
Quote
Clearly nobody who self builds single threaded uses the smart hide cursor setting... Much better when the ground outside the hide radius is actually drawn - try r8300.
A bigger question one should be asking is why one can still build Simutrans without multithreading support in 2017. Even modern smart phones have 6 cores...

At some stage pthreads should probably become mandatory so a lot of duplicate code and macros can be removed to avoid bugs like this. I think it already is mandatory for Simutrans Extended for performance reasons.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4804
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: smart hide cursor - lots of artefacts
« Reply #4 on: October 07, 2017, 10:12:13 AM »
Threading is difficult when working on the same mutable data structure. Sometimes even counter-productive. Apparently, there are still bugs in there, and they are difficult to track down. And Simutrans appears to only use threading when working on the same data structure. It would be much less error prone to remove the threading from the rendering, and introduce threading in the routing code where you only need to read shared data, and only when it is not mutating.

Although this build is limited to non-threaded builds, it is only a visual glitch, unlike the bug related to smart hiding in multithreaded builds, which locks everything up with complete loss of data. That makes me still happy to be able to stay away from the threaded builds. (Although mingw64 insists on linking against pthreads anyway. And it also insists on linking that particular library dynamically, unless I remove the files needed for that.)