IRC logs for #openttd on OFTC at 2019-03-12
            
00:03:37 *** Wolf01 has quit IRC
00:04:49 *** cHawk has joined #openttd
00:06:24 <LordAro> peter1138: did you say that the fluidsynth PR didn't make any difference? Can you comment on it as such so it doesn't get merged "accidentally" ?
00:08:12 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7365: Fix: Fluidsynth should not try to lock sample data in memory https://git.io/fhjEj
00:08:26 *** J0anJosep has quit IRC
00:08:38 *** m3henry has quit IRC
00:09:23 <Samu> https://github.com/OpenTTD/OpenTTD/pull/7294 bah... newgrfs solves everything
00:09:35 <Samu> I was wondering where did this go...
00:10:24 *** TrueBrain_ has joined #openttd
00:11:15 *** TrueBrain_ii has quit IRC
00:11:28 <peter1138> " actually I can easily make all tiles around an oil-rig " ahhahahaa
00:11:30 <peter1138> easily
00:11:31 *** TrueBrain has quit IRC
00:12:06 *** TrueBrain has joined #openttd
00:12:30 <peter1138> GFX_OILRIG_1
00:12:35 <peter1138> I think that's a bad test... so no.
00:12:41 <peter1138> OH....
00:13:53 <peter1138> Industry::GetByTile(tile)->neutral_station != NULL
00:14:09 <peter1138> lol crash
00:15:47 <peter1138> Hmm
00:15:51 <peter1138> Well... that works
00:16:51 <Samu> is there actually a newgrf that disables rail/road crossings?
00:17:29 <peter1138> Probaly just one to test the feature :p
00:18:46 <peter1138> LordAro, my ... earlier version ... http://fuzzle.org/~petern/ottd/docks5.png
00:18:56 <peter1138> red square inside the depot...
00:20:09 <Samu> so, forbidding multi-engine trains is also another newgrf solves request
00:20:31 <peter1138> definitely.
00:20:31 <Samu> why do you hate the base set so much
00:21:17 <LordAro> blame Chris Sawyer
00:21:52 <Samu> i blame newgrfs
00:22:04 <peter1138> OH MY GOD
00:22:16 <peter1138> Wentbourne in debug mode :/
00:22:45 <LordAro> how many spf ?
00:22:49 <peter1138> :)
00:23:24 <peter1138> Hmm, this ship save is a bit slower, I think.
00:25:07 <peter1138> Not one of these 4,966 ships is an oil tanker.
00:26:10 <Samu> I don't even know how to make a newgrf
00:26:23 <peter1138> 5ms penalty :(
00:27:00 <peter1138> So multiple docks slows the same down again.
00:27:06 <peter1138> I mean, obviously it would, but...
00:27:25 <peter1138> same->game
00:30:28 <peter1138> Hmm, I know what that will be.
00:30:34 <peter1138> Maybe.
00:31:49 <peter1138> Eh, kinda.
00:34:17 <peter1138> Hmm, station rect needs to be updated. Boo.
00:53:17 *** Oroburos has joined #openttd
00:54:57 *** supermop_Home has joined #openttd
00:58:48 <Eddi|zuHause> <peter1138> " actually I can easily make all tiles around an oil-rig " ahhahahaa <-- what about other newgrf industries which have an oilrig station?
01:00:44 <peter1138> 23:13 <@peter1138> Industry::GetByTile(tile)->neutral_station != NULL
01:00:54 <peter1138> ^ that handles it
01:01:06 <Eddi|zuHause> right. probably :p
01:01:13 *** Oroburos has quit IRC
01:01:31 <peter1138> And yes, that test was the "easily" bit I was missing for a couple of minutes.
01:01:58 <peter1138> If we hadn't had Samu's original neutral stations patch, it would still be a PITA.
01:02:43 <DorpsGek_II> [OpenTTD/OpenTTD] James103 commented on issue #6666: Town name list in Arabic https://git.io/fhjzT
01:15:57 <supermop_Home> :(
01:16:08 <Samu> damn it, i kicked somebody by mistake
01:16:15 <Samu> plz rejoin
01:16:15 <supermop_Home> :(
01:16:22 <Samu> was trying to move window
01:16:59 <Samu> the client list window kinda sucks
01:18:51 <Samu> i clicked on it to move around, cus i couldn't click the title bar
01:18:58 <Samu> ended up kicking supermop
01:37:00 <Samu> refit to available cargo doesn't work
01:37:27 <Samu> there is no available cargo though, but it would be Building Materials
01:37:43 <Samu> why doesn't it refit to building materials then?
01:40:04 <Samu> bad feature
01:40:19 <Samu> not too smart
01:40:30 <Samu> i thought it was smarter
01:45:29 <Samu> wow tram construction feels terrible
01:47:13 <Samu> can't build tram tracks over roads when there's a vehicle in it
01:50:18 <Samu> and i have to build some kind of roro at stations
01:50:33 <Samu> otherwise they get stuck
01:58:15 *** snail_UES_ has joined #openttd
02:01:06 *** HerzogDeXtEr has quit IRC
02:09:02 *** Thedarkb-X40 has joined #openttd
02:11:15 <supermop_Home> samu, refit to available cargo first requires some cargo to be there
02:11:38 <peter1138> chicken and egg?
02:11:45 <supermop_Home> so its best to get it started first with one vehicle making a trip with the explicit refit
02:12:13 <supermop_Home> its a little awkward but it dos work once you get it started
02:12:25 <supermop_Home> tram tracks do need turning loops
02:13:28 <Samu> a bit complex
02:13:48 <supermop_Home> the trade off is more capacity, possibly more efficiency, and you can control the path they take
02:14:19 <supermop_Home> but at the expense of having to build the tramway and allowing for turnarounds
02:14:42 <supermop_Home> vs road vehicles where you can just kind of 'fire and forget'
02:21:45 <Eddi|zuHause> i'm kinda missing a flag so some trams can go backwards
02:22:06 <Eddi|zuHause> because realism
02:29:06 <supermop_Home> Eddi|zuHause i'd love that
02:36:07 *** Wormnest has joined #openttd
02:38:32 *** Smedles has quit IRC
02:38:38 <peter1138> Woe
02:39:17 *** Smedles has joined #openttd
02:48:27 <Eddi|zuHause> refit-to-cargo needs a tweak to cargodist, so it considers making a link for all possible cargos. and possibly also the "don't deliver cargo to stations unless a matching vehicle visited"
02:49:19 <Eddi|zuHause> dunno if that would be a performance problem for cargodist, having many networks with no cargo on them
02:49:20 <peter1138> pr it :D
02:51:19 *** cHawk has quit IRC
02:53:41 *** cHawk has joined #openttd
03:04:12 *** Wormnest has quit IRC
03:15:16 *** Smedles has quit IRC
03:16:28 *** Smedles has joined #openttd
03:23:07 *** Smedles has quit IRC
03:24:19 *** Smedles has joined #openttd
03:29:29 <Samu> supermop_Home, cyas tomorrow I'll load it again
03:29:33 <supermop_Home> k
03:29:37 *** Samu has quit IRC
04:18:10 *** debdog has joined #openttd
04:21:31 *** D-HUND has quit IRC
04:26:46 *** Wormnest has joined #openttd
04:35:05 *** glx has quit IRC
04:42:09 *** Thedarkb-X40 has quit IRC
04:53:10 *** tokai|noir has joined #openttd
04:53:10 *** ChanServ sets mode: +v tokai|noir
04:59:50 *** tokai has quit IRC
05:03:46 *** supermop_Home has quit IRC
06:29:54 *** snail_UES_ has quit IRC
06:35:41 *** Smedles has quit IRC
06:37:11 *** Smedles has joined #openttd
06:50:53 *** Supercheese has joined #openttd
07:52:34 *** andythenorth has joined #openttd
07:57:13 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh updated pull request #7365: Fix: Fluidsynth should not try to lock sample data in memory https://git.io/fhhNw
07:58:06 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #7365: Fix: Fluidsynth should not try to lock sample data in memory https://git.io/fhjV2
08:05:09 <DorpsGek_II> [OpenTTD/website] andythenorth commented on pull request #65: Add: Monthly Dev Post of April 2019 https://git.io/fhjVP
08:32:07 *** Supercheese has quit IRC
08:39:40 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7365: Fix: Fluidsynth should not try to lock sample data in memory https://git.io/fhjwe
08:41:29 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #7366: Add: List recently executed commands in crashlog output. https://git.io/fhjwU
08:43:23 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7366: Add: List recently executed commands in crashlog output. https://git.io/fhjwT
09:28:35 <andythenorth> oof
09:29:42 <andythenorth> cargo colours :P
09:29:54 <andythenorth> coal, coke, coal tar, carbon black
09:29:58 <andythenorth> all currently black :P
09:54:04 *** m3henry has joined #openttd
09:56:13 <andythenorth> hmm FIRS pax is over-priced
09:56:21 <andythenorth> relative to original game
10:01:17 <andythenorth> wait wat, price factor is a dword?
10:01:26 * andythenorth teddy bear programming
10:06:26 <peter1138> Cargo colours eh
10:10:02 <andythenorth> rgb?
10:10:44 <andythenorth> I have 73 cargos defined, and FIRS has guards to make them all have unique colours and price factors :P
10:10:47 <andythenorth> to avoid errors
10:10:58 <andythenorth> running out of colours :P
10:15:45 <peter1138> unique price factors?
10:16:07 <andythenorth> so that they don't overlap on the cargo payment chart
10:16:17 <peter1138> o_O
10:16:27 <andythenorth> prop 12
10:16:34 <peter1138> I don't think that's a huge issue. You can filter them.
10:16:39 *** Xaroth has joined #openttd
10:16:46 <peter1138> Obviously you don't want them all the same.
10:16:52 <andythenorth> it bugs me, and isn't hard to solve until now
10:16:52 <Xaroth> https://opensource.googleblog.com/2019/03/introducing-season-of-docs.html << Something for OpenTTD?
10:17:28 <andythenorth> I can defeat the guard I wrote in the compile because nml allows floats :P
10:17:48 <andythenorth> but the result on the chart of e.g. 131 and 131.5 is overlap :D
10:19:41 <andythenorth> wonder why I set pax so high though, it's about £105 where OpenTTD base set is about £74
11:34:11 <DorpsGek_II> [OpenTTD/website] PeterN commented on pull request #65: Add: Monthly Dev Post of April 2019 https://git.io/fhjKG
11:34:31 <LordAro> AmigoOS is a much better name
11:34:40 <peter1138> :)
11:40:59 <Eddi|zuHause> the paragraph about passenger generation doesn't quite fit the theme of the other paragraphs, which is performance optimizations
11:46:07 <Eddi|zuHause> and the paragraph about catchment area could use a screenshot
11:55:28 <peter1138> planetmaker, https://jenkins.openttdcoop.org/job/opengfx/204/console < seems it built the wrong branch.
12:36:33 <planetmaker> hm, interesting
12:44:33 <peter1138> TrueBrain, do we want to compile with -Wunused-value (CMake branch does it)?
12:45:12 <LordAro> config.lib explicitly disables it
12:45:23 <peter1138> Ah.
12:45:39 <LordAro> perfect time to review it, of course
12:46:04 <peter1138> We just have these very weird constructs that do increments based on conditionals.
12:46:12 <LordAro> oh wait, only with clang
12:46:48 <peter1138> I can cast to void to ignore it, update the construct to something... less weird, or just allow unused-values.
12:47:02 <LordAro> i'd prefer option 2 :)
12:47:09 <peter1138> Yes, me too.
12:47:23 <peter1138> (val = 0, score < 170) || (val++, score < 350) || (....)
12:47:40 <peter1138> It's even ambiguous.
12:48:08 <LordAro> ew
12:48:12 <Eddi|zuHause> i never really liked these constructs
12:48:23 <LordAro> oh, i remember looking at those before
12:48:27 <peter1138> They strike me as some kind of assembly-code-left-over.
12:48:30 <LordAro> highscore tables, right?
12:48:47 <peter1138> This one is for Company HQ growing.
12:49:02 <Eddi|zuHause> i've seen these in the station rating calc
12:49:17 <peter1138> Yes, there too.
12:50:35 <Eddi|zuHause> but if you rewrite them with if, you might get deep nesting {}
12:50:57 <Eddi|zuHause> or rely on the fact that the conditions are incremental
12:51:08 <Eddi|zuHause> monotonous
12:51:13 <Eddi|zuHause> however you want to call it
12:51:32 <Eddi|zuHause> "if one condition is false, all following conditions are also false"
12:53:59 <LordAro> that particular construct dates from r1, certainly
12:56:18 <Eddi|zuHause> doesn't surprise me
13:00:21 *** andythenorth has quit IRC
13:01:34 <peter1138> https://paste.openttdcoop.org/pbwfwbvef
13:02:22 *** snail_UES_ has joined #openttd
13:02:49 <peter1138> You could do the if without lamba but then you'd need if (x) { } else if (y) { } else if (z) { } ...
13:03:09 <peter1138> Or
13:03:52 <Eddi|zuHause> https://paste.openttdcoop.org/pwqxrpiro
13:04:02 <peter1138> https://paste.openttdcoop.org/pc2lyz98q
13:04:18 <peter1138> Yes
13:04:24 <peter1138> Same solution, different section;
13:04:30 <Eddi|zuHause> i'm not 100% sure if i haven't changed the semantics
13:04:44 <peter1138> I think you have.
13:04:44 <LordAro> :)
13:05:01 <peter1138> Hmm, no
13:05:09 <peter1138> I changed the order but didn't need to.
13:05:36 <Eddi|zuHause> order shouldn't be relevant
13:05:38 <peter1138> Yeah that's probably the best way for conciseness.
13:05:43 <peter1138> No I realised :)
13:07:17 <peter1138> If it was perl you'd do ... well, one of 2 million solutions.
13:07:20 <peter1138> But...
13:09:08 <LordAro> https://godbolt.org/z/Vij81z godbolt comparison
13:10:44 <Eddi|zuHause> i don't think i follow any of that
13:10:44 <LordAro> i think i like func3 the best
13:10:47 *** andythenorth has joined #openttd
13:11:04 <peter1138> LordAro, no optimization flag?
13:11:13 <LordAro> you can add them yourself
13:11:25 <peter1138> Well, yes.
13:11:30 <LordAro> and i forgot :p
13:11:40 <peter1138> func2 is very literal
13:11:51 <peter1138> (with optimization)
13:12:16 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z opened pull request #7370: Cleanup: Remove questionable syntax in station rating calculation https://git.io/fhjil
13:13:14 <peter1138> Hmm, func3 is too.
13:13:59 <peter1138> func1 gets optimized away nicely
13:16:45 <peter1138> Weird, their clang doesn't compile func2
13:17:07 <peter1138> Verison 6+ does
13:17:15 <peter1138> but I'm on 3.8.1 which works with it.
13:20:49 <Eddi|zuHause> oh, i forgot one instance
13:21:29 <peter1138> Don't look at src/rail_cmd.cpp:2288 ;)
13:22:39 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax in station rating calculation https://git.io/fhjil
13:24:09 <Eddi|zuHause> do we want to do them one-by-one or all in one PR? :)
13:25:37 <Eddi|zuHause> there's probably a better/cleaner trick for rail_cmd.cpp:2288
13:27:19 <peter1138> Yeah, probably
13:28:18 *** Heiki has joined #openttd
13:37:11 <LordAro> Eddi|zuHause: one PR, imo
13:37:32 <peter1138> One PR, separate commits.
13:49:10 *** Flygon has quit IRC
13:55:08 *** snail_UES_ has quit IRC
13:55:15 *** octernion has joined #openttd
13:59:26 <Eddi|zuHause> ok, i definitely messed that one up :p
13:59:59 *** octernion has quit IRC
14:00:41 <peter1138> ?
14:01:19 *** octernion has joined #openttd
14:01:54 <Eddi|zuHause> https://ibin.co/4Zw4S3my1aTR.png
14:04:39 <LordAro> :D
14:04:43 <LordAro> i see no problems here
14:08:34 <Eddi|zuHause> i'm not entirely sure where i went wrong: https://paste.openttdcoop.org/pkwl0wrxh
14:09:05 <peter1138> Ah you changed it completely.
14:09:49 <peter1138> You've got confused by the semantics of the existing construct.
14:10:18 <Eddi|zuHause> probably
14:10:20 <peter1138> TRACK_BIT_HORZ is rti->base_sprites.track_ns + 1
14:10:45 <Eddi|zuHause> oh?
14:10:52 <peter1138> I think
14:10:59 <peter1138> Hmm, I am getting confused :P
14:11:02 <peter1138> Stupid construct.
14:11:14 <Eddi|zuHause> yeah. that's why we're replacing it :p
14:11:33 <Eddi|zuHause> i need the original code to compare...
14:11:49 * LordAro hands Eddi|zuHause ttd.exe
14:12:18 <peter1138> Eddi|zuHause, the order of the original is not TRACK_ order.
14:12:24 <peter1138> TRACK_BIT_X comes before TRACK_BIT_Y
14:12:32 <Eddi|zuHause> that's probably stupid :)
14:12:50 <peter1138> That's TTD original :p
14:12:56 <Eddi|zuHause> was a silly assumption of mine that this would be consistent :p
14:14:05 *** Samu has joined #openttd
14:14:07 <Eddi|zuHause> ok, needs an array like the other one, and reordered
14:14:41 <Samu> hi
14:16:37 <Eddi|zuHause> also, CROSS is apparently not a junction
14:18:35 <Eddi|zuHause> ok, slightly better, the junctions are still off
14:23:16 <Eddi|zuHause> hm, the track sprites are right, but the junction ground is wrong
14:29:10 <Eddi|zuHause> ah, i see the error
14:29:22 <Eddi|zuHause> i think
14:29:54 *** octernion has quit IRC
14:30:44 <Eddi|zuHause> seems right now
14:30:50 <DorpsGek_II> [OpenTTD/OpenTTD] stale[bot] commented on issue #6315: Advanced Fences: (with patch) https://git.io/fhjXt
14:31:02 *** octernion has joined #openttd
14:32:08 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax in station rating calculation https://git.io/fhjil
14:33:03 <Eddi|zuHause> not sure if it's actually good :)
14:33:43 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjXY
14:34:03 <peter1138> That is why it hasn't really been changed :)
14:43:13 *** supermop_work has joined #openttd
14:43:46 <peter1138> Hmm, 737 Max 8 banned from UK airspace.
14:44:00 *** supermop_work_ has joined #openttd
14:44:05 <Eddi|zuHause> yeah, and a few other countries
14:44:28 <Eddi|zuHause> because 2 crashes is now a series
14:45:00 <Eddi|zuHause> which might be true :)
14:46:46 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
14:51:14 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
14:51:15 *** supermop_work has quit IRC
14:56:10 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
14:57:35 <Samu> supermop_work_, hi
14:59:26 <Eddi|zuHause> there's another one in order_gui.cpp:398
15:00:59 <peter1138> Eddi|zuHause, i would recommend leaving the rail one as it is.
15:05:28 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
15:06:59 <Eddi|zuHause> any particular reason? i mean there's a dozen different ways to do this :)
15:11:12 <DorpsGek_II> [OpenTTD/OpenTTD] GabdaZM updated pull request #7369: Add: k-d tree element checker function https://git.io/fhjZB
15:14:12 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z commented on pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhj13
15:14:15 <peter1138> Eddi|zuHause, because it's already a partial look up table.
15:14:20 <peter1138> Just not an array.
15:14:50 <peter1138> I think it might be better to redesign base_sprites.
15:15:40 <peter1138> Fortunately base_sprites is not used by newgrf railtypes.
15:16:11 <Eddi|zuHause> but there are pre-railtypes NewGRFs?
15:18:53 <andythenorth> do we need them?
15:18:59 <Eddi|zuHause> yes.
15:19:02 <andythenorth> when does stuff get to die?
15:19:06 <Eddi|zuHause> never.
15:19:16 <andythenorth> well that's a definitive answer :P
15:22:32 <peter1138> But yeah, we look up some base values in that struct. Then do some calculations.
15:22:36 <peter1138> That seems pointless to me.
15:23:02 <peter1138> I think changing that is out of scope of your PR
15:23:09 <Eddi|zuHause> yes ;)
15:23:20 <peter1138> So I suggest to not make the changes there that you have.
15:23:29 <Eddi|zuHause> ok, i scrap that then.
15:27:19 <DorpsGek_II> [OpenTTD/OpenTTD] M3Henry requested changes for pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhj1w
15:28:08 <peter1138> Well it's not HTML/CSS :)
15:28:36 <Eddi|zuHause> ?
15:28:38 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhj1K
15:28:48 <peter1138> m3henry's comment, "mixed code and data"
15:29:47 <Eddi|zuHause> huh, i pressed F5 and the comments were gone
15:29:51 <peter1138> Yup, same.
15:30:02 <m3henry> :s
15:30:03 <peter1138> And now they're back.
15:30:17 <peter1138> std::lower_bound eh
15:30:25 <Eddi|zuHause> that sounds like overkill?
15:30:49 <m3henry> It's the the generic algorithm which is being manually unrolled by the code
15:30:50 <peter1138> Probably.
15:30:59 <m3henry> Just express the intent
15:31:34 <peter1138> I'm not sure how you'd implement it that way./
15:33:13 <Eddi|zuHause> yeah, the description lower_bound sounds like nothing we need here
15:33:14 <peter1138> I think std::lower_bound is working the opposite way.
15:33:22 <peter1138> We have one value.
15:33:32 <peter1138> And we're comparing it against a range.
15:35:34 * m3henry is making example
15:36:18 <peter1138> Thanks.
15:42:18 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
15:44:38 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z commented on pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjMT
15:44:45 *** nielsm has joined #openttd
15:45:50 <peter1138> Github having issues?
15:46:12 <peter1138> "This page is taking way too long to load."
15:46:13 <peter1138> Hmm
15:46:21 <Eddi|zuHause> i noticed dorpsgek messages taking a long time also
15:46:30 <m3henry> https://pastebin.com/5BDxsYUf
15:46:40 <m3henry> Turns out upper_bound was the right one
15:46:48 <m3henry> But the algo is the same
15:47:05 <m3henry> It's written verbosely as well
15:47:51 *** Wormnest has joined #openttd
15:48:32 <m3henry> could be written as return std::upper_bound(std::begin(bounds), std::end(bounds), rating) - std::begin(bounds)
15:48:55 <peter1138> Ok for that particular case.
15:50:39 <Eddi|zuHause> https://godbolt.org/z/t_Dtvp <-- doesn't seem to optimize very well
15:51:25 <peter1138> It's hardly critical performance code path here...
15:51:46 <peter1138> But I don't think it's an improvement.
15:52:09 <m3henry> I think most of that is iostream stuff
15:52:20 <m3henry> owait
15:52:26 <Eddi|zuHause> i removed that line
15:53:36 <peter1138> https://paste.openttdcoop.org/pc2lyz98q
15:53:46 <m3henry> Oh I see, the compiler has unrolled the binary search because there are only 4 elements of the array
15:53:48 <peter1138> ^ top entry in that list is more readable for me.
15:53:59 <peter1138> And anyway
15:54:06 <peter1138> This is the only case where we're using the result as an index.
15:54:16 <peter1138> In the other cases, the different things happen.
15:54:17 <m3henry> That was the only caseI was referring to
15:54:42 <m3henry> Don't know how to comment on specific diff
15:54:50 <Eddi|zuHause> this is what we germans call "shooting cannons at sparrows"
15:56:11 <peter1138> m3henry, in the "review changes" tab, you can click on any line of text to comment.
15:56:21 <peter1138> err
15:56:28 <peter1138> "files changed" tab, sorry
15:56:43 <peter1138> oh, click on the blue [+]
15:57:01 <m3henry> Removing the #include <iostream> line custs it down somewhat
15:57:14 <peter1138> I think Eddi|zuHause's change is better
15:57:35 <peter1138> It is simply a clean up, and fixes an issue with a return value being ignored.
16:00:54 <Eddi|zuHause> m3henry: here were the other options we considered https://godbolt.org/z/rLeIP1
16:01:33 <m3henry> https://godbolt.org/z/X09A79
16:02:48 <peter1138> Btw, it's not a sprite index.
16:03:11 <Eddi|zuHause> that's not really the point :)
16:03:16 <m3henry> :)
16:03:19 <peter1138> No but for clarirty ;)
16:03:21 <peter1138> -r
16:03:44 <DorpsGek_II> [OpenTTD/OpenTTD] LordAro commented on pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjMa
16:05:06 <Eddi|zuHause> github ate the comment again :/
16:07:45 <peter1138> wouldn't be awful if this was turned into a ternary, imo
16:07:53 <peter1138> Is the comment.
16:07:57 <peter1138> Reference to bus vs truck
16:07:58 <andythenorth> bad GH :P
16:08:32 <Eddi|zuHause> can't really align the "break"s with a ternary :/
16:09:10 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
16:09:12 <peter1138> They're not aligned at the moment.
16:10:19 <Eddi|zuHause> i mean, i have 3 aligned ones, but if i would align them with the 4th (after the ternary), then that would be a silly number of spaces
16:16:47 <m3henry> http://quick-bench.com/bIE3UWH6DSzb-tgHB0Ffewz7QqU do1 wins, just about
16:18:59 *** andythenorth has quit IRC
16:19:12 <Eddi|zuHause> m3henry: doesn't compile if i set it to C++11
16:19:55 *** m1cr0man has quit IRC
16:20:27 <m3henry> removing constexpr fixes that http://quick-bench.com/WhmW_wsYn2ZOwT5WH-zHYR-al2c
16:22:36 <Eddi|zuHause> and gcc complains about lack of upper_bound
16:24:07 <DorpsGek_II> [OpenTTD/OpenTTD] glx22 updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
16:24:17 <peter1138> I still think in this case it is not desirable.
16:26:58 <Eddi|zuHause> i'm not sure if i'm using this tool right, but it seems to completely fail on GCC... if i replace upper_bound by lower_bound to make it compile, then it takes 1700000 times longer
16:27:41 <m3henry> I think the test case is being optimized away as the disassembly is empty
16:28:01 <peter1138> Useful :p
16:29:15 <Eddi|zuHause> also your "if (i>1000) i=0" seems to be in the wrong place
16:29:38 <peter1138> If you don't optimize it, the simple if block is superior.
16:30:02 <Eddi|zuHause> that's... expected?
16:30:17 <Eddi|zuHause> but also completely useless information :)
16:30:29 <peter1138> Less useless than having everything optimized away.
16:30:34 <m3henry> Forcing it to not optimize gets this http://quick-bench.com/E77FPoBzfRhxTTpRscDgD0uznQs
16:32:21 <Eddi|zuHause> that seems like more plausible results :)
16:33:14 <peter1138> Annnnyway.
16:36:46 <m3henry> woah, even faster is std::find_if http://quick-bench.com/L4_Futc0uB1bzklVBE9OpNRICAE
16:39:26 <peter1138> Yeah but is it really clearer than the existing code?
16:40:08 <m3henry> Must admit that lambdas aren't always the easiest to read
16:41:09 <m3henry> wrapper function called linear_upper_bound?
16:41:29 <Eddi|zuHause> i don't think find_if produces corrrect results
16:44:18 <Eddi|zuHause> i mean if you look at https://godbolt.org/z/ddiKPv the find_if version only ever compares against 170
16:45:32 <m3henry> Oh the optimizes is smart
16:47:43 <m3henry> It should be >=
16:49:12 <Eddi|zuHause> that looks way more plausible
16:49:45 <Eddi|zuHause> still, i agree with peter1138, that it's not really clear to read
16:50:39 <m3henry> Fair 'nuff
16:51:57 <Eddi|zuHause> it's certainly more pythonic :)
16:53:01 <Eddi|zuHause> could maybe be put into a wrapper function
16:53:27 <nielsm> before choosing an algorithm based on what clang and/or gcc turns it into, make sure you also check what msvc turns it into :)
16:55:19 <peter1138> We're only touching this code because it fails to compile with -Wunused-value
16:55:35 *** supermop_work_ has quit IRC
16:56:08 <peter1138> Eddi|zuHause, your IsBus ternary as too many closing brackets.
16:56:22 <Eddi|zuHause> oops
16:56:49 *** synchris has joined #openttd
16:56:50 *** Gustavo6046 has quit IRC
16:57:14 <Eddi|zuHause> i should maybe be making real pasta instead of copy pasta
16:57:46 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
16:58:12 <Eddi|zuHause> nielsm: dunno, godbolt seems to output a lot of unreadable nonsense when switching to msvc :p
16:59:00 <nielsm> msvc tends to add a ton of linkable symbols that are not actually used
16:59:01 <peter1138> Eddi|zuHause, town_gui.cpp:158
16:59:16 <nielsm> any function inline-expanded also gets a non-inline linkable version
16:59:50 <Eddi|zuHause> peter1138: ah, my grep-foo failed to find that because of the comments :p
17:02:56 <peter1138> I'm tempted, for the rail one, to do the (void)( ... ); trick :p
17:03:08 <peter1138> Or just do it properly :)
17:08:42 <nielsm> http://classicprogrammerpaintings.com/post/183402738622
17:09:53 <LordAro> nielsm: :D
17:17:08 <Eddi|zuHause> nielsm: not helping :p
17:20:19 *** Gustavo6046 has joined #openttd
17:25:44 *** sla_ro|master has joined #openttd
17:40:55 *** andythenorth has joined #openttd
17:50:27 <Eddi|zuHause> i can't seem to make "put the find_if in a wrapper function" work...
17:54:42 <Eddi|zuHause> https://paste.openttdcoop.org/pqqdntpp9 could have been nice, but doesn't compile :/
17:55:59 <nielsm> yeah you can't template on an array value like that, afaik
17:56:19 <Eddi|zuHause> came across this on the way: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4198.html
17:56:32 *** Progman has joined #openttd
17:57:43 <Eddi|zuHause> but i can also not pass the array as a parameter, because then begin/end don't work
17:58:51 <nielsm> template <typename T, typename It> static inline ptrdiff_t IndexOf(const T &value; It begin, It end) { ... }
17:59:01 <nielsm> you'd have to pass begin/end of the range like that
17:59:09 *** HerzogDeXtEr has joined #openttd
17:59:21 <Eddi|zuHause> yeah, but that kinda defeats the point of wrapping it :p
18:00:20 <Eddi|zuHause> means the only way out would be a macro, and i really don't like to go down that path
18:05:22 <peter1138> https://paste.openttdcoop.org/pszxkjpt6
18:05:24 <peter1138> ^ KISS
18:05:35 <Eddi|zuHause> i know... but i wanted to try this :p
18:07:42 <nielsm> some things are not worth abstracting :P
18:07:55 *** rocky11384497 has quit IRC
18:08:12 <peter1138> I don't think the comments there add anything any more.
18:08:28 <peter1138> I assume the RATING_x was raw numbers at the time the comments were added.
18:08:37 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
18:08:43 *** rocky11384497 has joined #openttd
18:09:43 <Eddi|zuHause> but i think a range selection like this could simplify a bunch of code in various places
18:10:30 <peter1138> https://paste.openttdcoop.org/pw5lwmyfg
18:10:37 <peter1138> ^^ but that one could do with comments.
18:10:45 <peter1138> It's not quite how I'd envisaged "doing it properly" :p
18:10:56 *** HerzogDeXtEr has quit IRC
18:12:11 *** Thedarkb-T60 has quit IRC
18:12:34 *** Thedarkb-T60 has joined #openttd
18:13:28 *** HerzogDeXtEr has joined #openttd
18:14:10 *** Thedarkb-T60 has quit IRC
18:14:31 *** Thedarkb-T60 has joined #openttd
18:15:09 <nielsm> https://github.com/OpenTTD/OpenTTD/pull/7366 I'm a bit +/- 0 on whether this needs more, or should just be approved
18:16:18 <Eddi|zuHause> peter1138: i think the "if() {}" violates code style?
18:17:36 <Eddi|zuHause> not sure if that would actually reduce readability, though...
18:17:44 <peter1138> There's one place where it's done :/
18:17:52 <peter1138> src/newgrf_station.cpp
18:18:02 <Eddi|zuHause> yeah, i see why.
18:18:02 <peter1138> if (!HasBit(_svc.valid, 0)) { _svc.v40 = GetPlatformInfoHelper(this->tile, false, false, false); SetBit(_svc.valid, 0); }
18:18:27 <nielsm> you may as well make that one a single large table, I think?
18:18:28 <peter1138> if it was a lambda it could be a return, but...
18:18:48 <Eddi|zuHause> nielsm: it's a bit complicated
18:19:22 <peter1138> Yeah, it could be a table with 63 entries.
18:19:23 <Eddi|zuHause> peter1138: yeah, i was about to suggest turning my original function into a lambda, when you suggested i should drop it
18:20:10 <peter1138> https://github.com/OpenTTD/OpenTTD/commit/a0b25cec50f1dc6ba97ffed77e32340002c43279
18:20:15 <peter1138> ^ is somewhat different.
18:22:37 <peter1138> https://newgrf-specs.tt-wiki.net/images/grfwiki/8/85/Rails_combined.png
18:22:40 <peter1138> Layout of the table
18:22:41 <nielsm> or take the above switch and wrap in a function, then the image = x; break; sequences can be replaced with a return
18:25:23 <peter1138> I think if you make a big table, someone will try to convert it to an algorithM :p
18:25:27 <Eddi|zuHause> i wonder if my function would get simpler if i swapped the return (junction) and the reference parameter (image)
18:26:13 <Eddi|zuHause> the table would get loads of duplicate entries for the junctions
18:26:24 <Eddi|zuHause> and you still wouldn't get the "is this a junction" information
18:28:50 <peter1138> https://paste.openttdcoop.org/procqh74n
18:29:02 <peter1138> Eddi|zuHause, quite.
18:29:03 <m3henry> Eddi|zuHause: did you mean template <typename T, typename V> std::size_t IsInsideRanges(T const& container, V rating) ?
18:29:39 *** octernion has quit IRC
18:29:41 <nielsm> yay for closure functions called once
18:29:54 <Eddi|zuHause> m3henry: what would that solve?
18:29:58 <peter1138> All to avoid `if () { }` :p
18:30:07 <m3henry> You said it wouldn't compile?
18:30:37 *** HerzogDeXtEr1 has joined #openttd
18:30:42 <m3henry> I believe non-typename parameters as auto is a c++17 feature
18:30:54 <Eddi|zuHause> nielsm: i tried f(T x, T b[])
18:31:00 *** octernion has joined #openttd
18:31:05 <Eddi|zuHause> err
18:31:08 <Eddi|zuHause> m3henry:
18:31:31 <Eddi|zuHause> m3henry: but then begin/end cannot be called on a T[]
18:31:46 <m3henry> can
18:32:44 <m3henry> You did <typename T, array_like> f(T&)
18:33:21 <m3henry> You did <typename T, array&> f(T) sorry
18:33:22 *** HerzogDeXtEr2 has joined #openttd
18:34:01 <Eddi|zuHause> m3henry: the compile failure was because if i pass a local array, it complains about that array having no linkage
18:36:31 *** HerzogDeXtEr has quit IRC
18:38:49 <m3henry> I'll look again later xD
18:38:54 *** m3henry has quit IRC
18:40:10 *** HerzogDeXtEr1 has quit IRC
18:45:39 <TrueBrain> peter1138: I think CMake enables that by default .. can't remember I did anything with that tbh
18:45:58 <peter1138> TrueBrain, it's fine, we're just considering fixing the code.
18:46:17 <TrueBrain> yeah, removing those weird statements would really help :)
18:51:26 <peter1138> Eddi|zuHause, hmm... if ( ... ) { ... ; break; }
18:51:55 <peter1138> Certainly looks better then if ( ... ) {\n ...; \n} else if ( ...
18:51:59 <Eddi|zuHause> yes
18:55:01 *** HerzogDeXtEr has joined #openttd
18:57:53 *** HerzogDeXtEr1 has joined #openttd
18:58:40 *** HerzogDeXtEr2 has quit IRC
19:04:08 *** supermop_work_ has joined #openttd
19:05:11 *** Wolf01 has joined #openttd
19:05:16 *** HerzogDeXtEr1 has quit IRC
19:05:18 *** HerzogDeXtEr has quit IRC
19:05:26 <peter1138> https://paste.openttdcoop.org/p6kb84m7i
19:05:29 <peter1138> ^ version with comments.
19:05:31 <Wolf01> o/
19:05:42 <peter1138> Er, ignore the lambda bit, I guess.
19:06:12 *** supermop_work__ has joined #openttd
19:06:25 *** HerzogDeXtEr has joined #openttd
19:06:40 <TrueBrain> but that is the best part!
19:07:23 <andythenorth> right let's figure out what's wrong with GS
19:07:44 <Eddi|zuHause> i tried a similar thing https://paste.openttdcoop.org/pdinihf3j and was wondering about where to put the CROSS
19:11:40 *** Wormnest has quit IRC
19:12:10 *** Thedarkb-T60 has quit IRC
19:12:29 *** Thedarkb-T60 has joined #openttd
19:13:10 *** supermop_work_ has quit IRC
19:15:26 <peter1138> Eddi|zuHause, Yeah...
19:16:00 <peter1138> Maybe we should fill out the base_sprites instead :)
19:16:05 <peter1138> I'm gonna try it
19:16:43 *** octernion has quit IRC
19:20:01 *** octernion has joined #openttd
19:25:25 *** glx has joined #openttd
19:25:25 *** ChanServ sets mode: +v glx
19:28:32 <peter1138> Well, that works but doesn't really gain anything.
19:34:17 <Wolf01> https://img-9gag-fun.9cache.com/photo/aqK6XYj_460s.jpg HA!
19:34:59 <andythenorth> cryo tank wagons? o_O https://www.vtg.com/wagon-hire/our-fleet/g91111d/
19:35:03 <andythenorth> for Horse
19:38:52 <supermop_work__> yo
19:41:10 <andythenorth> yo supermop_work__
19:44:26 *** m3henry has joined #openttd
19:56:49 <peter1138> YO
19:57:12 <andythenorth> YO YO
19:59:04 <supermop_work__> so what's going on
20:00:08 <peter1138> Well...
20:02:42 <peter1138> https://github.com/OpenTTD/OpenTTD/commit/ac87f5c9d82aa1c3e7f4eda7dce719262bd08fe1
20:02:52 <peter1138> I'm pretty sure that does not add anything beneficial.
20:04:22 <peter1138> https://paste.openttdcoop.org/pdinihf3j < simpler, does the job.
20:04:35 <peter1138> But... numbers ;(
20:05:45 <Samu> uhm, I have a problemo
20:06:25 <Samu> https://imgur.com/J5YHSL9
20:06:43 <Samu> £10,000 k
20:06:52 <Samu> represented like that is ugly
20:07:14 <Samu> is it fixable?
20:07:37 <nielsm> that's text layout, it's probably complicated
20:07:49 <peter1138> Um.
20:08:03 <peter1138> What's the string?
20:08:13 <peter1138> 7,338 days is kinda shit too :p
20:08:36 <peter1138> But I guess that's.. hmm.
20:08:48 <peter1138> 20 years and 38 days?
20:08:52 <nielsm> and is £10,000k a confusing way to write 10 million?
20:08:57 <peter1138> That's an odd representation.
20:09:39 <peter1138> But yes, that's why I asked what the string is :-)
20:09:57 <peter1138> Samu, is it your own GS? One on bananas?
20:12:12 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN approved pull request #7368: Codechange: Update town sign on population change only when population is shown. https://git.io/fhjQt
20:12:37 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN merged pull request #7368: Codechange: Update town sign on population change only when population is shown. https://git.io/fhj3k
20:13:16 <peter1138> I guess he still doesn't get it with commit messages :-)
20:13:47 <peter1138> https://github.com/OpenTTD/OpenTTD/pull/7364 < anything blocking that now?
20:14:09 <peter1138> ^ it kinda needs a broken newgrf as a test case. But hey.
20:14:17 <Samu> it's my gs
20:14:37 <Samu> £10,000 k is fine, but it's in 2 lines :(
20:14:57 <Samu> the string is...
20:15:01 <Samu> gonna look
20:15:47 <Samu> STR_GOAL_REACHED : {WHITE}{COMMA} days{BLACK} after inauguration, {WHITE}{COMPANY}{BLACK} {COMPANY_NUM} was first to reach a company value of {GREEN}{CURRENCY_SHORT}{BLACK}. {}{}Game is now paused. {}{}Press {YELLOW}Continue{BLACK} to resume game.
20:15:53 <peter1138> Ok
20:15:57 <peter1138> {CURRENCY_SHORT}
20:16:02 <peter1138> Yeah, that's odd.
20:17:45 <nielsm> might need a ZWNBSP around the thousand separator, or use another character for thousand separator that does not allow line breaks around it
20:17:57 <Samu> GSGoal.Question(25, GSCompany.COMPANY_INVALID, GSText(GSText.STR_GOAL_REACHED, this.goal_company.days_taken, this.goal_company.c_id, this.goal_company.c_id, this.goal_company.goal_value), GSGoal.QT_INFORMATION, GSGoal.BUTTON_CONTINUE);
20:18:13 <nielsm> (if any of the unicode layout libraries want to be trusted to not do weird stuff)
20:19:34 <Samu> it is on bananas
20:19:46 <peter1138> Yeah, so...
20:19:59 <peter1138> Where do we format text?
20:22:43 <peter1138> NBSP is already used for the space before the "k"
20:23:13 <nielsm> strings.cpp has way too many things in it
20:23:18 <peter1138> Somewhat.
20:24:24 <peter1138> FEFF? Hmm
20:32:52 <TrueBrain> right .. time to see if I can get regression ported to CMake
20:32:58 <TrueBrain> this will be fun :D (really?)
20:37:09 <peter1138> Hmm, well, FEFF doesn't wor k:p
20:37:13 <nielsm> actually it should not be ZWNBSP (aka. the BOM), but probably ZWJ (zero width joiner)
20:38:22 <nielsm> also, is the unicode layout library used when using sprite font? (I don't think it is, otherwise we'd also be seeing the ICU crashes on sprite font cases)
20:38:41 *** Thedarkb-T60 has quit IRC
20:39:11 *** gelignite has joined #openttd
20:40:05 <peter1138> Eddi|zuHause, do you want to add the rail_cmd updates too?
20:40:23 <Eddi|zuHause> peter1138: i can do that
20:40:34 <peter1138> I don't feel my "rewrite" offers anything compelling.
20:40:51 *** Thedarkb-T60 has joined #openttd
20:41:48 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
20:42:09 *** supermop_work has joined #openttd
20:42:11 <Eddi|zuHause> should i have put credit in the commit message?
20:42:17 <peter1138> Nah
20:43:24 *** supermop_work_ has joined #openttd
20:45:02 *** supermop_work__ has quit IRC
20:50:10 *** supermop_work has quit IRC
20:52:32 <TrueBrain> "lang/welsh.lng's language ID is already known"
20:52:33 <TrueBrain> hmm
20:56:19 <peter1138> So #7370 passed CI, anyone want to review it? :p
20:56:44 <peter1138> Shame we don't have unit tests, this is perfect for that.
20:57:53 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjQb
20:58:02 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjQN
20:58:05 <peter1138> Oh spam :(
20:58:40 <peter1138> q
20:58:50 <TrueBrain> so add unit tests :D
20:58:56 <peter1138> Nah
20:59:16 <peter1138> Not worth it before CMake ;)
20:59:21 <TrueBrain> fair
20:59:28 <TrueBrain> why do I get these language errors .. I dont get it
20:59:29 <peter1138> And this PR will help your CMake build.
21:01:03 <TrueBrain> and I get a "File not readable"
21:01:06 <m3henry> Eddi|zuHause I think this is what you want: https://godbolt.org/z/ZU4t0o
21:01:06 <TrueBrain> without context
21:01:08 <TrueBrain> lovely
21:01:30 *** octernion has quit IRC
21:01:48 <Eddi|zuHause> m3henry: can't have c++14
21:01:53 <m3henry> It doesn't
21:02:14 <m3henry> That's why it has trailing return types and that comment
21:03:20 <Eddi|zuHause> frankly, that construct looks horrible
21:03:59 <m3henry> Yeah, that's why they introduced _t typedefs and such in later standards
21:04:45 <DorpsGek_II> [OpenTTD/OpenTTD] Eddi-z updated pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjil
21:07:08 <m3henry> This is the c++17 version, which is at least without all the type-trait spam
21:07:09 <m3henry> https://godbolt.org/z/4v6Ldr
21:07:27 *** sla_ro|master has quit IRC
21:09:06 <peter1138> My quick "unit test" shows no differences, it's not conclusive though
21:09:16 <peter1138> Eh, it's not a unit test, it's a regression test.
21:09:29 <peter1138> I printed the input and output and compared master vs the pr...
21:09:57 <Eddi|zuHause> it's a unit regression test :)
21:10:17 <Eddi|zuHause> a true unit test would imply you wrote the test before writing the unit
21:12:56 <TrueBrain> hmm .. is it normal to get "welsh.lng's language ID is already known" for every language file on startup?
21:13:03 <TrueBrain> it is like it scans the same folder twice
21:13:10 <TrueBrain> (for the regression, that is)
21:13:11 <peter1138> No?
21:13:28 <peter1138> Hmm, pub.
21:13:29 <TrueBrain> ./openttd -x -vnull:ticks=1 -snull -mnull -g -d9 -c ai/regression/regression.cfg 2>&1 | less
21:13:38 <TrueBrain> if I execte that in 'bin', it always shows me that
21:13:43 <TrueBrain> seems the searchpaths get a bit confused
21:13:59 <peter1138> Good idea to try make regression though :)
21:14:07 <peter1138> Passed.
21:14:12 <glx> maybe scanning exe path and cwd too
21:14:50 <TrueBrain> silly
21:14:56 <TrueBrain> but okay, I am going to ignore that, as it is already there :P
21:14:58 <glx> ah and -c fucks the path search too
21:15:08 <glx> there's an issue on github/PR
21:15:08 <peter1138> TrueBrain, ah yes, iwt that command, I do.
21:15:11 <TrueBrain> even without -c it does that, it seems
21:15:43 *** octernion has joined #openttd
21:16:38 <peter1138> It does say it's adding the current dir twice.
21:16:54 <TrueBrain> so it doesn't deduplicated searchpaths :D
21:16:58 <TrueBrain> well, we already knew this needed work :P
21:17:50 <TrueBrain> btw, I suggest that with CMake we start following sane rules .. no file generation outside the 'build' folder :P
21:17:56 <TrueBrain> (including baseset and stuff)
21:18:09 <TrueBrain> and make a single command (say, install, or pre-install), that preps 'bin' if we want
21:18:22 <glx> well baseset and lang are already done like that ;)
21:18:26 *** synchris has quit IRC
21:18:28 <TrueBrain> no, baseset was not :D
21:18:29 <TrueBrain> lang is ;)
21:18:39 <glx> baseset was
21:18:51 <TrueBrain> -set(BASESET_EXTRAGRF_FILE ${CMAKE_SOURCE_DIR}/bin/baseset/orig_extra.grf)
21:18:51 <TrueBrain> +set(BASESET_EXTRAGRF_FILE ${CMAKE_BINARY_DIR}/baseset/orig_extra.grf)
21:18:53 <TrueBrain> I just typed that
21:19:08 <glx> it's a source file
21:19:12 <TrueBrain> euh
21:19:13 <TrueBrain> hmm
21:19:15 <TrueBrain> you are right
21:19:17 <TrueBrain> so ...
21:19:21 <TrueBrain> hmm
21:19:22 <TrueBrain> sorry :D
21:19:38 <TrueBrain> that it is in the bin folder confused the fuck out of me :D
21:20:16 <TrueBrain> well, something for another day
21:20:19 <glx> but most stuff in bin should be copied into build during generation
21:20:41 <TrueBrain> shouldn't it be in media/baseset to stat with, I wonder
21:21:18 <glx> no media is the source, but the search path is ./baseset
21:21:24 <glx> like lang
21:21:36 <TrueBrain> I meant the bin/baseset/openttd.grf etc
21:21:43 <TrueBrain> I wonder if 'bin' is the right folder to start that off in
21:22:24 <TrueBrain> if we put it in media/baseset, and let Basetset.cmake copy it to the CMAKE_BINARY_DIR folder, doesn't that make more sense? (honest question)
21:22:39 <glx> ah, theorically it's generated it grfcodec is found
21:22:49 <TrueBrain> even if it isn't generated
21:22:58 <TrueBrain> not everything in media needs to be generated, does it? :)
21:23:32 <TrueBrain> side-question: media/baseset/translations.* can be removed now, not?
21:23:44 <glx> ha yes they can
21:23:59 <TrueBrain> media/extra_grf leads to baseset/orig_extra.grf ?
21:24:02 <TrueBrain> (if you have grfcodec)
21:24:26 <TrueBrain> shouldn't we convert it to an NML project? :D
21:24:46 <glx> maybe
21:25:10 <Eddi|zuHause> i thought we wanted to keep the dependencies low :p
21:25:30 <Eddi|zuHause> it's not like the baseset has much to gain from nml's complexity
21:25:38 <glx> depending on grfcodec or nmlc is similar, no ?
21:25:51 <glx> well + python
21:26:29 <TrueBrain> and something about preach what you teach ;)
21:27:23 <glx> at least nml should be easier to read than nfo ;)
21:27:26 <andythenorth> yeah but nml :(
21:28:13 <andythenorth> it's not an easy build
21:28:50 <TrueBrain> pip install nml
21:28:51 <TrueBrain> ? :)
21:29:42 <andythenorth> does that work on Windows now?
21:29:58 * andythenorth has NFI, but we have to provide a Windows nml binary afaik
21:30:31 <DorpsGek_II> [OpenTTD/OpenTTD] M3Henry updated pull request #7165: [core] Implement SmallVector using std::vector https://git.io/fhSz0
21:30:37 <glx> probably because newgrf devs are lazy ;)
21:30:52 <glx> or don't want to try to compile tools
21:31:04 * TrueBrain knows nothing about nml :)
21:31:06 <TrueBrain> first cmake
21:31:10 <TrueBrain> STOP DISTRACTING ME
21:31:11 <TrueBrain> :P
21:31:25 <andythenorth> ha ha
21:31:34 <andythenorth> I did consider trying a pyenv wrapper for nml https://hackernoon.com/reaching-python-development-nirvana-bb5692adf30c
21:31:35 <andythenorth> but eh
21:31:39 <andythenorth> stuff and things
21:31:39 <andythenorth> time
21:31:41 <andythenorth> tanks
21:31:47 <glx> btw I finished script_window.hpp generation
21:31:57 <glx> next step is all the .sq
21:32:08 <TrueBrain> cool :)
21:32:11 <glx> then xxx_instance.cpp
21:33:05 <glx> but the generated hpp is not usable, because the current .sq #include "../script_window.hpp"
21:36:57 <TrueBrain> okay .. so yeah, moving files out of 'bin' makes regression a bit easier :D
21:38:26 <TrueBrain> and gives a clean place to add the grfcodec call :D
21:38:27 <TrueBrain> sweet :)
21:46:09 *** octernion has quit IRC
21:47:51 <michi_cc> grfcodec will accept anything, while NML has to be updated which might get a tad annoying while coding a patch.
21:53:15 <andythenorth> dependency problems
21:53:45 <andythenorth> how often is openttd.grf patched though?
21:59:08 <Eddi|zuHause> often enough?
21:59:19 <andythenorth> often enough that the spec changes?
21:59:43 <Eddi|zuHause> adding stuff to action 5 is always a spec change?
22:00:16 <andythenorth> ok
22:02:58 <TrueBrain> bah, 'make test' in CMake is annoying
22:06:05 <TrueBrain> did we ever fix that Squirrel outputs pointers in all kind of weird ways depending on the platform?
22:06:11 <TrueBrain> gsub("0x(\\(nil\\)|0+)(x0)?", "0x00000000", $0);
22:06:13 <TrueBrain> that lovely regex :P
22:07:19 *** gelignite has quit IRC
22:08:40 <Eddi|zuHause> wtf would "0x(nil)" mean?
22:09:28 <Eddi|zuHause> and what's the trailing x0?
22:10:03 <TrueBrain> I know it was to fix up various of platforms being silly :D
22:22:57 <TrueBrain> hmmm .. how to 'diff' in a CMake safe way
22:22:58 <TrueBrain> hmm
22:27:06 *** nielsm has quit IRC
22:29:16 <TrueBrain> ha, does seem to work :D
22:29:36 <TrueBrain> most likely Windows will fail
22:30:03 <glx> of course windows needs the exe to be converted
22:30:10 <TrueBrain> exactly :)
22:30:25 <TrueBrain> and I need to fix that 'make test' also copies the regression files
22:30:27 <TrueBrain> not sure yet how ..
22:30:32 <DorpsGek_II> [OpenTTD/OpenTTD] stale[bot] closed issue #6887: Add layer showing boundaries for local authorities https://git.io/fhj57
22:32:35 <TrueBrain> my MSVC project keeps rebuilding
22:32:37 <TrueBrain> very annoying
22:33:04 <TrueBrain> (VS2019)
22:33:12 <glx> two options for that, use editbin but it's not directly in the path, or we can include https://devs.openttd.org/~glx/convert.zip in the test step
22:33:51 <glx> it's a small C file IIRC, wrote that long time ago
22:34:38 <TrueBrain> depends how difficult getting the path is with cmake
22:34:50 <TrueBrain> it might surprise us :D
22:37:19 <TrueBrain> VS2017 also keeps rebuilding
22:37:24 <TrueBrain> well, that is pretty useless :D
22:37:41 <TrueBrain> I generate (with -G a VS2017 project
22:37:46 <TrueBrain> I open it in VS2017
22:37:48 <TrueBrain> I hit build
22:37:50 <TrueBrain> wait a long time
22:37:52 <TrueBrain> hit build again
22:37:55 <TrueBrain> rebuilds EVERYTHING
22:37:58 <TrueBrain> you don't glx?
22:38:17 <glx> last time I checked it didn't
22:47:00 <glx> ok all .sq files are created, almost empty because SquirrelExport.cmake does nothing, but it's a big step :)
22:52:13 <TrueBrain> 1/2 Test #1: regression_tst_regression ........ Passed 9.21 sec
22:52:13 <TrueBrain> Start 2: regression_tst_stationlist
22:52:13 <TrueBrain> 2/2 Test #2: regression_tst_stationlist .......***Failed 3.10 sec
22:52:14 <TrueBrain> w00p :D
22:52:57 <TrueBrain> Start 1: regression_tst_regression
22:52:58 <TrueBrain> 1/2 Test #1: regression_tst_regression ........ Passed 9.22 sec
22:52:58 <TrueBrain> Start 2: regression_tst_stationlist
22:52:58 <TrueBrain> 2/2 Test #2: regression_tst_stationlist ....... Passed 3.06 sec
22:53:00 <TrueBrain> and there we go :)
22:53:41 <glx> nice
22:54:49 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN approved pull request #7370: Cleanup: Remove questionable syntax https://git.io/fhjdo
22:55:57 <TrueBrain> now lets see if I can get MSVC to work so I can test it ..
22:59:01 <TrueBrain> if it keeps rebuilding, there is not a lot I can do ..
22:59:01 <TrueBrain> meh
23:01:30 <TrueBrain> okay, can';t say I know enough about MSVC to understand this :P
23:07:43 <TrueBrain> Windows doesn't have a Shared dir? How can the regression run? :P
23:07:56 <TrueBrain> or is the shared directory done hardcoded ..
23:08:24 <glx> there's a shared dir
23:08:37 <glx> I think
23:08:47 <TrueBrain> there is, but it is done differently than other platforms
23:08:47 <TrueBrain> lol
23:09:25 <glx> it's <all users>\documents\openttd or something
23:09:33 <TrueBrain> C:\Users\Public\Documents\OpenTTD\
23:09:44 <glx> yes that one :)
23:09:59 <glx> and we get it via windows API
23:10:27 <TrueBrain> MSVC stores openttd.exe in a weird location
23:10:27 <TrueBrain> meh
23:10:44 <TrueBrain> it is for some reason under build/Debug
23:10:48 <TrueBrain> it should be in build/
23:11:11 <glx> no because you can also have it in build/Release
23:11:13 <Eddi|zuHause> there's build/Debug and build/Release?
23:11:26 <TrueBrain> that is not how CMake (should) work
23:11:32 <glx> depends on the configuration used to build
23:11:38 <TrueBrain> so nice that MSVC is being the annoy child in the class
23:11:39 <TrueBrain> but brrr
23:11:53 <glx> and that's how cmake does it for msvc projects
23:11:54 <TrueBrain> (the binary should be in the build folder in the same location as the source folder)
23:12:20 <TrueBrain> I am somewhat surprised that strgen runs
23:12:46 <glx> cmake knows where the exe will be :)
23:13:03 <TrueBrain> except that we run it as 'strgen'
23:13:12 <TrueBrain> meh
23:13:15 <TrueBrain> why are things always this annoying
23:13:34 <glx> yes we put strgen and cmake translate that to the right exe
23:13:48 <glx> because it recognise a target name
23:13:49 <TrueBrain> which we cannot do for openttd
23:14:01 <TrueBrain> it is the typical: everyone does A, but one thing has to do B
23:15:02 <glx> hmm if you use "openttd" with extension it doesn't convert ?
23:15:08 <glx> *without
23:15:16 <TrueBrain> it is in a completely different cmake
23:15:17 <TrueBrain> so no
23:15:33 <TrueBrain> (Regression is like baseset etc not executed from the main flow)
23:16:59 <glx> maybe pass it as an define, using $<TARGET_FILE:openttd>
23:17:06 <milek7> cmake relation with build configuration is weird: on make/other it requires one CMAKE_BUILD_TYPE, but on MSVC it always generates all possible configurations in vcproj
23:17:45 <glx> because it's a project file, intended to be used in GUI
23:18:35 <TrueBrain> get_property doesn't work .. lets try the alternatives ..
23:18:46 <TrueBrain> TARGET_FILE does work, so .. I guess that will have to do
23:22:18 <TrueBrain> okay, manually it works, after converting the executable
23:23:18 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
23:23:22 <TrueBrain> tomorrow or so I will battle MSVC, see why it is acting this annoying
23:24:02 * m3henry hopes to merge soon
23:24:49 <TrueBrain> glx: so for MSVC regression breaks; which is not a change in what it used to do :P
23:25:09 <TrueBrain> mingw should work, as far as I can tell (but I cannot test mingw here)
23:25:36 <glx> mingw needs conversion too I think, but I can quickly check
23:26:18 <TrueBrain> haha, installing the OpenGFX fails, because bin/baseset no longer exists :D
23:26:18 <TrueBrain> epic
23:27:28 *** Progman has quit IRC
23:27:37 <glx> of course make test doesn't build
23:28:10 <TrueBrain> hmm .. Linux fails for a completely different reason
23:28:18 <TrueBrain> which is also odd :D
23:28:32 <TrueBrain> owh, that might be my change
23:28:52 <TrueBrain> bugs all around :D
23:36:59 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
23:37:03 <TrueBrain> lets see if I can fix 2 bugs :P
23:37:12 <TrueBrain> I wanted to go to bed early .. I failed :D
23:40:54 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
23:42:29 <TrueBrain> lol .. on linux the OpenGFX is installed in the "wrong" location (in /usr/share, and it is checking /usr/local/share) :D
23:44:39 <DorpsGek_II> [OpenTTD/OpenTTD] TrueBrain updated pull request #7270: Introduce CMake (and removing all other project-related code) https://git.io/fhbqc
23:44:41 <TrueBrain> we just keep trying!
23:46:43 <TrueBrain> mkdir: /Library/Application Support/OpenTTD/baseset: Permission denied
23:46:46 <TrueBrain> :( *sad panda*
23:47:03 <TrueBrain> well, that is somewhat an issue ..
23:47:13 <TrueBrain> why are our searchpaths so fucked up? :(
23:49:10 <TrueBrain> okay, this sounds like for a me-problem tomorrow
23:49:16 <TrueBrain> and you guys are boring today :( So silent ...
23:49:18 <TrueBrain> night all!
23:49:22 *** andythenorth has quit IRC
23:50:55 <m3henry> o/
23:54:40 *** HerzogDeXtEr has quit IRC
23:58:22 <glx> Start 1: regression_tst_regression
23:58:22 <glx> 1/2 Test #1: regression_tst_regression ........***Failed 223.60 sec
23:58:22 <glx> Start 2: regression_tst_stationlist
23:58:22 <glx> 2/2 Test #2: regression_tst_stationlist ....... Passed 60.11 sec