The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: isidoro on September 04, 2008, 01:27:29 am

Title: r1994: Factory infoormation window
Post by: isidoro on September 04, 2008, 01:27:29 am
Since some last releases, I've noticed that when opening a factory information window and clicking on a factory provider or a consumer, the view is not moved to that factory any more.  Is it intended or a bug?
Title: Re: r1994: Factory infoormation window
Post by: whoami on September 04, 2008, 12:00:14 pm
You have to click on the small triangle in front of the factory name.
Title: Re: r1994: Factory infoormation window
Post by: isidoro on September 05, 2008, 02:06:32 am
It doesn't work either.  The graphic of the triangle is pressed but the view doesn't move.  I have tested it with r2000, Linux, pak64.
Title: Re: r1994: Factory infoormation window
Post by: prissi on September 05, 2008, 08:44:46 am
Strange, it works for me.
Title: Re: r1994: Factory infoormation window
Post by: z9999 on September 05, 2008, 03:47:41 pm
(Moved to new topic, because of different problem.)
Title: Re: r1994: Factory infoormation window
Post by: z9999 on September 05, 2008, 04:16:23 pm
It doesn't work either.  The graphic of the triangle is pressed but the view doesn't move.  I have tested it with r2000, Linux, pak64.

I downloaded r2000 from nightly site and tested.

Windows SDL and GDI worked well for me.
Linux GCC3 and GCC4 didn't work.
Title: Re: r1994: Factory infoormation window
Post by: isidoro on September 05, 2008, 10:59:44 pm
I've done some research and found that it works with r1969 and doesn't work with r1970.  Svn tells that:

------------------------------------------------------------------------
r1970 | prissi | 2008-08-26 22:08:16 +0200 (Tue, 26 Aug 2008) | 1 line

ADD: target destinations in halt details now clickable
------------------------------------------------------------------------

Keep doing some research...

Edit:
After some research, I've found out that the callback function is properly called when the button is pressed (fabrik_info_t::action_triggered(gui_komponente_t *komp, value_t v).  Variable v has two componets,
v.i and v.p.  The latter is OK.  The problem comes with v.i.

For these position buttons v.i is a pointer (koord *) and thus, different from 0 and 1.  But the problem is that in gcc/Linux that pointer is interpreted as signed and has a value of -1082123236 in my machine.  That makes the check in fabrik_info.cc:173 fail:
else if(v.i>1) {

I would suggest changing that line into:
else if(v.i!=0 && v.i!=1) {
or even:
else if(v.i&~1) {
but I am only guessing, since I don't know the code.
Title: Re: r1994: Factory infoormation window
Post by: prissi on September 06, 2008, 07:03:25 pm
That is a very good report, will be changed.
Title: Re: r1994: Factory infoormation window
Post by: isidoro on September 07, 2008, 02:30:03 am
Thanks, Prissi.

By the way, r2005 doesn't compile with gcc.  It says that array dimensions in these lines don't match:
crossing_logic.h:74:
static kreuzung_besch_t *can_cross_array[8][8];
crossing_logic.cc:173:
kreuzung_besch_t* crossing_logic_t::can_cross_array[9][9] =
Title: Re: r1994: Factory infoormation window
Post by: prissi on September 07, 2008, 07:25:06 pm
Well, this should be fixed now too. Why on earth did MSVC compile this one ... ?
Title: Re: r1994: Factory infoormation window
Post by: hellmade on September 09, 2008, 07:24:11 am
fixed with r2009

will work again