#exult@irc.freenode.net logs for 18 Feb 2005 (GMT)

Archive Today Yesterday Tomorrow
Exult homepage

[00:24:01] <-- Fingolfin has left IRC ("42")
[01:48:55] <-- pwr has left IRC ("Client exiting")
[01:55:37] --> Baastuul has joined #exult
[02:02:58] <-- Esbee-Eks has left IRC ("casts gate travel")
[02:05:26] --> claviola has joined #exult
[03:43:18] --- LordN_Away is now known as Lord_Nightmare
[03:44:40] --> offbyone has joined #exult
[03:45:16] <offbyone> So. What's the topic?
[03:45:18] <offbyone> :)
[03:45:49] <offbyone> On a less-wanky note (although more-munchkinny) is there anyone with a tool to modify Exult savegames?
[03:47:33] <Desdicado> hey
[03:47:40] <Desdicado> offbyone
[03:47:43] <Desdicado> a good browser
[03:47:52] <-- Cytech has left IRC (Read error: 60 (Operation timed out))
[03:47:56] <Desdicado> i like it
[03:48:16] <Desdicado> is it open source?
[03:49:40] <Desdicado> guys has anyone Uo pre alpha?
[03:50:33] <Baastuul> I have the Ultima Online: Third Dawn alpha CD... :S
[03:50:34] <Baastuul> hehe
[03:51:06] <Desdicado> im after the real pre-alpha
[03:51:18] <Desdicado> this channel was a discussion about it
[03:51:33] <Desdicado> its like built on a modified ultima 8 engine
[03:51:56] <Desdicado> it has real water for example
[03:52:11] <Desdicado> not the UO waterstill titles it uses now
[05:42:16] <-- offbyone has left #exult ()
[05:49:15] <-- Baastuul has left IRC ("Reconnecting.")
[05:50:18] --> Baastuul has joined #exult
[06:18:17] <-- Desdicado has left IRC ()
[06:26:50] <-- shazza has left IRC (Read error: 60 (Operation timed out))
[06:45:50] --> Colourless has joined #Exult
[06:45:50] --- ChanServ gives channel operator status to Colourless
[07:47:20] --> hit-n-mis has joined #Exult
[07:47:38] <-- hit-n-mis has left #Exult ()
[08:31:45] <-- claviola has left IRC ("Leaving")
[09:52:03] --> Baastuul_ has joined #exult
[10:06:22] <-- [KrusheR] has left IRC ("I've come to cleanse this land...")
[10:10:17] <-- Baastuul has left IRC (Read error: 113 (No route to host))
[13:05:16] <-- Kirben has left IRC ("System Meltdown")
[13:12:05] --> shazza has joined #exult
[13:55:48] --> Baastuul has joined #exult
[14:10:33] <-- Baastuul_ has left IRC (Read error: 113 (No route to host))
[14:38:00] --> sbx has joined #exult
[14:40:23] --> stevenh has joined #exult
[15:17:12] --> [KrusheR] has joined #exult
[17:45:26] <-- sbx has left IRC (Read error: 110 (Connection timed out))
[18:07:35] <-- Baastuul has left IRC (Read error: 113 (No route to host))
[18:35:20] <-- Colourless has left IRC ("casts improved invisibility")
[18:35:45] --> sbx has joined #exult
[18:57:06] <-- DoomIhlVaria has left IRC ("The Great Panda God ate my soul")
[19:09:14] <-- sbx has left IRC ("clicks the exit button")
[19:32:54] --> Fingolfin has joined #exult
[19:32:54] --- ChanServ gives channel operator status to Fingolfin
[19:48:02] --> sbx has joined #exult
[19:51:36] <-- Fingolfin has left IRC ("42")
[20:27:30] --> claviola has joined #exult
[20:48:06] --> artaxerxes has joined #exult
[20:48:06] --- ChanServ gives channel operator status to artaxerxes
[20:48:08] <artaxerxes> hi all
[20:49:21] <artaxerxes> anyone skilled in c++ here that could answer a question?
[20:49:55] <artaxerxes> I've got the following typedef'd
[20:50:28] <artaxerxes> typedef unsigned char Uint8;
[20:50:49] <artaxerxes> I want to create a buffer of length X, so in (regular) c I did:
[20:51:07] <artaxerxes> oh wait, I also have another typedef:
[20:51:42] <artaxerxes> typedef Uint8* u7b_Text;
[20:51:48] <artaxerxes> so in c, I do:
[20:52:10] <artaxerxes> buffer = (u7b_Text)malloc(sizeof(X));
[20:52:29] <artaxerxes> In c++, that line works fine too, but I want to use new and free so I did:
[20:52:49] <artaxerxes> buffer = new Uint8 [X];
[20:53:04] <artaxerxes> it compiles fine, but when I run it I get:
[20:53:41] <artaxerxes> terminate called after throwing an instance of 'std::bad_alloc'
[20:53:41] <artaxerxes> what(): St9bad_alloc
[20:53:41] <artaxerxes> Aborted
[20:53:57] <artaxerxes> any idea of what's going on?
[20:56:01] <sbx> hi
[20:56:05] <artaxerxes> hey
[20:59:34] <sbx> guess I'm not skilled enough for that :)
[20:59:59] <sbx> I know in C it would just be malloc(X).
[21:00:43] <artaxerxes> yeah, sorry, I meant malloc(X) not malloc(sizeof(X)); ;-)
[21:03:20] <sbx> sounds like somethings wrong with new
[21:04:11] <sbx> I didnt find much searching about it, except where it occurs because of low memory or a compiler error.
[21:08:00] <sbx> btw I compiled this and it worked
[21:08:13] <sbx> X = 65535
[21:08:27] <artaxerxes> maybe you're right... I just got the prog to spit some text and at some point it wants to allocate 4294770687 bytes!!
[21:08:49] <artaxerxes> must be an error in my code somewhere. Thx for your help!
[21:08:57] <sbx> hmm, debugging output always helps :)
[21:09:01] <sbx> ok np
[21:10:08] <sbx> I'm still working on that SI functions list btw. I wonder how many of the functions you documented.
[21:10:23] * sbx thinks he says btw too much.
[21:11:28] <sbx> I can send you what I got sometime in case it will add to your list, then we'll have a complete list to go with my flags list (I'm about half through with that).
[21:12:10] <artaxerxes> hey! that did it! the prog works great now! thx again!
[21:12:36] <artaxerxes> I replaced a: while(!in.feof()) by a: while(in.peek() != EOF)
[21:12:46] <artaxerxes> otherwise it would go on round too much
[21:13:01] <artaxerxes> as for SI's function list, I've got most of them I think.
[21:14:11] <sbx> you programming anything interesting? :)
[21:15:23] <artaxerxes> err... yeah... nothing public yet though.
[21:16:04] <artaxerxes> I've been starting too many project without finishing them. It's been my plague and I want to stop this bad rep of mine!
[21:17:11] <sbx> hmm that sounds like me
[21:17:12] <artaxerxes> I'm rewriting my lib to process usecode files. It's quite fast and it will be useful for translating.
[21:17:32] <artaxerxes> I've got the API down, now I'm writing it! ;-)
[21:17:42] <sbx> I try not to publicize anything im working on either, until I know it's going to be finished. :)
[21:17:45] <sbx> ah
[21:17:54] <sbx> with the web interface?
[21:18:03] <sbx> Someone should upgrade ucxt.
[21:18:10] <artaxerxes> and I had issues with memory allocation in C so I'm trying C++ now and it's much better.
[21:18:22] <sbx> ...to output function and variable names from a config
[21:18:34] <artaxerxes> let's say that when it's finish, the web interface will be able to use it.
[21:18:38] <sbx> what did you have trouble doing in C?
[21:19:08] <artaxerxes> I was allocating memory in a sub-function and reading the data part of a usecode function in it, but when I left the function, the text was gone!
[21:19:26] <artaxerxes> quite frustrating
[21:19:58] <sbx> oh
[21:20:00] <artaxerxes> I replace with ever-growing array of functions by a vector, change the code at only a couple places and the thing ran beautiful
[21:20:11] <artaxerxes> s/replace/replaced
[21:20:22] <artaxerxes> s/replace with /replaced the
[21:20:29] <sbx> guess you'd have to return the data with a pointer
[21:20:47] <sbx> from the sub-function
[21:21:18] <artaxerxes> well, to be frank, I don't think I will continue the c version. I will finish the c++ and create a c interface for those who want to use a C API.
[21:21:18] <sbx> actually I thought you might have only done the SI functions with text in them
[21:22:07] <artaxerxes> I could, but then if I output the result, it wouldn't have the one without text. I also load the code part too.
[21:22:08] <sbx> I made a bytecode compiler in C and ended up converting it to C++.
[21:22:18] <artaxerxes> so you speak c++?
[21:22:42] <sbx> enough to ask where the bathroom is
[21:23:02] <sbx> or I mean, yeah somewhat
[21:23:06] <sbx> my STL isn't so good
[21:23:26] <artaxerxes> google is our friend....
[21:23:42] <artaxerxes> I have 20 tabs opened to c++ STL stuff atm
[21:23:56] <sbx> I obviously didn't know enough about your error. But strange errors in any language always confuse me.
[21:23:59] <sbx> heh
[21:24:04] <sbx> I have a reference manual.
[21:24:09] <sbx> You use Opera?
[21:24:20] <sbx> or Mozilla?
[21:24:23] <sbx> something with tabs :)
[21:24:39] <artaxerxes> firefox ;-)
[21:24:47] <sbx> close!
[21:24:56] <artaxerxes> ... but no cigar!
[21:25:04] <sbx> ...
[21:25:04] <sbx> hehe
[21:25:06] <artaxerxes> ;-)
[21:25:16] <sbx> I switched a friend from Firefox to Opera unintentionally.
[21:25:25] <artaxerxes> what happened?
[21:25:50] <sbx> I was only mentioning what I liked about Opera, not trying to convert him. But he went and tried it and decided he liked Opera better too.
[21:26:09] <artaxerxes> I found it too crowded when I tried it
[21:26:13] <sbx> I even told him to keep Firefox if he thought it was good enough. :p
[21:26:21] <sbx> yeah he disabled all the extras right away
[21:26:29] <sbx> I use Opera's history as my favorites list.
[21:26:33] <artaxerxes> btw, I have a tab delim list of my function with the description if you are interested
[21:26:40] <sbx> not favorites but... bookmarks
[21:26:50] <sbx> yes I am!
[21:27:07] <sbx> I was hoping I could contribute but you probably have all these documented.
[21:27:22] <sbx> I'll send my list anyway, if it has something new.
[21:27:27] <sbx> what don't you have?
[21:27:44] <artaxerxes> how do you want it? Email?
[21:27:56] <sbx> DCC?
[21:27:57] <artaxerxes> it's about 13k so I won't post it here! ;-)
[21:28:00] <sbx> oh
[21:28:11] <sbx> 130k?
[21:28:12] <artaxerxes> ouch, DCC has always crashed here.
[21:28:15] <sbx> 13k?
[21:28:19] <artaxerxes> 13k
[21:28:24] --- Lord_Nightmare is now known as LordN_Away
[21:28:26] <sbx> ok I'll msg you my address
[21:29:04] <sbx> need a gmail invite?
[21:29:59] <artaxerxes> got 3 already!
[21:30:17] <artaxerxes> but thx anyways!
[21:30:32] <sbx> at first it was hard to get one, now you can't get rid of these things
[21:31:13] <artaxerxes> I heard there was a site where you could donate them. That would be a nice gesture.
[21:31:38] <sbx> that's interesting
[21:31:56] <sbx> u7Babel?
[21:32:23] <sbx> csv that's a good format
[21:33:20] <sbx> I don't see the comma's though
[21:33:55] <artaxerxes> tab delimited
[21:34:04] <sbx> oh right
[21:34:11] <sbx> tsv
[21:34:14] <sbx> ?
[21:34:20] <sbx> This looks like my list!
[21:34:21] <artaxerxes> never seem that b4
[21:34:24] <artaxerxes> cool!
[21:34:29] <sbx> I thought you meant you had them all described.
[21:34:32] <sbx> or most of them
[21:35:22] <sbx> The difference being, I don't have any listed that aren't described. On the other hand, I list all the flags even those I havn't gotten the meaning of yet.
[21:35:29] <artaxerxes> well, a whole bunch don't have any text
[21:35:36] <sbx> I just list a function when I need to know what it does to see what a flag is for.
[21:35:54] <artaxerxes> it would be nice to see a sample of your flag list
[21:36:27] <sbx> no problem
[21:36:44] <sbx> to the same address?
[21:37:24] <artaxerxes> u7babel is the name of the international consortium mega-global corporation we are creating to dominate and monopolize the U7 translation vertical business.... not.
[21:37:38] <artaxerxes> ;-)
[21:37:44] <sbx> U& translation vertical business? sounds like corpspeak
[21:38:02] <sbx> what are your core competencies and repurposing strategies?
[21:38:12] <artaxerxes> sounds like a Dilbert.... ;-)
[21:38:19] <sbx> do you provide enterprise solutions?
[21:38:20] <sbx> hehe
[21:38:31] <artaxerxes> sure same address is fine
[21:39:01] <sbx> ok...
[21:39:27] <sbx> some of the function names are derived from the SI Spanish usecode
[21:39:41] <sbx> it has identifiers for functions and variables
[21:39:46] <sbx> not to mention line numbers
[21:40:32] <artaxerxes> we are concepting a new paradigm shift toward lightweight execution and ownership of solutions-oriented technology to leverage the interactive information superhighway in a binary-compatible application frameworks.
[21:42:28] <artaxerxes> ;-)
[21:43:54] <sbx> ouch
[21:44:24] <artaxerxes> I wonder if I missed some... ;-)
[21:45:06] <sbx> admittedly most of them are guessed by the text in the function
[21:45:28] <artaxerxes> that's how I named the functions
[21:45:58] <sbx> most of the NPCs aren't there either (they are easy to get)
[21:47:32] <artaxerxes> what do you mean?
[21:49:02] <sbx> I didn't list most NPC functions. I'm more interested in the ones that are harder to figure out, like utility functions.
[21:49:23] <sbx> SI uses a lot of functions from BG
[21:50:23] <artaxerxes> I see. I created the list for translation purpose, that's why mine focuses more on the NPC and their text
[21:51:26] <sbx> That's another reason I didn't list those; I figured our lists would complement eachother that way.
[21:52:14] <sbx> this will be helpful for new game or mod makers
[21:52:27] <sbx> so I hope ucxt can be upgraded to output the correct names
[21:53:59] <sbx> hey Dupre doesn't need an accent
[21:56:11] <-- sbx has left IRC ("BRB")
[21:56:43] <artaxerxes> that must be a typo.
[22:00:14] --> sbx has joined #exult
[22:07:41] <wjp> artaxerxes: I noticed your name on the widelands mailing list a last month :-)
[22:09:50] <wjp> (had me confused for a second :-) )
[22:12:24] <artaxerxes> yeah, I played a bit with it! I wasn't surprised to see you there too! ;-)
[22:13:59] <wjp> hehe, you must've been following it for quite some time if you saw me there ;-)
[22:14:17] <wjp> must've been two years ago since I actually looked at their code
[22:15:07] <sbx> what's widelands?
[22:15:13] <wjp> settlers clone
[22:15:46] <sbx> what's settlers?
[22:15:46] <sbx> heh j
[22:15:46] <sbx> k
[22:15:47] <sbx> jk*
[22:16:20] <sbx> never played though
[22:17:32] <artaxerxes> it's a cool game, You could give it a try if you want.
[22:17:35] <-- stevenh has left IRC ("Leaving")
[22:17:53] <artaxerxes> sbx: you might have missed one of my replies:
[22:18:05] <artaxerxes> that must be a typo (regarding Dupre's accent)
[22:18:55] <sbx> aye
[22:19:43] <artaxerxes> to copy a buffer into a string, what's the best way in c++?
[22:20:17] <artaxerxes> strcpy() is c only and the = operator needs to be overloaded I guess so it's not simple.
[22:20:18] <sbx> "It's Dupre - sounds like dewpray, remember?"
[22:21:30] <artaxerxes> sbx: that's why an account is nice. Otherwise it sounds like dewp'r
[22:22:08] <wjp> artaxerxes: the = operator already does that
[22:22:57] <artaxerxes> I see, what about copying a buffer into a char* ?
[22:23:08] <wjp> strcpy
[22:23:14] <wjp> or std::strcpy if you're in C++ :-)
[22:23:19] <sbx> He did dewp' Lord British into knighting him.
[22:23:31] <artaxerxes> should I #include<stio.h> for that?
[22:23:35] <artaxerxes> should I #include<stdio.h> for that?
[22:23:39] <wjp> #include <cstring>
[22:24:09] <artaxerxes> thx
[22:24:16] <wjp> incidentally, you shouldn't include things like stdio.h in C++ code
[22:24:38] <wjp> all headers like that have a C++ equivalent; for stdio.h it's cstdio, for string.h it's cstring, etc...
[22:25:12] <artaxerxes> ohhh big setgfault here
[22:25:53] <artaxerxes> even with std::strncpy
[22:26:48] <artaxerxes> here is the situation:
[22:27:04] <artaxerxes> I have a class and I want to put the max number of elements in the private area.
[22:27:12] <artaxerxes> and have methods to access them
[22:27:38] <artaxerxes> I have a char* buff that I want to read content from a file into.
[22:28:09] <artaxerxes> so I have a std::fstream in, that I open with in.open(filename, flags);
[22:28:15] <artaxerxes> but I can
[22:28:33] <artaxerxes> but I can't do a in.read(buff) since it is private
[22:28:59] <artaxerxes> so I tried a in.read(temp_buff), and a class.setData(temp_buff).
[22:29:01] <wjp> hm?
[22:29:18] <artaxerxes> which copies temp_buff to buff
[22:29:23] <wjp> you have a private buffer in a class and you want to read into it from outside that class?
[22:29:23] <artaxerxes> but I segfault
[22:29:44] <sbx> by definition if buff is private you only want to read into it from inside the class
[22:30:06] <artaxerxes> don't you want to have all your variables private?
[22:30:12] <artaxerxes> for protection?
[22:30:20] <artaxerxes> to be safe?
[22:30:26] <sbx> although you should be able to read into it, but in practice that looks confusing
[22:31:02] <sbx> course I'm not one to talk about good practice, what with my crazy use of inline
[22:31:11] <artaxerxes> I mean, when it was public, my code worked great! I would do: in.read(obj->buff,obj->getSize());
[22:31:56] <sbx> sure, why not make a class method that does the in.read?
[22:32:04] <artaxerxes> I also tried to pass the "in" (a fstream) to my method but it chocked on copy constructor saying some stuff was private.
[22:32:22] <sbx> pass in to it
[22:32:23] <wjp> you'll want to pass a reference to the fstream
[22:32:46] <artaxerxes> I did obj->setDate(in&);
[22:32:57] <wjp> that's not valid syntax
[22:32:59] <artaxerxes> s/setDate/setData/
[22:33:09] <sbx> sorry I'm a little lagged
[22:33:11] <artaxerxes> maybe it was in the declaration
[22:33:19] <artaxerxes> let me try again
[22:33:28] <wjp> void setData(std::fstream& in) { in.read(buff); }
[22:33:34] <wjp> obj->setData(in);
[22:33:40] <artaxerxes> b4 I proceed, you guys agree it is better to have all your variabe private, right?
[22:33:58] <wjp> hm, not in all cases
[22:34:06] <wjp> but generally, yeah
[22:35:06] <sbx> I learned that too.
[22:35:34] <sbx> or protected: so you can subclass it
[22:35:52] <artaxerxes> let's try that
[22:36:20] <wjp> there are also cases where you want to keep things private from subclasses, of course :-)
[22:37:13] <sbx> oh, right
[22:37:30] <sbx> havn't done that much
[22:38:12] <artaxerxes> hmmm.. still segfault
[22:38:56] <sbx> What does obj->setData(in&) do? I didn't know that compiles.
[22:39:05] <wjp> that shouldn't compile
[22:39:26] <sbx> oh ok :)
[22:39:34] <artaxerxes> yeah, my mistake. I tried to explain from memory but even that I got wrong!
[22:40:04] <wjp> which line is causing the segfault?
[22:41:11] <artaxerxes> some sort of strlen that I never called! at least, that's whay gdb says
[22:41:28] <artaxerxes> any trick to catch the segfault?
[22:42:11] <wjp> well, the number of things that can cause the segfault is probably fairly limited
[22:43:07] <wjp> from what you said, I would expect an uninitialized pointer or a read/write past the end of a buffer
[22:44:14] <artaxerxes> this is what the setData do:
[22:44:24] <artaxerxes> u7b_Size u7b_Function::setData(std::ifstream& in){
[22:44:24] <artaxerxes> this->raw_data = new Uint8 [this->getDataSize()];
[22:44:24] <artaxerxes> if(this->getDataSize() > 0 && !this->raw_data){
[22:44:24] <artaxerxes> return(U7B_NOMEM);
[22:44:24] <artaxerxes> }
[22:44:27] <artaxerxes> in.read((char *)this->raw_data,this->getDataSize());
[22:44:30] <artaxerxes> return(this->getDataSize());
[22:45:08] <wjp> why all the 'this->' ?
[22:45:20] <artaxerxes> you don't need it?
[22:45:25] <wjp> no
[22:45:27] <artaxerxes> ah.
[22:45:34] <artaxerxes> ok
[22:45:39] * artaxerxes makes a mental note
[22:46:54] <wjp> is it string data or binary data?
[22:46:58] <artaxerxes> bin
[22:47:13] <wjp> ah
[22:47:20] <wjp> are you using str(n)cpy anywhere?
[22:47:26] <wjp> switch to memcpy :-)
[22:48:02] <artaxerxes> I don't use str[n]cpy anywhere!
[22:48:13] <artaxerxes> (not anymore at least)
[22:48:18] <wjp> can getDataSize() be zero?
[22:48:46] <artaxerxes> oh absolutely. Some usecode function don't have any text part
[22:49:12] <wjp> I don't think 'new' likes allocating an array of size zero
[22:49:24] <wjp> but not entirely sure of that
[22:49:25] <artaxerxes> would in.read(bug,0) simply do nothing?
[22:49:31] <artaxerxes> s/bug/buf
[22:49:48] <artaxerxes> I can add a check to see if that's the case
[22:51:06] <artaxerxes> nope. still segfault... weird.
[22:52:50] <sbx> weird
[22:53:22] <artaxerxes> loading the usecode file into my class works, it's when I access it it died
[22:53:32] <artaxerxes> oh
[22:53:36] <artaxerxes> maybe I got it
[22:54:27] <artaxerxes> that was it!
[22:54:40] <artaxerxes> I forgot to implement getData
[22:54:58] <artaxerxes> so when I called it, it barfed
[22:55:39] <artaxerxes> btw, I was studying the SDL source code when it dealt with SDL_Error and they actually use a global variable
[22:55:44] <artaxerxes> is that the only way?
[22:55:50] <sbx> hmm
[22:57:18] <wjp> 'the only way' to do what?
[22:57:23] <sbx> I don't have SDL source here.
[22:57:42] <artaxerxes> 'cause it would be a pain otherwise to add another element in my functions to access the error status
[22:57:52] --> Kirben has joined #exult
[22:57:52] --- ChanServ gives channel operator status to Kirben
[22:58:12] <artaxerxes> hi
[22:58:17] <wjp> error status of your own class?
[22:58:31] <artaxerxes> yup
[22:59:47] <artaxerxes> I have one class that holds another class on which I do most of my operations. I don't know if those subclasses can access their parent though
[23:01:00] <sbx> you have to pass the parent to them
[23:01:17] <artaxerxes> you know what I don't like? it's having to have a setX, getX, setY, getY for all my members... If only there was a simpler way...
[23:01:58] <artaxerxes> changing the subclass to have a reference to its parent?
[23:02:00] <sbx> if they are simple variables, having functions to access them is just a hassle
[23:02:34] <sbx> as long as you know they can't be corrupted (the class always validates them, for example)
[23:02:49] <artaxerxes> something like set(X,value) get(X,value)
[23:03:30] <sbx> those functions wouldn't know what they're setting
[23:03:30] <artaxerxes> the closest I can think of is set("X",value) and then do a switch on the "X".
[23:03:51] <sbx> why do you need to do this?
[23:04:18] <artaxerxes> cause everytime I add a member, I have to add setX, getX... the class gets huge!
[23:04:52] <sbx> you might just make them public
[23:05:19] <sbx> if you know that setting them from the outside can't corrupt them
[23:05:36] <sbx> (and if your setX getX functions just set and return them, you aren't getting added protection anyway)
[23:06:02] <wjp> unless you decide to change the internals of the class later...
[23:06:17] <wjp> in which case you'll have to find all accesses to those variables and change/check them
[23:06:30] <sbx> Also I didn't know you were talking about a subclass. A subclass can access its parent's with a scope/namespace prefix.
[23:06:37] <wjp> for things like x,y,z I usually prefer to have a single getter/setter for the 3-tuple
[23:06:42] <artaxerxes> well, it's not really a subclass
[23:06:52] <wjp> (getLocation, setLocation)
[23:06:57] <artaxerxes> wjp: could you expand?
[23:07:16] <artaxerxes> here is the struct:
[23:07:20] <wjp> void getLocation(int& x, int& y, int& z); void setLocation(int x, int y, int z);
[23:07:56] <artaxerxes> (note: the struct is not stable yet)
[23:08:03] <artaxerxes> class u7b_usecode {
[23:08:24] <artaxerxes> private: int maxfuncnum; //won't be in use for long
[23:08:30] <artaxerxes> public:
[23:08:40] <artaxerxes> std::vector<u7b_Function> functions;
[23:08:59] <artaxerxes> int size; // size in byte of usecode
[23:09:18] <artaxerxes> constructor, destructor and a couple other methods
[23:09:19] <artaxerxes> }
[23:09:27] <artaxerxes> class u7b_Function {
[23:09:59] <artaxerxes> private: all my junk, some int, some char* and a bool
[23:10:12] <artaxerxes> public: all my methods to access my junk
[23:10:14] <artaxerxes> }
[23:11:06] <sbx> size is like an internal property of the class, you probably dont want it public
[23:11:20] <artaxerxes> I then call import_usecode(u7b_Usecode usecode, filename);
[23:12:27] <artaxerxes> import_usecode is my big function atm. It opens filename into "in" and reads functions one at a time into a temporary u7b_Function object and then push it into my vector;
[23:13:00] <artaxerxes> atm, import_usecode is not a method of my class u7b_Usecode
[23:13:15] <artaxerxes> although I want to change that.
[23:13:51] <sbx> will changing that fix all your problems?
[23:14:30] <artaxerxes> when I think about it, the function import_usecode already has access to the object "usecode" to which I could add my error status and error string!
[23:15:41] <artaxerxes> maybe I don't need a global variable then.
[23:15:43] <sbx> bbl
[23:15:43] --- sbx is now known as sbx|afk
[23:15:49] <artaxerxes> I gotta go too
[23:15:57] <artaxerxes> see ya all and thx a bunch for your help!
[23:16:14] <artaxerxes> wjp: always a savior as usual!
[23:16:24] <artaxerxes> sbx: great talking with you today!
[23:16:29] <artaxerxes> bye
[23:16:31] <-- artaxerxes has left IRC ("leaving")
[23:20:23] --> Baastuul has joined #exult
[23:43:23] <-- claviola has left IRC ("Leaving")
[23:47:37] --> Baastuul_ has joined #exult
[23:58:46] <-- Sevalecan has left #exult ("Leaving")