The International Simutrans Forum

 

Author Topic: Patch to Shift-constriction mode  (Read 3222 times)

0 Members and 1 Guest are viewing this topic.

Offline Ichou

  • *
  • Posts: 73
  • Languages: JA, EN
Patch to Shift-constriction mode
« on: April 06, 2017, 08:07:12 AM »
<This topic is derived from http://forum.simutrans.com/index.php?topic=16851.0>

I made a patch to complete Shift-construction mode.
This patch is based on r8188.

This patch has 2 additional functions.
  • Point lower layer when clicked by elevated waybuilders with Shift key on.
  • Consider existing elevated ways as "path"s when elevated ways are built.

Therefore, with this patch, you can receive much convenience as the movie shows.
Not a valid vimeo URL
This patch will definitely make your Simutrans more useful!

Offline Leartin

  • Devotee
  • *
  • Posts: 1395
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Patch to Shift-constriction mode
« Reply #1 on: April 06, 2017, 08:25:05 AM »
Looking good, hope it has no side effects so it can be implemented :)

Offline Ichou

  • *
  • Posts: 73
  • Languages: JA, EN
Re: Patch to Shift-constriction mode
« Reply #2 on: April 06, 2017, 10:16:59 AM »
I confirmed this works with r8163 - the latest stable version.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4665
  • Languages: EN, DE, AT
Re: Patch to Shift-constriction mode
« Reply #3 on: April 06, 2017, 07:37:01 PM »
Imho the patch doubles some code in wegbauer.cc, which is not nice from a maintaining perspective. It should be possible to obtain the same behavior by modifying just the essential parts. Also you do not need a second instance of marker_t.

Offline Ichou

  • *
  • Posts: 73
  • Languages: JA, EN
Re: Patch to Shift-constriction mode
« Reply #4 on: April 07, 2017, 01:32:22 AM »
Quote
Imho the patch doubles some code in wegbauer.cc, which is not nice from a maintaining perspective. It should be possible to obtain the same behavior by modifying just the essential parts. Also you do not need a second instance of marker_t.
I wonder whether it is possible to make a grund_t obj which means there is no obj, and which contains only the coordinates as meaningful information.
If it's possible, I don't need the second instance of marker_t and reduce some double coding easily.
If it's not possible, I need it because it has to distinguish the two situations that the tile is visited as "lower" or "upper" layers.




I reduced part of doubled coding.(Not all!)

Changing general source to search ways, it might cause a problem related to groundway/bridge/tunnels/... construction.
« Last Edit: April 07, 2017, 03:00:13 AM by Isaac.Eiland-Hall »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9901
  • Languages: De,EN,JP
Re: Patch to Shift-constriction mode
« Reply #5 on: August 11, 2017, 02:46:37 AM »
Thank you incorporated in r8284, thank you

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4665
  • Languages: EN, DE, AT
Re: Patch to Shift-constriction mode
« Reply #6 on: August 11, 2017, 03:32:17 PM »
Now we have a lot of code duplicated and triplicated in wegbauer.cc

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9901
  • Languages: De,EN,JP
Re: Patch to Shift-constriction mode
« Reply #7 on: August 19, 2017, 03:00:23 PM »
Yes, but it reduced the otherwise even larger check for readiness for places. Not sure how one could get away without duplication in some place.