#exult@irc.freenode.net logs for 22 Jun 2016 (GMT)

Archive Today Yesterday Tomorrow
Exult homepage


[00:06:47] <Dominus> Tried my hands at bundling the exultmsg.txt with the flx but failed again at char vs ifstream... Malignant where did you fail? May I see your code?
[00:07:08] <Dominus> But now first sleep!!!
[00:17:29] --> Malignant_Manor has joined #exult
[00:17:48] <Malignant_Manor> Dominus: Yes, it was ifstream that caused issues. http://pastebin.com/BVektEvS
[00:20:40] <-- Malignant_Manor has left IRC (Client Quit)
[00:46:23] --> frob has joined #exult
[00:50:55] <-- frob has left IRC (Ping timeout: 252 seconds)
[01:33:40] --> DominusExult has joined #exult
[01:33:41] --- ChanServ gives channel operator status to DominusExult
[01:37:44] <-- Dominus has left IRC (Ping timeout: 260 seconds)
[01:37:45] --- DominusExult is now known as Dominus
[03:36:23] --> DominusExult has joined #exult
[03:36:23] --- ChanServ gives channel operator status to DominusExult
[03:38:30] <-- Dominus has left IRC (Ping timeout: 244 seconds)
[03:38:30] --- DominusExult is now known as Dominus
[05:03:03] --> frob has joined #exult
[05:08:06] <-- frob has left IRC (Ping timeout: 260 seconds)
[06:28:32] --> ttarrant has joined #exult
[06:35:39] --> frob has joined #exult
[06:42:21] <-- frob has left IRC (Remote host closed the connection)
[06:47:08] --> frob has joined #exult
[06:51:48] --> Sevalecan has joined #exult
[06:56:40] <-- frob has left IRC (Remote host closed the connection)
[07:02:42] <-- Sev has left IRC (*.net *.split)
[07:18:14] <-- RadoS has left IRC (Remote host closed the connection)
[07:32:52] --> DominusExult has joined #exult
[07:32:53] --- ChanServ gives channel operator status to DominusExult
[07:34:51] <-- Dominus has left IRC (Ping timeout: 250 seconds)
[07:34:51] --- DominusExult is now known as Dominus
[08:56:01] <Dominus> malignant: sadly my work looked almost exactly... http://pastebin.com/AeAcB3Ve
[08:59:00] <Dominus> I only added a bundle check and it *opens* the txt file but crashes with "file name too long"...
[08:59:10] <Dominus> hmm, an ifstream too many :)
[08:59:27] <Dominus> so it is http://pastebin.com/SH2TsaGz
[09:03:46] <Dominus> wjp, we (Malignant & me) are doing something horribly wrong, trying to read exultmsg.txt from a flx file. We can't load it because there is either a clash with ifstream and const char (the commented Read_text_msg_file), or it won't correctly read the text because it runs out of buffer (because U7open doesn't like the buf -> again ifstream/const/char thinng).
[09:03:57] <Dominus> What are we doing wrong?
[09:04:05] <Dominus> the whole patch is http://pastebin.com/xHZtaved
[09:04:27] <Dominus> the relevant code in items.cc is http://pastebin.com/SH2TsaGz
[09:05:08] <Dominus> and I tried to copy loading of autonotes.txt from flx as in gumps/Notebook_gump.cc:849
[09:08:47] --> frob has joined #exult
[09:13:24] <-- frob has left IRC (Ping timeout: 264 seconds)
[09:14:28] --> RadoS has joined #exult
[09:40:56] <wjp_> I'm a bit confused by your description
[09:41:04] <wjp_> what's the problem that the specific patch you link to gives?
[09:41:49] <wjp_> oh, but I think I see
[09:49:56] <wjp_> in that second pastebin, you're doing an U7open on the _contents_ of the file
[09:51:48] <wjp_> this whole approach won't work quite so easily
[09:52:02] <Dominus> sorry wjp, hard to explain when you don't know what is happening really
[09:52:10] <Dominus> I feared
[09:53:31] <Dominus> first and second patch are the same, btw, it's just condensed to the items.cc code but wanted to give the "whole" story with the complete patch
[09:55:16] <Dominus> so it would probably need two more functions: one for reading a patch exultmsg, one for reading the flx and then combining it in the Setup_text function? (not that I really understand that)
[09:56:32] <wjp_> well
[09:56:51] <wjp_> Setup_text and Setup_item_names probably should just be changed not to use an ifstream
[09:57:11] <wjp_> this is the only place those two functions are used anyway
[09:57:54] <wjp_> should be fairly straightforward to change the ifstream to a DataSource, and then you can use the 'BufferDataSource buf(txt, len)' you're creating for exultmsg
[09:58:19] <wjp_> at first glance most of it will "just work" then
[10:05:16] <Dominus> thanks wjp, right now, no idea how to do the datasource but I'll keep digging unless you have some more pointers)
[10:22:56] <wjp_> remind me tonight
[12:09:06] --> frob has joined #exult
[12:12:18] <Marzo> wjp_, Dominus: to be honest, I have been itching to nuke the Exult file handling code and rewrite it from scratch for ages
[12:14:06] <-- frob has left IRC (Ping timeout: 272 seconds)
[12:14:21] <Marzo> The Exult DataSource stuff is the kind of thing that can be done using (i|o)stream instead; FileDataSource by fstream, and BufferDataSource by stringstream
[12:43:33] <wjp_> any thoughts on how you'd add endianness-independent read/write functions to that?
[12:46:51] <wjp_> (because a DataSource-like class wrapping STL streams would be one of the default ways of doing that)
[12:48:49] <wjp_> I think there's a lot that could be improved in Exult's file handling, but I'm not sure the DataSource concept itself is so bad
[12:50:22] <wjp_> the infrastructure around it feels rather unstructured/inconsistent though
[13:21:04] <Marzo> We do already have free functions for that function
[13:21:34] <Marzo> But yeah, having the DataSource enforce it would prevent programmer error
[13:22:46] <Marzo> So I guess we could modify DataSource could wrap around STL streams, and do it consistently everywhere
[13:23:10] <Marzo> Including having things like U7open return a DataSource instead
[14:36:25] --> frob has joined #exult
[14:40:51] <-- frob has left IRC (Ping timeout: 244 seconds)
[16:20:50] --> frob has joined #exult
[17:44:30] <Marzo> Dominus: I have been thinking; maybe we should add an interface for selecting MIDI devices on Exult? We already enumerate them
[17:45:28] <Marzo> We could also allow changing ALSA port in Linux, to simplify configuration
[18:07:10] <Dominus> Marzo: yes, it shouldn't be too hard. We enumerate them for Windows and OS X (no idea how that stuff works on linux) so choosing one of the ports shouldn't be too hard
[18:08:06] <Dominus> Wjp_: if you have time a bit later... Right now I need to tidy up the children mess
[18:08:44] <Dominus> Marzo: we'd just need to cram it in our Audio options gump
[18:19:42] <Marzo> Along with fixing text overflow that can happen on one of the buttons
[20:31:52] <Dominus> now I'm here :)
[21:09:21] <-- ttarrant has left IRC (Ping timeout: 276 seconds)
[21:15:30] <Dominus> Marzo: http://pastebin.com/j0k0jeVL <- patch for allowing patch/autonotes.txt
[21:15:53] <Dominus> This works and possibly looks good enough :)
[21:16:24] <Dominus> it doesn't *add* patch_autonotes to default or config/autonotes
[21:16:35] <Dominus> that would be beyond me...
[23:38:38] <Dominus> Malignant_Manor, I've added a little patch to http://exult.sourceforge.net/forum/read.php?f=1&i=1715475&t=136892 - I think Knight Captain might need someone to build him a special Exult version... hint ... hint... :)
[23:39:12] <Dominus> it would need to not redirect stdout to a file. I'm not entirely sure if and how that works with makefile.mingw
[23:39:52] <Dominus> And do you have a clue on how to use DataSource with the bundling of exultmsg.txt?
[23:43:52] <Dominus> anyway, long past my bedtime... good night