IRC logs for #openttd on OFTC at 2024-06-09
⏴ go to previous day
02:09:23 *** ChanServ sets mode: +v tokai
02:16:16 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
02:18:35 *** Wormnest has quit IRC (Quit: Leaving)
02:21:41 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:57:03 *** gnu_jj_ has joined #openttd
03:00:11 *** gnu_jj has quit IRC (Ping timeout: 480 seconds)
04:12:18 *** tokai has quit IRC (Ping timeout: 480 seconds)
04:16:03 *** ChanServ sets mode: +v tokai
04:41:33 <DorpsGek> - Update: Translations from eints (by translators)
06:42:28 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
08:23:38 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
09:03:31 <andriydohniak> Just to show what yall are missing out on
09:10:55 *** silent_tempest has joined #openttd
09:10:55 <silent_tempest> peter1138: Sorry that took so long.
09:24:25 <peter1138> Huh, that was timing, just got back from hanging up laundry...
10:53:45 *** gelignite has joined #openttd
11:21:32 *** exceptik has joined #openttd
11:21:32 <exceptik> andriydohniak: We've played spiff's battle royale, dw
11:23:13 <andriydohniak> exceptik: I missed it :(
11:23:34 <exceptik> There are rumors... That they would repeat it some day
11:24:09 <andriydohniak> exceptik: Idk, but I am trying to add mass multiplayer support upstream, so mb this will be more frequent and less buggy
11:25:59 <exceptik> Worst part was updating ui so it actually makes sense for "mmo" mode
11:29:36 <andythenorth> neat, seems I previously wrote a python -> squirrel table repr in my compile
11:30:03 <andythenorth> so I can just add dict items in my python files per FIRS industry and they appear in the GS
11:30:18 <andythenorth> what's the opposite of Marvin? 🙂
12:09:20 *** gelignite has quit IRC (Quit: Stay safe!)
12:13:20 <andriydohniak> I know this is asking a lot, but if somebody can explain how UIs in openTTD work?
12:13:20 <andriydohniak> - How are they constructed
12:13:20 <andriydohniak> - What constitues a widget, and how and when are widgets are re-rendered
12:13:20 <andriydohniak> - When is the DrawWidget function called, and when do the draw updates actually show on the screen
12:13:20 <andriydohniak> - How can widgets in separate windows interact with each other, and what do InvalidateWindowData, and this->SetDirty() do / mean
12:17:03 <andythenorth> we live in a time of advanced robots, that can answer my question using expensive GPUs
12:17:03 <andythenorth> In "The Hitchhiker's Guide to the Galaxy" (HHGTTG) by Douglas Adams, being gloomy is indeed akin to being like Marvin, the depressed robot. In contrast, the character that best embodies positivity and affirming attitudes would be Zaphod Beeblebrox. Zaphod, the two-headed, three-armed ex-President of the Galaxy, is often exuberant, carefree, and unflinchingly optimistic, even in the face of danger
12:17:03 <andythenorth> or absurdity. His larger-than-life personality and unyielding confidence serve as a stark counterpoint to Marvin's perpetual gloominess.
12:20:07 <andriydohniak> andythenorth: Objection your honor! Relevance
12:20:37 <andriydohniak> I move to strike this from the record
12:21:20 <andythenorth> relevance is that TB reminds me when I'm being offputtingly gloomy about GS
12:21:29 <andythenorth> so I've provided some balance
12:22:12 <andriydohniak> andythenorth: TB? Tuberculosis?
12:23:51 <andriydohniak> Ok, I should read some classical literature, or I will stay confused
12:53:54 <andriydohniak> Please correct me if I am wrong, but Invalidate just calles OnInvalidate of the individual widget, and the draw function is called every frame, but the information actually gets displayed when SetDirty is called
12:57:39 <andriydohniak> Ok, DrawWidget is called when something in a particular region of the screen changes
12:58:00 <andriydohniak> So when there are a lot of moving cars behind the graph, it will update very often
12:58:12 <andriydohniak> and when it's over water it will not update at all
12:58:17 <peter1138> SetDirty marks a region on screen dirty. DrawWidget is then called later.
12:58:22 <andriydohniak> That is very weird
12:58:45 <andriydohniak> peter1138: But when I call draw widget manually, it does not update the screen properly
12:58:57 <peter1138> It's not a compositing window manager, is the dirty region system doesn't only knows about the area, not which window it is
12:59:09 <peter1138> Don't call it manually.
12:59:23 <peter1138> If you want it to redraw, use SetDirty.
12:59:56 <andriydohniak> peter1138: And If I want to redraw some other window, I use Invalidate, which should inside OnInvalidate set SetDirty
13:01:01 <peter1138> Invalidate is about making sure any data is up to date.
13:03:00 <andriydohniak> peter1138: But that's the only "Signal" I can send to other windows, correct?
13:03:30 <andriydohniak> peter1138: And what is the point of being up to date, if the screen information is wrong
13:05:57 <peter1138> What's the point of drawing to the screen if your data is not up to date?
13:06:55 <andriydohniak> Ok, I don't get something, if you know that the info is not up to date, why not just immediatelly draw it after changing the info in the memory? why let it sit there and wait for a new draw?
13:07:21 <andriydohniak> Or can you just give me an example where InvalidateWidget doesn't really care about redrawing
13:10:21 <peter1138> Invalidate always marks it as dirty, so I don't really see what you're getting at here.
13:10:30 <andriydohniak> peter1138: How then can I move a corner of a map behind the graph window, without causing the graph redraw?
13:10:52 <andriydohniak> peter1138: Hmm, I need to double check something then
13:11:51 <peter1138> Window::InvalidateData().
13:11:59 <peter1138> The first call is this->SetDirty()
13:12:30 <peter1138> andriydohniak: The graph will redraw even though it doesn't really need to, don't worry about it.
13:13:06 <andriydohniak> Ok, true, I was just messing around, and I guess I didn't remember this correctly
13:13:54 <andriydohniak> andriydohniak: What about this?
13:13:54 *** tokai|noir has joined #openttd
13:13:54 *** ChanServ sets mode: +v tokai|noir
13:14:36 <andriydohniak> I put a log message on that widget DrawWidget function, and it does not trigger
13:15:27 <andriydohniak> why moving a map does not trigger a redraw, but a car moving under it does
13:16:47 <peter1138> There's special code that handles a viewport being moved that minimizes amount of viewport redrawing.
13:17:14 <peter1138> It moves what's already drawn then, and then only redraws the bits that were previously occluded.
13:17:16 *** tokai has quit IRC (Ping timeout: 480 seconds)
13:17:47 <andriydohniak> but if windows are always above cars, why do they trigger a redraw of a window?
13:18:45 <peter1138> Jesus why can I not type properly these days? 😦
13:19:05 <peter1138> The dirty screen region system only goes by screen area.
13:19:32 <peter1138> So when a vehicle moves it marks a region of screen dirty, and whatever is in that region is then redrawn.
13:19:54 *** ChanServ sets mode: +v tokai
13:20:14 <andriydohniak> peter1138: AAAAAAAAAAHHHH
13:20:51 <andriydohniak> When the viewport is moved, it calculates what regions were ocluded anyway, and just doesn't request a redraw there!
13:21:38 <andriydohniak> So it probably itarates through all the widgets, and checks which regions do they take up, and then redraws only regions that are not obscured on the top layer
13:22:05 <andriydohniak> probably with some algorithm of greedy rectangles feeling the space
13:22:07 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
13:22:12 <andriydohniak> and then setting that space to be redrawn
13:22:20 <andriydohniak> or just pixel by pixel, idk
13:22:37 <andriydohniak> DId I get it? or am I hallucinating?
13:23:09 <peter1138> It only cares about window rectangles, it doesn't need to know about widget rectangles.
13:23:29 <andriydohniak> peter1138: Yea, I confused the 2
13:23:36 <peter1138> It is pretty recursive.
13:23:39 <andriydohniak> Ok, NICE! I understand now
13:24:37 <andriydohniak> peter1138: Clever rectangle filling algorithm
13:25:37 *** tokai|noir has joined #openttd
13:25:37 *** ChanServ sets mode: +v tokai|noir
13:25:48 <andriydohniak> peter1138: You are VERY knowledgeable in this huge codebase! You helped me with the tiles, saveload, and now the UI side
13:27:34 *** HerzogDeXtEr has joined #openttd
13:28:07 *** tokai has quit IRC (Ping timeout: 480 seconds)
13:29:22 *** gelignite has joined #openttd
13:56:43 <peter1138> Hmm, annoying, my "compositor" patch no longer works.
14:14:51 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
14:38:15 <andriydohniak> The different color suggest some subpixel corruption, idk
14:39:33 <andriydohniak> or mb the photo is just compressed, so multiple pixels become 1
15:11:23 <pickpacket> I need to sit down at my computer and write in that shares system discussion... i just see exploits waiting to happen
15:12:50 <peter1138> Just uninitialised memory.
15:13:11 <peter1138> Caused by ZOOM_LVL_NORMAL not being ZOOM_LVL_MIN any more.
15:24:58 <peter1138> About 4 months old, yes.
15:25:21 <_glx_> hmm but zoom level enum reorder is older
15:34:09 <peter1138> Anyway, it's really slow. So something else is wrong.
15:34:25 <peter1138> Or maybe it was always slow but I was using a RelWithDebInfo build last time.
15:35:32 *** Wormnest has joined #openttd
15:37:33 *** toktik is now known as Guest9067
15:43:11 *** Guest9067 has quit IRC (Ping timeout: 480 seconds)
17:40:55 *** gelignite has quit IRC (Read error: Connection reset by peer)
17:56:34 *** gelignite has joined #openttd
19:06:24 <talltyler> Yikes, `GenerateClearTile()` is just walking tech debt. One-and two-letter variables, nested for and do while loops, magic numbers, and a goto 😬
19:06:59 <talltyler> I can't in good conscience make a small change without rewriting the whole function...
19:18:41 <andythenorth> do we have tests? 😛
19:36:04 <ahyangyi> peter1138: Is that a sub-merged pull request?
20:01:38 <peter1139> LordAro, you absolute beast
20:10:22 *** gelignite has quit IRC (Quit: Stay safe!)
20:15:55 <peter1139> Alright, so I need to determine if a buffer is the screen or a separate surface, in case of palette animation.
20:16:18 <peter1139> Or maybe rethink it.
20:16:43 <andriydohniak> If somebody that does GUI is over here, what is the best way to do a scrollable selectable list in openTTD?
20:17:09 <peter1138> The cargo graph window has one already.
20:17:32 <peter1138> Although it's a bit quirky as it uses the small font for hysterical raisins.
20:18:12 <andriydohniak> peter1138: hysterical raisins 🤣
20:18:32 <andriydohniak> just screaming grapes
20:19:26 <andriydohniak> I think I will keep my implementation a separate window, but this is very usefull!
20:54:20 <peter1139> Ah, well the company key window already exists, and probably isn't too much work to change. Would need to be changed from separate widgets per row to a WWT_MATRIX.
20:59:26 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:03:04 <LordAro> peter1139: my knees hurt
21:04:01 <truebrain> want him to kiss them, to make you feel better? 😛
21:06:42 <peter1139> LordAro, I am not surprised!
21:27:23 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:29:50 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
21:42:27 *** ChanServ sets mode: +v tokai
21:49:27 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
21:50:48 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
continue to next day ⏵