IRC logs for #opendune on OFTC at 2011-05-07
            
00:42:16 <DorpsGek> SVN: glx (r1527) -Add: C-ified GUI_CreateWindow()
02:57:11 *** glx has quit IRC
07:52:14 *** Alberth has joined #openDune
12:00:01 *** glx has joined #openDune
12:00:02 *** ChanServ sets mode: +o glx
12:01:36 <glx> hello
12:07:56 <Alberth> hello
13:07:54 <DorpsGek> SVN: glx (r1528) -Add: C-ified GUI_Widget_Undraw(), GUI_Window_BackupScreen() and GUI_Window_RestoreScreen()
13:10:30 <TrueBrain> glx: also feel free to apply any of Alberth's patches ;)
13:10:47 <glx> hmm yes I should read them
13:14:29 <glx> #71 is the code that moves mentat eyes ???
13:15:01 * Alberth remembers that C needs a "struct" prefix before "Widget" :)
13:15:12 <Alberth> or perhaps the mouth?
13:15:23 <glx> only if you don't include widget.h :)
13:15:51 * Alberth tests
13:22:43 <Alberth> how did you decide the function is about eyes?
13:23:24 <Alberth> s/decide/deduce/
13:23:56 <glx> many IsMouseInsideRegion
13:25:29 <glx> and it seems there's a bug in the conversion
13:26:13 <glx> hmm screen corruption in clean trunk
13:30:02 <Alberth> I tested #71 quite a lot due to the deadlock problems :)
13:32:07 <glx> hmm no bug indeed, it was just a feeling
13:36:25 <DorpsGek> SVN: glx (r1529) -Add (#71): C-ified GUI_Mentat_Animation() (patch by Alberth)
13:36:54 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=71 :: New Status: closed (fixed)
13:40:59 <Alberth> you're fast in checking that large function :)
13:41:30 <TrueBrain> I for one never check your conversion; just the surroundings and the implications :D
13:41:49 <TrueBrain> (which results in renaming here and there :p)
13:41:59 <glx> I just quick read to see obvious errors
13:42:14 <TrueBrain> there are bound the be errors all over the place anywa y:)
13:42:51 <glx> even our stuff is sometimes wrong
13:43:14 <TrueBrain> yup
13:43:21 <TrueBrain> almost 'often' :D
13:44:39 <glx> there was a copy/paste error in r1527 btw (fixed while doing r1528) :)
13:45:24 <glx> of course now #72 doesn't apply :)
13:46:59 <Alberth> of course :)
13:51:45 <glx> ok applied
13:51:55 <Alberth> thanks
13:52:09 <Alberth> need to do some other stuff first, bbl
13:52:21 *** Alberth has left #openDune
13:56:06 <DorpsGek> SVN: glx (r1530) -Add (#72): C-ified GUI_DrawSprite_8002() (patch by Alberth)
13:56:25 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=72 :: New Status: closed (fixed)
13:56:45 <glx> I won't touch #70 for now ;)
13:57:20 <TrueBrain> yeah ... lets leave that alone for a bit :D
13:59:26 <glx> now another big one: GUI_String_Get_ByIndex()
13:59:37 <TrueBrain> good luck :D
14:00:32 <glx> the last B4F2 seems to get free space on disk
14:01:12 <TrueBrain> lets see if my netbeans works, then I can take a look? (if nobody else is :p)
14:02:28 <TrueBrain> src/gui/widget_click.c: emu_GUI_DrawText_Wrapper still used. Replace with GUI_DrawText_Wrapper
14:02:30 <TrueBrain> src/gui/widget_click.c: emu_GUI_DrawText_Wrapper still used. Replace with GUI_DrawText_Wrapper
14:02:31 <TrueBrain> src/gui/widget_click.c: emu_GUI_DrawText_Wrapper still used. Replace with GUI_DrawText_Wrapper
14:02:33 <TrueBrain> src/gui/widget_draw.c: emu_GUI_DrawText_Wrapper still used. Replace with GUI_DrawText_Wrapper
14:02:49 <glx> I know
14:02:56 <TrueBrain> k :)
14:02:57 <glx> need GUI_String_Get_ByIndex() first :)
14:03:11 <TrueBrain> Netbeans 7.0 loads :D
14:04:19 <TrueBrain> missing plugins
14:04:21 <TrueBrain> lol
14:06:08 <TrueBrain> I love seeing almost no decompiled shit :D
14:06:47 <TrueBrain> I will do the other B4F2 now, it is a funny one :D
14:07:40 <glx> do you want the asm ?
14:07:49 <TrueBrain> I don't it is needed in our case
14:08:09 <TrueBrain> libemu ensures those never happen
14:09:27 <TrueBrain> @calc 0x7530
14:09:27 <DorpsGek> TrueBrain: 30000
14:09:45 <TrueBrain> it checks if there is 30,000 bytes free on the disk, basically
14:10:19 <glx> emu_subw(&emu_bx, 0xFFF2); <-- funny substraction ;)
14:11:18 <TrueBrain> yeah, 2A91 is true if there is 30,000 bytes free on the disk :p
14:11:21 <TrueBrain> how silly :D
14:11:47 <TrueBrain> do we want to keep all that, or shall I just prepare it for a real conversion? :)
14:17:48 <DorpsGek> SVN: truebrain (r1531) -Add: C-ified File_HasFreeSpace(), and removed 01F7 deps (and it is not really a C-ification, just a 'return true' placehold)
14:17:51 <TrueBrain> :D
14:19:37 <DorpsGek> SVN: truebrain (r1532) -Add: named g_global->variable_2A91
14:24:48 <DorpsGek> SVN: truebrain (r1533) -Add: C-ified GUI_Widget_HOF_Resume_Click()
14:25:33 <glx> oh you had stuff in the queue
14:25:37 <TrueBrain> nope
14:25:47 <TrueBrain> but 1533 was _really_ easy :D
14:26:05 <glx> lol
14:26:54 <TrueBrain> most is only GUI stuff .. nice :D
14:28:58 <TrueBrain> guess I can try B495_0000
14:30:51 <TrueBrain> @calc 0x2FD
14:30:51 <DorpsGek> TrueBrain: 765
14:42:39 <TrueBrain> converting has become so much easier, lol
14:42:53 <glx> hehe :)
14:43:02 <glx> the more we convert the easier it is
14:44:15 <TrueBrain> how to call that GUI window where you can order stuff
14:44:20 <TrueBrain> starport / construction yard?
14:47:49 <TrueBrain> GUI_Order_Show?
14:47:53 <TrueBrain> OrderScreen
14:47:56 <TrueBrain> ....?
14:50:29 <TrueBrain> also goes for factories of course
14:51:22 <TrueBrain> GUI_DisplayFactory ?
15:00:34 <DorpsGek> SVN: truebrain (r1534) -Add: C-ified GUI_DisplayFactoryWindow()
15:00:43 <TrueBrain> 60% converted
15:13:42 <glx> hmm someone added warnings :)
15:14:32 <TrueBrain> don't I always?
15:15:27 *** ChanServ sets mode: +v glx
15:15:27 *** ChanServ sets mode: +v Xaroth|Work
15:15:27 *** ChanServ sets mode: +o TrueBrain
15:17:52 <glx> every time you touch something with houseID ;)
15:19:39 <TrueBrain> :p
15:24:28 *** ChanServ sets mode: +v TrueBrain
15:29:14 <DorpsGek> SVN: glx (r1535) -Add: C-ified GUI_String_Get_ByIndex(). Bye B4F2
15:32:10 <glx> ha some warnings were mine
15:32:42 <DorpsGek> SVN: glx (r1536) -Fix: MSVC warnings
15:49:46 <TrueBrain> time to clean up scenario shit a bit ...
15:56:24 <TrueBrain> owh, yeah ... that wasn't that simple ... lol
15:59:24 <TrueBrain> glx: did we ever decide if we wanted our own INI routine, or convert the existing one?
16:00:05 <glx> we never decided anything about that IIRC
16:00:45 <TrueBrain> so what do you think now? :p
16:04:58 <TrueBrain> owh yeah, it was either convert, or use a libini
16:06:56 <glx> right
16:26:39 *** Alberth has joined #openDune
16:27:19 <TrueBrain> 740 lines ... tricky what is best :p
16:28:20 <Alberth> make it 741
16:28:36 <TrueBrain> it is more like 738
16:30:16 <TrueBrain> guess converting it is ...
16:31:31 <Alberth> that's the usual idea here :p
16:31:40 <TrueBrain> we were debating the ini read routines
16:31:42 <TrueBrain> they are nasty
16:31:54 <TrueBrain> we can either use a libini that exists, or convert this
16:32:00 <Alberth> although 'refactoring to a higher abstraction level' sounds nicer :)
16:40:08 <Xaroth|Work> is there a downside to using libini inmediately?
16:42:17 <TrueBrain> do you know one that works on all OSes? :D
16:42:24 <TrueBrain> 3rdparty lib
16:42:41 <glx> there's a libini project on sourceforge
16:43:02 <Xaroth|Work> for something as simple as ini I would have expected one to be around
16:43:38 <Alberth> openttd has a file for that too :)
16:44:17 <Alberth> recently I abstracted that file away from FIO
16:44:29 <glx> ok the one on codeplex is in C# so not for us
16:44:49 <TrueBrain> I am just going to convert the shit :p We can figure it out later :)
16:46:29 <glx> wow only 7 emu_Tools_Malloc() left
16:46:39 <glx> in decompiled ;)
16:47:05 <TrueBrain> :D:D
16:47:17 <TrueBrain> time for me to do something else :)
16:47:36 <glx> 8 free/free_wrapper
16:48:00 <glx> and 4 getfreemem
16:48:25 <glx> maybe we should convert the last callers first :)
16:49:13 <glx> ok I'm on 2B4C
19:22:54 <Alberth> glx: fix for 'abs()' in char *s = g_global->savegameDesc[abs((int16)stringID + 1)]; in r1535: http://devs.openttd.org/~alberth/abs.patch
19:23:16 <glx> oh missing include again
19:23:53 <Alberth> these problems are easy to fix :p
19:25:21 <DorpsGek> SVN: glx (r1537) -Fix (r1535): missing include again
20:14:42 *** Alberth has left #openDune
20:27:41 <TrueBrain> right ... B4FC is mine :D Going to eat it all!
20:27:43 <TrueBrain> Yam yam yam
20:35:48 <glx> hmm looks like I'm hit by timing changes
20:36:07 <glx> (triggered unresolved in 01F7)
20:37:12 <TrueBrain> :(
20:42:41 <TrueBrain> do we have a strupr?
20:43:03 <TrueBrain> guess no, as there is only one match; my match :D
20:45:00 <glx> hmm we had that already IIRC
20:45:07 <TrueBrain> me too, can't find it :(
20:46:11 <TrueBrain> found custom forloops :D
20:47:29 <glx> ha
20:49:47 <TrueBrain> we should fix that :D
20:53:33 <glx> hmm a lot of unresolved triggered, maybe I have an error in the begin of my conversion
20:54:00 <glx> though I haven't converted that much
20:54:17 <TrueBrain> check cclean trnk?
20:54:27 <glx> clean trunk is ok :)
20:54:38 <glx> I think it's because I pop too much :)
20:54:48 <glx> (removed the push at the begin
20:54:58 <glx> but not the pop at the end
20:56:19 <TrueBrain> for (loc02 = var18; loc02 != NULL; loc02 = strchr(loc02++, "["))
20:56:22 <TrueBrain> too much? :D
20:56:45 <TrueBrain> for (loc02 = var18 - 1; loc02 != NULL; loc02 = strchr(++loc02, "["))
20:56:49 <TrueBrain> to solve the first time
20:56:57 <TrueBrain> owh, still wrong
20:57:04 <glx> yes it's better with the push :)
20:57:14 <TrueBrain> for (loc02 = strchr(var18, '['); loc02 != NULL; loc02 = strchr(++loc02, "["))
20:57:31 <SmatZ> I am not sure that code would win any readability contest...
20:57:51 <TrueBrain> I wonder how to write it in nice C
20:57:55 <SmatZ> :)
20:57:58 <TrueBrain> while keeping things like continues in order
20:58:13 <SmatZ> can var18 == NULL ?
20:58:17 <TrueBrain> no
20:58:21 <TrueBrain> (pre-checks)
20:59:41 <TrueBrain> for (loc02 = var18; loc02 != NULL; loc02++)
20:59:45 <TrueBrain> loc02 = strchr(loc02, "[")
20:59:46 <TrueBrain> better, right?
21:01:02 <SmatZ> for (loc02 = var18; *loc02 != '\0'; loc02++) { if (*loc02 != '[') continue; ...
21:01:05 <SmatZ> maybe :)
21:01:18 <TrueBrain> haha, also possible :)
21:01:28 <TrueBrain> but yeah, we both wrote the same, just I use strchr, you don't :D
21:01:42 <SmatZ> :)
21:01:56 <SmatZ> you possible lose the performance-optimised strchr
21:02:04 <SmatZ> *possibly
21:03:12 <SmatZ> loc02 = strchr(loc02, "[")
21:03:18 <SmatZ> ^^^ then loc02 can be NULL
21:03:25 <SmatZ> so you have to check for non-NULL again
21:03:32 <TrueBrain> yeah, a check follows :D
21:03:42 <TrueBrain> far from optimal, but meh
21:03:54 <SmatZ> for (loc02 = var18; loc02 != NULL; loc02 = strchr(loc02 +1, '[') ?
21:04:07 <SmatZ> eg. not loc02++ in strchr call
21:04:18 <SmatZ> oh
21:04:32 <SmatZ> it would fail if '[' would be the first character...
21:04:49 <TrueBrain> :D
21:08:11 <TrueBrain> weird, if you have text like [map] as value somewhere, it aborts :d
21:08:55 <SmatZ> :p
21:09:14 <TrueBrain> don't really understand what that is about :p
21:18:40 <glx> Memory Corrupt!!!
21:18:40 <glx> Ram Free Error! Press any key to exit to DOS.
21:18:46 <glx> yeah \o/
21:20:18 <TrueBrain> :D:D:D
21:21:21 <glx> and I don't see anything wrong :/
21:43:23 <TrueBrain> did something wrong; have to get some sleep :P
21:43:25 <TrueBrain> night :)
21:43:33 <TrueBrain> (my conversion failed horribly, but I am drunk, might be related :D)
21:45:33 <glx> pff of course I forgot to remove cs:ip pop