JGR's Patch Pack

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
vincentkoevoets
Engineer
Engineer
Posts: 48
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets »

Hey JGR! Thanks for the new update! Can you help me with a compiling problem? I always compiled on MacBook without any problems, but 27.0 gave me spritecache error. I pasted the output from where it tries to compile spritecache.cpp. I am quite the noob when it comes to compiling, but I had it working fine before!
Thanks man!

Code: Select all

[SRC] Compiling spritecache.cpp
In file included from /Users/koevoets/Downloads/source/src/spritecache.cpp:19:
In file included from /Users/koevoets/Downloads/source/src/blitter/factory.hpp:19:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/map:442:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tree:18:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:719:71: error: 
      invalid operands to binary expression ('const SpriteInfo' and
      'const SpriteInfo')
    bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
                                                                  ~~~ ^ ~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:4973:13: note: 
      in instantiation of member function 'std::__1::__less<SpriteInfo,
      SpriteInfo>::operator()' requested here
        if (__comp(*__ptr, *--__last))
            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:5001:5: note: 
      in instantiation of function template specialization
      'std::__1::__sift_up<std::__1::__less<SpriteInfo, SpriteInfo> &,
      std::__1::__wrap_iter<SpriteInfo *> >' requested here
    __sift_up<_Comp_ref>(__first, __last, __comp, __last - __first);
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:5010:12: note: 
      in instantiation of function template specialization
      'std::__1::push_heap<std::__1::__wrap_iter<SpriteInfo *>,
      std::__1::__less<SpriteInfo, SpriteInfo> >' requested here
    _VSTD::push_heap(__first, __last, __less<typename iterator_traits<_R...
           ^
/Users/koevoets/Downloads/source/src/spritecache.cpp:680:8: note: in
      instantiation of function template specialization
      'std::__1::push_heap<std::__1::__wrap_iter<SpriteInfo *> >' requested here
                std::push_heap(candidates.begin(), candidates.end());
                     ^
/Users/koevoets/Downloads/source/src/spritecache.cpp:670:8: note: candidate
      function not viable: 'this' argument has type 'const SpriteInfo', but
      method is not marked const
                bool operator<(const SpriteInfo &other)
                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/utility:567:1: note: 
      candidate template ignored: could not match 'pair<type-parameter-0-0,
      type-parameter-0-1>' against 'const SpriteInfo'
operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:706:1: note: 
      candidate template ignored: could not match
      'reverse_iterator<type-parameter-0-0>' against 'const SpriteInfo'
operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_I...
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:1125:1: note: 
      candidate template ignored: could not match
      'move_iterator<type-parameter-0-0>' against 'const SpriteInfo'
operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iterator:1494:1: note: 
      candidate template ignored: could not match
      '__wrap_iter<type-parameter-0-0>' against 'const SpriteInfo'
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y...
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/tuple:1187:1: note: 
      candidate template ignored: could not match 'tuple<type-parameter-0-0...>'
      against 'const SpriteInfo'
operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2874:1: note: 
      candidate template ignored: could not match
      'unique_ptr<type-parameter-0-0, type-parameter-0-1>' against
      'const SpriteInfo'
operator< (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2932:1: note: 
      candidate template ignored: could not match
      'unique_ptr<type-parameter-0-0, type-parameter-0-1>' against
      'const SpriteInfo'
operator<(const unique_ptr<_T1, _D1>& __x, nullptr_t)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2941:1: note: 
      candidate template ignored: could not match
      'unique_ptr<type-parameter-0-0, type-parameter-0-1>' against
      'const SpriteInfo'
operator<(nullptr_t, const unique_ptr<_T1, _D1>& __x)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4702:1: note: 
      candidate template ignored: could not match
      'shared_ptr<type-parameter-0-0>' against 'const SpriteInfo'
operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4767:1: note: 
      candidate template ignored: could not match
      'shared_ptr<type-parameter-0-0>' against 'const SpriteInfo'
operator<(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:4775:1: note: 
      candidate template ignored: could not match
      'shared_ptr<type-parameter-0-0>' against 'const SpriteInfo'
operator<(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
^
1 error generated.
make[1]: *** [spritecache.o] Error 1
make: *** [all] Error 1
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: JGR's Patch Pack

Post by 3iff »

A thank you for including the "send to depot and sell" option. It is absolutely magic. When I close a service now, I just auto sell the vehicles and don't have to sit there waiting until the last one arrives.
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

vincentkoevoets wrote:Hey JGR! Thanks for the new update! Can you help me with a compiling problem? I always compiled on MacBook without any problems, but 27.0 gave me spritecache error. I pasted the output from where it tries to compile spritecache.cpp. I am quite the noob when it comes to compiling, but I had it working fine before!
Thanks man!
Thanks for letting me know about this, can you try the most recent commit which I've pushed to the repo (i.e. using git pull).
3iff wrote:A thank you for including the "send to depot and sell" option. It is absolutely magic. When I close a service now, I just auto sell the vehicles and don't have to sit there waiting until the last one arrives.
Thanks :)
Ex TTDPatch Coder
Patch Pack, Github
User avatar
vincentkoevoets
Engineer
Engineer
Posts: 48
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets »

JGR wrote:
vincentkoevoets wrote:Hey JGR! Thanks for the new update! Can you help me with a compiling problem? I always compiled on MacBook without any problems, but 27.0 gave me spritecache error. I pasted the output from where it tries to compile spritecache.cpp. I am quite the noob when it comes to compiling, but I had it working fine before!
Thanks man!
Thanks for letting me know about this, can you try the most recent commit which I've pushed to the repo (i.e. using git pull).
Everything back in working order. I'm ashamed to admit that I don't know how to use github (and git pull..), really a noob!, but I manually changed the code of spritecache.cpp and compiled without a problem.
Last edited by vincentkoevoets on 13 Sep 2018 06:49, edited 1 time in total.
User avatar
SquireJames
Tycoon
Tycoon
Posts: 1863
Joined: 07 Aug 2004 11:56
Skype: squirejames5
Location: Stoke-on-Trent
Contact:

Re: JGR's Patch Pack

Post by SquireJames »

JGR wrote:
SquireJames wrote:Seem to be encountering repeated crashes when trying to upgrade signals (from their semaphore to electric light equivalent). I can upload the dmp file to a server if required.
Does this still occur with the latest release (0.27.0)?
There have been some bug fixes since then which may be related.
If so it would be useful if you could attach a savegame.
I can't do anything with windows dmp files, so there's no need to upload those.
Thanks.
Running 0.27.0 now and it seems to be resolved. Thanks :)
Image
Tsylatac
Engineer
Engineer
Posts: 50
Joined: 26 Dec 2015 01:04

Re: JGR's Patch Pack

Post by Tsylatac »

Thanks again for all of the work you put into this for us! <3

If I may make another small suggestion/request, when creating a new vehicle group, could that group (optionally?) automatically be made a child of whatever group was selected at the time? As the network expands it gets a little annoying scrolling and scrolling and scrolling to drag each new subgroup to the appropriate parent :lol:

Also, a bug report, when setting Zoning to "Station catchment (window open)" it falls short a row of tiles to the bottom-left.

And I don't know if this is a bug or intentional, but when "When paused allow:" is set to the default "All non-construction actions" it is not allowed to program a signal while paused. I'm leaning toward bug, because setting routefinding restrictions is still allowed...
ecolortest
Engineer
Engineer
Posts: 19
Joined: 12 Oct 2016 07:46

Re: JGR's Patch Pack

Post by ecolortest »

A bug in this version 0.27.1

Assertion failed at line 75 of /home/jgr/openttd/cross-win32/src/fontcache.cpp: IsPrintable(key)

This is happen if do click a Game Options
Triskelen
Engineer
Engineer
Posts: 6
Joined: 08 Aug 2018 13:11

Re: JGR's Patch Pack

Post by Triskelen »

So i downloaded openttd installed it then I downloaded the pack from githubb then overwritten the files in the folder
and it still seems I'm just playing normal openttd :?
mak
Traffic Manager
Traffic Manager
Posts: 205
Joined: 30 Sep 2015 13:16

Re: JGR's Patch Pack

Post by mak »

Triskelen wrote:So i downloaded openttd installed it then I downloaded the pack from githubb then overwritten the files in the folder
and it still seems I'm just playing normal openttd :?
Assume using Windows
Go to page one of this topic, download the zip file you require.
Unzip downloaded file to a new file {choose name for this file example: JGR) in Documents or whever you wish
Create dektop shortcut to the 'aplication' within that file.

Enjoy
sd70
Engineer
Engineer
Posts: 8
Joined: 11 Aug 2005 05:58
Location: Spokane, Wa. USA

Re: JGR's Patch Pack

Post by sd70 »

Thank you JGR for adding the vehicle flipping in station patch, it works great !!
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: JGR's Patch Pack

Post by SimYouLater »

sd70 wrote:Thank you JGR for adding the vehicle flipping in station patch, it works great !!
What exactly does that patch do, again? I can't figure out how it reverses trains in the depiot. (Yes, I have it enabled! :) )
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
JGR
Tycoon
Tycoon
Posts: 2557
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

Tsylatac wrote:Thanks again for all of the work you put into this for us! <3

If I may make another small suggestion/request, when creating a new vehicle group, could that group (optionally?) automatically be made a child of whatever group was selected at the time? As the network expands it gets a little annoying scrolling and scrolling and scrolling to drag each new subgroup to the appropriate parent :lol:
I know what you mean there, I will look into it when I have some time available.
Tsylatac wrote:Also, a bug report, when setting Zoning to "Station catchment (window open)" it falls short a row of tiles to the bottom-left.

And I don't know if this is a bug or intentional, but when "When paused allow:" is set to the default "All non-construction actions" it is not allowed to program a signal while paused. I'm leaning toward bug, because setting routefinding restrictions is still allowed...
Thanks for spotting and pointing out these. They should both be fixed now and will be in the next release.
ecolortest wrote:A bug in this version 0.27.1

Assertion failed at line 75 of /home/jgr/openttd/cross-win32/src/fontcache.cpp: IsPrintable(key)

This is happen if do click a Game Options
I presume this is in Wine?
I will look into it, but I don't anticipate much success in resolving the issue.
You'll probably be better building for your platform (Linux?).
SimYouLater wrote:What exactly does that patch do, again? I can't figure out how it reverses trains in the depiot. (Yes, I have it enabled! :) )
It enables reversing the direction of non-articulated train wagons/locomotives in the depot using Ctrl-click.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
Captain Rand
Traffic Manager
Traffic Manager
Posts: 192
Joined: 28 Jan 2012 07:35

Re: JGR's Patch Pack

Post by Captain Rand »

JGR wrote:
You'll probably be better building for your platform (Linux?).
Speaking of which.... Is there any chance of getting a ready to go Linux build?
I really hate Windows (OTTD is one of the very few things I have to keep a Windows box for), and I've never been able to get Wine to work.

Pete.
There's nothing like a deadline to hone the concentration.

Good manners cost nothing, but earn respect.

" 'Impossible' is not in our vocabulary." Jack Chrichton, Farscape
ino
Traffic Manager
Traffic Manager
Posts: 152
Joined: 09 Apr 2017 14:58

Re: JGR's Patch Pack

Post by ino »

Captain Rand wrote:
JGR wrote:
You'll probably be better building for your platform (Linux?).
Speaking of which.... Is there any chance of getting a ready to go Linux build?
I really hate Windows (OTTD is one of the very few things I have to keep a Windows box for), and I've never been able to get Wine to work.

Pete.
ํYou literally

Code: Select all

$ git clone https://github.com/JGRennison/OpenTTD-patches.git
$ cd OpenTTD-patches
$ ./configure
$ make
$ ./bin/openttd
JGR is developing on Linux, and all Windows build he provided is actually cross-compiled with mingw.

I find it much easier than to download Windows binaries back when I was using Windows tbh.
User avatar
Captain Rand
Traffic Manager
Traffic Manager
Posts: 192
Joined: 28 Jan 2012 07:35

Re: JGR's Patch Pack

Post by Captain Rand »

ino wrote:
Captain Rand wrote:
JGR wrote:
You'll probably be better building for your platform (Linux?).
Speaking of which.... Is there any chance of getting a ready to go Linux build?
I really hate Windows (OTTD is one of the very few things I have to keep a Windows box for), and I've never been able to get Wine to work.

Pete.
ํYou literally

Code: Select all

$ git clone https://github.com/JGRennison/OpenTTD-patches.git
$ cd OpenTTD-patches
$ ./configure
$ make
$ ./bin/openttd
JGR is developing on Linux, and all Windows build he provided is actually cross-compiled with mingw.

I find it much easier than to download Windows binaries back when I was using Windows tbh.
Thanks, but I have no idea on how to compile. Where and how is this code used?

Pete.
There's nothing like a deadline to hone the concentration.

Good manners cost nothing, but earn respect.

" 'Impossible' is not in our vocabulary." Jack Chrichton, Farscape
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: JGR's Patch Pack

Post by kamnet »

Captain Rand wrote:
ino wrote:
Captain Rand wrote:
Speaking of which.... Is there any chance of getting a ready to go Linux build?
I really hate Windows (OTTD is one of the very few things I have to keep a Windows box for), and I've never been able to get Wine to work.

Pete.
ํYou literally

Code: Select all

$ git clone https://github.com/JGRennison/OpenTTD-patches.git
$ cd OpenTTD-patches
$ ./configure
$ make
$ ./bin/openttd
JGR is developing on Linux, and all Windows build he provided is actually cross-compiled with mingw.

I find it much easier than to download Windows binaries back when I was using Windows tbh.
Thanks, but I have no idea on how to compile. Where and how is this code used?

Pete.
Open a shell window. Create a directory where you want to install OpenTTD source code. CD into it. Run the directions above. It will automatically download the code, configure it and compile it into a binary. The last line fires up OpenTTD.

If you receive any errors (you probably will), post the errors and somebody can help you figure out what needs fixed. A little cumbersome your first time out, but once your get your tools installed and set up it's a breeze to update.
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: JGR's Patch Pack

Post by SimYouLater »

JGR wrote:
SimYouLater wrote:What exactly does that patch do, again? I can't figure out how it reverses trains in the depiot. (Yes, I have it enabled! :) )
It enables reversing the direction of non-articulated train wagons/locomotives in the depot using Ctrl-click.
Oh. Alright. Strangely, I can't reverse the Cyclops from Iron Horse using Ctrl-Click?
kamnet wrote:
Captain Rand wrote:
ino wrote:
ํYou literally

Code: Select all

$ git clone https://github.com/JGRennison/OpenTTD-patches.git
$ cd OpenTTD-patches
$ ./configure
$ make
$ ./bin/openttd
JGR is developing on Linux, and all Windows build he provided is actually cross-compiled with mingw.

I find it much easier than to download Windows binaries back when I was using Windows tbh.
Thanks, but I have no idea on how to compile. Where and how is this code used?

Pete.
Open a shell window. Create a directory where you want to install OpenTTD source code. CD into it. Run the directions above. It will automatically download the code, configure it and compile it into a binary. The last line fires up OpenTTD.

If you receive any errors (you probably will), post the errors and somebody can help you figure out what needs fixed. A little cumbersome your first time out, but once your get your tools installed and set up it's a breeze to update.
He sounds like a newbie to this. "CD" or "cd" means "change directory". "CD into it" means typing...

Code: Select all

cd <insert full directory path of folder>
...into the terminal. Hope this helps!
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
Auge
Director
Director
Posts: 633
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: JGR's Patch Pack

Post by Auge »

Hello

No newbie will compile a program with only …

Code: Select all

cd <insert full directory path of folder>
… and …

Code: Select all

$ git clone https://github.com/JGRennison/OpenTTD-patches.git
$ cd OpenTTD-patches
$ ./configure
$ make
$ ./bin/openttd
… even these two parts are important. To prepare the system to be able to compile is also important. The manual provides a page with the list of necessary programs one have to install to be able to compile OpenTTD.

Attention: At least the section about Debian/Ubuntu is partially outdated. The OpenTTD-team does not use subversion anymore. One has to install git instead. So actually the commands for the shell (command line, if you changed from Windows ;-)) should be (please correct me if I'm wrong):

Code: Select all

sudo apt-get build-dep openttd
sudo apt-get install git patch
Afterwards one has to follow the commands, given by ino (in the shell).

Code: Select all

$ git clone https://github.com/JGRennison/OpenTTD-patches.git
$ cd OpenTTD-patches
$ ./configure
$ make
$ ./bin/openttd
One can omit the last step (./bin/openttd) and start the program from whereEverYouAre/OpenTTD-patches/bin/openttd. This may be useful, if one installed another (maybe an unpatched) version before.

Tschö, Auge
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: JGR's Patch Pack

Post by SimYouLater »

Auge wrote:Hello

No newbie will compile a program with only …

Code: Select all

cd <insert full directory path of folder>
… and …

Code: Select all

$ git clone https://github.com/JGRennison/OpenTTD-patches.git
$ cd OpenTTD-patches
$ ./configure
$ make
$ ./bin/openttd
… even these two parts are important. To prepare the system to be able to compile is also important. The manual provides a page with the list of necessary programs one have to install to be able to compile OpenTTD.

Attention: At least the section about Debian/Ubuntu is partially outdated. The OpenTTD-team does not use subversion anymore. One has to install git instead. So actually the commands for the shell (command line, if you changed from Windows ;-)) should be (please correct me if I'm wrong):

Code: Select all

sudo apt-get build-dep openttd
sudo apt-get install git patch
Afterwards one has to follow the commands, given by ino (in the shell).

Code: Select all

$ git clone https://github.com/JGRennison/OpenTTD-patches.git
$ cd OpenTTD-patches
$ ./configure
$ make
$ ./bin/openttd
One can omit the last step (./bin/openttd) and start the program from whereEverYouAre/OpenTTD-patches/bin/openttd. This may be useful, if one installed another (maybe an unpatched) version before.

Tschö, Auge
Oh! Congrats, then! Sorry I assumed you were inexperienced, you obviously know more than I do.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5656
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: JGR's Patch Pack

Post by andythenorth »

SimYouLater wrote:Oh. Alright. Strangely, I can't reverse the Cyclops from Iron Horse using Ctrl-Click?
Yair. If that's Iron Horse 1.x it's because articulated vehicles can't be flipped, and all IH 1.x trains are articulated for $reasons. That will be fixed in IH 2. If it's not IH 1.x, then I have no clue, nothing else to add.

Public service announcement: flipping is disabled by default in trunk because it is broken for non 8/8 vehicles. https://newgrf-specs.tt-wiki.net/wiki/A ... ite_note-6 . Maybe the patch fixes that, I didn't check. But eh. You get what you pay for.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 8 guests