Page 37 of 40

Re: Howto apply a patch/diff file

Posted: 08 Nov 2011 12:38
by Logital82
Yexo wrote:Follow either http://wiki.openttd.org/Compiling_on_MinGW or http://wiki.openttd.org/Microsoft_Visua ... s_Editions to compile the source code you got. I'd strongly recommend trying to compile a clean version of the code (without any patch applied first) so you know that works for you.
Oh my god! This looks like it is very complicated.

Re: Howto apply a patch/diff file

Posted: 08 Nov 2011 12:43
by planetmaker
Logital82 wrote: First: Downloaded TortoiseSVN and installed it:
than: Downloaded source files from here: http://www.openttd.org/en/download-stable
than: extractet sourcefiles to a folder
(highlight mine)
If you use a version controly system like SVN it's stupid to first download the bundled source. Use the VCS to obtain the source via its inbuilt ability to checkout certain source revisions:

Code: Select all

then: Checkout appropriate source revision

Re: Howto apply a patch/diff file

Posted: 08 Nov 2011 15:39
by Ezennemuljon
Can somebody make a video tutorial from patching?

Re: Howto apply a patch/diff file

Posted: 20 Dec 2011 12:03
by donpost
Hi all. I'm trying to apply the patch in the last post of this thread:

http://www.tt-forums.net/viewtopic.php?f=33&t=54332

Being on Vista 64, I have followed the instructions for using tortouiseSVN in the 4th post in this thread by MeusH.

I checked out the source code, then right clicked on the folder and chose apply patch as described. When the list of files come up they are all red. I click patch all then a lot of windows titled something like "Rejected chunks" or similar appear.

I have set up MinGW using the wiki article - and can compile the source code I have patched above with no problems. However, the patched features do not appear in game. The evidence suggests the patching process is where I have gone wrong, but I'm not sure.

Could anyone shine any light on what I am doing wrong?

Thanks in advance :)

Re: Howto apply a patch/diff file

Posted: 20 Dec 2011 12:20
by planetmaker
donpost wrote: Could anyone shine any light on what I am doing wrong?
You checked out the wrong version of the source code. In principle a patch is only made for one very specific version of the source code. It may or may not work for other revisions. How well that works depends on whether the underlaying code changed.

Re: Howto apply a patch/diff file

Posted: 02 Jan 2012 17:21
by Antonio1984
Hi...
I have applied the extraZoom patch to the source of openttd and now I try to compile the code with Visual C++ 2008 express edition (windows 7, 64 bit), following the instructions contained in this link http://wiki.openttd.org/Microsoft_Visua ... s_Editions, except for these 2 points:

Right-click on openttd (project) -> Properties -> C/C++ -> -> General -> Additional Include Directories. Add the DirectX headers subdirectory (Usually, C:\Program Files\Microsoft DirectX SDK (August 2007)\Include)
For Win32:
Right-click on openttd (project) -> Properties -> Linker -> General -> Additional Library Directories. Add the DirectX SDK Lib subdirectory (Usually, C:\Program Files\Microsoft DirectX SDK (August 2007)\Lib\x86)

because I haven't installed DirectX SDK

But the compilation fails and I get 156 errors, all of the same type:

...
1>..\src\subsidy.cpp(29) : fatal error C1083: Cannot open include file: 'table/strings.h': No such file or directory

1>..\src\signs.cpp(19) : fatal error C1083: Cannot open include file: 'table/strings.h': No such file or directory
...

while for example these filel work
1>sprite.cpp
1>sound.cpp
1>signs.cpp

it seems a problem with the path, but I don't know how resolve the problem...any ideas???
thank you!

Re: Howto apply a patch/diff file

Posted: 02 Jan 2012 19:26
by Terkhen
You need to pay attention to the output while applying the patch; you probably got a lot of rejects. You can only apply a patch against the revision it was made, if you try to apply it to other revision patching will likely fail. I also recommend you to try compiling an unpatched trunk version first to know for sure if you can compile or not.

Re: Howto apply a patch/diff file

Posted: 03 Jan 2012 00:14
by Eddi
make sure you compile the whole solution, not only one subproject.

Re: Howto apply a patch/diff file

Posted: 03 Jan 2012 00:26
by Antonio1984
Terkhen wrote:You need to pay attention to the output while applying the patch; you probably got a lot of rejects. You can only apply a patch against the revision it was made, if you try to apply it to other revision patching will likely fail. I also recommend you to try compiling an unpatched trunk version first to know for sure if you can compile or not.
ok...and which is the way to understand which is the correct match patch/revision?
Thank you!

Re: Howto apply a patch/diff file

Posted: 03 Jan 2012 08:11
by Terkhen
Most patches include the revision in their name, or at least in the post where they can be downloaded. For example, patch_r20000 applies to Subversion revision 20000 (svn up -r 20000 with console Subversion).

Re: Howto apply a patch/diff file

Posted: 03 Jan 2012 12:06
by Antonio1984
Ok...I've the extraZoom patch ez_r22998_full.diff so I guess it is for the revision 22998...perfect...and now?What I have to do?I use Tortoise SVN to get the source code..
Excuse me but I'm a bit confused...

Re: Howto apply a patch/diff file

Posted: 03 Jan 2012 12:39
by Eddi
tortoise svn offers a "update to <revision>" option on right click.

Re: Howto apply a patch/diff file

Posted: 03 Jan 2012 19:59
by Antonio1984
I've specified the revision when I've done the checkout...but inspite of that, I get always a lot of "reject" during the patching..

Re: Howto apply a patch/diff file

Posted: 03 Jan 2012 21:40
by Alberth
extra-zoom patch seems to have 3 parts. It is important to apply them in the right order.

Also, it is a HG diff, which TortoiseSVN does not understand (see also http://wiki.openttd.org/FAQ_development ... a_patch.3F ).

Re: Howto apply a patch/diff file

Posted: 06 Jan 2012 11:07
by Frank327
I've done everything described in this thread (using windows). I've created a new folder, used TortoiseSVN for SVNcheckout. Set it to svn.openttd.org/trunk, and filled the folder. Then I updated it to the version number that was in the patch title. So then I tried to patch it, and still I get mass errors. Does it have to do with my windows version (windows 7 64 bit), or does it have something to do with the patch? I'm completely lost.

Re: Howto apply a patch/diff file

Posted: 06 Jan 2012 11:14
by Terkhen
Without knowing which errors you get while patching we can only guess what is happening.

Re: Howto apply a patch/diff file

Posted: 19 Jan 2012 16:50
by iranair777
Hiya all,
I've been trying to add departure boards and Timetable separation to my cargodist openttd.

I'm just wholly confused about where to start on the patching the .patch file. I've read a multitude of links and tried a few options, the most promising the TortoiseSVN as described in this link, but:
a) I don't know exactly which openttd source code (cargodist if there is one or the actual games) I have to use if there is a difference (I've tried with the games source code)

b) even with the games source code, as per the instructions, there is no apply patch in the tortoiseSVN submenu when I extract

Is the .diff file just an advanced/complete version of a .patch file? I'm just a attach and play person

I've also tried with buildottd which failed on too many levels and just don't know where to start ?(

Re: Howto apply a patch/diff file

Posted: 19 Jan 2012 17:03
by planetmaker
patch and diff file are different words for the same thing. TortoiseSVN doesn't understand all kind of diff files, though. You'll need to get the proper source version a patch applies to. If you try to apply more than one patch at once, they might interfer and you'll need to know how to solve the conflicts, thus you'll need to know the programme code and decide what is right. In this context CargoDist is a pre-patched version of OpenTTD.

Patching is not a "click and play" business. I recommend you to try Chill's PatchPack.

Re: Howto apply a patch/diff file

Posted: 19 Jan 2012 17:33
by iranair777
planetmaker wrote:patch and diff file are different words for the same thing. TortoiseSVN doesn't understand all kind of diff files, though. You'll need to get the proper source version a patch applies to. If you try to apply more than one patch at once, they might interfer and you'll need to know how to solve the conflicts, thus you'll need to know the programme code and decide what is right. In this context CargoDist is a pre-patched version of OpenTTD.

Patching is not a "click and play" business. I recommend you to try Chill's PatchPack.
thanks for the reply, I guess thats my best option. was hoping to be able to carry on using the map I was playing with.

Re: Howto apply a patch/diff file

Posted: 19 Jan 2012 17:36
by planetmaker
For patched builds you usually have to continue using the very same binary you started out with.