IRC logs for #opendune on OFTC at 2009-12-18
⏴ go to previous day
00:00:23 <TrueBrain> okay, I really have to redo this ... as this just sucks :p
00:01:40 <glx> you made strange mistakes ;)
00:02:00 <glx> but these ifs are really a pain
00:02:08 <TrueBrain> I was getting tired
00:02:11 <TrueBrain> too much copy/pasting
00:02:18 <TrueBrain> I can only concentrate N long
00:09:22 <TrueBrain> those were for Xaroth! :p
00:09:48 <TrueBrain> + u2= Unit_Get_ByPackedTile(packed);
00:10:12 <glx> there were unresolved jumps in this one ;)
00:11:55 <glx> easier to read these than the big ones
00:12:46 <DorpsGek> SVN: glx (r796) -Add: C-ified Unit_SetDestination()
00:13:33 <glx> do we create widget_click ?
00:13:59 <TrueBrain> I think there is where the viewport should go in and stuff, yes
00:14:06 <TrueBrain> and I think we should rename widget.c to widget_draw.c
00:14:13 <TrueBrain> or .. we need to group all widget types together
00:14:16 <TrueBrain> that is the other choice
00:14:23 <TrueBrain> dunno what is more useful
00:14:57 <glx> or just gui_click.c and gui_draw.c
00:15:05 <TrueBrain> might be too general
00:15:18 <TrueBrain> but I dunno about those click functions
00:15:21 <TrueBrain> if they all can go in one file
00:15:25 <TrueBrain> or if they should be split too
00:16:10 <TrueBrain> the other .. what .. 20, are not
00:16:21 <TrueBrain> so maybe we should split it by Mentat, Production, ...
00:16:38 <TrueBrain> I dunno ... naming is tricky at this stage for such things
00:16:54 <glx> so viewport_click.c and viewport_draw.c would be better
00:17:02 <TrueBrain> but might be over-specific
00:17:09 <TrueBrain> for viewport it might be acceptable
00:17:20 <TrueBrain> (is there a ViewportDraw routine?
00:17:49 <TrueBrain> but yes, by the looks, it would be best to have viewport_NNN.c, mentat_NNN.c, general_NNN.c
00:18:23 <glx> but it should be something to draw the map, the minimap, ...
00:18:41 <TrueBrain> so lets deal with it when we find it :)
00:19:18 <glx> anyway all 0AEC functions are viewport_XXX_click
00:19:35 <glx> can stay viewport.c for now
00:19:56 <TrueBrain> the Place button has little to do with the viewport ;)
00:20:14 <glx> maybe viewport.c is then too specific :)
00:20:15 <TrueBrain> so I would suggest to put them in widget_click.c, assuming the current widget.c will be renamed to widget_draw.c
00:20:25 <TrueBrain> as these are more generic widgets I guess
00:21:10 <TrueBrain> as I am guessing Widget_SpriteTextButton_Draw has also a Widget_SpriteTextButton_Click
00:21:23 <TrueBrain> (which you named BuildPlace I believe)
00:21:45 <glx> emu_GUI_BuildPlace() <-- this one in 0AEC yes
00:21:48 <TrueBrain> they turned out to be general buttons with both a sprite and text
00:21:58 <TrueBrain> (with some exception code, but still)
00:22:23 <TrueBrain> so I wonder what that function does exactly ..
00:22:32 <TrueBrain> if it is really specific, or also more general, with a bit of exception code
00:23:31 <TrueBrain> the whole problem with Dune2 is that it has such a small Window system, one can wonder if you should name it general, or very specific
00:23:41 <glx> what to do is specified in 353F:97E5
00:23:54 <TrueBrain> 97E5 is set by SpriteTextButton_Draw
00:24:12 <TrueBrain> well, not set I believe, or not directly, but it comes from there :)
00:24:23 <TrueBrain> it is the string on the button
00:24:52 <TrueBrain> but okay, for now: C-ify it, put is in widget_click.c
00:25:04 <TrueBrain> when we are done with all the clickytheclick functions, we revisit the exact naming
00:25:13 <TrueBrain> (as then we know their exact scope)
00:30:54 <TrueBrain> I really fucked up many statements ....
00:31:50 <TrueBrain> found a bunch more ..
00:32:08 <TrueBrain> it now _almost_ works
00:32:14 <TrueBrain> real clicking still refuses
00:45:12 <TrueBrain> I don't see the problem :(
00:45:46 <TrueBrain> in fact ... I don't see how the click is working for those buttons :p
00:47:54 <TrueBrain> oops .. forgot to set emu_ax :p
00:48:05 <TrueBrain> it seems to work :o
00:48:29 <glx> return value is sometime important
00:48:31 <TrueBrain> only it clicks too much :p
00:48:43 <TrueBrain> that is, in Mentat, clicking Exit immediatly exists Mentat, where it should go back to the main list
00:49:28 <TrueBrain> and buttons do not always seem to work
00:49:31 <TrueBrain> so still an error, somewhere
00:54:54 <TrueBrain> oh, let me try to update first ..
00:58:05 <TrueBrain> there is a printf, which should never be triggered :p
00:59:55 <TrueBrain> tomorrow ... tomorrow I will try to understand the code, and maybe ... maybe, make it more readable
01:00:12 <TrueBrain> for sure there are 4 types of 'buttons'
01:03:06 <TrueBrain> k, enough for today ...
08:50:24 <TrueBrain> so why are you up so early?
08:50:38 <Xaroth> need to drive her to school and back
08:50:41 <Xaroth> then shopping for xmas
09:02:10 <TrueBrain> I still need to do mine ....
09:05:32 <TrueBrain> no sense make to me do does not
09:07:34 <TrueBrain> g_global->widgetLastButtonState &= ~((locdx & 0x4400) >> 1);
09:07:36 <TrueBrain> g_global->widgetLastButtonState |= (locdx & 0x1100) << 1;
09:07:40 <TrueBrain> sometimes, I hate math .. :p
09:36:54 <DorpsGek> TrueBrain: 111101111111
09:40:02 <DorpsGek> TrueBrain: 111111111001
10:05:45 <DorpsGek> TrueBrain: 111111111011
10:05:46 <DorpsGek> TrueBrain: 111111111101
11:01:16 <TrueBrain> all this time my patch works; then I started to integrate it file-wise .. and now it fails :( :(
11:04:52 <TrueBrain> okay .. a minor design flaw in the function of glx
11:04:56 <TrueBrain> thought I was going nuts
11:22:41 <TrueBrain> k .. one bug remaining: I can't skip the Mentat blabla shit
11:53:46 <TrueBrain> you are early today ;)
11:55:07 <TrueBrain> I understand most of it :) :) :) :)
11:55:26 <TrueBrain> after this I want to remove a few entries from 353F and make it local statics, so I can make them real pointers :)
11:57:45 <glx> -void GUI_Widget_Viewport_Click(Widget *w)
11:57:45 <glx> +bool GUI_Widget_Viewport_Click(Widget *w)
11:58:53 <TrueBrain> it gave me a bit of trouble, that the emu_ did something different ;)
12:00:37 <glx> oh indeed my if blocks were not very clean :)
12:07:15 <glx> going to eat, I'll continue reading after :)
13:18:37 <glx> +,...,...positionX = w->offsetX;
13:18:37 <glx> +,...,...if (w->offsetX < 0) positionX = (g_global->variable_4062[w->parentID][2] << 3) + w->offsetX; <-- could be a simple +=
13:19:26 <glx> +,...,.../* Check if there was a keypress for the widget */
13:20:36 <TrueBrain> FYI: 'state' & 0xF000 is right button, 'state' & 0x0F00 is left button
13:20:42 <TrueBrain> for all 'state' variables (and even for flags)
13:21:07 <TrueBrain> 0x1 is click, 0x2 is down, 0x4 is release, 0x8 is up
13:22:01 <TrueBrain> (0x1 and 0x4 are the 'changing' values, where 0x2 and 0x8 are the 'from the past' values)
13:22:04 <TrueBrain> it is pretty clever
13:22:29 <glx> even if the game merges left and right :)
13:24:02 <Xaroth> now my tv is actually bigger than my screens again :P
13:25:17 <TrueBrain> I have a 80cm ... I am happy with it :)
13:25:37 <Xaroth> 37" could have probably fit in my room
13:25:41 <Xaroth> but that'd make things a bit cramped
13:25:55 <TrueBrain> for every 10 inch, you need to be 1m away to view 'normally'
13:25:59 <TrueBrain> so 30" means 3 meters away ..
13:26:02 <TrueBrain> 37" means 4 meters away ..
13:26:14 <TrueBrain> there is a moment things are not comphy :)
13:26:25 <TrueBrain> FullHD? (I took HDReady, plenty for me for now :p)
13:26:30 <Xaroth> this one's also 'ziggo certified' .. so hopefully i can get one of those slide-in cards to get digital tv
13:27:07 <Xaroth> that's all I wanted, as my old tv had some dodgy scart :P
13:28:52 <glx> TrueBrain: very easy to follow now :)
13:29:41 <DorpsGek> SVN: truebrain (r797) -Add: C-ified GUI_Widget_HandleEvents()
13:31:58 <TrueBrain> cleaning files now ..
13:36:49 <TrueBrain> glx: what do you think .. I can move 18FE and 1902 to a 'static Widget *'
13:36:58 <TrueBrain> but this means that anything new that might use them will fail
13:37:01 <TrueBrain> I don't expect it though ...
13:37:26 <DorpsGek> SVN: truebrain (r798) -Codechange: move Draw() functions to their own file
13:38:22 <DorpsGek> SVN: truebrain (r799) -Codechange: one unneeded 'extern void' declare
13:39:31 <DorpsGek> SVN: truebrain (r800) -Codechange: remove unneeded includes
13:42:00 <TrueBrain> and how to name such globals? g_widget_selected and g_widget_current_first?
13:42:25 <TrueBrain> and how to mark the entries in global.h?
13:46:02 <TrueBrain> should I add any comments to it?
13:46:26 <glx> maybe the name and location of the replacement
13:46:42 <TrueBrain> that can change over time
13:50:00 <glx> selectionObjectLayout (0x35C6) is indeed a local static
13:51:32 <TrueBrain> shit, I broke something :)
13:51:52 <glx> anyway theorically if we move stuff out on global.h it should be unused in asm
13:52:20 <TrueBrain> g_ or l_ (because it is a local static)
13:52:23 <glx> no emu_get_memory() for the value
13:52:36 <TrueBrain> yes, but there might be one in undetected parts ;)
13:53:51 <glx> l_ for locals and g_ for globals seems right
13:54:27 <TrueBrain> need to find a nice way to fix the 'next' stuff
13:55:50 <glx> and for local I mean used in only 1 function, like function() { static var; } ;)
13:56:04 <TrueBrain> yes, these 3 are that
13:56:09 <TrueBrain> but I don't like adding the 'static' in the function
13:56:13 <TrueBrain> dunno if that makes it more readable
13:56:33 <TrueBrain> reload, what do you think?
13:58:09 <TrueBrain> shit .. I still need wcsip access .. sucks ...
14:00:49 <glx> but indeed wscip need is bad :)
14:01:12 <glx> but it will go away when other functions will be converted
14:01:20 <TrueBrain> yes, there only a few
14:01:39 <TrueBrain> but I have a hard time fixing it for now
14:01:59 <TrueBrain> even more as the 'cs' value for those are very .. random
14:03:01 <glx> and you still need it for GUI_Widget_Draw ?
14:03:38 <glx> and of course for some click handlers
14:05:04 <TrueBrain> shit, I broke something .. Mentat no longer works
14:05:11 <glx> oh missing wcsip = wcsip->next in click handler for
14:06:17 <TrueBrain> ah, csip of that for indeed
14:07:21 <TrueBrain> final patch uploaded
14:08:49 <TrueBrain> yes, I like the new code better, even more if the 'csip' would be removed :p
14:09:00 <TrueBrain> first true C-ification is getting there ;)
14:12:59 <TrueBrain> any final comments?
14:13:18 <TrueBrain> Xaroth: minus the style, looks nice ;)
14:13:24 <Xaroth> what's wrong with the style :/
14:13:39 <TrueBrain> it also misses lines, it is hard to read which user did what
14:13:44 <Xaroth> ignore that bit style-wise
14:13:52 <TrueBrain> is the first 'glx' 767? 768? 766?
14:13:55 <Xaroth> i'm working on the menu/top side atm
14:14:00 <TrueBrain> but it looks nice ;)
14:14:05 <Xaroth> as they are the generic header for everything
14:14:17 <Xaroth> unlike websvn's.. limited :P
14:15:45 <TrueBrain> one nasty bug: wncsip was uninitialized :p
14:16:34 <DorpsGek> SVN: truebrain (r801) -Codechange: moved 3 global variables to 'static local', as that is what they are. Also allows using real pointers instead of csips.
14:21:27 <glx> I guess it's better to keep the arg even if it's unused ;)
14:21:57 <glx> because later we'll call the function directly without a switch
14:29:41 <TrueBrain> + if (s->type == STRUCTURE_CONSTRUCTION_YARD){
14:30:10 <TrueBrain> please put strings between ""
14:31:00 <TrueBrain> jsut don't forget to add doxygen comments
14:40:51 <DorpsGek> SVN: glx (r802) -Add: C-ified GUI_Widget_SpriteTextButton_Click()
15:16:09 <DorpsGek> SVN: truebrain (r803) -Fix (r801): save before commit
15:16:37 <TrueBrain> I am going to do emu_GUI_Mentat_Draw_ScrollBar now
15:17:53 <TrueBrain> hmm ... all this 'Widget' might just be a bit too much for certain functions
15:19:22 <glx> hmm there are many TextButton_Click handlers
15:19:42 <glx> cancel, repair/upgrade, unitcommands
15:20:23 <TrueBrain> Name, Cancel, Picture, RepairUpgrade, UnitCommand .. what do they have in common
15:20:30 <TrueBrain> they are all that thing on the right ..
15:20:44 <glx> Name is not really a button (doesn't look like it)
15:21:04 <TrueBrain> but how to call that panel?
15:22:15 <TrueBrain> as this is what I would like to suggest:
15:22:26 <TrueBrain> rename GUI_Widget_Viewport_Click to GUI_Viewport_Click
15:22:33 <TrueBrain> create a gui/commandinfo.c
15:22:33 <Xaroth> as every page should show that.
15:22:40 <TrueBrain> in there, GUI_Command_Name_Click
15:22:44 <TrueBrain> GUI_Command_Picture_Click
15:23:12 <Xaroth> thing on right -> sidebar
15:23:25 <TrueBrain> GUI_Sidebar_Name_Click
15:23:29 <TrueBrain> glx: wouldn't that be more sane?
15:23:58 <TrueBrain> (means the current widget_click.c should be renamed too btw :p)
15:24:11 <TrueBrain> yesterday I had a brainfart thinking one button would have one click function
15:24:11 <glx> move, attack,... are all handled by the same function
15:24:14 <TrueBrain> that of course is insane ;)
15:24:24 <TrueBrain> so call it GUI_Sidebar_Command
15:24:33 <TrueBrain> or GUI_Sidebar_UnitCommand_Click
15:25:19 <TrueBrain> and then maybe the draw functions should be moved too, if they are not as general as I want to see them :p
15:25:27 <TrueBrain> (the SpriteText is not I guess)
15:26:27 <TrueBrain> you think that would work glx?
15:27:44 <TrueBrain> but is it also sane?
15:32:19 <TrueBrain> another function .. another way of writing stuff
15:32:22 <TrueBrain> uint16 locsi = g_global->variable_4062[w->parentID][0] << 3;
15:32:23 <TrueBrain> if (w->offsetX < 0) locsi += g_global->variable_4062[w->parentID][2] << 3;
15:32:25 <TrueBrain> locsi += w->offsetX;
15:32:29 <TrueBrain> shit is so pissing me off :p
15:32:42 <glx> looks like something you already converted ;)
15:32:50 <TrueBrain> but in reversed order
15:33:36 <glx> btw I'm starting emu_Structure_IsValidBuildLocation() (used only by C-ified files now)
15:33:39 <TrueBrain> how fucking difficult is it to stay consistant?!
15:34:08 <glx> and I'd like to know its return values ;)
15:34:32 <glx> ,...,...,...,...g_global->variable_38EC = emu_ax; <-- to name that if possible
15:45:11 <TrueBrain> I have a csip32, and I don't know what it is accessing :s
15:50:17 <TrueBrain> the code can handle vertical scrollbars too
15:50:22 <TrueBrain> and the Mentat scrollbar handler is universal
15:52:10 <TrueBrain> fuck ... and it still needs wcsip :(
15:53:11 <glx> universal but used only there ;)
15:54:22 <TrueBrain> why BuildingType over StructureType?
15:54:37 <glx> because it's s->buildingType
15:55:00 <glx> and the structure doesn't really exists yet (as it is not placed)
15:55:04 <TrueBrain> maybe that should be structureType too?
15:55:20 <TrueBrain> it is StructureType, the enum, right?
15:55:41 <TrueBrain> yes .. I guess s->buildingType is just a 'forgot to rename when doing s/building/structure/g'
15:55:51 <TrueBrain> so I think it is more consistant to rename it to structureType
15:56:10 <TrueBrain> (a slab is not a building, that is why we renamed to structure ;))
15:56:37 <glx> but it's the type of the structure we are building
15:56:45 <TrueBrain> type of structure :)
15:57:13 <TrueBrain> it should be s->structureType
15:57:39 <TrueBrain> that for sure .. dunno why that is wrong ..
15:58:03 <TrueBrain> I think we should avoid the name 'building' unless it is used as verb
15:58:21 <TrueBrain> (so: you are building a structure, but the structure itself should always be refered to as structure)
15:58:26 <TrueBrain> to avoid future confusion :)
15:59:16 <TrueBrain> I think this pointer has to do with the list you are scrolling or something
16:02:02 <glx> hmm buildingType can be a unit too
16:02:58 <glx> that's the best option yes
16:12:13 <TrueBrain> that explains why it was buildingType .. but that is very ambigious
16:12:19 <TrueBrain> objectType is much more sane :)
16:14:28 <DorpsGek> SVN: glx (r804) -Codechange: renamed some variables
16:14:31 <TrueBrain> off by one, the scrollbar now ..
16:23:31 <TrueBrain> somewhere is a bug, but I will trace that a bit later
16:28:45 <TrueBrain> and .. add .. tomato .. tomato
16:31:45 <DorpsGek> SVN: truebrain (r805) -Add: C-ified GUI_Widget_ScrollBar_Draw()
16:32:33 <TrueBrain> needs 2 more function conversions before the wcsip can be removed
16:32:47 <TrueBrain> not today ... I am going to close down, going to move to my parents for 2 weeks, so I need to pack ...
16:32:53 <TrueBrain> be back later, most likely tomorrow :) Bye all!
18:04:46 <Xaroth> ah well, floating to the left it is
18:05:29 <Xaroth> no wait, this can work differently.. i think
18:06:07 <Xaroth> why use a list.. if you can use a table :P
18:19:25 <Xaroth> in pages without pagination the top and bottom bar will be gone
18:19:34 <Xaroth> but the main view will still move up
18:39:11 <Xaroth> I still need to figure out how this while border-collapse thing works
21:09:05 <TrueBrain> I need 2 bounces to connect to my IRC again :p How annoying ...
22:06:12 <TrueBrain> locsi -> isValid or something?
22:09:53 <TrueBrain> and the 10 is SLAB_1x1 I guess?
22:10:48 <TrueBrain> don't forget the doxygen comment
22:11:19 <TrueBrain> going to bed; night
22:39:14 <TrueBrain> damn, wifi which is slighty out of reach ... poor reception ...
22:39:22 <TrueBrain> (yes, I am in bed :p)
22:44:59 <TrueBrain> glx: I like the last for; it check for connecting structures/slabs/walls
22:45:35 <TrueBrain> B4CD:0750 btw gets the type on the tile, I assume
22:48:16 <TrueBrain> the return values are only weird ..
22:48:23 <TrueBrain> 10 for slabs, 11 for walls ..
22:48:51 <TrueBrain> why ..... I mean ..... why?!
22:49:29 <TrueBrain> 12 for structure ..
22:49:53 <TrueBrain> so I guess there is need for MapType ;)
22:50:04 <TrueBrain> oh well .. nightynight for real now :)
22:51:05 <glx> and it compares spriteID with some global variables
23:09:57 <Xaroth> TrueBrain: why not use something like irssi :P
continue to next day ⏵