Having issues merging 2 patches

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

Post Reply
User avatar
MasterMeNL
Engineer
Engineer
Posts: 86
Joined: 12 Oct 2012 17:16
Location: Netherlands

Having issues merging 2 patches

Post by MasterMeNL »

Hi guys.

Well basically I tried merging Slim Timetable Seperation and Departure Boards (this is based of MMNL Custom Series 1 V6 which can be found in my signature) and it should work but it's giving some durpy errors that I just can't solve.

These are the only errors I have:

Code: Select all

4>  date_gui.cpp
4>..\src\date_gui.cpp(183): error C2664: 'SetDateWindow::SetDateWindow(WindowDesc *,WindowNumber,Window *,Date,Year,Year,SetDateCallback (__fastcall *))' : cannot convert parameter 1 from 'const WindowDesc *' to 'WindowDesc *'
4>          Conversion loses qualifiers
4>..\src\date_gui.cpp(346): error C2661: 'WindowDesc::WindowDesc' : no overloaded function takes 8 arguments
The code:

Code: Select all

struct SetMinutesWindow : SetDateWindow
{
	Minutes minutes;

	/** Constructor. */
	SetMinutesWindow(const WindowDesc *desc, WindowNumber window_number, Window *parent, DateTicks initial_date, Year min_year, Year max_year, SetDateCallback *callback) :
		SetDateWindow(desc, window_number, parent, initial_date, min_year, max_year, callback),
		minutes(initial_date / _settings_client.gui.ticks_per_minute)
	{
	}

Code: Select all

static const WindowDesc _set_minutes_desc(
	WDP_CENTER, 0, 0,
	WC_SET_DATE, WC_NONE,
	0,
	_nested_set_minutes_widgets, lengthof(_nested_set_minutes_widgets)
);
I also attached the patches I have so far, although there was something wring with station_gui.cpp (whitespaces or something) so I attached it separately.

Thanks in forward,

Melvin.

The patches here are outdated, check later posts.
Attachments
r25797 Custom Series 1 V7 DEBUG Departure Boards.patch
(631.81 KiB) Downloaded 85 times
r25797 Custom Series 1 V7 DEBUG Departure Boards Projects.patch
(654.54 KiB) Downloaded 98 times
station_gui.cpp
(84.12 KiB) Downloaded 82 times
Last edited by MasterMeNL on 01 Oct 2013 14:54, edited 1 time in total.
User avatar
adf88
Chief Executive
Chief Executive
Posts: 644
Joined: 14 Jan 2008 15:51
Location: PL

Re: Having issues merging 2 patches

Post by adf88 »

1. You have to change SetMinutesWindow::SetMinutesWindow in a way that it takes non-const WindowDesc.
2. There is a new argument while constructing WindowDesc (second one, const char *ini_key). Pass NULL there when initializing _set_minutes_desc.
:] don't worry, be happy and checkout my patches
zooks
Transport Coordinator
Transport Coordinator
Posts: 262
Joined: 29 Jun 2006 08:36

Re: Having issues merging 2 patches

Post by zooks »

Here is departureboards/wallclock updated against trunk r25801. It compiles and doesn't crash openttd, but it breaks the ctrl-timetable click spreading (http://vcs.openttd.org/svn/changeset/25377/).
Attachments
departureboardswallclock25-r25801.diff
(62.58 KiB) Downloaded 106 times
User avatar
MasterMeNL
Engineer
Engineer
Posts: 86
Joined: 12 Oct 2012 17:16
Location: Netherlands

Re: Having issues merging 2 patches

Post by MasterMeNL »

adf88 wrote:1. You have to change SetMinutesWindow::SetMinutesWindow in a way that it takes non-const WindowDesc.
2. There is a new argument while constructing WindowDesc (second one, const char *ini_key). Pass NULL there when initializing _set_minutes_desc.
I really don't know what that means, lmao. I'm still too much of a rookie I guess. :mrgreen:
Zooks' updated patched helped me merge, but now it's magic.
zooks wrote:Here is departureboards/wallclock updated against trunk r25801. It compiles and doesn't crash openttd, but it breaks the ctrl-timetable click spreading (http://vcs.openttd.org/svn/changeset/25377/).
It looks like your forgot to add the header files, but I added them from an older version of the patch (don't know if something in there changed).

Anyway, I merged it but now I'm getting this magic:

Code: Select all

4>station_gui.obj : error LNK2001: unresolved external symbol "void __cdecl ShowStationDepartures(unsigned short)" (?ShowStationDepartures@@YAXG@Z)
4>waypoint_gui.obj : error LNK2001: unresolved external symbol "void __cdecl ShowWaypointDepartures(unsigned short)" (?ShowWaypointDepartures@@YAXG@Z)
4>C:\Data\Programming\OpenTTD\revisions\r25800 MMNL Custom Series 1 V8\trunk\projects\..\objs\x64\Release\openttd.exe : fatal error LNK1120: 2 unresolved externals
5000 karma points if you help me.

Thanks in forward,

Melvin.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Having issues merging 2 patches

Post by Alberth »

My suggestion is that you start learning C++, or you will be forever asking for this kind of help.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: Having issues merging 2 patches

Post by Lord Aro »

^^ :roll: :oops:
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
User avatar
MasterMeNL
Engineer
Engineer
Posts: 86
Joined: 12 Oct 2012 17:16
Location: Netherlands

Re: Having issues merging 2 patches

Post by MasterMeNL »

I'm sort of learning C++ right now but I can't know everything in like 3 weeks.
Those 2 patches are 2 I really want in my patch pack (and some others want it too) but I can't figure it out, after this I consider it more or less complete.

This is the first (and hopefully last) time I ask for help, so could you help me out for this one time? :wink:
I attached the updated patch file of what I've done so far in case you need it.

Thanks in forward,

Melvin.
Attachments
r25801 MMNL Custom Series 1 V8 Debug.patch
(669.36 KiB) Downloaded 83 times
Eddi
Tycoon
Tycoon
Posts: 8271
Joined: 17 Jan 2007 00:14

Re: Having issues merging 2 patches

Post by Eddi »

smells like you're missing a new .cpp file as well, even after you copied over the missing .h files. or you didn't include it in sources.lst or forgot to run projects/generate.
User avatar
MasterMeNL
Engineer
Engineer
Posts: 86
Joined: 12 Oct 2012 17:16
Location: Netherlands

Re: Having issues merging 2 patches

Post by MasterMeNL »

Eddi wrote:smells like you're missing a new .cpp file as well, even after you copied over the missing .h files. or you didn't include it in sources.lst or forgot to run projects/generate.
So I generated it, put it the settings again and suddenly it worked apart from 1 little error I fixed within a minute.
I never even knew you had to run generate so I never did it before.
Thanks a lot!

Looks like my "C++ skills" were good enough. ( ͡° ͜ʖ ͡°)

Regards,

Melvin.

P.S. This response isn't late or anything like that.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests