--- Log opened Wed Apr 05 00:00:09 2017 20170405 00:00:51-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-dev 20170405 00:02:35-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Remote host closed the connection] 20170405 00:03:26-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20170405 00:03:36-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Remote host closed the connection] 20170405 00:03:55-!- irker367 [~irker@uruz.ai0867.net] has quit [Quit: transmission timeout] 20170405 00:04:08-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20170405 00:04:34-!- RatArmy_ [~ratarmy@om126234112233.16.openmobile.ne.jp] has quit [Ping timeout: 264 seconds] 20170405 00:12:26-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 00:21:16-!- TC04 [~quassel@venus.arosser.com] has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.] 20170405 00:21:33-!- TC01 [~quassel@venus.arosser.com] has joined #wesnoth-dev 20170405 00:25:44-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Remote host closed the connection] 20170405 00:26:21-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 00:30:56-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Ping timeout: 256 seconds] 20170405 00:33:52-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-dev 20170405 00:50:20-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20170405 00:59:09-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Remote host closed the connection] 20170405 00:59:41-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20170405 01:05:38-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Quit: Konversation terminated!] 20170405 01:06:02-!- gfgtdf_ [~chatzilla@x4e368229.dyn.telefonica.de] has joined #wesnoth-dev 20170405 01:07:44-!- gfgtdf [~chatzilla@x4e36999c.dyn.telefonica.de] has quit [Ping timeout: 260 seconds] 20170405 01:07:57-!- gfgtdf_ is now known as gfgtdf 20170405 01:30:18-!- irker431 [~irker@uruz.ai0867.net] has joined #wesnoth-dev 20170405 01:30:18< irker431> wesnoth: Celtic Minstrel wesnoth:wfl_memleak_fix_attempt 8d67d4fbe2ef / src/tests/test_formula_core.cpp: Fix tests https://github.com/wesnoth/wesnoth/commit/8d67d4fbe2ef8e2953fda5365e57812e4c31d85c 20170405 01:30:41-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-dev 20170405 01:30:49-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20170405 01:39:45-!- gfgtdf [~chatzilla@x4e368229.dyn.telefonica.de] has quit [Quit: ChatZilla 0.9.93 [Firefox 52.0.2/20170323105023]] 20170405 01:57:29< irker431> wesnoth: Celtic Minstrel wesnoth:wfl_memleak_fix_attempt 174cae5ee8b4 / src/formula/callable_fwd.hpp: Fix missing include on Travis Mac build https://github.com/wesnoth/wesnoth/commit/174cae5ee8b425d9d35cf8fa1014f7f60bf70d31 20170405 01:59:04< celticminstrel> Okay, next step is to figure out what the heck is wrong with the MSVC 2013 build on that branch... :| 20170405 02:25:24< vultraz_iOS> the solution is to drop 2013 :P 20170405 02:25:49< celticminstrel> I think it's best not to drop 2013 until after a 1.14 release. 20170405 02:26:10< celticminstrel> Or perhaps a better way to put it is... I think it's best not to drop it right before a release. 20170405 02:26:30< celticminstrel> (Where "right before" is taken liberally.) 20170405 02:31:05< vultraz_iOS> how come? 20170405 02:39:04< vultraz_iOS> (well, it might be better to have it going into 1.14) 20170405 02:48:52< celticminstrel> I wonder if anyone would actually notice if I somehow made fallback() last only until end of turn... 20170405 02:54:56-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20170405 02:55:06-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-dev 20170405 03:02:11-!- SigurdFD [~SigurdFD@dynamic-acs-72-23-110-196.zoominternet.net] has joined #wesnoth-dev 20170405 03:14:14-!- celticminstrel is now known as celmin|sleep 20170405 03:27:38-!- Shiki_ [~Shiki@p54854D31.dip0.t-ipconnect.de] has joined #wesnoth-dev 20170405 03:27:56-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-dev 20170405 03:31:34-!- Shiki [~Shiki@p548555DC.dip0.t-ipconnect.de] has quit [Ping timeout: 264 seconds] 20170405 03:35:48-!- noy [~Noy@wesnoth/developer/noy] has quit [Read error: Connection reset by peer] 20170405 03:36:16-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-dev 20170405 03:40:17< vultraz_iOS> *sigh* 20170405 03:40:25< vultraz_iOS> I can't seem to make the new panels draw :| 20170405 03:45:52< vultraz_iOS> ok, let's focus on getting the images drawn in the right place.. 20170405 03:47:19-!- boucman [~rosen@wesnoth/developer/boucman] has joined #wesnoth-dev 20170405 03:56:37 * vultraz_iOS pings celmin|sleep 20170405 03:57:29< vultraz_iOS> celmin|sleep: from what I can see, formula::evaluate in the unit filter code gets passed a map_formula_callable 20170405 03:57:50< vultraz_iOS> celmin|sleep: but you said that it should be passed an action_function_symbol_table 20170405 03:58:24< vultraz_iOS> celmin|sleep: but if it's not passed both the canvas map_formula_callable and the local shape scope map_formula_callable... how do I evaluate variables? :/ 20170405 04:01:10< vultraz_iOS> celmin|sleep: ok it looks like the local scope map_formula_callable copies the global scope... but I still need to pass both the local map_formula_callable or else I have no access to variables and the action_function_symbol_table or else I have no access to, say, set_var :| 20170405 04:01:12< vultraz_iOS> celmin|sleep: what do 20170405 04:07:25< celmin|sleep> evaluate takes a function table as an optional second argument. 20170405 04:08:41< vultraz_iOS> uh... you mean formula? 20170405 04:08:48< vultraz_iOS> formula(const std::string& str, function_symbol_table* symbols = nullptr); 20170405 04:09:20< celmin|sleep> Oh, maybe? 20170405 04:09:38< vultraz_iOS> in which case I guess I would create a formula like.. wfl::formula foo(cfg["action"].str(), the_symbol_table); then foo.evaluate(variables)? 20170405 04:10:00< celmin|sleep> Something like that. 20170405 04:10:04< vultraz_iOS> ahh 20170405 04:10:05< vultraz_iOS> ok 20170405 04:10:05< vultraz_iOS> thanks 20170405 04:10:11< celmin|sleep> G'night. 20170405 04:22:44-!- Kwandulin [~Kwandulin@p200300760F3E7D2E90812C76693DF7BE.dip0.t-ipconnect.de] has joined #wesnoth-dev 20170405 04:31:40-!- SigurdFD [~SigurdFD@dynamic-acs-72-23-110-196.zoominternet.net] has quit [] 20170405 04:43:15-!- Kwandulin [~Kwandulin@p200300760F3E7D2E90812C76693DF7BE.dip0.t-ipconnect.de] has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org] 20170405 04:50:57-!- noy_ [~Noy@wesnoth/developer/noy] has joined #wesnoth-dev 20170405 04:50:58-!- noy [~Noy@wesnoth/developer/noy] has quit [Read error: Connection reset by peer] 20170405 04:51:00-!- noy_ is now known as noy 20170405 04:54:29-!- JyrkiVesterinen [~JyrkiVest@87-100-226-53.bb.dnainternet.fi] has joined #wesnoth-dev 20170405 04:56:25-!- Elsi [~Elsi@luwin.ulrar.net] has joined #wesnoth-dev 20170405 04:59:22-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-dev 20170405 05:14:44-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 05:19:16-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Ping timeout: 260 seconds] 20170405 05:43:46-!- boucman [~rosen@wesnoth/developer/boucman] has quit [Remote host closed the connection] 20170405 05:53:19-!- JyrkiVesterinen [~JyrkiVest@87-100-226-53.bb.dnainternet.fi] has quit [Quit: .] 20170405 06:11:16-!- atarocch [~atarocch@93.56.160.28] has joined #wesnoth-dev 20170405 06:17:27-!- atarocch [~atarocch@93.56.160.28] has quit [Ping timeout: 240 seconds] 20170405 06:25:08-!- JyrkiVesterinen [~JyrkiVest@85-76-66-240-nat.elisa-mobile.fi] has joined #wesnoth-dev 20170405 07:03:02-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 07:07:32-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Ping timeout: 260 seconds] 20170405 07:51:01-!- atarocch [atarocch@nat/redhat/x-tkvdytzmhqcuovzz] has joined #wesnoth-dev 20170405 08:17:44-!- Kwandulin [~Kwandulin@p200300760F3E7D2E90812C76693DF7BE.dip0.t-ipconnect.de] has joined #wesnoth-dev 20170405 08:19:45-!- Shiki_ [~Shiki@p54854D31.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 20170405 08:51:23-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 08:55:48-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Ping timeout: 260 seconds] 20170405 08:58:49-!- vincent_c [~bip@vcheng.org] has quit [Quit: Coyote finally caught me] 20170405 08:59:26-!- vincent_c [~bip@vcheng.org] has joined #wesnoth-dev 20170405 09:03:43-!- JyrkiVesterinen [~JyrkiVest@85-76-66-240-nat.elisa-mobile.fi] has quit [Quit: .] 20170405 09:27:27-!- Kwandulin [~Kwandulin@p200300760F3E7D2E90812C76693DF7BE.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20170405 09:29:27-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 240 seconds] 20170405 09:34:16-!- JyrkiVesterinen [~JyrkiVest@85-76-66-240-nat.elisa-mobile.fi] has joined #wesnoth-dev 20170405 09:53:08-!- Kwandulin [~Kwandulin@p200300760F3E7D2E90812C76693DF7BE.dip0.t-ipconnect.de] has joined #wesnoth-dev 20170405 10:08:50-!- irker431 [~irker@uruz.ai0867.net] has quit [Quit: transmission timeout] 20170405 10:14:56-!- ToBeFree [uid51591@wikimedia/ToBeFree] has joined #wesnoth-dev 20170405 10:36:32-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20170405 10:39:41-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 10:44:05-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Ping timeout: 258 seconds] 20170405 11:10:25-!- Ravana_ [~Ravana@unaffiliated/ravana/x-2327071] has quit [Ping timeout: 246 seconds] 20170405 11:21:11-!- Duthlet [~Duthlet@dslb-188-105-120-151.188.105.pools.vodafone-ip.de] has joined #wesnoth-dev 20170405 11:34:59-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20170405 11:35:09-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-dev 20170405 11:55:44-!- Kwandulin [~Kwandulin@p200300760F3E7D2E90812C76693DF7BE.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20170405 12:26:55-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 12:30:02-!- bumbadadabum [~bumbadada@wesnoth/developer/bumbadadabum] has quit [Ping timeout: 256 seconds] 20170405 12:31:24-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Ping timeout: 260 seconds] 20170405 12:52:30< matthiaskrgr> hmm 20170405 12:52:43< matthiaskrgr> is -Wunused not part of the wesnoth default cxxflags? 20170405 12:56:32< JyrkiVesterinen> From what I can tell, it is. 20170405 12:56:33< JyrkiVesterinen> https://github.com/wesnoth/wesnoth/blob/master/SConstruct#L324 20170405 12:56:40-!- bumbadadabum [~bumbadada@wesnoth/developer/bumbadadabum] has joined #wesnoth-dev 20170405 12:56:50< JyrkiVesterinen> "(note that -Wall implies -Wunused)" 20170405 12:56:52< JyrkiVesterinen> https://linux.die.net/man/1/gcc 20170405 12:57:13< matthiaskrgr> yes 20170405 12:57:15< matthiaskrgr> mmh 20170405 12:57:25< matthiaskrgr> maybe not for clang? but that would be strange 20170405 12:57:46-!- vultraz_iOS [uid24821@wesnoth/developer/vultraz] has quit [Quit: Connection closed for inactivity] 20170405 12:58:09< JyrkiVesterinen> The SCons script at least only passes -Wall to GCC. 20170405 12:58:37< JyrkiVesterinen> Apparently the intent is to not pass it to GCC-incompatible compilers such as cl.exe. 20170405 12:58:41< matthiaskrgr> yeah, same for cmake 20170405 12:59:41< matthiaskrgr> I'll enable -DENABLE_STRICT_COMPILATION=ON locally, let's see what happens 20170405 13:00:56< matthiaskrgr> -Werror within the first 100 files 20170405 13:00:58< matthiaskrgr> lol 20170405 13:02:05-!- bumbadadabum [~bumbadada@wesnoth/developer/bumbadadabum] has quit [Ping timeout: 258 seconds] 20170405 13:06:18-!- atarocch [atarocch@nat/redhat/x-tkvdytzmhqcuovzz] has quit [Ping timeout: 256 seconds] 20170405 13:21:36-!- Duthlet [~Duthlet@dslb-188-105-120-151.188.105.pools.vodafone-ip.de] has quit [Ping timeout: 256 seconds] 20170405 13:22:02-!- atarocch [atarocch@nat/redhat/x-tkoioxxtetbjcvhy] has joined #wesnoth-dev 20170405 13:28:32-!- Duthlet [~Duthlet@dslb-188-106-144-235.188.106.pools.vodafone-ip.de] has joined #wesnoth-dev 20170405 13:55:06-!- vultraz_iOS [uid24821@wesnoth/developer/vultraz] has joined #wesnoth-dev 20170405 13:56:10-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-dev 20170405 14:30:17-!- JyrkiVesterinen [~JyrkiVest@85-76-66-240-nat.elisa-mobile.fi] has quit [Quit: .] 20170405 14:35:50-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Ping timeout: 256 seconds] 20170405 14:36:04-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20170405 14:42:30-!- noy [~Noy@wesnoth/developer/noy] has quit [Ping timeout: 260 seconds] 20170405 14:47:25-!- atarocch [atarocch@nat/redhat/x-tkoioxxtetbjcvhy] has quit [Ping timeout: 246 seconds] 20170405 15:15:04-!- bumbadadabum [~bumbadada@wesnoth/developer/bumbadadabum] has joined #wesnoth-dev 20170405 15:29:50 * vultraz_iOS idly wonders if everyone would hate him if all their storyscreen markers were suddenly in the wrong place 20170405 15:30:05-!- celmin|sleep is now known as celticminstrel 20170405 15:30:10< celticminstrel> Yup, I imagine so. 20170405 15:30:18< celticminstrel> Don't do it. 20170405 15:30:30< celticminstrel> Put them in the right place! 20170405 15:31:58< zookeeper> i wouldn't mind as long as you then fix it before the next release. 20170405 15:32:06< celticminstrel> Heh. 20170405 15:32:14< vultraz_iOS> well they're already in the wrong place now 20170405 15:32:22< celticminstrel> So fix it. 20170405 15:32:24< zookeeper> of course you didn't mean permanently changing the coordinate system, because that would have been an obnoxious suggestion :J 20170405 15:32:30< vultraz_iOS> i'm just reading the wiki doc on [image] x,y https://wiki.wesnoth.org/IntroWML 20170405 15:32:36< vultraz_iOS> it seems ridiculously complicated 20170405 15:32:44< vultraz_iOS> but i don't know how I could make it easier for people 20170405 15:32:48< celticminstrel> It's not as comlicated as it makes out, honestly. 20170405 15:32:59< celticminstrel> In fact, IMO, that's the simplest way to do it. 20170405 15:33:19< vultraz_iOS> oh? 20170405 15:33:23< vultraz_iOS> well then I'll leave it 20170405 15:33:28< celticminstrel> The wiki has all that stuff about "compensating for it", but in the vast majority of cases, you don't need to compensate for it. 20170405 15:33:29< vultraz_iOS> if you say it's simple 20170405 15:33:50< celticminstrel> I suspect the compensation stuff is something of a relic from a time before images were placed by their centre. 20170405 15:34:24< vultraz_iOS> centers are indeed very nice 20170405 15:34:32< celticminstrel> It's simple because you simply need to specify the coordinate on the background image at which you want your image to be centred, and the game places it at that exact location even if the background image has been scaled. 20170405 15:35:11< zookeeper> it's explained in a really complicated manner in the wiki, dunno why. i mean basically it's just supposed to plot the marker onto the background image, no? 20170405 15:35:28< vultraz_iOS> yes 20170405 15:35:29< zookeeper> (and background can mean whichever [background_layer] of course) 20170405 15:35:54< vultraz_iOS> currently pondering how to translate this code over to the gui2 system... 20170405 15:36:20< celticminstrel> You do need to care about the compensation stuff if you want to position it at an absolute screen location, admittedly. 20170405 15:36:22< vultraz_iOS> I need the scale *factor*, not the scaled *size*... 20170405 15:36:28< celticminstrel> But I imagine that's rare. 20170405 15:36:43< vultraz_iOS> because the coords are multiplied by the factor... 20170405 15:36:51< zookeeper> celticminstrel, well, i can't imagine why anyone would want to use absolute screen location 20170405 15:36:54< celticminstrel> The scale factor would be actual size divided by scaled size, no? 20170405 15:37:03< celticminstrel> zookeeper: Yeah, me neither. 20170405 15:37:35< celticminstrel> Or maybe scaled size divided by actual size. 20170405 15:37:39< vultraz_iOS> ah, yes.. 20170405 15:37:42< vultraz_iOS> that's what I have 20170405 15:37:44< celticminstrel> Yeah, the second one. 20170405 15:37:50-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-dev 20170405 15:37:52< vultraz_iOS> but i could use image_width 20170405 15:37:55< celticminstrel> Because if it scaled up the scale factor should be >1. 20170405 15:38:15< celticminstrel> And then divide the x and y coordinates by the scale factor, I think? 20170405 15:38:27< vultraz_iOS> it's multiplied 20170405 15:38:33< celticminstrel> Why? 20170405 15:38:40< celticminstrel> Maybe that is right though. 20170405 15:38:47< celticminstrel> Yeah, yeah, that's right. 20170405 15:39:03< celticminstrel> I guess that overcomplicated description is helpful for reimplementing it. :P 20170405 15:39:18< vultraz_iOS> btw 20170405 15:39:27< vultraz_iOS> what is the variant I'm supposed to call execute_variant on? 20170405 15:39:29< zookeeper> "the coordinates for where to place the image, using the [background_layer] with base_layer=yes (or background= if no [background_layer]s exist) as the canvas, taking into account any scaling said image might be subject to." <- wouldn't that be all the functionality that's needed? 20170405 15:39:52-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 15:39:54< celticminstrel> vultraz_iOS: The variant whose variables will be changed. 20170405 15:40:13< vultraz_iOS> the variant whose variables will be changed... 20170405 15:40:35< celticminstrel> So the canvas map_formula_callable, I think? 20170405 15:41:03< vultraz_iOS> right now i have this 20170405 15:41:05< vultraz_iOS> wfl::variant res = actions_formula_.evaluate(local_variables); 20170405 15:41:05< vultraz_iOS> res.execute_variant(res); 20170405 15:41:30< celticminstrel> Heh, that won't work. :P 20170405 15:41:44< vultraz_iOS> I need the local values, and map_formula_callable's ctor takes a fallback pointer.. 20170405 15:41:56< vultraz_iOS> so I'm assuming i have access to both scopes here 20170405 15:42:05< celticminstrel> Check? 20170405 15:43:02< vultraz_iOS> ah, yes, the code queries the fallback if the value is not found 20170405 15:43:40< celticminstrel> I meant more "check that local_variables is constructed with the global formula variables callable as the fallback"... 20170405 15:43:43< vultraz_iOS> but will set_var *set* something in the fallback.. 20170405 15:43:55< vultraz_iOS> it is 20170405 15:43:58< celticminstrel> No, pretty sure it doesn't. 20170405 15:44:01< vultraz_iOS> wfl::map_formula_callable local_variables(variables); 20170405 15:44:13< celticminstrel> set_var calls formula_callable::mutate_value which calls set_value. 20170405 15:44:23< celticminstrel> Is there a map_formula_callable::get_fallback? 20170405 15:44:43< vultraz_iOS> no 20170405 15:45:11< vultraz_iOS> do I need to make a copy of the global scope with the local scope as a fallback? :/ 20170405 15:45:25< celticminstrel> Uh. Why would you do that? 20170405 15:45:45< vultraz_iOS> because I need to set variables in the global scope 20170405 15:45:49< celticminstrel> Can you access variables from your function? 20170405 15:46:16< celticminstrel> Because if so, variant(variables.fake_ptr()).execute_variant(res) 20170405 15:46:32< vultraz_iOS> this is master 20170405 15:46:35< vultraz_iOS> no fake_ptr 20170405 15:46:46< celticminstrel> Oh right, then &variables. 20170405 15:46:54< vultraz_iOS> ah, I see 20170405 15:47:15< vultraz_iOS> (ya know at some point i start to wonder why I don't just use the c++ interface for this. oh well) 20170405 15:47:25< celticminstrel> The wfl_memleak_fix_attempt branch did pass on Travis, so we need to figure out the MSVC problems now. 20170405 15:47:31< celticminstrel> C++ interface for what? 20170405 15:47:57< vultraz_iOS> the scale factor and base rect thing 20170405 15:48:28< celticminstrel> Well, I dunno what you're talking about. 20170405 15:49:14< vultraz_iOS> did we decide on some delim for string literals? 20170405 15:51:15< celticminstrel> What? 20170405 15:52:17< vultraz_iOS> need a multiline string here for this WFL 20170405 15:52:34< celticminstrel> Why? 20170405 15:52:37-!- JyrkiVesterinen [~JyrkiVest@89-166-121-39.bb.dnainternet.fi] has joined #wesnoth-dev 20170405 15:52:45< celticminstrel> WFL string literals are 'abc' in any case. 20170405 15:52:53< celticminstrel> Hello Jyrki 20170405 15:52:55< vultraz_iOS> because it's in c++ 20170405 15:53:02< JyrkiVesterinen> Hi celticminstrel 20170405 15:53:18< vultraz_iOS> build, this does not https://pastebin.com/BYzBL1XK 20170405 15:53:20< celticminstrel> vultraz_iOS: I'm not quite sure what you're asking, then. 20170405 15:53:38< celticminstrel> Ah. 20170405 15:53:46< celticminstrel> So you have a couple of choices. 20170405 15:54:02< celticminstrel> 1. Escape the newlines. 2. Split into one string per line. 3. Use raw-string notation. 20170405 15:54:24< celticminstrel> If you write "abc" "123" in C++, it joins them into a single string literal. (#2_ 20170405 15:54:39< celticminstrel> You can escape the newlines by simply ending the line with a backslash. (#1) 20170405 15:55:08< celticminstrel> Raw string notation is R"stuff(your string)stuff" where the two stuff have to be the same (possibly empty). 20170405 15:55:51< vultraz_iOS> ah 20170405 15:56:00< vultraz_iOS> indeed, simply pretending an R works. 20170405 15:56:05< vultraz_iOS> prepending 20170405 15:56:25< celticminstrel> Note that prepending an R means the enclosing parentheses aren't included as part of the string. 20170405 15:56:32< celticminstrel> This probably doesn't matter here though. 20170405 15:56:42< celticminstrel> Because you didn't use typed_formula. 20170405 15:56:54< vultraz_iOS> looks like R""" is our standard 20170405 15:57:03< celticminstrel> Oh right, you're going to need [] enclosing them though. 20170405 15:57:12< vultraz_iOS> eh? 20170405 15:57:17< celticminstrel> No, raw strings are not R"". They are R"()". 20170405 15:57:37< celticminstrel> You have two set_var actions. A WFL formula can only return one value, so you need to wrap them up in a list. 20170405 15:57:47< vultraz_iOS> no I mean it looks like our delim is "" 20170405 15:57:53< celticminstrel> Also, if I recall correctly, the variable name means to be quoted. 20170405 15:58:22< celticminstrel> Oh yeah, I've used a pair of double quotes as the raw-string delimiter before as a callback to Python triple-quoted strings. 20170405 15:58:45< celticminstrel> But the parentheses are also part of the delimiter. 20170405 15:58:57< vultraz_iOS> right 20170405 15:59:10< vultraz_iOS> what if I want parentheses as part of the string? 20170405 15:59:18< vultraz_iOS> just add another pair? 20170405 15:59:22< celticminstrel> Yeah. 20170405 15:59:38< celticminstrel> But here you want square brackets rather than parentheses as part of the string. 20170405 16:00:30< vultraz_iOS> like so? https://pastebin.com/6ebKUSHL 20170405 16:00:35-!- Ravana_ [~Ravana@unaffiliated/ravana/x-2327071] has joined #wesnoth-dev 20170405 16:01:02< celticminstrel> Yup, just like that, but you actually don't need the extra pair of parentheses here. 20170405 16:01:13< celticminstrel> It doesn't hurt to have them, but it's not needed. 20170405 16:01:24< vultraz_iOS> right 20170405 16:01:31< celticminstrel> Why is image_width enclosed in double quotes? 20170405 16:01:46< vultraz_iOS> you said it needed quotes 20170405 16:01:51< celticminstrel> No I didn't? 20170405 16:01:55< vultraz_iOS> ... 20170405 16:01:57< vultraz_iOS> ugh 20170405 16:01:59< vultraz_iOS> i quoted 20170405 16:02:01< vultraz_iOS> the wrong thing 20170405 16:02:13< celticminstrel> The variable name as in base_scale_x. 20170405 16:02:17< vultraz_iOS> yes 20170405 16:02:19< celticminstrel> And WFL doesn't use double quotes. 20170405 16:02:19< vultraz_iOS> i know 20170405 16:02:24< vultraz_iOS> oh? 20170405 16:02:28< celticminstrel> Single quotes. 20170405 16:02:40< vultraz_iOS> alright 20170405 16:02:47< celticminstrel> WFL doesn't use double quotes because it's typically used in a double-quoted string. 20170405 16:02:58< vultraz_iOS> makes sense 20170405 16:03:08< celticminstrel> Similar to why it doesn't use curly braces. 20170405 16:03:24< celticminstrel> (I don't know for certain if that's the reason, but it seems likely that it is.) 20170405 16:04:32< vultraz_iOS> ok, now what do I need.. 20170405 16:04:54-!- Shiki [~Shiki@pD954C3D9.dip0.t-ipconnect.de] has joined #wesnoth-dev 20170405 16:05:16< vultraz_iOS> there's a c++ interface for transforming the rects, but I can probably do it procedurally... 20170405 16:05:36< vultraz_iOS> s/rects/coords 20170405 16:06:42< vultraz_iOS> since I'm just testing without the base rect yet, this should be simple 20170405 16:07:31< vultraz_iOS> oh, but I have the base x value in c++ :| 20170405 16:07:34< vultraz_iOS> fuck 20170405 16:08:21< celticminstrel> ??? 20170405 16:10:37< celticminstrel> Tutorial says "there are two villages within your reach", but it's not actually true. 20170405 16:11:59< vultraz_iOS> I shall need to ponder this further :/ 20170405 16:12:51< vultraz_iOS> assuming the variable is set correctly in the canvas by the WFL, I was assuming I could just pass, for x, "(x * base_scale_x)" 20170405 16:13:15< vultraz_iOS> but how to set x :/ 20170405 16:13:41< vultraz_iOS> x is the data from evaluating x= 20170405 16:14:49< vultraz_iOS> so unless I use canvas.set_variables from c++ and assign a unique variables to what the base 'x' needs to be (ie floating_image.ref_x())... 20170405 16:14:52< vultraz_iOS> blah 20170405 16:14:55< vultraz_iOS> need to consider further 20170405 16:16:45< celticminstrel> Um, x="(x * base_scale_x)" sounds recursive. 20170405 16:16:46-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Remote host closed the connection] 20170405 16:17:13-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 16:17:13-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Remote host closed the connection] 20170405 16:17:30< celticminstrel> Does local_variables contain x and y by default, though? 20170405 16:18:03< celticminstrel> It seems to me that it shouldn't. 20170405 16:18:18< celticminstrel> Which would make it safe for you to set it, though using a different name might make more sense. 20170405 16:18:23-!- clavi [~clavi@v22017034422546657.goodsrv.de] has quit [Quit: ZNC - http://znc.in] 20170405 16:18:24-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 16:18:31< celticminstrel> Like "relative_x" or something. 20170405 16:21:14-!- bumbadadabum [~bumbadada@wesnoth/developer/bumbadadabum] has quit [Read error: Connection reset by peer] 20170405 16:21:43-!- bumbadadabum [~bumbadada@wesnoth/developer/bumbadadabum] has joined #wesnoth-dev 20170405 16:21:48-!- clavi [~clavi@v22017034422546657.goodsrv.de] has joined #wesnoth-dev 20170405 16:22:25< vultraz_iOS> Right 20170405 16:22:49< vultraz_iOS> I'm just pondering if using both the WFL and c++ interfaces to set variables is very neat 20170405 16:25:08< celticminstrel> I just noticed that "delete_ai_component" is called "add_ai_component" on the wiki... >_> 20170405 16:25:51< celticminstrel> Which makes it look like "add_ai_component" is documented twice. 20170405 16:26:07< vultraz_iOS> Do you have objections to using both interfaces? 20170405 16:26:15< celticminstrel> Not really? 20170405 16:36:25-!- Kwandulin [~Kwandulin@p200300760F3E7D2E90812C76693DF7BE.dip0.t-ipconnect.de] has joined #wesnoth-dev 20170405 16:40:51< vultraz_iOS> Ponder ponder ponder 20170405 16:42:05< celticminstrel> wesnoth.scroll seems to be undocumented, so I assume no-one will have any objections to be arbitrarily changing its API. 20170405 16:44:51< celticminstrel> ^to me 20170405 16:53:47-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has quit [Remote host closed the connection] 20170405 16:53:53-!- janebot [~Gambot@unaffiliated/gambit/bot/gambot] has joined #wesnoth-dev 20170405 17:00:47< JyrkiVesterinen> I noticed that the add-on manager often selects a wrong add-on after I install or remove something. 20170405 17:00:48< JyrkiVesterinen> https://github.com/wesnoth/wesnoth/blob/36dbd7cf02883857125e80ef1283320b28a2bef3/src/gui/dialogs/addon/manager.cpp#L492-L499 20170405 17:01:21< JyrkiVesterinen> The problem is that reloading the add-on list invalidates the id variable. After the reload the reference can point to who knows what. 20170405 17:01:33< JyrkiVesterinen> I'll change the function to receive the id by value instead. 20170405 17:01:41< celticminstrel> I don't suppose you have time to help me figure out how to get wfl_memleak_fix_attempt to build in MSVC 2013? 20170405 17:01:57< celticminstrel> It builds on Travis now finally. 20170405 17:02:21< celticminstrel> I haven't actually tested the latest fixes on MSVC 2013, but they were mostly in the tests so shouldn't affect it. 20170405 17:02:34< JyrkiVesterinen> I'm not willing to spend more time developing Wesnoth today, unfortunately. 20170405 17:02:47< celticminstrel> Okay. 20170405 17:11:51-!- irker973 [~irker@uruz.ai0867.net] has joined #wesnoth-dev 20170405 17:11:51< irker973> wesnoth: Jyrki Vesterinen wesnoth:master 9a09e2b783c6 / src/gui/dialogs/addon/ (manager.cpp manager.hpp): Fix wrong add-on often being selected after install/uninstall https://github.com/wesnoth/wesnoth/commit/9a09e2b783c6a32114dfbf43c2c30aeb8688d776 20170405 17:25:17-!- Greg-Bog_ [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 17:26:35-!- Appleman1234 [~Appleman1@pl21277.ag1212.nttpc.ne.jp] has quit [Ping timeout: 258 seconds] 20170405 17:28:40-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Ping timeout: 256 seconds] 20170405 17:34:45-!- Greg-Bog_ [~greg_bogg@173.240.241.83] has quit [Remote host closed the connection] 20170405 17:35:11-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 17:41:21-!- ToBeFree [uid51591@wikimedia/ToBeFree] has quit [Quit: Connection closed for inactivity] 20170405 17:44:05-!- Duthlet [~Duthlet@dslb-188-106-144-235.188.106.pools.vodafone-ip.de] has quit [Ping timeout: 240 seconds] 20170405 17:51:41-!- JyrkiVesterinen [~JyrkiVest@89-166-121-39.bb.dnainternet.fi] has quit [Ping timeout: 268 seconds] 20170405 17:55:30-!- JyrkiVesterinen [~JyrkiVest@89-166-121-39.bb.dnainternet.fi] has joined #wesnoth-dev 20170405 18:15:43< irker973> wesnoth: Celtic Minstrel wesnoth:wml_tag_porting 4c89e9394fe6 / / (3 files in 2 dirs): Properly port [kill] to Lua https://github.com/wesnoth/wesnoth/commit/4c89e9394fe63a592f496c9ac5e135aa95398d0f 20170405 18:15:45< irker973> wesnoth: Celtic Minstrel wesnoth:wml_tag_porting 9b4514db8b14 / data/lua/wml-tags.lua src/scripting/game_lua_kernel.cpp src/scripting/lua_team.cpp: Properly port [scroll] to Lua https://github.com/wesnoth/wesnoth/commit/9b4514db8b149c373e120324b0dc093ffec78384 20170405 18:16:00< irker973> wesnoth: Celtic Minstrel wesnoth:wml_tag_porting ab006161f065 / data/lua/wml-tags.lua src/scripting/game_lua_kernel.cpp src/scripting/lua_team.cpp: Properly port [scroll] to Lua https://github.com/wesnoth/wesnoth/commit/ab006161f065a6d7d25b02bba13e293a1c943915 20170405 18:18:34-!- atarocch [~atarocch@93.56.160.28] has joined #wesnoth-dev 20170405 18:27:56< vultraz_iOS> welp, images getting drawn at 0,0.. :/ 20170405 18:30:36< celticminstrel> Formula error or something? 20170405 18:30:39< celticminstrel> I dunno. 20170405 18:31:32< vultraz_iOS> no, base_scale_x/y are 0 20170405 18:33:05< celticminstrel> Ah, that would do it. :P 20170405 18:33:10< celticminstrel> So why are they zero? 20170405 18:33:13< vultraz_iOS> celticminstrel: does this look correct? https://github.com/Vultraz/wesnoth/commit/c39a99fe23d6a07f336bd70165757018072081ba 20170405 18:33:30< celticminstrel> Wow commit message. 20170405 18:34:15< celticminstrel> IIRC, windows each have their own function table, so the same for canvas would make sense to me. 20170405 18:36:02< celticminstrel> Probably no need to bother checking if the actions formula is empty. The code in lines 1091/2 is a no-op anyway in that case. 20170405 18:36:14< celticminstrel> The formula will evaluate to null, and executing null does nothing. 20170405 18:36:43< celticminstrel> That does look correct to me, in any case. 20170405 18:36:43-!- Appleman1234 [~Appleman1@pl2771.ag1212.nttpc.ne.jp] has joined #wesnoth-dev 20170405 18:37:17< celticminstrel> (Well, making the function table file-static is probably not what you want, but it wouldn't prevent things from working.) 20170405 18:39:56< vultraz_iOS> but why does it not :/ 20170405 18:41:01< celticminstrel> I would assume it's something to do with code you didn't show. 20170405 18:41:56< celticminstrel> I mean, I suppose I could be wrong. 20170405 18:42:09< celticminstrel> (BTW, if you're adding a key, you need to update the schema, don't you?) 20170405 18:42:14< vultraz_iOS> https://github.com/Vultraz/wesnoth/commit/97d8dcf244f37a3f982e2d6a4b0bbca05baecd6f 20170405 18:42:25-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Quit: Konversation terminated!] 20170405 18:42:26< celticminstrel> Wow commit message. XD 20170405 18:44:00< celticminstrel> Shouldn't append_cfg set is_dirty for you? 20170405 18:44:20< vultraz_iOS> I should probably make it do that 20170405 18:44:42< celticminstrel> Hmm, still don't see anything wrong though... 20170405 18:46:04< celticminstrel> I think I'd suggest you try using some debug_print calls in your formulas, just temporarily. Might need to also enable the scripting/formula log domain at the debug level. 20170405 18:46:45< celticminstrel> debug_print basically returns its argument after printing it to the log. 20170405 18:47:09< celticminstrel> So you can wrap anything in it, and the log will tell you the value. 20170405 18:47:25< celticminstrel> IIRC you can also pass a string as a first argument so that you can distinguish exactly what is being printed. 20170405 18:47:55< vultraz_iOS> looks like there's an actual debug_print function 20170405 18:48:48< celticminstrel> Yes. That's what I was talking about. 20170405 18:49:29< vultraz_iOS> debug_print('base x', set_var('base_scale_x', image_width / image_original_width)) 20170405 18:49:31< vultraz_iOS> like this? 20170405 18:50:41< celticminstrel> Pretty much. You could also wrap the calculation - debug_print('should be', image_width / image_original_width) - or elements of the x/y formulas where the resulting value is then used. 20170405 18:51:38< vultraz_iOS> debug print doesn't print to log, it prints to chat :/ 20170405 18:51:51< celticminstrel> Maybe it does both. 20170405 18:52:03< vultraz_iOS> oh, wait, I see a LOG_SF 20170405 18:52:06< celticminstrel> At least when debug mode is enabled. 20170405 18:52:10 * vultraz_iOS changes to cerr locally 20170405 18:52:23< celticminstrel> Also callable_objects.cpp:697 20170405 18:52:39< vultraz_iOS> oh 20170405 18:52:47< vultraz_iOS> once you get in game the message is helpfully in chat! 20170405 18:52:48< vultraz_iOS> nice 20170405 18:53:05< vultraz_iOS> all it i tells me is its 0 20170405 18:53:08< celticminstrel> IMO it's probably more useful in the log though. :P 20170405 18:53:22< celticminstrel> Okay, what debug formula did you use and what's the output? 20170405 18:53:52< celticminstrel> I thought you wrapped the whole set_var? 20170405 18:54:32< vultraz_iOS> yes 20170405 18:54:43< celticminstrel> So it should output something with curly braces. 20170405 18:54:47< vultraz_iOS> just says the key and that it's value is 0 20170405 18:54:54< vultraz_iOS> yes 20170405 18:55:09< celticminstrel> Okay, so that means the calculation yielded 0... 20170405 18:55:57< celticminstrel> Which implies that image_width is 0... 20170405 18:56:14< celticminstrel> (If image_original_width were 0, you'd get null instead.) 20170405 18:58:32< vultraz_iOS> they're not 0 :/ 20170405 18:58:37< celticminstrel> Yeah, I see that. 20170405 18:59:20< vultraz_iOS> image_height comes out 801, original_image_height 960 20170405 18:59:37< vultraz_iOS> corresponding for width, 1068 and 1280 20170405 18:59:53< celticminstrel> You mean if you wrap them in debug_print? 20170405 19:00:34< vultraz_iOS> yes 20170405 19:01:00< celticminstrel> Hm. This suggests there could be something wrong in set_var_callable or set_var_function... 20170405 19:01:28-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20170405 19:02:53-!- JyrkiVesterinen [~JyrkiVest@89-166-121-39.bb.dnainternet.fi] has quit [Quit: .] 20170405 19:04:26< vultraz_iOS> so my code is correct, then 20170405 19:07:12< vultraz_iOS> hmmmmmmmmmmmmm 20170405 19:08:33< vultraz_iOS> hmmm 20170405 19:08:40< vultraz_iOS> actually, how does the old code do it.. 20170405 19:09:07< vultraz_iOS> ri.rect.x = static_cast(x_*xscale) + dst_rect.x; 20170405 19:09:07< vultraz_iOS> ri.rect.y = static_cast(y_*yscale) + dst_rect.y; 20170405 19:09:45< vultraz_iOS> ok, so in my testing the dst rect would be at 0, or the full screen 20170405 19:09:48< vultraz_iOS> so not a problem... 20170405 19:09:53< vultraz_iOS> but it shouldn't draw at 00 20170405 19:11:42< vultraz_iOS> I'm open to suggestions 20170405 19:12:15< celticminstrel> My build insists on complaining about incompatible iterators when searching the seen stack. :| 20170405 19:12:27< celticminstrel> Even though there's literally no way they could ever be compatible? 20170405 19:12:41< celticminstrel> The seen stack only contains pointers, right? 20170405 19:12:48< celticminstrel> Anyway... 20170405 19:13:33< celticminstrel> What do you get if you wrap the whole value of set_var in debug_print? 20170405 19:13:42< celticminstrel> The w / orig_w formula. 20170405 19:13:57< celticminstrel> ... 20170405 19:14:06< celticminstrel> I figured it out. 20170405 19:14:24< vultraz_iOS> hm? 20170405 19:14:27< celticminstrel> The width and original width are ints, so it's rounded. 20170405 19:14:36-!- atarocch [~atarocch@93.56.160.28] has quit [Ping timeout: 260 seconds] 20170405 19:14:50< celticminstrel> Or rather, truncated. 20170405 19:14:59< vultraz_iOS> so what do I need to do 20170405 19:15:13< vultraz_iOS> (probably why the original code used 1.0 when calculating the factor) 20170405 19:15:17< celticminstrel> There's a formula function to turn an int into a decimal. Use that on image_width. 20170405 19:15:22< celticminstrel> Probably, yeah. 20170405 19:15:33< celticminstrel> (And image_height of course) 20170405 19:16:13< vultraz_iOS> blah, need to create a function_symbol_table then too 20170405 19:16:26< vultraz_iOS> (or do I?) 20170405 19:16:31< celticminstrel> ? 20170405 19:17:30< vultraz_iOS> nevermind 20170405 19:17:41< vultraz_iOS> ok, images no longer at 0,0 20170405 19:17:46< celticminstrel> \o/ 20170405 19:17:50< vultraz_iOS> geniusminstrel 20170405 19:17:54< celticminstrel> But are they where they should be? 20170405 19:18:10< vultraz_iOS> no, because I haven't handled the base rect yet 20170405 19:18:20< vultraz_iOS> I need to do so 20170405 19:18:27< celticminstrel> I suppose that +rect.x should also be retained. 20170405 19:18:35< celticminstrel> Isn't there an option to only scale one dimension or something? 20170405 19:18:56< vultraz_iOS> yes 20170405 19:19:11< vultraz_iOS> the base rect is the evaluated rect of the base layer 20170405 19:19:22< vultraz_iOS> so i need to add a rect object 20170405 19:19:29< vultraz_iOS> to where do I do this? 20170405 19:19:43< celticminstrel> By "add a rect object" do you mean a formula_callable? 20170405 19:19:52< vultraz_iOS> yes 20170405 19:19:53< celticminstrel> If so, formula/callable_objects.?pp 20170405 19:20:07< celticminstrel> You can probably just copy and tweak location_callable. 20170405 19:20:35< celticminstrel> Of course, you don't really need a rect object; you could just use multiple variables. 20170405 19:21:27< vultraz_iOS> actually, i might only need the origin.. 20170405 19:22:03< vultraz_iOS> yes that rather appears so 20170405 19:22:55< vultraz_iOS> can i do set_var('foo', loc(x,y))? 20170405 19:23:23< celticminstrel> Sure? 20170405 19:23:33< vultraz_iOS> ok 20170405 19:23:49< celticminstrel> Note that location_callble wraps a map_location, so it might be a little weird. 20170405 19:23:52< celticminstrel> ^callable 20170405 19:24:04< celticminstrel> But it should still work. 20170405 19:36:07-!- boucman [~rosen@wesnoth/developer/boucman] has joined #wesnoth-dev 20170405 19:53:27-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Remote host closed the connection] 20170405 19:53:59-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20170405 19:54:11< vultraz_iOS> celticminstrel: is there no as_int? 20170405 19:54:29< vultraz_iOS> or perhaps i can use rount? 20170405 19:54:31< vultraz_iOS> round* 20170405 19:56:39< celticminstrel> There's no as_int because there's at least five different ways to get an int from a real number. 20170405 19:56:57< celticminstrel> round, trunc, floor, ceil... wait, maybe I miscounted. 20170405 19:57:22< vultraz_iOS> ok, I have the image *almost* in the right location 20170405 19:57:26< vultraz_iOS> it's offset for some reason :/ 20170405 19:57:51< celticminstrel> Did you half its width from its x, and half its height from its y? 20170405 19:58:42< vultraz_iOS> ah right 20170405 20:00:39< vultraz_iOS> but that's only if centered 20170405 20:00:48 * vultraz_iOS looks for the getter 20170405 20:00:52< celticminstrel> Obviously. 20170405 20:07:23< vultraz_iOS> ok, now let me compare with GUI1 20170405 20:08:27< celticminstrel> ...wow. I missed the word "subtract" there, somehow. 20170405 20:08:29< vultraz_iOS> my impl is a few pixels higher it seems 20170405 20:08:50< celticminstrel> That doesn't seem good. 20170405 20:08:58< celticminstrel> Different rounding? 20170405 20:09:06< vultraz_iOS> probably 20170405 20:09:11< vultraz_iOS> the difference is tiny 20170405 20:09:15< celticminstrel> Like maybe you used round and they used trunc. 20170405 20:09:35< vultraz_iOS> they used static_cast(a * b) 20170405 20:09:43< celticminstrel> That's equivalent to trunc. 20170405 20:10:35< vultraz_iOS> I'll see what trunc does 20170405 20:11:55< vultraz_iOS> doesn't seem to make much difference 20170405 20:12:19< celticminstrel> Maybe there's some other difference in your formulas? 20170405 20:12:22< vultraz_iOS> but really, the different is a very few pixels 20170405 20:12:42< vultraz_iOS> I'll leave it as trunc, though 20170405 20:14:35< vultraz_iOS> the old code uses doubles 20170405 20:14:47< vultraz_iOS> i it's possible we have more precision now 20170405 20:14:51< vultraz_iOS> s/i/so 20170405 20:15:51< vultraz_iOS> (I'm assuming doubles have 2-place precision while we have 3, since the values are multiplied by 1000) 20170405 20:15:58< vultraz_iOS> though how that would matter at all, I don't know 20170405 20:16:31< celticminstrel> ...what? 20170405 20:16:39< celticminstrel> No. 20170405 20:16:53< vultraz_iOS> oh? 20170405 20:16:55< vultraz_iOS> nevermind then 20170405 20:17:09< vultraz_iOS> the important thing is it works! 20170405 20:18:00< celticminstrel> But what you describe could still be the cause. Double has around 15 digits of precision and also can't accurately represent most fractions. 20170405 20:18:27< celticminstrel> So the lower precision of the formula decimal could certainly be the cause. 20170405 20:18:52< vultraz_iOS> ah 20170405 20:18:57< celticminstrel> (Note also that that's 15 significant digits, not 15 decimal places.) 20170405 20:19:09< celticminstrel> (Whereas for formula it's 3 decimal places.) 20170405 20:19:14< vultraz_iOS> ah.. 20170405 20:20:49< celticminstrel> (That's just the difference between fixed-point and floating-point.) 20170405 20:21:41< celticminstrel> I guess a few pixels off might not hurt. 20170405 20:22:46< celticminstrel> At least for the typical use-case I think it would be fine. 20170405 20:22:59< celticminstrel> I don't know if anyone uses it for things other than tracks. 20170405 20:23:15< celticminstrel> Things that require higher precision. 20170405 20:23:37< vultraz_iOS> celticminstrel: I think I'm going to allow passing an action function table to the canvas optionally 20170405 20:23:44< vultraz_iOS> And pass the window action table 20170405 20:23:47< vultraz_iOS> To its canvas 20170405 20:24:00< celticminstrel> That means the window function table needs to become an action table. 20170405 20:24:00< vultraz_iOS> So you can define functions in the wml instead of c++ 20170405 20:24:12< vultraz_iOS> Oh. 20170405 20:24:17< vultraz_iOS> Would that break anything? 20170405 20:24:21< celticminstrel> No. 20170405 20:24:29< vultraz_iOS> Ok 20170405 20:24:43< celticminstrel> Unless of course someone decided to define a function named set_var. 20170405 20:25:55< vultraz_iOS> seems a typo in a formula causes a crash 20170405 20:26:21< vultraz_iOS> accidentally put set_vat earlier and wesnoth crashed on entering the storyscreen 20170405 20:27:26< celticminstrel> It throws an exception, IIRC. 20170405 20:27:47< celticminstrel> So you might want to wrap something in a try block. 20170405 20:28:06-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20170405 20:37:45-!- Shiki [~Shiki@pD954C3D9.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 20170405 20:39:48-!- Kwandulin [~Kwandulin@p200300760F3E7D2E90812C76693DF7BE.dip0.t-ipconnect.de] has quit [Read error: Connection reset by peer] 20170405 20:47:59-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Remote host closed the connection] 20170405 20:48:31-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20170405 21:06:53-!- Greg-Bog_ [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 21:10:16-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-dev 20170405 21:11:00-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Ping timeout: 260 seconds] 20170405 21:16:10-!- irker973 [~irker@uruz.ai0867.net] has quit [Quit: transmission timeout] 20170405 21:29:55< vultraz_iOS> hmmmmm 20170405 21:30:03< vultraz_iOS> can't find where i would pass in the window table... 20170405 21:30:25< vultraz_iOS> perhaps i should use a setter 20170405 21:30:56< celticminstrel> Setter? 20170405 21:31:18< celticminstrel> I'm assuming by table you mean the function table. 20170405 21:31:21< vultraz_iOS> yes 20170405 21:31:31< vultraz_iOS> I don't think I can pass it in the ctor 20170405 21:32:01< celticminstrel> Note that the actions formula would be able to define functions, unlike most of the other formulas. 20170405 21:35:39-!- Greg-Bog_ [~greg_bogg@173.240.241.83] has quit [Remote host closed the connection] 20170405 21:35:56< vultraz_iOS> so, the most obvious place to do this would be the window builder 20170405 21:36:01< vultraz_iOS> but is the canvas initialized then... 20170405 21:37:53< vultraz_iOS> ah, let'd do this later 20170405 21:40:31-!- stikonas [~gentoo@wesnoth/translator/stikonas] has quit [Remote host closed the connection] 20170405 21:41:04-!- stikonas [~gentoo@wesnoth/translator/stikonas] has joined #wesnoth-dev 20170405 21:42:33-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 21:57:51-!- boucman [~rosen@wesnoth/developer/boucman] has quit [Remote host closed the connection] 20170405 22:06:25-!- irker216 [~irker@uruz.ai0867.net] has joined #wesnoth-dev 20170405 22:06:25< irker216> wesnoth: Charles Dang wesnoth:master c8ac77da423a / data/gui/schema.cfg src/gui/core/canvas.cpp src/gui/core/canvas.hpp: GUI2/Canvas: implement WFL action context https://github.com/wesnoth/wesnoth/commit/c8ac77da423abbf04baf8e2d138d56a4a39af66e 20170405 22:06:26< irker216> wesnoth: Charles Dang wesnoth:master 8b14059e8bdd / src/gui/core/canvas.cpp: GUI2/Canvas: added override specifiers https://github.com/wesnoth/wesnoth/commit/8b14059e8bdd322c88990be0fa4c24a9d6fde17b 20170405 22:06:27< irker216> wesnoth: Charles Dang wesnoth:master 733e8db8a2c2 / src/gui/dialogs/ (story_viewer.cpp story_viewer.hpp): Story Viewer: implement correct location calculation for floating images https://github.com/wesnoth/wesnoth/commit/733e8db8a2c2ee8298b8b461d885d5b6c36b7bd5 20170405 22:08:24< vultraz_iOS> need to figure out how best to implement it for all shapes 20170405 22:08:31< celticminstrel> What's with the new clip_x and clip_y? 20170405 22:08:44< vultraz_iOS> x,y coords for the image 20170405 22:09:09< celticminstrel> I see spaces indentation at functions_() 20170405 22:09:29< vultraz_iOS> ;_; 20170405 22:09:47< celticminstrel> Implementing for all shapes would imply shoving it into the base class, surely? 20170405 22:10:20< vultraz_iOS> surely 20170405 22:10:27< vultraz_iOS> but how best do it, I don't know 20170405 22:10:36< vultraz_iOS> not every context has local variables, for one 20170405 22:10:52< celticminstrel> Oh? 20170405 22:11:18< vultraz_iOS> no 20170405 22:11:20< vultraz_iOS> only text and image 20170405 22:11:26-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 256 seconds] 20170405 22:11:34< celticminstrel> BTW, you might want to also add a functions= key to canvas now, similar to the same in window. 20170405 22:12:03< vultraz_iOS> where? 20170405 22:12:07< vultraz_iOS> in [draw]? 20170405 22:12:30< celticminstrel> You didn't need as_decimal on both the numerator and the denominator. One would be sufficient. 20170405 22:12:40< celticminstrel> [draw]? I'm talking about the canvas. 20170405 22:12:51< celticminstrel> I dunno, wherever the canvas is defined. 20170405 22:12:56< vultraz_iOS> [draw] is the key that contains canvas wml 20170405 22:12:56< celticminstrel> Presumably in the widget definition. 20170405 22:13:16< celticminstrel> Well okay. 20170405 22:14:23< celticminstrel> I forgot to mention that I didn't like the name fi_ref_x. Oh well. Not that important anyway. 20170405 22:15:05< celticminstrel> Out of curiosity, if you divide by 2.0 instead of 2, does that have any effect on that few pixels off? 20170405 22:15:14< celticminstrel> Oh wait. 20170405 22:15:18< vultraz_iOS> ? 20170405 22:15:21< vultraz_iOS> why would it 20170405 22:15:27< vultraz_iOS> that 20170405 22:15:33< vultraz_iOS> shouldn't 20170405 22:15:34< celticminstrel> That's outside tehh trunc, so I guess it wouldn't. 20170405 22:15:37< celticminstrel> ... 20170405 22:15:43< vultraz_iOS> the dimensions are whole numbers 20170405 22:15:44< celticminstrel> ^the 20170405 22:16:25< vultraz_iOS> i'd still like to define that function in WML somewhere 20170405 22:16:36< celticminstrel> That would be great, indeed. 20170405 22:16:42< celticminstrel> Also you could do this... 20170405 22:17:25< celticminstrel> image_x = "(trunc(f_ref_x * base_scale_x) + base_origin.x - if(centered, image_original_width / 2, 0))" 20170405 22:17:34< celticminstrel> I dunno if it would make any difference. 20170405 22:17:54< vultraz_iOS> possible, possible 20170405 22:18:07< vultraz_iOS> I hadn't thought of setting a 'centered' variable 20170405 22:18:27< celticminstrel> Not sure it's worth it as-is, but if you find a way to move these formulas to WML I think it would be worth it. 20170405 22:18:40< celticminstrel> autoscale too. 20170405 22:18:43< vultraz_iOS> for the one-liners, it's fine as-is 20170405 22:18:58< celticminstrel> "(if(autoscale, width, image_width))" 20170405 22:19:00< vultraz_iOS> but the multiline one, definitely should move 20170405 22:22:31< celticminstrel> Maybe that HTTT translation problem is best solved with a custom WML tag. 20170405 22:22:51< celticminstrel> Thus pushing the translation onto the Lua API which does support plurals. 20170405 22:23:46< vultraz_iOS> ? 20170405 22:25:16< celticminstrel> GNA11811 20170405 22:26:51< celticminstrel> Apparently there's also a case in SoF... 20170405 22:27:11< celticminstrel> We can totally solve the issue on a case-by-case basis by making a custom WML tag each time, but... 20170405 22:31:11< celticminstrel> Hmm, I just thought of another idea for how a WML solution could work - store the variable name (or, potentially, a formula) in the string, instead of the actual count like the Lua setup does. 20170405 22:32:57< celticminstrel> When fetched from a config, it would just return the singular value. When fetched from a vconfig, it would look up the variable and resolve the translation. 20170405 22:33:56< celticminstrel> Still not quite satisfying though, somehow... 20170405 22:36:26< irker216> wesnoth: Charles Dang wesnoth:master 5efc6a807f06 / src/gui/core/canvas.cpp: GUI2/Canvas: cleaned up some formatting https://github.com/wesnoth/wesnoth/commit/5efc6a807f061239db042941e8d8a0d3ebdf609e 20170405 22:38:28< vultraz_iOS> ah, just realized that static won't work 20170405 22:38:29< vultraz_iOS> bleh 20170405 22:38:47< celticminstrel> Make it a global function instead of a lambda? 20170405 22:39:03< celticminstrel> It doesn't look like it depends on any of the class values, anyway. 20170405 22:39:08< celticminstrel> A static class function would be fine too. 20170405 22:39:21< vultraz_iOS> 'name' 20170405 22:39:29< vultraz_iOS> but i can just make that a param 20170405 22:39:30< celticminstrel> Ah, true, but that could just be passed in every time. 20170405 22:39:52< celticminstrel> Or you could make it a non-static class function. 20170405 22:48:08< vultraz_iOS> good god the new update to VSCode makes searching fast P_P 20170405 22:48:32< vultraz_iOS> whatever this "ripgrep" thing is it's great 20170405 22:48:59< celticminstrel> You're not using ... what was it again... CodeBlocks? 20170405 22:49:07< vultraz_iOS> I use codeblocks to build 20170405 22:49:10< vultraz_iOS> never to write code 20170405 22:49:16< celticminstrel> Oh okay. 20170405 22:49:28< vultraz_iOS> I used to use N++ until i got my new laptop and i realized the text was rather thin at 4k 20170405 22:49:37< vultraz_iOS> i had tried VSCode before and it was rather lacking 20170405 22:49:48< vultraz_iOS> so i gave Atom a shot, but i had no touch scrolling 20170405 22:49:54< vultraz_iOS> so i went to see about VSCode again 20170405 22:50:05< vultraz_iOS> and ive stuck with it since it's greatly improved since launch 20170405 22:50:16< vultraz_iOS> and has a lot of nice stuff 20170405 22:56:07< vultraz_iOS> ok, I've added a functions= key to dra 20170405 22:56:08< vultraz_iOS> w 20170405 22:56:41< vultraz_iOS> doesn't seem to be working, though... 20170405 22:58:37< vultraz_iOS> yeah, I guess the thing is that evaluate() here doesn't have the right variable context 20170405 22:58:49< vultraz_iOS> not sure how to fix 20170405 23:01:21-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Remote host closed the connection] 20170405 23:02:03-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has quit [Quit: wedge009] 20170405 23:02:28-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 23:02:56< vultraz_iOS> i would think it would just registe the function 20170405 23:03:01< vultraz_iOS> not.. execute it :/ 20170405 23:03:07-!- Greg-Boggs [~greg_bogg@173.240.241.83] has quit [Remote host closed the connection] 20170405 23:03:08< celticminstrel> I don't think it needs a variable context. 20170405 23:03:27< celticminstrel> It evaluates the formula and ignores the result. 20170405 23:03:36-!- Greg-Boggs [~greg_bogg@173.240.241.83] has joined #wesnoth-dev 20170405 23:03:38< celticminstrel> That should result in the functions being stored, if any. 20170405 23:04:49-!- wedge009 [~Thunderbi@60-241-236-92.static.tpgi.com.au] has joined #wesnoth-dev 20170405 23:05:22< vultraz_iOS> hm 20170405 23:05:46< vultraz_iOS> i guess then when evaluate is called with the local variables, it doesn't do anything 20170405 23:05:54< vultraz_iOS> since what it's evaluating is the function call.. 20170405 23:06:10< vultraz_iOS> not the contents itself.. 20170405 23:06:32< celticminstrel> Well, it is evaluating the contents, but you'd expect the contents (besides the function definitions) to be empty. 20170405 23:06:50< vultraz_iOS> so in this case, the *local* variables would need to be passed in for the execution 20170405 23:07:08< celticminstrel> I'm not quite sure I understand what you're doing though. 20170405 23:07:09< vultraz_iOS> but then it can't set in the global context :/ 20170405 23:07:24< celticminstrel> What are you talking about? 20170405 23:08:14< vultraz_iOS> https://github.com/Vultraz/wesnoth/commit/53159fb794c5cfc4c0cde9c068c682f076fe07f8 20170405 23:08:31< vultraz_iOS> so, i think the problem is that the local variables are not available for execution... only evaluation 20170405 23:08:40< vultraz_iOS> which has now been moved to the global context 20170405 23:08:52< vultraz_iOS> need to rethink how this works 20170405 23:09:07< celticminstrel> ??? 20170405 23:09:52< vultraz_iOS> sigh 20170405 23:09:59< vultraz_iOS> as you can see i added handling for a functions= key 20170405 23:10:03< vultraz_iOS> it gets evaluated when the cfg is set 20170405 23:10:15< vultraz_iOS> and changed the actions= key im using to just be a function call 20170405 23:10:18< celticminstrel> This is exactly why I said that typed_formula keys cannot define functions. 20170405 23:10:26< celticminstrel> Though I could be mistaken. 20170405 23:10:47< vultraz_iOS> but i *think* it doesn't work because in the image context when this is called: 20170405 23:10:48< vultraz_iOS> wfl::variant(&variables).execute_variant(actions_formula_.evaluate(local_variables)); 20170405 23:10:54< celticminstrel> Still... does it make any difference if you remove the enclosing parentheses? 20170405 23:11:00< vultraz_iOS> all it "evaluates" with the local variables is the function call 20170405 23:11:17< vultraz_iOS> then it would call the function with the "global" context 20170405 23:11:29< vultraz_iOS> where the function is defined in the action table 20170405 23:11:39< vultraz_iOS> but no variables exist. 20170405 23:11:48< celticminstrel> Variables are evaluated when the function is called. 20170405 23:12:02< celticminstrel> Though I don't recall how that works for variables that aren't parameters. 20170405 23:12:09< vultraz_iOS> right, but as you can see i pass the global variable context 20170405 23:12:12< vultraz_iOS> not the local one 20170405 23:12:20< vultraz_iOS> because the local one is for eval only 20170405 23:12:28< celticminstrel> No? 20170405 23:12:30< celticminstrel> You don't? 20170405 23:12:40< vultraz_iOS> and i can't do wfl::variant(&local_variables).execute_variant(actions_formula_.evaluate(local_variables)); 20170405 23:12:41< celticminstrel> You're passing no variable context that I can see. 20170405 23:12:57< vultraz_iOS> what are you talking about? 20170405 23:13:04< vultraz_iOS> are you talking about the functions= handling? 20170405 23:13:06< celticminstrel> The code you linked. 20170405 23:13:18< vultraz_iOS> yeah, im talking about the stuff i just added earlier 20170405 23:13:25< vultraz_iOS> and why it can;t work with this 20170405 23:14:10< celticminstrel> Okay, so it doesn't complain that it's not a function? 20170405 23:14:16< vultraz_iOS> no 20170405 23:16:28-!- noy [~Noy@wesnoth/developer/noy] has quit [Ping timeout: 240 seconds] 20170405 23:19:13< celticminstrel> It looks like functions get their own private variable space, so the formula that defines them can't reference anything other than their arguments. 20170405 23:19:22< celticminstrel> But there should be a trivial way to work around this. 20170405 23:19:45< vultraz_iOS> And that is? 20170405 23:20:06< celticminstrel> Make it take one argument whose name ends in * 20170405 23:20:14< celticminstrel> Then pass self to the function. 20170405 23:20:21< celticminstrel> ...wait, but map_formula_callable doesn't have self. 20170405 23:20:41< celticminstrel> Hmm... 20170405 23:20:52< celticminstrel> I mean, you could just pass in all your data as arguments, though. 20170405 23:21:01< celticminstrel> That would make it take five arguments. 20170405 23:21:57< vultraz_iOS> But I don't have data because it's setting the data! 20170405 23:22:02< vultraz_iOS> We need to rethink this 20170405 23:28:27-!- TheJJ [~rofl@ipbcc36896.dynamic.kabel-deutschland.de] has quit [Ping timeout: 240 seconds] 20170405 23:29:34-!- TheJJ [~rofl@ipbcc36896.dynamic.kabel-deutschland.de] has joined #wesnoth-dev 20170405 23:38:09< celticminstrel> vultraz_iOS: Uh, what are you talking about? 20170405 23:38:17< celticminstrel> The formula does not change anything ever. 20170405 23:38:31< celticminstrel> You do have data - the image widths and heights, and the origin. 20170405 23:38:46< celticminstrel> The formula merely outputs a request to change data. 20170405 23:39:31< celticminstrel> (Well okay, "does not change anything ever" is a slight exaggeration, since it can define a function. But that's the only thing that can be changed by merely evaluating a formula.) 20170405 23:40:40< celticminstrel> Basically, if you pass image_width, image_height, image_original_width, image_original_height, clip_x, clip_y as parameters to the function, it should work. 20170405 23:41:11< celticminstrel> I'm not necessarily recommending that this is the best way of doing it, mind you. 20170405 23:41:34< celticminstrel> Ultimately, functions should probably try to connect to the global callable that they're evaluated on. 20170405 23:42:28< celticminstrel> ...actually... come to think if it, that may be trivial to implement... 20170405 23:42:53< celticminstrel> See formula/function.cpp:1546-76 20170405 23:43:34< celticminstrel> ...that indent code is not exception-safe... 20170405 23:43:54< celticminstrel> I mean, it's only for debugging, so I guess it doesn't really matter, but... 20170405 23:45:20< celticminstrel> I guess maybe not so trivial though... because what you'd need to do is set variables as the fallback, but then what do you do if there's a star arg? 20170405 23:47:29< celticminstrel> I suppose you could just say that having a star arg overrides it. --- Log closed Thu Apr 06 00:00:54 2017